From ef2e85f8115d2a8bccc5a1f905fb407b77cbd4fc Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Thu, 9 Jun 2022 09:32:31 +0200 Subject: [PATCH] add getFairGasPrice() to SmartContract class --- src/contracts/SmartContract.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/contracts/SmartContract.ts b/src/contracts/SmartContract.ts index fb3114a0..3dd0cf41 100644 --- a/src/contracts/SmartContract.ts +++ b/src/contracts/SmartContract.ts @@ -1,7 +1,7 @@ import Web3 from 'web3' import { AbiItem } from 'web3-utils' import { Config, ConfigHelper } from '../config' -import { amountToUnits, unitsToAmount } from '../utils' +import { amountToUnits, getFairGasPrice, unitsToAmount } from '../utils' export abstract class SmartContract { public web3: Web3 @@ -43,4 +43,8 @@ export abstract class SmartContract { ): Promise { return unitsToAmount(this.web3, token, amount, tokenDecimals) } + + async getFairGasPrice(): Promise { + return getFairGasPrice(this.web3, this.config) + } }