mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add getFairGasPrice() to SmartContract class
This commit is contained in:
parent
011b48a9e2
commit
ef2e85f811
@ -1,7 +1,7 @@
|
|||||||
import Web3 from 'web3'
|
import Web3 from 'web3'
|
||||||
import { AbiItem } from 'web3-utils'
|
import { AbiItem } from 'web3-utils'
|
||||||
import { Config, ConfigHelper } from '../config'
|
import { Config, ConfigHelper } from '../config'
|
||||||
import { amountToUnits, unitsToAmount } from '../utils'
|
import { amountToUnits, getFairGasPrice, unitsToAmount } from '../utils'
|
||||||
|
|
||||||
export abstract class SmartContract {
|
export abstract class SmartContract {
|
||||||
public web3: Web3
|
public web3: Web3
|
||||||
@ -43,4 +43,8 @@ export abstract class SmartContract {
|
|||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return unitsToAmount(this.web3, token, amount, tokenDecimals)
|
return unitsToAmount(this.web3, token, amount, tokenDecimals)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getFairGasPrice(): Promise<string> {
|
||||||
|
return getFairGasPrice(this.web3, this.config)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user