diff --git a/source/pages/Send/Confirm.tsx b/source/pages/Send/Confirm.tsx index 96e96eccf..f0bbfcbc4 100755 --- a/source/pages/Send/Confirm.tsx +++ b/source/pages/Send/Confirm.tsx @@ -913,8 +913,6 @@ export const SendConfirm = () => { const arrayValidation = [ !fee?.gasLimit, !fee?.maxFeePerGas, - !fee?.baseFee, - !fee?.maxPriorityFeePerGas, isBitcoinBased, ]; @@ -925,13 +923,7 @@ export const SendConfirm = () => { Number(validateCustomGasLimit ? customFee.gasLimit : fee?.gasLimit)) / 10 ** 9 ); - }, [ - fee?.maxPriorityFeePerGas, - fee?.gasLimit, - fee?.maxFeePerGas, - customFee, - isBitcoinBased, - ]); + }, [fee?.gasLimit, fee?.maxFeePerGas, customFee, isBitcoinBased]); useEffect(() => { if (!copied) return; diff --git a/source/scripts/Background/controllers/MainController.ts b/source/scripts/Background/controllers/MainController.ts index 43e2c8956..acb77de0a 100644 --- a/source/scripts/Background/controllers/MainController.ts +++ b/source/scripts/Background/controllers/MainController.ts @@ -9,6 +9,7 @@ import { KeyringAccountType, IWalletState, CustomJsonRpcProvider, + CustomL2JsonRpcProvider, } from '@pollum-io/sysweb3-keyring'; import { getSysRpc, @@ -1218,14 +1219,23 @@ class MainController extends KeyringManager { isPolling?: boolean; }) { const { accounts } = store.getState().vault; + const L2Networks = [324, 300]; + const isL2Network = L2Networks.includes(activeNetwork.chainId); const currentAccount = accounts[activeAccount.type][activeAccount.id]; - let internalProvider: CustomJsonRpcProvider | undefined; + let internalProvider: + | CustomJsonRpcProvider + | CustomL2JsonRpcProvider + | undefined; if (isPolling) { + const CurrentProvider = isL2Network + ? CustomL2JsonRpcProvider + : CustomJsonRpcProvider; + const abortController = new AbortController(); - internalProvider = new CustomJsonRpcProvider( + internalProvider = new CurrentProvider( abortController.signal, activeNetwork.url ); diff --git a/source/scripts/Background/controllers/balances/evm.ts b/source/scripts/Background/controllers/balances/evm.ts index b7fde10d9..e7de3aa9b 100644 --- a/source/scripts/Background/controllers/balances/evm.ts +++ b/source/scripts/Background/controllers/balances/evm.ts @@ -1,6 +1,9 @@ import { ethers } from 'ethers'; -import { CustomJsonRpcProvider } from '@pollum-io/sysweb3-keyring'; +import { + CustomJsonRpcProvider, + CustomL2JsonRpcProvider, +} from '@pollum-io/sysweb3-keyring'; import { IPaliAccount } from 'state/vault/types'; import { ONE_MILLION } from 'utils/constants'; @@ -10,7 +13,7 @@ import { IEvmBalanceController } from './types'; import { zerosRepeatingAtStartOfEvmBalance } from './utils'; const EvmBalanceController = ( - web3Provider: CustomJsonRpcProvider + web3Provider: CustomJsonRpcProvider | CustomL2JsonRpcProvider ): IEvmBalanceController => { const getEvmBalanceForAccount = async (currentAccount: IPaliAccount) => { try { diff --git a/source/scripts/Background/controllers/balances/index.ts b/source/scripts/Background/controllers/balances/index.ts index f9373d9a6..6c29d2ed2 100644 --- a/source/scripts/Background/controllers/balances/index.ts +++ b/source/scripts/Background/controllers/balances/index.ts @@ -1,4 +1,7 @@ -import { CustomJsonRpcProvider } from '@pollum-io/sysweb3-keyring'; +import { + CustomJsonRpcProvider, + CustomL2JsonRpcProvider, +} from '@pollum-io/sysweb3-keyring'; import { IPaliAccount } from 'state/vault/types'; @@ -7,14 +10,14 @@ import SyscoinBalanceController from './syscoin'; import { IBalancesManager } from './types'; const BalancesManager = ( - web3Provider: CustomJsonRpcProvider + web3Provider: CustomJsonRpcProvider | CustomL2JsonRpcProvider ): IBalancesManager => { const evmBalanceController = EvmBalanceController(web3Provider); const getBalanceUpdatedForAccount = async ( currentAccount: IPaliAccount, isBitcoinBased: boolean, networkUrl: string, - provider?: CustomJsonRpcProvider + provider?: CustomJsonRpcProvider | CustomL2JsonRpcProvider ) => { switch (isBitcoinBased) { case true: diff --git a/source/scripts/Background/controllers/balances/types.ts b/source/scripts/Background/controllers/balances/types.ts index 34cae1cb5..95cf36ea2 100644 --- a/source/scripts/Background/controllers/balances/types.ts +++ b/source/scripts/Background/controllers/balances/types.ts @@ -1,4 +1,7 @@ -import { CustomJsonRpcProvider } from '@pollum-io/sysweb3-keyring'; +import { + CustomJsonRpcProvider, + CustomL2JsonRpcProvider, +} from '@pollum-io/sysweb3-keyring'; import { IPaliAccount } from 'state/vault/types'; @@ -18,7 +21,7 @@ export interface IBalancesManagerUtils { currentAccount: IPaliAccount, isBitcoinBased: boolean, networkUrl: string, - provider?: CustomJsonRpcProvider + provider?: CustomJsonRpcProvider | CustomL2JsonRpcProvider ) => Promise; }