1
0
mirror of https://github.com/oceanprotocol/react.git synced 2025-02-14 21:10:38 +01:00

Fix undefined property error in cheapestPool object

This commit is contained in:
Santiago Gonzalez 2020-09-02 01:27:27 -05:00
parent ede221142e
commit 49019e8d69

View File

@ -73,12 +73,12 @@ export async function checkAndBuyDT(
dataTokenAddress
)
Decimal.set({ precision: 5 })
const price = new Decimal(cheapestPool.poolPrice).times(1.05).toString()
const maxPrice = new Decimal(cheapestPool.poolPrice).times(2).toString()
const price = new Decimal(cheapestPool.price).times(1.05).toString()
const maxPrice = new Decimal(cheapestPool.price).times(2).toString()
Logger.log('Buying token', cheapestPool, account.getId(), price)
const buyResponse = await ocean.pool.buyDT(
account.getId(),
cheapestPool.poolAddress,
cheapestPool.address,
'1',
price,
maxPrice