From 72a665a19a8d682d242bb533e1763d76f488240a Mon Sep 17 00:00:00 2001 From: Danil Kovtonyuk Date: Thu, 3 Jun 2021 16:16:31 +0300 Subject: [PATCH] add gasPriceOracleConfig --- package.json | 4 ++-- src/TxManager.js | 4 ++-- yarn.lock | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7fa71bf..e721087 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tx-manager", - "version": "0.2.9", + "version": "0.3.0", "description": "", "main": "index.js", "scripts": { @@ -23,7 +23,7 @@ "dependencies": { "async-mutex": "^0.2.4", "ethers": "^5.0.17", - "gas-price-oracle": "^0.2.2", + "gas-price-oracle": "^0.3.1", "web3-core-promievent": "^1.3.0" }, "devDependencies": { diff --git a/src/TxManager.js b/src/TxManager.js index 00a5198..2280e80 100644 --- a/src/TxManager.js +++ b/src/TxManager.js @@ -18,14 +18,14 @@ const defaultConfig = { } class TxManager { - constructor({ privateKey, rpcUrl, broadcastNodes = [], config = {} }) { + constructor({ privateKey, rpcUrl, broadcastNodes = [], config = {}, gasPriceOracleConfig = {} }) { this.config = Object.assign({ ...defaultConfig }, config) this._privateKey = privateKey.startsWith('0x') ? privateKey : '0x' + privateKey this._provider = new ethers.providers.JsonRpcProvider(rpcUrl) this._wallet = new ethers.Wallet(this._privateKey, this._provider) this.address = this._wallet.address this._broadcastNodes = broadcastNodes - this._gasPriceOracle = new GasPriceOracle({ defaultRpc: rpcUrl }) + this._gasPriceOracle = new GasPriceOracle({ defaultRpc: rpcUrl, ...gasPriceOracleConfig }) this._mutex = new Mutex() this._nonce = null } diff --git a/yarn.lock b/yarn.lock index 0e2abfb..786c780 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1141,10 +1141,10 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gas-price-oracle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/gas-price-oracle/-/gas-price-oracle-0.2.2.tgz#32c57a9aa6bc69152be96812880232efebfecbc6" - integrity sha512-I4+rLbc7C1vgYXV+cYY0MKeqdZVna2hXpNfD2fcIvf/wIgvtIYmG9gsmhiaYGSgOE2RSPUs2xf/W4K2nJOoNuQ== +gas-price-oracle@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/gas-price-oracle/-/gas-price-oracle-0.3.1.tgz#4977de5edfa49ae17defad0e0d06f9a67bdf2cc6" + integrity sha512-v82AEeQVnO4lGKoJbRqLI9YdOVoImBorYDSOMTGZZAF+RNC89fdTsbhLQVsI/1Zsduqcpiz4VqlQ/4I8wwCbAg== dependencies: axios "^0.19.2" bignumber.js "^9.0.0"