mirror of
https://github.com/oceanprotocol/react.git
synced 2024-12-23 01:29:49 +01:00
Merge pull request #100 from santteegt/bug/cheapestpool
Fix undefined property error in cheapestPool object
This commit is contained in:
commit
450d1e7bdd
@ -73,12 +73,12 @@ export async function checkAndBuyDT(
|
|||||||
dataTokenAddress
|
dataTokenAddress
|
||||||
)
|
)
|
||||||
Decimal.set({ precision: 5 })
|
Decimal.set({ precision: 5 })
|
||||||
const price = new Decimal(cheapestPool.poolPrice).times(1.05).toString()
|
const price = new Decimal(cheapestPool.price).times(1.05).toString()
|
||||||
const maxPrice = new Decimal(cheapestPool.poolPrice).times(2).toString()
|
const maxPrice = new Decimal(cheapestPool.price).times(2).toString()
|
||||||
Logger.log('Buying token', cheapestPool, account.getId(), price)
|
Logger.log('Buying token', cheapestPool, account.getId(), price)
|
||||||
const buyResponse = await ocean.pool.buyDT(
|
const buyResponse = await ocean.pool.buyDT(
|
||||||
account.getId(),
|
account.getId(),
|
||||||
cheapestPool.poolAddress,
|
cheapestPool.address,
|
||||||
'1',
|
'1',
|
||||||
price,
|
price,
|
||||||
maxPrice
|
maxPrice
|
||||||
|
Loading…
Reference in New Issue
Block a user