1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

fix fromwei conversion

This commit is contained in:
alexcos20 2020-10-30 04:43:26 -07:00
parent 0a0ce63580
commit 8407287b9b

View File

@ -337,6 +337,8 @@ export class OceanFixedRateExchange {
const result: FixedPriceExchange = await this.contract.methods const result: FixedPriceExchange = await this.contract.methods
.getExchange(exchangeId) .getExchange(exchangeId)
.call() .call()
result.fixedRate = this.web3.utils.fromWei(result.fixedRate)
result.supply = this.web3.utils.fromWei(result.supply)
return result return result
} }
@ -392,7 +394,7 @@ export class OceanFixedRateExchange {
constituents.active === true && constituents.active === true &&
constituents.dataToken.toLowerCase() === dataTokenAddress.toLowerCase() constituents.dataToken.toLowerCase() === dataTokenAddress.toLowerCase()
) { ) {
const supply = new BigNumber(await this.getSupply(constituents.exchangeID)) const supply = new BigNumber(constituents.supply)
const required = new BigNumber(minSupply) const required = new BigNumber(minSupply)
if (supply.gte(required)) { if (supply.gte(required)) {
result.push(constituents) result.push(constituents)