mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
refactor getting dtPrice
This commit is contained in:
parent
00f02729e1
commit
8d51307852
@ -32,8 +32,9 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
useEffect(() => {
|
||||
async function init() {
|
||||
try {
|
||||
const { poolAddress } = await getBestPool(ddo.dataToken)
|
||||
const { poolAddress, poolPrice } = await getBestPool(ddo.dataToken)
|
||||
setPoolAddress(poolAddress)
|
||||
setDtPrice(poolPrice)
|
||||
|
||||
const dtSymbol = await ocean.datatokens.getSymbol(
|
||||
ddo.dataToken,
|
||||
@ -41,9 +42,6 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
)
|
||||
setDtSymbol(dtSymbol)
|
||||
|
||||
const dtPrice = await ocean.pool.getDTPrice(accountId, poolAddress)
|
||||
setDtPrice(dtPrice)
|
||||
|
||||
const oceanReserve = await ocean.pool.getOceanReserve(
|
||||
accountId,
|
||||
poolAddress
|
||||
|
Loading…
Reference in New Issue
Block a user