1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-06-30 21:52:18 +02:00

Merge pull request #100 from santteegt/bug/cheapestpool

Fix undefined property error in cheapestPool object
This commit is contained in:
mihaisc 2020-09-02 11:43:33 +03:00 committed by GitHub
commit 450d1e7bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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