mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
lib-js updates
This commit is contained in:
parent
feb29924c7
commit
5a52d8fbe9
@ -57,23 +57,14 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
//
|
||||
// Get data token symbol
|
||||
//
|
||||
const dtSymbol = await ocean.datatokens.getSymbol(
|
||||
ddo.dataToken,
|
||||
accountId
|
||||
)
|
||||
const dtSymbol = await ocean.datatokens.getSymbol(ddo.dataToken)
|
||||
setDtSymbol(dtSymbol)
|
||||
|
||||
//
|
||||
// Get everything which is in the pool
|
||||
//
|
||||
const oceanReserve = await ocean.pool.getOceanReserve(
|
||||
accountId,
|
||||
price.address
|
||||
)
|
||||
const dtReserve = await ocean.pool.getDTReserve(
|
||||
accountId,
|
||||
price.address
|
||||
)
|
||||
const oceanReserve = await ocean.pool.getOceanReserve(price.address)
|
||||
const dtReserve = await ocean.pool.getDTReserve(price.address)
|
||||
setTotalBalance({
|
||||
ocean: oceanReserve,
|
||||
dt: dtReserve
|
||||
@ -106,7 +97,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
setUserBalance(userBalance)
|
||||
|
||||
// Get liquidity provider fee
|
||||
const swapFee = await ocean.pool.getSwapFee(accountId, price.address)
|
||||
const swapFee = await ocean.pool.getSwapFee(price.address)
|
||||
setSwapFee(swapFee)
|
||||
} catch (error) {
|
||||
console.error(error.message)
|
||||
|
@ -15,7 +15,7 @@ export default function MetaFull({
|
||||
ddo: DDO
|
||||
metadata: MetadataMarket
|
||||
}): ReactElement {
|
||||
const { ocean, accountId } = useOcean()
|
||||
const { ocean } = useOcean()
|
||||
const { id, dataToken } = ddo
|
||||
const { dateCreated, datePublished, author, license } = metadata.main
|
||||
|
||||
@ -26,13 +26,13 @@ export default function MetaFull({
|
||||
if (!ocean) return
|
||||
|
||||
async function getDataTokenInfo() {
|
||||
const name = await ocean.datatokens.getName(dataToken, accountId)
|
||||
const name = await ocean.datatokens.getName(dataToken)
|
||||
setDtName(name)
|
||||
const symbol = await ocean.datatokens.getSymbol(dataToken, accountId)
|
||||
const symbol = await ocean.datatokens.getSymbol(dataToken)
|
||||
setDtSymbol(symbol)
|
||||
}
|
||||
getDataTokenInfo()
|
||||
}, [ocean, accountId, dataToken])
|
||||
}, [ocean, dataToken])
|
||||
|
||||
return (
|
||||
<div className={styles.metaFull}>
|
||||
|
Loading…
Reference in New Issue
Block a user