Compare commits
1 Commits
c27d5e638c
...
bef587cc1a
| Author | SHA1 | Date | |
|---|---|---|---|
| bef587cc1a |
@ -19,11 +19,14 @@ import { TornadoFeeOracleV5 } from './feeOracleV5';
|
|||||||
*/
|
*/
|
||||||
export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeOracle {
|
export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeOracle {
|
||||||
private fallbackFeeOracle: TornadoFeeOracleV5;
|
private fallbackFeeOracle: TornadoFeeOracleV5;
|
||||||
|
// Override value for BSC (Since old relayers use static value of 3.3 gwei)
|
||||||
|
public overrideGasPrice?: GasPriceParams;
|
||||||
|
|
||||||
public constructor(chainId: number, rpcUrl: string) {
|
public constructor(chainId: number, rpcUrl: string, overrideGasPrice?: GasPriceParams) {
|
||||||
super(6, chainId, rpcUrl);
|
super(6, chainId, rpcUrl);
|
||||||
|
|
||||||
this.fallbackFeeOracle = new TornadoFeeOracleV5(chainId, rpcUrl);
|
this.fallbackFeeOracle = new TornadoFeeOracleV5(chainId, rpcUrl);
|
||||||
|
this.overrideGasPrice = overrideGasPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,6 +49,9 @@ export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeO
|
|||||||
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
|
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
|
||||||
*/
|
*/
|
||||||
async getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams> {
|
async getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams> {
|
||||||
|
if (this.overrideGasPrice) {
|
||||||
|
return this.overrideGasPrice;
|
||||||
|
}
|
||||||
if (typeof bumpPercent === 'undefined') {
|
if (typeof bumpPercent === 'undefined') {
|
||||||
bumpPercent = this.chainId === ChainId.BSC ? undefined : 30;
|
bumpPercent = this.chainId === ChainId.BSC ? undefined : 30;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user