diff --git a/src/lib/config.ts b/src/lib/config.ts index 71b9e6f..79d85a9 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -163,6 +163,8 @@ const defaultAccount: RpcConfig['account'] = { }; const defaultTransactionConfig: RpcConfig['transaction'] = { type: 'eip1559' as const, + maxGasPricePerTransactionWei: null, + maxNativePerTransactionWei: null, totalTries: 1, // by default, only try the trx once retryGasMultiplier: 1.2, // up gas by 20% on each retry baseFeeMultiplier: 1.25, // 25% above base fee @@ -295,6 +297,10 @@ export const RPC_CONFIG: Record = { // example of a non bridging transaction: https://basescan.org/tx/0x4c06da47f27a0910737c6efe0ca54b493e0ab081effa8caa4641e11d458bff19 forceGasLimit: 1_500_000n, }, + transaction: { + ...defaultTransactionConfig, + maxGasPricePerTransactionWei: ONE_GWEI, + }, }, bsc: { ...defaultConfig, diff --git a/src/lib/harvest-chain.ts b/src/lib/harvest-chain.ts index 63c91b9..3622d2c 100644 --- a/src/lib/harvest-chain.ts +++ b/src/lib/harvest-chain.ts @@ -297,7 +297,6 @@ export async function harvestChain({ } if ( - rpcConfig.transaction.type === 'legacy' && rpcConfig.transaction.maxNativePerTransactionWei && item.simulation.gas.transactionCostEstimationWei > rpcConfig.transaction.maxNativePerTransactionWei ) { @@ -315,7 +314,6 @@ export async function harvestChain({ } if ( - rpcConfig.transaction.type === 'legacy' && rpcConfig.transaction.maxGasPricePerTransactionWei && item.simulation.gas.gasPrice > rpcConfig.transaction.maxGasPricePerTransactionWei ) { diff --git a/src/lib/rpc-config.ts b/src/lib/rpc-config.ts index f46b6fd..7a8dfe8 100644 --- a/src/lib/rpc-config.ts +++ b/src/lib/rpc-config.ts @@ -25,6 +25,8 @@ export type RpcConfig = { } | { type: 'eip1559'; + maxNativePerTransactionWei: bigint | null; + maxGasPricePerTransactionWei: bigint | null; } ) & { // @see aggressivelyWriteContract