@@ -2,7 +2,6 @@ import { useEffect, useRef, useCallback } from 'react';
2
2
import { estimateGas , web3Provider , toHex } from '@/handlers/web3' ;
3
3
import { convertHexToString , omitFlatten } from '@/helpers/utilities' ;
4
4
import { logger , RainbowError } from '@/logger' ;
5
- import { getNetworkObject } from '@/networks' ;
6
5
import { ethereumUtils } from '@/utils' ;
7
6
import { hexToNumber , isHex } from 'viem' ;
8
7
import { isEmpty } from 'lodash' ;
@@ -11,6 +10,7 @@ import { GasFeeParamsBySpeed } from '@/entities';
11
10
import { StaticJsonRpcProvider } from '@ethersproject/providers' ;
12
11
import { useGas } from '@/hooks' ;
13
12
import { ChainId } from '@/networks/types' ;
13
+ import { needsL1SecurityFeeChains } from '@/networks/chains' ;
14
14
15
15
type CalculateGasLimitProps = {
16
16
isMessageRequest : boolean ;
@@ -52,8 +52,8 @@ export const useCalculateGasLimit = ({
52
52
} finally {
53
53
logger . debug ( 'WC: Setting gas limit to' , { gas : convertHexToString ( gas ) } , logger . DebugContext . walletconnect ) ;
54
54
55
- const networkObject = getNetworkObject ( { chainId } ) ;
56
- if ( chainId && networkObject . gas . OptimismTxFee ) {
55
+ const needsL1SecurityFee = needsL1SecurityFeeChains . includes ( chainId ) ;
56
+ if ( needsL1SecurityFee ) {
57
57
const l1GasFeeOptimism = await ethereumUtils . calculateL1FeeOptimism ( txPayload , provider || web3Provider ) ;
58
58
updateTxFee ( gas , null , l1GasFeeOptimism ) ;
59
59
} else {
0 commit comments