1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-13 16:54:53 +01:00

make pool info work

This commit is contained in:
Matthias Kretschmann 2020-08-18 13:13:55 +02:00
parent 7e10f2232c
commit 2d3e0e9681
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -8,11 +8,12 @@ export default function Trade({ ddo }: { ddo: DDO }): ReactElement {
const [currentTokens, setCurrentTokens] = useState<string[]>()
const [numTokens, setNumTokens] = useState()
const poolAddress = '0xunknown' // How to get this?
useEffect(() => {
async function init() {
try {
const pools = await ocean.pool.searchPoolforDT(accountId, ddo.dataToken)
const poolAddress = pools[0] // assume there is only one pool
const numTokens = await ocean.pool.getNumTokens(accountId, poolAddress)
setNumTokens(numTokens)