tornado-oracles/lib/feeOracleV6.d.ts

33 lines
1.7 KiB
TypeScript

import { TornadoFeeOracle } from './feeOracle';
import { ITornadoFeeOracle, TransactionData, TxType, LegacyGasPriceKey, GasPriceParams, GetWithdrawalFeeViaRelayerInput, HexadecimalStringifiedNumber } from './types';
/**
* V6 version that would cover every available networks and relayers
*
* Ported from https://git.tornado.ws/tornadocontrib/tornado-core/src/branch/main/src/fees.ts and has been verified over time
*/
export declare class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeOracle {
private fallbackFeeOracle;
overrideGasPrice?: GasPriceParams;
constructor(chainId: number, rpcUrl: string, overrideGasPrice?: GasPriceParams);
/**
* Apply static 10% gasLimit premium as it wouldn't change across nodes or relayers
*/
getGasLimit(tx?: TransactionData, type?: TxType, bumpPercent?: number): Promise<number>;
/**
* Apply static 50% gasPrice premium for EIP-1559 enabled networks
*
* Because Tornado Transactions are censored from block builders
* it would take some time to be confirmed after when the transaction is broadcasted.
*
* We apply 50% premium to combat basefee spike (ethers.js uses 100% premium by default)
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
*/
getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams>;
/**
* Apply 20% premium from the calculated fee from UI, applies 5% fee from relayer to prevent arbitrage from refund
*/
calculateWithdrawalFeeViaRelayer(params: GetWithdrawalFeeViaRelayerInput & {
premium?: number;
}): Promise<HexadecimalStringifiedNumber>;
}