crosslightning-evm
Advanced tools
Comparing version 4.0.7 to 4.0.8
@@ -23,4 +23,4 @@ import { BigNumber, providers, Wallet } from "ethers"; | ||
callbacks: ((oldTx: string, oldTxId: string, newTx: string, newTxId: string) => Promise<void>)[]; | ||
readonly getGasPriceFunc: () => Promise<BigNumber>; | ||
constructor(privateKey: string, rpcUrl: string, chainId: number, directory: string, minFeeIncrease?: BigNumber, waitBeforeBumpMillis?: number, getGasPriceFunc?: () => Promise<BigNumber>); | ||
readonly getGasPriceFunc: (provider: providers.Provider) => Promise<BigNumber>; | ||
constructor(privateKey: string, rpcUrl: string, chainId: number, directory: string, minFeeIncrease?: BigNumber, waitBeforeBumpMillis?: number, getGasPriceFunc?: (provider: providers.Provider) => Promise<BigNumber>); | ||
transactionListener(transaction: providers.TransactionReceipt): void; | ||
@@ -27,0 +27,0 @@ init(): Promise<void>; |
@@ -140,3 +140,3 @@ "use strict"; | ||
if (_gasPrice == null) | ||
_gasPrice = this.getGasPriceFunc != null ? yield this.getGasPriceFunc() : yield this.provider.getGasPrice(); | ||
_gasPrice = this.getGasPriceFunc != null ? yield this.getGasPriceFunc(this.provider) : yield this.provider.getGasPrice(); | ||
const feeDifference = _gasPrice.sub(lastTx.gasPrice); | ||
@@ -248,3 +248,3 @@ const newTx = ethers_1.utils.shallowCopy(lastTx); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const gasPrice = this.getGasPriceFunc != null ? yield this.getGasPriceFunc() : yield this.provider.getGasPrice(); | ||
const gasPrice = this.getGasPriceFunc != null ? yield this.getGasPriceFunc(this.provider) : yield this.provider.getGasPrice(); | ||
//const gasPrice: BigNumber = BigNumber.from(2*1000000000); | ||
@@ -251,0 +251,0 @@ transaction.gasPrice = gasPrice; |
{ | ||
"name": "crosslightning-evm", | ||
"version": "4.0.7", | ||
"version": "4.0.8", | ||
"description": "EVM specific base implementation", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -89,3 +89,3 @@ import {BigNumber, providers, Transaction, UnsignedTransaction, utils, Wallet} from "ethers"; | ||
readonly getGasPriceFunc: () => Promise<BigNumber>; | ||
readonly getGasPriceFunc: (provider: providers.Provider) => Promise<BigNumber>; | ||
@@ -99,3 +99,3 @@ constructor( | ||
waitBeforeBumpMillis?: number, | ||
getGasPriceFunc?: () => Promise<BigNumber> | ||
getGasPriceFunc?: (provider: providers.Provider) => Promise<BigNumber> | ||
) { | ||
@@ -174,3 +174,3 @@ super(privateKey, new OverridenStaticJsonRpcProvider(rpcUrl, chainId)); | ||
console.log("Bump fee for tx: ", lastTx.hash); | ||
if(_gasPrice==null) _gasPrice = this.getGasPriceFunc!=null ? await this.getGasPriceFunc() : await this.provider.getGasPrice(); | ||
if(_gasPrice==null) _gasPrice = this.getGasPriceFunc!=null ? await this.getGasPriceFunc(this.provider) : await this.provider.getGasPrice(); | ||
const feeDifference = _gasPrice.sub(lastTx.gasPrice); | ||
@@ -291,3 +291,3 @@ const newTx = utils.shallowCopy(lastTx); | ||
async sendTransaction(transaction: Deferrable<providers.TransactionRequest>, onBeforePublish?: (txId: string, rawTx: string) => Promise<void>): Promise<providers.TransactionResponse> { | ||
const gasPrice: BigNumber = this.getGasPriceFunc!=null ? await this.getGasPriceFunc() : await this.provider.getGasPrice(); | ||
const gasPrice: BigNumber = this.getGasPriceFunc!=null ? await this.getGasPriceFunc(this.provider) : await this.provider.getGasPrice(); | ||
//const gasPrice: BigNumber = BigNumber.from(2*1000000000); | ||
@@ -294,0 +294,0 @@ transaction.gasPrice = gasPrice; |
349509