mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-14 17:24:51 +01:00
make pool info work
This commit is contained in:
parent
7e10f2232c
commit
2d3e0e9681
@ -8,11 +8,12 @@ export default function Trade({ ddo }: { ddo: DDO }): ReactElement {
|
|||||||
const [currentTokens, setCurrentTokens] = useState<string[]>()
|
const [currentTokens, setCurrentTokens] = useState<string[]>()
|
||||||
const [numTokens, setNumTokens] = useState()
|
const [numTokens, setNumTokens] = useState()
|
||||||
|
|
||||||
const poolAddress = '0xunknown' // How to get this?
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function init() {
|
async function init() {
|
||||||
try {
|
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)
|
const numTokens = await ocean.pool.getNumTokens(accountId, poolAddress)
|
||||||
setNumTokens(numTokens)
|
setNumTokens(numTokens)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user