diff --git a/app/actions/transaction/index.js b/app/actions/transaction/index.js index f2ecbae38d1..7cc0d95a3e0 100644 --- a/app/actions/transaction/index.js +++ b/app/actions/transaction/index.js @@ -144,42 +144,6 @@ export function setEtherTransaction(transaction) { }; } -/** - * Enable individual ERC20 asset only to send in a transaction - * - * @param {object} token - Token object to be sent - */ -export function setIndividualTokenTransaction(token) { - return { - type: 'SET_INDIVIDUAL_TOKEN_TRANSACTION', - token, - }; -} - -/** - * Enable individual ERC721 asset only to send in a transaction - * - * @param {object} collectible - Collectible object to be sent - */ -export function setIndividualCollectibleTransaction(collectible) { - return { - type: 'SET_INDIVIDUAL_COLLECTIBLE_TRANSACTION', - collectible, - }; -} - -/** - * Enable selectable ERC721 assets who's current account is owner of a specific contract to be sent in a transaction - * - * @param {object} collectible - Collectible of the type contract collectible that the user wants to send - */ -export function setCollectibleContractTransaction(collectible) { - return { - type: 'SET_COLLECTIBLE_CONTRACT_TRANSACTION', - collectible, - }; -} - export function setNonce(nonce) { return { type: 'SET_NONCE', diff --git a/app/component-library/components/HeaderBase/HeaderBase.types.ts b/app/component-library/components/HeaderBase/HeaderBase.types.ts index 8cb463919db..afff99c5f86 100644 --- a/app/component-library/components/HeaderBase/HeaderBase.types.ts +++ b/app/component-library/components/HeaderBase/HeaderBase.types.ts @@ -8,7 +8,7 @@ export interface HeaderBaseProps extends ViewProps { /** * Title of the HeaderBase. */ - children: React.ReactNode; + children?: React.ReactNode | string; /** * Optional prop to include content to be displayed before the title. */ diff --git a/app/components/Nav/App/index.js b/app/components/Nav/App/index.js index 95832e5e070..e8da5aaa3df 100644 --- a/app/components/Nav/App/index.js +++ b/app/components/Nav/App/index.js @@ -98,7 +98,7 @@ import { DevLogger } from '../../../../app/core/SDKConnect/utils/DevLogger'; import { PPOMView } from '../../../lib/ppom/PPOMView'; import NavigationService from '../../../core/NavigationService'; import LockScreen from '../../Views/LockScreen'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import ShowIpfsGatewaySheet from '../../Views/ShowIpfsGatewaySheet/ShowIpfsGatewaySheet'; import ShowDisplayNftMediaSheet from '../../Views/ShowDisplayMediaNFTSheet/ShowDisplayNFTMediaSheet'; import AmbiguousAddressSheet from '../../../../app/components/Views/Settings/Contacts/AmbiguousAddressSheet/AmbiguousAddressSheet'; @@ -328,7 +328,7 @@ const App = ({ userLoggedIn }) => { useEffect(() => { if (prevNavigator.current || !navigator) return; const appTriggeredAuth = async () => { - const existingUser = await AsyncStorage.getItem(EXISTING_USER); + const existingUser = await StorageWrapper.getItem(EXISTING_USER); try { if (existingUser) { await Authentication.appTriggeredAuth(); @@ -501,7 +501,7 @@ const App = ({ userLoggedIn }) => { useEffect(() => { async function checkExisting() { - const existingUser = await AsyncStorage.getItem(EXISTING_USER); + const existingUser = await StorageWrapper.getItem(EXISTING_USER); setOnboarded(!!existingUser); const route = !existingUser ? Routes.ONBOARDING.ROOT_NAV @@ -517,24 +517,24 @@ const App = ({ userLoggedIn }) => { useEffect(() => { async function startApp() { - const existingUser = await AsyncStorage.getItem(EXISTING_USER); + const existingUser = await StorageWrapper.getItem(EXISTING_USER); try { const currentVersion = getVersion(); - const savedVersion = await AsyncStorage.getItem(CURRENT_APP_VERSION); + const savedVersion = await StorageWrapper.getItem(CURRENT_APP_VERSION); if (currentVersion !== savedVersion) { if (savedVersion) - await AsyncStorage.setItem(LAST_APP_VERSION, savedVersion); - await AsyncStorage.setItem(CURRENT_APP_VERSION, currentVersion); + await StorageWrapper.setItem(LAST_APP_VERSION, savedVersion); + await StorageWrapper.setItem(CURRENT_APP_VERSION, currentVersion); } - const lastVersion = await AsyncStorage.getItem(LAST_APP_VERSION); + const lastVersion = await StorageWrapper.getItem(LAST_APP_VERSION); if (!lastVersion) { if (existingUser) { // Setting last version to first version if user exists and lastVersion does not, to simulate update - await AsyncStorage.setItem(LAST_APP_VERSION, '0.0.1'); + await StorageWrapper.setItem(LAST_APP_VERSION, '0.0.1'); } else { // Setting last version to current version so that it's not treated as an update - await AsyncStorage.setItem(LAST_APP_VERSION, currentVersion); + await StorageWrapper.setItem(LAST_APP_VERSION, currentVersion); } } } catch (error) { diff --git a/app/components/Nav/Main/RootRPCMethodsUI.js b/app/components/Nav/Main/RootRPCMethodsUI.js index 2b331b13333..47a2e5bf552 100644 --- a/app/components/Nav/Main/RootRPCMethodsUI.js +++ b/app/components/Nav/Main/RootRPCMethodsUI.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback } from 'react'; +import React, { useState, useEffect, useCallback, useMemo } from 'react'; import { Alert } from 'react-native'; import PropTypes from 'prop-types'; @@ -66,6 +66,7 @@ import { useMetrics } from '../../../components/hooks/useMetrics'; import { selectShouldUseSmartTransaction } from '../../../selectors/smartTransactionsController'; import { STX_NO_HASH_ERROR } from '../../../util/smart-transactions/smart-publish-hook'; import { getSmartTransactionMetricsProperties } from '../../../util/smart-transactions'; +import { cloneDeep, isEqual } from 'lodash'; ///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps) import InstallSnapApproval from '../../Approvals/InstallSnapApproval'; @@ -73,28 +74,40 @@ import InstallSnapApproval from '../../Approvals/InstallSnapApproval'; const hstInterface = new ethers.utils.Interface(abi); -export const useSwapConfirmedEvent = ({ - TransactionController, - swapsTransactions, - trackSwaps, -}) => { +function useSwapsTransactions() { + const swapTransactions = useSelector( + (state) => + state.engine.backgroundState.TransactionController.swapsTransactions, + isEqual, + ); + + // Memo prevents fresh fallback empty object on every render. + return useMemo(() => swapTransactions ?? {}, [swapTransactions]); +} + +export const useSwapConfirmedEvent = ({ trackSwaps }) => { const [transactionMetaIdsForListening, setTransactionMetaIdsForListening] = useState([]); - const addTransactionMetaIdForListening = (txMetaId) => { - setTransactionMetaIdsForListening([ - ...transactionMetaIdsForListening, - txMetaId, - ]); - }; + const addTransactionMetaIdForListening = useCallback( + (txMetaId) => { + setTransactionMetaIdsForListening([ + ...transactionMetaIdsForListening, + txMetaId, + ]); + }, + [transactionMetaIdsForListening], + ); + + const swapsTransactions = useSwapsTransactions(); useEffect(() => { // Cannot directly call trackSwaps from the event listener in autoSign due to stale closure of swapsTransactions const [txMetaId, ...restTxMetaIds] = transactionMetaIdsForListening; if (txMetaId && swapsTransactions[txMetaId]) { - TransactionController.hub.once( - `${txMetaId}:confirmed`, + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionConfirmed', (transactionMeta) => { if ( swapsTransactions[transactionMeta.id]?.analytics && @@ -107,15 +120,11 @@ export const useSwapConfirmedEvent = ({ ); } }, + (transactionMeta) => transactionMeta.id === txMetaId, ); setTransactionMetaIdsForListening(restTxMetaIds); } - }, [ - trackSwaps, - transactionMetaIdsForListening, - swapsTransactions, - TransactionController, - ]); + }, [trackSwaps, transactionMetaIdsForListening, swapsTransactions]); return { addTransactionMetaIdForListening, @@ -152,29 +161,25 @@ const RootRPCMethodsUI = (props) => { TransactionController.state.transactions.find( ({ id }) => id === approvalTransactionMetaId, ); - const ethBalance = await query( - TransactionController.ethQuery, - 'getBalance', - [props.selectedAddress], - ); - const receipt = await query( - TransactionController.ethQuery, - 'getTransactionReceipt', - [transactionMeta.hash], - ); - const currentBlock = await query( - TransactionController.ethQuery, - 'getBlockByHash', - [receipt.blockHash, false], - ); + const ethQuery = Engine.getGlobalEthQuery(); + + const ethBalance = await query(ethQuery, 'getBalance', [ + props.selectedAddress, + ]); + const receipt = await query(ethQuery, 'getTransactionReceipt', [ + transactionMeta.hash, + ]); + + const currentBlock = await query(ethQuery, 'getBlockByHash', [ + receipt.blockHash, + false, + ]); let approvalReceipt; if (approvalTransaction?.hash) { - approvalReceipt = await query( - TransactionController.ethQuery, - 'getTransactionReceipt', - [approvalTransaction.hash], - ); + approvalReceipt = await query(ethQuery, 'getTransactionReceipt', [ + approvalTransaction.hash, + ]); } const tokensReceived = swapsUtils.getSwapsTokensReceived( receipt, @@ -191,8 +196,8 @@ const RootRPCMethodsUI = (props) => { newSwapsTransactions[transactionMeta.id].receivedDestinationAmount = new BigNumber(tokensReceived, 16).toString(10); } - TransactionController.update({ - swapsTransactions: newSwapsTransactions, + TransactionController.update((state) => { + state.swapsTransactions = newSwapsTransactions; }); const timeToMine = currentBlock.timestamp - sentAt; @@ -253,19 +258,19 @@ const RootRPCMethodsUI = (props) => { ); const { addTransactionMetaIdForListening } = useSwapConfirmedEvent({ - TransactionController: Engine.context.TransactionController, - swapsTransactions: props.swapsTransactions, trackSwaps, }); + const swapsTransactions = useSwapsTransactions(); + const autoSign = useCallback( async (transactionMeta) => { - const { TransactionController, KeyringController } = Engine.context; - const swapsTransactions = props.swapsTransactions; + const { KeyringController } = Engine.context; + const { id: transactionId } = transactionMeta; try { - TransactionController.hub.once( - `${transactionMeta.id}:finished`, + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionFinished', (transactionMeta) => { if (transactionMeta.status === 'submitted') { NotificationManager.watchSubmittedTransaction({ @@ -283,6 +288,7 @@ const RootRPCMethodsUI = (props) => { throw transactionMeta.error; } }, + (transactionMeta) => transactionMeta.id === transactionId, ); // Queue txMetaId to listen for confirmation event @@ -331,13 +337,15 @@ const RootRPCMethodsUI = (props) => { props.navigation, trackSwaps, trackEvent, - props.swapsTransactions, + swapsTransactions, addTransactionMetaIdForListening, ], ); const onUnapprovedTransaction = useCallback( - async (transactionMeta) => { + async (transactionMetaOriginal) => { + const transactionMeta = cloneDeep(transactionMetaOriginal); + if (transactionMeta.origin === TransactionTypes.MMM) return; const to = transactionMeta.txParams.to?.toLowerCase(); @@ -404,7 +412,6 @@ const RootRPCMethodsUI = (props) => { transactionMeta.txParams.to = toAddress; setTransactionObject({ - type: 'INDIVIDUAL_TOKEN_TRANSACTION', selectedAsset: asset, id: transactionMeta.id, origin: transactionMeta.origin, @@ -448,13 +455,13 @@ const RootRPCMethodsUI = (props) => { // unapprovedTransaction effect useEffect(() => { - Engine.context.TransactionController.hub.on( - 'unapprovedTransaction', + Engine.controllerMessenger.subscribe( + 'TransactionController:unapprovedTransactionAdded', onUnapprovedTransaction, ); return () => { - Engine.context.TransactionController.hub.removeListener( - 'unapprovedTransaction', + Engine.controllerMessenger.unsubscribe( + 'TransactionController:unapprovedTransactionAdded', onUnapprovedTransaction, ); }; @@ -498,7 +505,6 @@ const RootRPCMethodsUI = (props) => { }; RootRPCMethodsUI.propTypes = { - swapsTransactions: PropTypes.object, /** * Object that represents the navigator */ @@ -533,8 +539,6 @@ const mapStateToProps = (state) => ({ selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), chainId: selectChainId(state), tokens: selectTokens(state), - swapsTransactions: - state.engine.backgroundState.TransactionController.swapsTransactions || {}, providerType: selectProviderType(state), shouldUseSmartTransaction: selectShouldUseSmartTransaction(state), }); diff --git a/app/components/Nav/Main/index.js b/app/components/Nav/Main/index.js index d090218d381..1353c66b04a 100644 --- a/app/components/Nav/Main/index.js +++ b/app/components/Nav/Main/index.js @@ -151,8 +151,8 @@ const Main = (props) => { const checkInfuraAvailability = useCallback(async () => { if (props.providerType !== 'rpc') { try { - const { TransactionController } = Engine.context; - await query(TransactionController.ethQuery, 'blockNumber', []); + const ethQuery = Engine.getGlobalEthQuery(); + await query(ethQuery, 'blockNumber', []); props.setInfuraAvailabilityNotBlocked(); } catch (e) { if (e.message === AppConstants.ERRORS.INFURA_BLOCKED_MESSAGE) { diff --git a/app/components/Nav/Main/index.test.tsx b/app/components/Nav/Main/index.test.tsx index 965d5097ba7..8abdb23a780 100644 --- a/app/components/Nav/Main/index.test.tsx +++ b/app/components/Nav/Main/index.test.tsx @@ -3,13 +3,92 @@ import React from 'react'; import { shallow } from 'enzyme'; // eslint-disable-next-line import/named import { NavigationContainer } from '@react-navigation/native'; -import EventEmitter from 'events'; import Main from './'; import { useSwapConfirmedEvent } from './RootRPCMethodsUI'; -import { renderHook, act } from '@testing-library/react-hooks'; +import { act } from '@testing-library/react-hooks'; import { MetaMetricsEvents } from '../../hooks/useMetrics'; +import { renderHookWithProvider } from '../../../util/test/renderWithProvider'; +import Engine from '../../../core/Engine'; + +jest.mock('../../../core/Engine.ts', () => ({ + controllerMessenger: { + subscribeOnceIf: jest.fn(), + }, +})); + +const TRANSACTION_META_ID_MOCK = '04541dc0-2e69-11ef-b995-33aef2c88d1e'; + +const SWAP_TRANSACTIONS_MOCK = { + [TRANSACTION_META_ID_MOCK]: { + action: 'swap', + analytics: { + available_quotes: 5, + best_quote_source: 'oneInchV5', + chain_id: '1', + custom_slippage: false, + network_fees_ETH: '0.00337', + network_fees_USD: '$12.04', + other_quote_selected: false, + request_type: 'Order', + token_from: 'ETH', + token_from_amount: '0.001254', + token_to: 'USDC', + token_to_amount: '4.440771', + }, + destinationAmount: '4440771', + destinationToken: { + address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + decimals: 6, + }, + paramsForAnalytics: { + approvalTransactionMetaId: {}, + ethAccountBalance: '0xedfffbea734a07', + gasEstimate: '0x33024', + sentAt: '0x66732203', + }, + sourceAmount: '1254000000000000', + sourceAmountInFiat: '$4.47', + sourceToken: { + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + }, + }, +}; + +function renderUseSwapConfirmedEventHook({ + swapsTransactions, + trackSwaps, +}: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + swapsTransactions: any; + trackSwaps?: jest.Func; +}) { + const finalTrackSwaps = trackSwaps || jest.fn(); + + const { result } = renderHookWithProvider( + () => + useSwapConfirmedEvent({ + trackSwaps: finalTrackSwaps, + }), + { + state: { + engine: { + backgroundState: { + TransactionController: { swapsTransactions }, + }, + }, + }, + }, + ); + + return result; +} describe('Main', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + it('should render correctly', () => { const MainAppContainer = () => ( @@ -21,127 +100,88 @@ describe('Main', () => { }); describe('useSwapConfirmedEvent', () => { - const txMetaId = '04541dc0-2e69-11ef-b995-33aef2c88d1e'; - const swapsTransactions = { - [txMetaId]: { - action: 'swap', - analytics: { - available_quotes: 5, - best_quote_source: 'oneInchV5', - chain_id: '1', - custom_slippage: false, - network_fees_ETH: '0.00337', - network_fees_USD: '$12.04', - other_quote_selected: false, - request_type: 'Order', - token_from: 'ETH', - token_from_amount: '0.001254', - token_to: 'USDC', - token_to_amount: '4.440771', - }, - destinationAmount: '4440771', - destinationToken: { - address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', - decimals: 6, - }, - paramsForAnalytics: { - approvalTransactionMetaId: {}, - ethAccountBalance: '0xedfffbea734a07', - gasEstimate: '0x33024', - sentAt: '0x66732203', - }, - sourceAmount: '1254000000000000', - sourceAmountInFiat: '$4.47', - sourceToken: { - address: '0x0000000000000000000000000000000000000000', - decimals: 18, - }, - }, - }; - it('queues transactionMeta ids correctly', () => { - const eventEmitter = new EventEmitter(); + const result = renderUseSwapConfirmedEventHook({ + swapsTransactions: {}, + }); - const { result } = renderHook(() => - useSwapConfirmedEvent({ - TransactionController: { - hub: eventEmitter, - }, - swapsTransactions: {}, // This has to be empty object, otherwise test fails - trackSwaps: jest.fn(), - }), - ); act(() => { - result.current.addTransactionMetaIdForListening(txMetaId); + result.current.addTransactionMetaIdForListening( + TRANSACTION_META_ID_MOCK, + ); }); - expect(result.current.transactionMetaIdsForListening).toEqual([txMetaId]); + expect(result.current.transactionMetaIdsForListening).toEqual([ + TRANSACTION_META_ID_MOCK, + ]); }); + it('adds a listener for transaction confirmation on the TransactionController', () => { - const eventEmitter = new EventEmitter(); + const result = renderUseSwapConfirmedEventHook({ + swapsTransactions: SWAP_TRANSACTIONS_MOCK, + }); - const { result } = renderHook(() => - useSwapConfirmedEvent({ - TransactionController: { - hub: eventEmitter, - }, - swapsTransactions, - trackSwaps: jest.fn(), - }), - ); act(() => { - result.current.addTransactionMetaIdForListening(txMetaId); + result.current.addTransactionMetaIdForListening( + TRANSACTION_META_ID_MOCK, + ); }); - expect(eventEmitter.listenerCount(`${txMetaId}:confirmed`)).toBe(1); + expect(Engine.controllerMessenger.subscribeOnceIf).toHaveBeenCalledTimes( + 1, + ); }); + it('tracks Swap Confirmed after transaction confirmed', () => { - const eventEmitter = new EventEmitter(); const trackSwaps = jest.fn(); + const txMeta = { - id: txMetaId, + id: TRANSACTION_META_ID_MOCK, }; - const { result } = renderHook(() => - useSwapConfirmedEvent({ - TransactionController: { - hub: eventEmitter, - }, - swapsTransactions, - trackSwaps, - }), - ); + const result = renderUseSwapConfirmedEventHook({ + swapsTransactions: SWAP_TRANSACTIONS_MOCK, + trackSwaps, + }); + act(() => { - result.current.addTransactionMetaIdForListening(txMetaId); + result.current.addTransactionMetaIdForListening( + TRANSACTION_META_ID_MOCK, + ); }); - eventEmitter.emit(`${txMetaId}:confirmed`, txMeta); + + jest + .mocked(Engine.controllerMessenger.subscribeOnceIf) + .mock.calls[0][1](txMeta as never); expect(trackSwaps).toHaveBeenCalledWith( MetaMetricsEvents.SWAP_COMPLETED, txMeta, - swapsTransactions, + SWAP_TRANSACTIONS_MOCK, ); }); + it('removes transactionMeta id after tracking', () => { - const eventEmitter = new EventEmitter(); const trackSwaps = jest.fn(); + const txMeta = { - id: txMetaId, + id: TRANSACTION_META_ID_MOCK, }; - const { result } = renderHook(() => - useSwapConfirmedEvent({ - TransactionController: { - hub: eventEmitter, - }, - swapsTransactions, - trackSwaps, - }), - ); + const result = renderUseSwapConfirmedEventHook({ + swapsTransactions: SWAP_TRANSACTIONS_MOCK, + trackSwaps, + }); + act(() => { - result.current.addTransactionMetaIdForListening(txMetaId); + result.current.addTransactionMetaIdForListening( + TRANSACTION_META_ID_MOCK, + ); }); - eventEmitter.emit(`${txMetaId}:confirmed`, txMeta); + + jest + .mocked(Engine.controllerMessenger.subscribeOnceIf) + .mock.calls[0][1](txMeta as never); expect(result.current.transactionMetaIdsForListening).toEqual([]); }); diff --git a/app/components/UI/OnboardingWizard/index.tsx b/app/components/UI/OnboardingWizard/index.tsx index d771dbf9a96..f55d4e396f5 100644 --- a/app/components/UI/OnboardingWizard/index.tsx +++ b/app/components/UI/OnboardingWizard/index.tsx @@ -1,7 +1,6 @@ import React, { useContext } from 'react'; import { View, StyleSheet, TextStyle } from 'react-native'; import { useDispatch, useSelector } from 'react-redux'; -import DefaultPreference from 'react-native-default-preference'; import Modal from 'react-native-modal'; import type { Theme } from '@metamask/design-tokens'; import { DrawerContext } from '../../../components/Nav/Main/MainNavigator'; @@ -23,7 +22,7 @@ import { } from '../../../core/Analytics'; import { useTheme } from '../../../util/theme'; import Device from '../../../util/device'; -import AsyncStorageWrapper from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { isTest } from '../../../util/test/utils'; import { useMetrics } from '../../hooks/useMetrics'; @@ -103,7 +102,7 @@ const OnboardingWizard = ({ * Close onboarding wizard setting step to 0 and closing drawer */ const closeOnboardingWizard = async () => { - await DefaultPreference.set(ONBOARDING_WIZARD, EXPLORED); + await StorageWrapper.setItem(ONBOARDING_WIZARD, EXPLORED); dispatch(setOnboardingWizardStep(0)); drawerRef?.current?.dismissDrawer?.(); trackEvent(MetaMetricsEvents.ONBOARDING_TOUR_SKIPPED, { @@ -118,7 +117,7 @@ const OnboardingWizard = ({ // it indicates that it was provided by fixtures, triggering the call to closeOnboardingWizard(). if (isTest && step === 1) { const inTestCloseOnboardingWizard = async () => { - const wizardStep = await AsyncStorageWrapper.getItem(ONBOARDING_WIZARD); + const wizardStep = await StorageWrapper.getItem(ONBOARDING_WIZARD); if (wizardStep === EXPLORED) { await closeOnboardingWizard(); } diff --git a/app/components/UI/OptinMetrics/index.js b/app/components/UI/OptinMetrics/index.js index ef195031657..1e75c37db92 100644 --- a/app/components/UI/OptinMetrics/index.js +++ b/app/components/UI/OptinMetrics/index.js @@ -25,7 +25,7 @@ import { MetaMetricsEvents, withMetricsAwareness, } from '../../hooks/useMetrics'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../../store/storage-wrapper'; import { ThemeContext } from '../../../util/theme'; import { MetaMetricsOptInSelectorsIDs } from '../../../../e2e/selectors/Onboarding/MetaMetricsOptIn.selectors'; import Checkbox from '../../../component-library/components/Checkbox'; @@ -236,7 +236,7 @@ class OptinMetrics extends PureComponent { } // Get onboarding wizard state - const onboardingWizard = await DefaultPreference.get(ONBOARDING_WIZARD); + const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD); if (onboardingWizard) { this.props.navigation.reset({ routes: [{ name: 'HomeNav' }] }); } else { diff --git a/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx b/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx index ba4c600fc44..b5d8994e194 100644 --- a/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx +++ b/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx @@ -8,13 +8,13 @@ import { configureStore } from '@reduxjs/toolkit'; import { SimulationErrorCode, SimulationTokenStandard, + CHAIN_IDS, } from '@metamask/transaction-controller'; import { default as SimulationDetails, type SimulationDetailsProps, } from './SimulationDetails'; -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; const backdropStyle = { backgroundColor: 'white', padding: 16 }; type Story = StoryObj; diff --git a/app/components/UI/Swaps/QuotesView.js b/app/components/UI/Swaps/QuotesView.js index 3532e5a99a1..2fea4c2cd69 100644 --- a/app/components/UI/Swaps/QuotesView.js +++ b/app/components/UI/Swaps/QuotesView.js @@ -18,7 +18,7 @@ import { WalletDevice, TransactionStatus, } from '@metamask/transaction-controller'; -import { query } from '@metamask/controller-utils'; +import { query, toHex } from '@metamask/controller-utils'; import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; import { @@ -784,16 +784,12 @@ function SwapsQuotesView({ newSwapsTransactions, ) => { const { TransactionController } = Engine.context; - const blockNumber = await query( - TransactionController.ethQuery, - 'blockNumber', - [], - ); - const currentBlock = await query( - TransactionController.ethQuery, - 'getBlockByNumber', - [blockNumber, false], - ); + const ethQuery = Engine.getGlobalEthQuery(); + const blockNumber = await query(ethQuery, 'blockNumber', []); + const currentBlock = await query(ethQuery, 'getBlockByNumber', [ + blockNumber, + false, + ]); newSwapsTransactions[transactionMeta.id] = { action: 'swap', sourceToken: { @@ -842,7 +838,9 @@ function SwapsQuotesView({ approvalTransactionMetaId, }, }; - TransactionController.update({ swapsTransactions: newSwapsTransactions }); + TransactionController.update((state) => { + state.swapsTransactions = newSwapsTransactions; + }); }, [ chainId, @@ -922,7 +920,7 @@ function SwapsQuotesView({ gasEstimateType, gasEstimates, ), - gas: new BigNumber(gasLimit).toString(16), + gas: toHex(gasLimit), }, { deviceConfirmedOn: WalletDevice.MM_MOBILE, @@ -999,8 +997,10 @@ function SwapsQuotesView({ ).toString(10), }; if (isHardwareAddress || shouldUseSmartTransaction) { - TransactionController.hub.once( - `${transactionMeta.id}:confirmed`, + const { id: transactionId } = transactionMeta; + + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionConfirmed', (transactionMeta) => { if (transactionMeta.status === TransactionStatus.confirmed) { handleSwapTransaction( @@ -1011,6 +1011,7 @@ function SwapsQuotesView({ ); } }, + (transactionMeta) => transactionMeta.id === transactionId, ); } } catch (e) { diff --git a/app/components/UI/TransactionElement/TransactionDetails/index.js b/app/components/UI/TransactionElement/TransactionDetails/index.js index 5a5eca528d1..6fc259c1f95 100644 --- a/app/components/UI/TransactionElement/TransactionDetails/index.js +++ b/app/components/UI/TransactionElement/TransactionDetails/index.js @@ -138,12 +138,8 @@ class TransactionDetails extends PureComponent { }; fetchTxReceipt = async (transactionHash) => { - const { TransactionController } = Engine.context; - return await query( - TransactionController.ethQuery, - 'getTransactionReceipt', - [transactionHash], - ); + const ethQuery = Engine.getGlobalEthQuery(); + return await query(ethQuery, 'getTransactionReceipt', [transactionHash]); }; /** diff --git a/app/components/UI/Transactions/index.js b/app/components/UI/Transactions/index.js index 8404fe5f9b4..43278d0c4f0 100644 --- a/app/components/UI/Transactions/index.js +++ b/app/components/UI/Transactions/index.js @@ -41,7 +41,7 @@ import { getBlockExplorerName, isMainnetByChainId, } from '../../../util/networks'; -import { renderFromWei } from '../../../util/number'; +import { addHexPrefix, hexToBN, renderFromWei } from '../../../util/number'; import { mockTheme, ThemeContext } from '../../../util/theme'; import { validateTransactionActionBalance } from '../../../util/transactions'; import withQRHardwareAwareness from '../QRHardware/withQRHardwareAwareness'; @@ -73,6 +73,7 @@ import { updateIncomingTransactions, } from '../../../util/transaction-controller'; import { selectGasFeeEstimates } from '../../../selectors/confirmTransaction'; +import { decGWEIToHexWEI } from '../../../util/conversions'; const createStyles = (colors, typography) => StyleSheet.create({ @@ -203,6 +204,7 @@ class Transactions extends PureComponent { * On scroll past navbar callback */ onScrollThroughContent: PropTypes.func, + gasFeeEstimates: PropTypes.object, }; static defaultProps = { @@ -541,10 +543,7 @@ class Transactions extends PureComponent { } else { await speedUpTransaction( this.speedUpTxId, - transactionObject?.suggestedMaxFeePerGasHex && { - maxFeePerGas: `0x${transactionObject?.suggestedMaxFeePerGasHex}`, - maxPriorityFeePerGas: `0x${transactionObject?.suggestedMaxPriorityFeePerGasHex}`, - }, + this.getCancelOrSpeedupValues(transactionObject), ); } this.onSpeedUpCompleted(); @@ -613,10 +612,7 @@ class Transactions extends PureComponent { } else { await Engine.context.TransactionController.stopTransaction( this.cancelTxId, - transactionObject?.suggestedMaxFeePerGasHex && { - maxFeePerGas: `0x${transactionObject?.suggestedMaxFeePerGasHex}`, - maxPriorityFeePerGas: `0x${transactionObject?.suggestedMaxPriorityFeePerGasHex}`, - }, + this.getCancelOrSpeedupValues(transactionObject), ); } this.onCancelCompleted(); @@ -758,22 +754,24 @@ class Transactions extends PureComponent { .concat(confirmedTransactions) : this.props.transactions; - const renderSpeedUpGas = () => { + const renderRetryGas = (rate) => { if (!this.existingGas) return null; - if (!this.existingGas.isEIP1559Transaction) - return `${renderFromWei( - Math.floor(this.existingGas.gasPrice * SPEED_UP_RATE), - )} ${strings('unit.eth')}`; - }; - const renderCancelGas = () => { - if (!this.existingGas) return null; - if (!this.existingGas.isEIP1559Transaction) - return `${renderFromWei( - Math.floor(this.existingGas.gasPrice * CANCEL_RATE), - )} ${strings('unit.eth')}`; + if (this.existingGas.isEIP1559Transaction) return null; + + const gasPrice = this.existingGas.gasPrice; + + const increasedGasPrice = + gasPrice === 0 + ? hexToBN(this.getGasPriceEstimate()) + : Math.floor(gasPrice * rate); + + return `${renderFromWei(increasedGasPrice)} ${strings('unit.eth')}`; }; + const renderSpeedUpGas = () => renderRetryGas(SPEED_UP_RATE); + const renderCancelGas = () => renderRetryGas(CANCEL_RATE); + return ( @@ -865,6 +863,37 @@ class Transactions extends PureComponent { ); }; + + getCancelOrSpeedupValues(transactionObject) { + const { suggestedMaxFeePerGasHex, suggestedMaxPriorityFeePerGasHex } = + transactionObject ?? {}; + + if (suggestedMaxFeePerGasHex) { + return { + maxFeePerGas: `0x${suggestedMaxFeePerGasHex}`, + maxPriorityFeePerGas: `0x${suggestedMaxPriorityFeePerGasHex}`, + }; + } + + if (this.existingGas.gasPrice !== 0) { + // Transaction controller will multiply existing gas price by the rate. + return undefined; + } + + return { gasPrice: this.getGasPriceEstimate() }; + } + + getGasPriceEstimate() { + const { gasFeeEstimates } = this.props; + + const estimateGweiDecimal = + gasFeeEstimates?.medium?.suggestedMaxFeePerGas ?? + gasFeeEstimates?.medium ?? + gasFeeEstimates.gasPrice ?? + '0'; + + return addHexPrefix(decGWEIToHexWEI(estimateGweiDecimal)); + } } const mapStateToProps = (state) => ({ diff --git a/app/components/UI/WhatsNewModal/WhatsNewModal.tsx b/app/components/UI/WhatsNewModal/WhatsNewModal.tsx index 96639afe680..fc2620ef383 100644 --- a/app/components/UI/WhatsNewModal/WhatsNewModal.tsx +++ b/app/components/UI/WhatsNewModal/WhatsNewModal.tsx @@ -10,7 +10,7 @@ import { } from 'react-native'; import { strings } from '../../../../locales/i18n'; import Device from '../../../util/device'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { CURRENT_APP_VERSION, WHATS_NEW_APP_VERSION_SEEN, @@ -123,8 +123,8 @@ const WhatsNewModal = () => { const styles = createStyles(colors); const recordSeenModal = async () => { - const version = await AsyncStorage.getItem(CURRENT_APP_VERSION); - await AsyncStorage.setItem(WHATS_NEW_APP_VERSION_SEEN, version as string); + const version = await StorageWrapper.getItem(CURRENT_APP_VERSION); + await StorageWrapper.setItem(WHATS_NEW_APP_VERSION_SEEN, version as string); }; const dismissModal = (callback?: () => void) => diff --git a/app/components/Views/AccountBackupStep1/index.js b/app/components/Views/AccountBackupStep1/index.js index 1700173ba3f..8e00be8bf73 100644 --- a/app/components/Views/AccountBackupStep1/index.js +++ b/app/components/Views/AccountBackupStep1/index.js @@ -27,7 +27,7 @@ import { connect } from 'react-redux'; import setOnboardingWizardStep from '../../../actions/wizard'; import { MetaMetricsEvents } from '../../../core/Analytics'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../../store/storage-wrapper'; import { useTheme } from '../../../util/theme'; import { ManualBackUpStepsSelectorsIDs } from '../../../../e2e/selectors/Onboarding/ManualBackUpSteps.selectors'; import trackOnboarding from '../../../util/metrics/TrackOnboarding/trackOnboarding'; @@ -192,7 +192,7 @@ const AccountBackupStep1 = (props) => { hideRemindLaterModal(); track(MetaMetricsEvents.WALLET_SECURITY_SKIP_CONFIRMED); // Get onboarding wizard state - const onboardingWizard = await DefaultPreference.get(ONBOARDING_WIZARD); + const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD); !onboardingWizard && props.setOnboardingWizardStep(1); props.navigation.reset({ index: 1, diff --git a/app/components/Views/ChoosePassword/index.js b/app/components/Views/ChoosePassword/index.js index cfa89ab4c41..51fafd3a8d0 100644 --- a/app/components/Views/ChoosePassword/index.js +++ b/app/components/Views/ChoosePassword/index.js @@ -15,7 +15,7 @@ import Text, { TextColor, TextVariant, } from '../../../component-library/components/Texts/Text'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { connect } from 'react-redux'; import { passwordSet, @@ -273,10 +273,10 @@ class ChoosePassword extends PureComponent { async componentDidMount() { const authData = await Authentication.getType(); - const previouslyDisabled = await AsyncStorage.getItem( + const previouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); if (authData.currentAuthType === AUTHENTICATION_TYPE.PASSCODE) { @@ -378,8 +378,8 @@ class ChoosePassword extends PureComponent { Logger.error(e); } // Set state in app as it was with no password - await AsyncStorage.setItem(EXISTING_USER, TRUE); - await AsyncStorage.removeItem(SEED_PHRASE_HINTS); + await StorageWrapper.setItem(EXISTING_USER, TRUE); + await StorageWrapper.removeItem(SEED_PHRASE_HINTS); this.props.passwordUnset(); this.props.setLockTime(-1); // Should we force people to enable passcode / biometrics? diff --git a/app/components/Views/ImportFromSecretRecoveryPhrase/index.js b/app/components/Views/ImportFromSecretRecoveryPhrase/index.js index dcb53ccf776..86452748aaa 100644 --- a/app/components/Views/ImportFromSecretRecoveryPhrase/index.js +++ b/app/components/Views/ImportFromSecretRecoveryPhrase/index.js @@ -11,12 +11,11 @@ import { Platform, } from 'react-native'; import { connect } from 'react-redux'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import zxcvbn from 'zxcvbn'; import Icon from 'react-native-vector-icons/FontAwesome'; import { OutlinedTextField } from 'react-native-material-textfield'; -import DefaultPreference from 'react-native-default-preference'; import Clipboard from '@react-native-clipboard/clipboard'; import AppConstants from '../../../core/AppConstants'; import Device from '../../../util/device'; @@ -117,10 +116,10 @@ const ImportFromSecretRecoveryPhrase = ({ const setBiometricsOption = async () => { const authData = await Authentication.getType(); - const previouslyDisabled = await AsyncStorage.getItem( + const previouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); if (authData.currentAuthType === AUTHENTICATION_TYPE.PASSCODE) { @@ -228,7 +227,9 @@ const ImportFromSecretRecoveryPhrase = ({ await handleRejectedOsBiometricPrompt(parsedSeed); } // Get onboarding wizard state - const onboardingWizard = await DefaultPreference.get(ONBOARDING_WIZARD); + const onboardingWizard = await StorageWrapper.getItem( + ONBOARDING_WIZARD, + ); setLoading(false); passwordSet(); setLockTime(AppConstants.DEFAULT_LOCK_TIMEOUT); diff --git a/app/components/Views/Login/index.js b/app/components/Views/Login/index.js index b68e300af1d..f7c2a66ce13 100644 --- a/app/components/Views/Login/index.js +++ b/app/components/Views/Login/index.js @@ -16,7 +16,7 @@ import Text, { TextColor, TextVariant, } from '../../../component-library/components/Texts/Text'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import Button from '@metamask/react-native-button'; import StyledButton from '../../UI/StyledButton'; @@ -44,7 +44,6 @@ import Routes from '../../../constants/navigation/Routes'; import { passwordRequirementsMet } from '../../../util/password'; import ErrorBoundary from '../ErrorBoundary'; import { toLowerCaseEquals } from '../../../util/general'; -import DefaultPreference from 'react-native-default-preference'; import { Authentication } from '../../../core'; import AUTHENTICATION_TYPE from '../../../constants/userProperties'; import { ThemeContext, mockTheme } from '../../../util/theme'; @@ -251,10 +250,10 @@ class Login extends PureComponent { const authData = await Authentication.getType(); //Setup UI to handle Biometric - const previouslyDisabled = await AsyncStorage.getItem( + const previouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); @@ -373,7 +372,7 @@ class Login extends PureComponent { Keyboard.dismiss(); // Get onboarding wizard state - const onboardingWizard = await DefaultPreference.get(ONBOARDING_WIZARD); + const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD); if (onboardingWizard) { this.props.navigation.replace(Routes.ONBOARDING.HOME_NAV); } else { @@ -434,7 +433,7 @@ class Login extends PureComponent { field?.blur(); try { await Authentication.appTriggeredAuth(); - const onboardingWizard = await DefaultPreference.get(ONBOARDING_WIZARD); + const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD); if (!onboardingWizard) this.props.setOnboardingWizardStep(1); this.props.navigation.replace(Routes.ONBOARDING.HOME_NAV); // Only way to land back on Login is to log out, which clears credentials (meaning we should not show biometric button) diff --git a/app/components/Views/ManualBackupStep3/index.js b/app/components/Views/ManualBackupStep3/index.js index f3ed4cb1b1c..eb1a4e12088 100644 --- a/app/components/Views/ManualBackupStep3/index.js +++ b/app/components/Views/ManualBackupStep3/index.js @@ -3,7 +3,7 @@ import { Alert, BackHandler, View, StyleSheet, Keyboard } from 'react-native'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { fontStyles } from '../../../styles/common'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import OnboardingProgress from '../../UI/OnboardingProgress'; import { strings } from '../../../../locales/i18n'; import { showAlert } from '../../../actions/alert'; @@ -18,7 +18,6 @@ import { SEED_PHRASE_HINTS, } from '../../../constants/storage'; import { MetaMetricsEvents } from '../../../core/Analytics'; -import DefaultPreference from 'react-native-default-preference'; import { ThemeContext, mockTheme } from '../../../util/theme'; import trackOnboarding from '../../../util/metrics/TrackOnboarding/trackOnboarding'; import OnboardingSuccess from '../OnboardingSuccess'; @@ -118,7 +117,7 @@ class ManualBackupStep3 extends PureComponent { componentDidMount = async () => { this.updateNavBar(); - const currentSeedphraseHints = await AsyncStorage.getItem( + const currentSeedphraseHints = await StorageWrapper.getItem( SEED_PHRASE_HINTS, ); const parsedHints = @@ -165,11 +164,11 @@ class ManualBackupStep3 extends PureComponent { return; } this.toggleHint(); - const currentSeedphraseHints = await AsyncStorage.getItem( + const currentSeedphraseHints = await StorageWrapper.getItem( SEED_PHRASE_HINTS, ); const parsedHints = JSON.parse(currentSeedphraseHints); - await AsyncStorage.setItem( + await StorageWrapper.setItem( SEED_PHRASE_HINTS, JSON.stringify({ ...parsedHints, manualBackup: hintText }), ); @@ -177,7 +176,7 @@ class ManualBackupStep3 extends PureComponent { }; done = async () => { - const onboardingWizard = await DefaultPreference.get(ONBOARDING_WIZARD); + const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD); if (onboardingWizard) { this.props.navigation.reset({ routes: [{ name: 'HomeNav' }] }); } else { diff --git a/app/components/Views/NetworkSelector/NetworkSelector.test.tsx b/app/components/Views/NetworkSelector/NetworkSelector.test.tsx index 033bea358f0..e8e3bc62151 100644 --- a/app/components/Views/NetworkSelector/NetworkSelector.test.tsx +++ b/app/components/Views/NetworkSelector/NetworkSelector.test.tsx @@ -9,7 +9,7 @@ import { backgroundState } from '../../../util/test/initial-root-state'; // Internal dependencies import NetworkSelector from './NetworkSelector'; -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; import { NetworkListModalSelectorsIDs } from '../../../../e2e/selectors/Modals/NetworkListModal.selectors'; const mockEngine = Engine; diff --git a/app/components/Views/Onboarding/index.js b/app/components/Views/Onboarding/index.js index 7c7599904c6..f15aa33c3c5 100644 --- a/app/components/Views/Onboarding/index.js +++ b/app/components/Views/Onboarding/index.js @@ -14,7 +14,7 @@ import { import Text, { TextVariant, } from '../../../component-library/components/Texts/Text'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import StyledButton from '../../UI/StyledButton'; import { fontStyles, @@ -249,7 +249,7 @@ class Onboarding extends PureComponent { }; async checkIfExistingUser() { - const existingUser = await AsyncStorage.getItem(EXISTING_USER); + const existingUser = await StorageWrapper.getItem(EXISTING_USER); if (existingUser !== null) { this.setState({ existingUser: true }); } diff --git a/app/components/Views/OnboardingSuccess/index.tsx b/app/components/Views/OnboardingSuccess/index.tsx index dd7afe5ea72..b8f7feb47c9 100644 --- a/app/components/Views/OnboardingSuccess/index.tsx +++ b/app/components/Views/OnboardingSuccess/index.tsx @@ -20,7 +20,7 @@ import Routes from '../../../constants/navigation/Routes'; import { getTransparentOnboardingNavbarOptions } from '../../UI/Navbar'; import HintModal from '../../UI/HintModal'; import { useTheme } from '../../../util/theme'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { SEED_PHRASE_HINTS } from '../../../constants/storage'; import Icon, { IconName, @@ -65,12 +65,12 @@ const OnboardingSuccess = ({ const saveHint = async () => { if (!hintText) return; setShowHint(false); - const currentSeedphraseHints = await AsyncStorage.getItem( + const currentSeedphraseHints = await StorageWrapper.getItem( SEED_PHRASE_HINTS, ); if (currentSeedphraseHints) { const parsedHints = JSON.parse(currentSeedphraseHints); - await AsyncStorage.setItem( + await StorageWrapper.setItem( SEED_PHRASE_HINTS, JSON.stringify({ ...parsedHints, manualBackup: hintText }), ); diff --git a/app/components/Views/ResetPassword/index.js b/app/components/Views/ResetPassword/index.js index 8afcb7af43b..9f2f2261f95 100644 --- a/app/components/Views/ResetPassword/index.js +++ b/app/components/Views/ResetPassword/index.js @@ -18,7 +18,7 @@ import Text, { TextColor, TextVariant, } from '../../../component-library/components/Texts/Text'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { connect } from 'react-redux'; import { passwordSet, seedphraseNotBackedUp } from '../../../actions/user'; import { setLockTime } from '../../../actions/settings'; @@ -313,10 +313,10 @@ class ResetPassword extends PureComponent { const state = { view: CONFIRM_PASSWORD }; const authData = await Authentication.getType(); - const previouslyDisabled = await AsyncStorage.getItem( + const previouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); if (authData.currentAuthType === AUTHENTICATION_TYPE.PASSCODE) diff --git a/app/components/Views/RevealPrivateCredential/RevealPrivateCredential.tsx b/app/components/Views/RevealPrivateCredential/RevealPrivateCredential.tsx index cc6570861f5..52b67d40941 100644 --- a/app/components/Views/RevealPrivateCredential/RevealPrivateCredential.tsx +++ b/app/components/Views/RevealPrivateCredential/RevealPrivateCredential.tsx @@ -19,7 +19,7 @@ import ScrollableTabView, { // eslint-disable-next-line @typescript-eslint/no-explicit-any const CustomTabView = View as any; import Icon from 'react-native-vector-icons/FontAwesome5'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import ActionView from '../../UI/ActionView'; import ButtonReveal from '../../UI/ButtonReveal'; import Button, { @@ -176,7 +176,7 @@ const RevealPrivateCredential = ({ if (!passwordSet) { tryUnlockWithPassword(''); } else if (availableBiometryType) { - const biometryChoice = await AsyncStorage.getItem(BIOMETRY_CHOICE); + const biometryChoice = await StorageWrapper.getItem(BIOMETRY_CHOICE); if (biometryChoice !== '' && biometryChoice === availableBiometryType) { const credentials = await Authentication.getPassword(); if (credentials) { diff --git a/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js b/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js index 3e9ab017621..ad606a6149e 100644 --- a/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js +++ b/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js @@ -73,7 +73,7 @@ import { import { CustomDefaultNetworkIDs } from '../../../../../../e2e/selectors/Onboarding/CustomDefaultNetwork.selectors'; import { updateIncomingTransactions } from '../../../../../util/transaction-controller'; import { withMetricsAwareness } from '../../../../../components/hooks/useMetrics'; -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; import Routes from '../../../../../constants/navigation/Routes'; import { selectUseSafeChainsListValidation } from '../../../../../../app/selectors/preferencesController'; import withIsOriginalNativeToken from './withIsOriginalNativeToken'; diff --git a/app/components/Views/Settings/SecuritySettings/Sections/LoginOptionsSettings.tsx b/app/components/Views/Settings/SecuritySettings/Sections/LoginOptionsSettings.tsx index d71393b473a..6106202e777 100644 --- a/app/components/Views/Settings/SecuritySettings/Sections/LoginOptionsSettings.tsx +++ b/app/components/Views/Settings/SecuritySettings/Sections/LoginOptionsSettings.tsx @@ -5,7 +5,7 @@ import { BIOMETRY_TYPE } from 'react-native-keychain'; import { Authentication } from '../../../../../core'; import AUTHENTICATION_TYPE from '../../../../../constants/userProperties'; import Device from '../../../../../util/device'; -import AsyncStorage from '../../../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../../../store/storage-wrapper'; import { BIOMETRY_CHOICE_DISABLED, PASSCODE_DISABLED, @@ -33,10 +33,10 @@ const LoginOptionsSettings = ({ useEffect(() => { const getOptions = async () => { const authType = await Authentication.getType(); - const previouslyDisabled = await AsyncStorage.getItem( + const previouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); if ( diff --git a/app/components/Views/Settings/SecuritySettings/SecuritySettings.tsx b/app/components/Views/Settings/SecuritySettings/SecuritySettings.tsx index b384fcfe8d7..f60053067c5 100644 --- a/app/components/Views/Settings/SecuritySettings/SecuritySettings.tsx +++ b/app/components/Views/Settings/SecuritySettings/SecuritySettings.tsx @@ -10,7 +10,7 @@ import { Platform, Linking, } from 'react-native'; -import AsyncStorage from '../../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../../store/storage-wrapper'; import { useDispatch, useSelector } from 'react-redux'; import { MAINNET } from '../../../../constants/network'; import ActionModal from '../../../UI/ActionModal'; @@ -105,7 +105,7 @@ import Networks, { toggleUseSafeChainsListValidation, } from '../../../../util/networks'; import images from 'images/image-icons'; -import { ETHERSCAN_SUPPORTED_NETWORKS } from '@metamask/transaction-controller/dist/constants'; +import { ETHERSCAN_SUPPORTED_NETWORKS } from '@metamask/transaction-controller'; import { SecurityPrivacyViewSelectorsIDs } from '../../../../../e2e/selectors/Settings/SecurityAndPrivacy/SecurityPrivacyView.selectors'; import Text, { TextVariant, @@ -232,7 +232,7 @@ const Settings: React.FC = () => { }, [isIpfsGatewayEnabled]); const handleHintText = useCallback(async () => { - const currentSeedphraseHints = await AsyncStorage.getItem( + const currentSeedphraseHints = await StorageWrapper.getItem( SEED_PHRASE_HINTS, ); const parsedHints = @@ -299,12 +299,12 @@ const Settings: React.FC = () => { const saveHint = async () => { if (!hintText) return; toggleHint(); - const currentSeedphraseHints = await AsyncStorage.getItem( + const currentSeedphraseHints = await StorageWrapper.getItem( SEED_PHRASE_HINTS, ); if (currentSeedphraseHints) { const parsedHints = JSON.parse(currentSeedphraseHints); - await AsyncStorage.setItem( + await StorageWrapper.setItem( SEED_PHRASE_HINTS, JSON.stringify({ ...parsedHints, manualBackup: hintText }), ); @@ -321,15 +321,15 @@ const Settings: React.FC = () => { await Engine.context.KeyringController.exportSeedPhrase(password); - await AsyncStorage.setItem(EXISTING_USER, TRUE); + await StorageWrapper.setItem(EXISTING_USER, TRUE); if (!enabled) { setLoading(false); if (authChoice === PASSCODE_CHOICE_STRING) { - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); } else if (authChoice === BIOMETRY_CHOICE_STRING) { - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); } return; diff --git a/app/components/Views/SmartTransactionsOptInModal/SmartTranactionsOptInModal.tsx b/app/components/Views/SmartTransactionsOptInModal/SmartTranactionsOptInModal.tsx index 7acdcab5ba7..463653059a3 100644 --- a/app/components/Views/SmartTransactionsOptInModal/SmartTranactionsOptInModal.tsx +++ b/app/components/Views/SmartTransactionsOptInModal/SmartTranactionsOptInModal.tsx @@ -8,7 +8,7 @@ import { } from 'react-native'; import { strings } from '../../../../locales/i18n'; import Device from '../../../util/device'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { CURRENT_APP_VERSION } from '../../../constants/storage'; import { useTheme } from '../../../util/theme'; import Text, { @@ -147,7 +147,7 @@ const SmartTransactionsOptInModal = () => { }; const markOptInModalAsSeen = async () => { - const version = await AsyncStorage.getItem(CURRENT_APP_VERSION); + const version = await StorageWrapper.getItem(CURRENT_APP_VERSION); dispatch(updateOptInModalAppVersionSeen(version)); }; diff --git a/app/components/Views/SmartTransactionsOptInModal/SmartTransactionsOptInModal.test.tsx b/app/components/Views/SmartTransactionsOptInModal/SmartTransactionsOptInModal.test.tsx index 82299764f95..02664a58ebf 100644 --- a/app/components/Views/SmartTransactionsOptInModal/SmartTransactionsOptInModal.test.tsx +++ b/app/components/Views/SmartTransactionsOptInModal/SmartTransactionsOptInModal.test.tsx @@ -30,7 +30,7 @@ jest.mock('../../../core/Engine', () => ({ })); const VERSION = '1.0.0'; -jest.mock('../../../store/async-storage-wrapper', () => ({ +jest.mock('../../../store/storage-wrapper', () => ({ getItem: jest.fn(() => VERSION), setItem: jest.fn(), removeItem: jest.fn(), diff --git a/app/components/Views/WalletConnectSessions/index.js b/app/components/Views/WalletConnectSessions/index.js index bd6255322bc..d7063708e23 100644 --- a/app/components/Views/WalletConnectSessions/index.js +++ b/app/components/Views/WalletConnectSessions/index.js @@ -12,7 +12,7 @@ import { fontStyles } from '../../../styles/common'; import { strings } from '../../../../locales/i18n'; import { getNavigationOptionsTitle } from '../../UI/Navbar'; import WebsiteIcon from '../../UI/WebsiteIcon'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import ActionSheet from '@metamask/react-native-actionsheet'; import WalletConnect from '../../../core/WalletConnect/WalletConnect'; import Logger from '../../../util/Logger'; @@ -117,7 +117,7 @@ export default class WalletConnectSessions extends PureComponent { let sessions = []; let sessionsV2 = []; - const sessionData = await AsyncStorage.getItem(WALLETCONNECT_SESSIONS); + const sessionData = await StorageWrapper.getItem(WALLETCONNECT_SESSIONS); if (sessionData) { sessions = JSON.parse(sessionData); } diff --git a/app/components/Views/WalletConnectSessions/index.test.tsx b/app/components/Views/WalletConnectSessions/index.test.tsx index e5633ace378..79d20072b6a 100644 --- a/app/components/Views/WalletConnectSessions/index.test.tsx +++ b/app/components/Views/WalletConnectSessions/index.test.tsx @@ -1,6 +1,6 @@ import { waitFor } from '@testing-library/react-native'; import WalletConnectSessions from './'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import { renderScreen } from '../../../util/test/renderWithProvider'; import Routes from '../../../constants/navigation/Routes'; import { ExperimentalSelectorsIDs } from '../../../../e2e/selectors/Settings/ExperimentalView.selectors'; @@ -14,7 +14,7 @@ describe('WalletConnectSessions', () => { }); it('renders empty component with no active sessions', async () => { - jest.spyOn(AsyncStorage, 'getItem').mockResolvedValue(null); + jest.spyOn(StorageWrapper, 'getItem').mockResolvedValue(null); const { getByTestId, toJSON } = renderScreen(WalletConnectSessions, { name: Routes.WALLET.WALLET_CONNECT_SESSIONS_VIEW, @@ -40,7 +40,7 @@ describe('WalletConnectSessions', () => { ]; jest - .spyOn(AsyncStorage, 'getItem') + .spyOn(StorageWrapper, 'getItem') .mockResolvedValue(JSON.stringify(sessions)); const { getByTestId, toJSON } = renderScreen(WalletConnectSessions, { diff --git a/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js b/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js index a6a78f3dea5..5e607dfbef8 100644 --- a/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js +++ b/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js @@ -268,7 +268,6 @@ class TransactionEditor extends PureComponent { }); } - await this.validate(undefined, LegacyGasData); // eslint-disable-next-line react/no-did-update-set-state this.setState( { @@ -286,6 +285,8 @@ class TransactionEditor extends PureComponent { this.setState({ animateOnChange: false }); }, ); + + await this.validate(undefined, LegacyGasData); } }; @@ -397,7 +398,8 @@ class TransactionEditor extends PureComponent { this.props.gasFeeEstimates && transaction.gas && (!shallowEqual(prevProps.gasFeeEstimates, this.props.gasFeeEstimates) || - !transaction.gas.eq(prevProps?.transaction?.gas)) + !transaction.gas.eq(prevProps?.transaction?.gas) || + !this.state.ready) ) { this.computeGasEstimates(gasEstimateTypeChanged); } diff --git a/app/components/Views/confirmations/Approval/index.js b/app/components/Views/confirmations/Approval/index.js index 512a62ea843..562722131e1 100644 --- a/app/components/Views/confirmations/Approval/index.js +++ b/app/components/Views/confirmations/Approval/index.js @@ -4,7 +4,7 @@ import Engine from '../../../../core/Engine'; import PropTypes from 'prop-types'; import TransactionEditor from './components/TransactionEditor'; import Modal from 'react-native-modal'; -import { addHexPrefix, BNToHex } from '../../../../util/number'; +import { safeBNToHex } from '../../../../util/number'; import { getTransactionOptionsTitle } from '../../../UI/Navbar'; import { resetTransaction } from '../../../../actions/transaction'; import { connect } from 'react-redux'; @@ -20,12 +20,10 @@ import { strings } from '../../../../../locales/i18n'; import { getAddressAccountType, isQRHardwareAccount, - safeToChecksumAddress, isHardwareAccount, } from '../../../../util/address'; import { WALLET_CONNECT_ORIGIN } from '../../../../util/walletconnect'; import Logger from '../../../../util/Logger'; -import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; import { KEYSTONE_TX_CANCELED } from '../../../../constants/error'; import { ThemeContext, mockTheme } from '../../../../util/theme'; import { createLedgerTransactionModalNavDetails } from '../../../UI/LedgerModals/LedgerTransactionModal'; @@ -53,6 +51,7 @@ import { withMetricsAwareness } from '../../../../components/hooks/useMetrics'; import { STX_NO_HASH_ERROR } from '../../../../util/smart-transactions/smart-publish-hook'; import { getSmartTransactionMetricsProperties } from '../../../../util/smart-transactions'; import { selectTransactionMetrics } from '../../../../core/redux/slices/transactionMetrics'; +import { buildTransactionParams } from '../../../../util/confirmation/transactions'; const REVIEW = 'review'; const EDIT = 'edit'; @@ -71,6 +70,8 @@ const styles = StyleSheet.create({ class Approval extends PureComponent { appStateListener; + #transactionFinishedListener; + static propTypes = { /** * A string that represents the selected address @@ -108,7 +109,6 @@ class Approval extends PureComponent { * Indicates whether custom nonce should be shown in transaction editor */ showCustomNonce: PropTypes.bool, - nonce: PropTypes.number, /** * A string representing the network chainId @@ -161,6 +161,7 @@ class Approval extends PureComponent { const { transactionHandled } = this.state; const { transaction, selectedAddress } = this.props; const { KeyringController } = Engine.context; + if (!transactionHandled) { if (isQRHardwareAccount(selectedAddress)) { KeyringController.cancelQRSignRequest(); @@ -174,12 +175,16 @@ class Approval extends PureComponent { }, ); } - Engine.context.TransactionController.hub.removeAllListeners( - `${transaction.id}:finished`, + + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:transactionFinished', + this.#transactionFinishedListener, ); + this.appStateListener?.remove(); - this.clear(); } + + this.clear(); } catch (e) { if (e) { throw e; @@ -326,9 +331,9 @@ class Approval extends PureComponent { const { TransactionController, SmartTransactionsController } = Engine.context; - const transactionMeta = TransactionController.getTransaction( - transaction.id, - ); + const transactionMeta = TransactionController.getTransactions({ + searchCriteria: { id: transaction.id }, + })?.[0]; const smartTransactionMetricsProperties = getSmartTransactionMetricsProperties( @@ -402,8 +407,9 @@ class Approval extends PureComponent { if (!approve) { //cancelTransaction will change transaction status to reject and throw error from event listener //component is being unmounted, error will be unhandled, hence remove listener before cancel - TransactionController.hub.removeAllListeners( - `${transactionId}:finished`, + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:transactionFinished', + this.#transactionFinishedListener, ); TransactionController.cancelTransaction(transactionId); @@ -429,27 +435,12 @@ class Approval extends PureComponent { * Callback on confirm transaction */ onConfirm = async ({ gasEstimateType, EIP1559GasData, gasSelected }) => { - const { TransactionController, KeyringController, ApprovalController } = - Engine.context; - const { - transactions, - transaction: { assetType, selectedAsset }, - showCustomNonce, - chainId, - shouldUseSmartTransaction, - } = this.props; + const { KeyringController, ApprovalController } = Engine.context; + const { transactions, chainId, shouldUseSmartTransaction } = this.props; let { transaction } = this.props; - const { nonce } = transaction; const { transactionConfirmed } = this.state; if (transactionConfirmed) return; - if (showCustomNonce && nonce) { - transaction.nonce = BNToHex(nonce); - } else { - // If nonce is not set in transaction, TransactionController will set it to the next nonce - transaction.nonce = undefined; - } - const isLedgerAccount = isHardwareAccount(transaction.from, [ ExtendedKeyringTypes.ledger, ]); @@ -457,20 +448,10 @@ class Approval extends PureComponent { this.setState({ transactionConfirmed: true }); try { - if (assetType === 'ETH') { - transaction = this.prepareTransaction({ - transaction, - gasEstimateType, - EIP1559GasData, - }); - } else { - transaction = this.prepareAssetTransaction({ - transaction, - selectedAsset, - gasEstimateType, - EIP1559GasData, - }); - } + transaction = this.prepareTransaction({ + gasEstimateType, + EIP1559GasData, + }); // For STX, don't wait for TxController to get finished event, since it will take some time to get hash for STX if (shouldUseSmartTransaction) { @@ -478,23 +459,25 @@ class Approval extends PureComponent { this.props.hideModal(); } - TransactionController.hub.once( - `${transaction.id}:finished`, - (transactionMeta) => { - if (transactionMeta.status === 'submitted') { - if (!isLedgerAccount) { - this.setState({ transactionHandled: true }); - this.props.hideModal(); + this.#transactionFinishedListener = + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionFinished', + (transactionMeta) => { + if (transactionMeta.status === 'submitted') { + if (!isLedgerAccount) { + this.setState({ transactionHandled: true }); + this.props.hideModal(); + } + NotificationManager.watchSubmittedTransaction({ + ...transactionMeta, + assetType: transaction.assetType, + }); + } else { + throw transactionMeta.error; } - NotificationManager.watchSubmittedTransaction({ - ...transactionMeta, - assetType: transaction.assetType, - }); - } else { - throw transactionMeta.error; - } - }, - ); + }, + (transactionMeta) => transactionMeta.id === transaction.id, + ); const fullTx = transactions.find(({ id }) => id === transaction.id); @@ -591,36 +574,6 @@ class Approval extends PureComponent { }); }; - /** - * Returns transaction object with gas, gasPrice and value in hex format - * - * @param {object} transaction - Transaction object - */ - prepareTransaction = ({ transaction, gasEstimateType, EIP1559GasData }) => { - const transactionToSend = { - ...transaction, - value: BNToHex(transaction.value), - to: safeToChecksumAddress(transaction.to), - }; - - if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) { - transactionToSend.gas = EIP1559GasData.gasLimitHex; - transactionToSend.maxFeePerGas = addHexPrefix( - EIP1559GasData.suggestedMaxFeePerGasHex, - ); //'0x2540be400' - transactionToSend.maxPriorityFeePerGas = addHexPrefix( - EIP1559GasData.suggestedMaxPriorityFeePerGasHex, - ); //'0x3b9aca00'; - transactionToSend.to = safeToChecksumAddress(transaction.to); - delete transactionToSend.gasPrice; - } else { - transactionToSend.gas = BNToHex(transaction.gas); - transactionToSend.gasPrice = BNToHex(transaction.gasPrice); - } - - return transactionToSend; - }; - /** * Returns transaction object with gas and gasPrice in hex format, value set to 0 in hex format * and to set to selectedAsset address @@ -628,33 +581,31 @@ class Approval extends PureComponent { * @param {object} transaction - Transaction object * @param {object} selectedAsset - Asset object */ - prepareAssetTransaction = ({ - transaction, - selectedAsset, - gasEstimateType, - EIP1559GasData, - }) => { - const transactionToSend = { - ...transaction, - value: '0x0', - to: selectedAsset.address, + prepareTransaction = ({ EIP1559GasData, gasEstimateType }) => { + const { transaction: rawTransaction, showCustomNonce } = this.props; + const { assetType, gas, gasPrice, selectedAsset } = rawTransaction; + + const transaction = { + ...rawTransaction, }; - if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) { - transactionToSend.gas = EIP1559GasData.gasLimitHex; - transactionToSend.maxFeePerGas = addHexPrefix( - EIP1559GasData.suggestedMaxFeePerGasHex, - ); //'0x2540be400' - transactionToSend.maxPriorityFeePerGas = addHexPrefix( - EIP1559GasData.suggestedMaxPriorityFeePerGasHex, - ); //'0x3b9aca00'; - delete transactionToSend.gasPrice; - } else { - transactionToSend.gas = BNToHex(transaction.gas); - transactionToSend.gasPrice = BNToHex(transaction.gasPrice); + if (assetType !== 'ETH') { + transaction.to = selectedAsset.address; + transaction.value = '0x0'; } - return transactionToSend; + const gasDataLegacy = { + suggestedGasLimitHex: safeBNToHex(gas), + suggestedGasPriceHex: safeBNToHex(gasPrice), + }; + + return buildTransactionParams({ + gasDataEIP1559: EIP1559GasData, + gasDataLegacy, + gasEstimateType, + showCustomNonce, + transaction, + }); }; getTransactionMetrics = () => { diff --git a/app/components/Views/confirmations/ApproveView/Approve/index.js b/app/components/Views/confirmations/ApproveView/Approve/index.js index bfee39183c5..e07ffd07628 100644 --- a/app/components/Views/confirmations/ApproveView/Approve/index.js +++ b/app/components/Views/confirmations/ApproveView/Approve/index.js @@ -21,13 +21,7 @@ import { setProposedNonce, } from '../../../../../actions/transaction'; import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; -import { BNToHex } from '@metamask/controller-utils'; -import { - addHexPrefix, - fromWei, - renderFromWei, - hexToBN, -} from '../../../../../util/number'; +import { fromWei, renderFromWei, hexToBN } from '../../../../../util/number'; import { getNormalizedTxState, getTicker, @@ -77,6 +71,7 @@ import { selectGasFeeEstimates } from '../../../../../selectors/confirmTransacti import { selectGasFeeControllerEstimateType } from '../../../../../selectors/gasFeeController'; import { selectShouldUseSmartTransaction } from '../../../../../selectors/smartTransactionsController'; import { STX_NO_HASH_ERROR } from '../../../../../util/smart-transactions/smart-publish-hook'; +import { buildTransactionParams } from '../../../../../util/confirmation/transactions'; const EDIT = 'edit'; const REVIEW = 'review'; @@ -87,6 +82,8 @@ const REVIEW = 'review'; class Approve extends PureComponent { appStateListener; + #transactionFinishedSubscription; + static navigationOptions = ({ navigation }) => getApproveNavbar('approve.title', navigation); @@ -316,7 +313,8 @@ class Approve extends PureComponent { this.props.gasFeeEstimates && transaction.gas && (!shallowEqual(prevProps.gasFeeEstimates, this.props.gasFeeEstimates) || - !transaction.gas.eq(prevProps?.transaction?.gas)) + !transaction.gas.eq(prevProps?.transaction?.gas) || + !this.state.ready) ) { this.computeGasEstimates(null, null, gasEstimateTypeChanged); } @@ -324,7 +322,6 @@ class Approve extends PureComponent { }; componentWillUnmount = async () => { - const { TransactionController } = Engine.context; const { approved } = this.state; const { transaction } = this.props; @@ -336,9 +333,11 @@ class Approve extends PureComponent { this.appStateListener?.remove(); if (!isLedgerAccount) { - TransactionController.hub.removeAllListeners( - `${transaction.id}:finished`, + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:transactionFinished', + this.#transactionFinishedSubscription, ); + if (!approved) Engine.rejectPendingApproval( transaction.id, @@ -427,37 +426,21 @@ class Approve extends PureComponent { return error; }; - prepareTransaction = (transaction) => { - const { gasEstimateType, showCustomNonce } = this.props; - const { legacyGasTransaction, eip1559GasTransaction } = this.state; - const transactionToSend = { - ...transaction, - value: BNToHex(transaction.value), - to: safeToChecksumAddress(transaction.to), - from: safeToChecksumAddress(transaction.from), - }; - - if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) { - transactionToSend.gas = eip1559GasTransaction.gasLimitHex; - transactionToSend.maxFeePerGas = addHexPrefix( - eip1559GasTransaction.suggestedMaxFeePerGasHex, - ); //'0x2540be400' - transactionToSend.maxPriorityFeePerGas = addHexPrefix( - eip1559GasTransaction.suggestedMaxPriorityFeePerGasHex, - ); //'0x3b9aca00'; - delete transactionToSend.gasPrice; - } else { - transactionToSend.gas = legacyGasTransaction.suggestedGasLimitHex; - transactionToSend.gasPrice = addHexPrefix( - legacyGasTransaction.suggestedGasPriceHex, - ); - } + prepareTransaction = () => { + const { gasEstimateType, showCustomNonce, transaction } = this.props; - if (showCustomNonce && transactionToSend.nonce) { - transactionToSend.nonce = BNToHex(transactionToSend.nonce); - } + const { + legacyGasTransaction: gasDataLegacy, + eip1559GasTransaction: gasDataEIP1559, + } = this.state; - return transactionToSend; + return buildTransactionParams({ + gasDataEIP1559, + gasDataLegacy, + gasEstimateType, + showCustomNonce, + transaction, + }); }; getAnalyticsParams = () => { @@ -483,8 +466,9 @@ class Approve extends PureComponent { if (!approve) { //cancelTransaction will change transaction status to reject and throw error from event listener //component is being unmounted, error will be unhandled, hence remove listener before cancel - TransactionController.hub.removeAllListeners( - `${transactionId}:finished`, + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:transactionFinished', + this.#transactionFinishedSubscription, ); TransactionController.cancelTransaction(transactionId); @@ -504,8 +488,7 @@ class Approve extends PureComponent { }; onConfirm = async () => { - const { TransactionController, KeyringController, ApprovalController } = - Engine.context; + const { KeyringController, ApprovalController } = Engine.context; const { transactions, gasEstimateType, @@ -527,28 +510,30 @@ class Approve extends PureComponent { this.setState({ transactionConfirmed: true }); try { - const transaction = this.prepareTransaction(this.props.transaction); + const transaction = this.prepareTransaction(); const isLedgerAccount = isHardwareAccount(transaction.from, [ ExtendedKeyringTypes.ledger, ]); - TransactionController.hub.once( - `${transaction.id}:finished`, - (transactionMeta) => { - if (transactionMeta.status === 'submitted') { - if (!isLedgerAccount) { - this.setState({ approved: true }); - this.props.hideModal(); + this.#transactionFinishedSubscription = + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionFinished', + (transactionMeta) => { + if (transactionMeta.status === 'submitted') { + if (!isLedgerAccount) { + this.setState({ approved: true }); + this.props.hideModal(); + } + NotificationManager.watchSubmittedTransaction({ + ...transactionMeta, + assetType: 'ETH', + }); + } else { + throw transactionMeta.error; } - NotificationManager.watchSubmittedTransaction({ - ...transactionMeta, - assetType: 'ETH', - }); - } else { - throw transactionMeta.error; - } - }, - ); + }, + (transactionMeta) => transactionMeta.id === transaction.id, + ); const fullTx = transactions.find(({ id }) => id === transaction.id); diff --git a/app/components/Views/confirmations/Send/index.js b/app/components/Views/confirmations/Send/index.js index 2b98788ba80..3059f52b4a9 100644 --- a/app/components/Views/confirmations/Send/index.js +++ b/app/components/Views/confirmations/Send/index.js @@ -37,7 +37,6 @@ import { } from '../../../../util/transactions'; import Logger from '../../../../util/Logger'; import { getAddress } from '../../../../util/address'; -import TransactionTypes from '../../../../core/TransactionTypes'; import { MAINNET } from '../../../../constants/network'; import BigNumber from 'bignumber.js'; import { WalletDevice } from '@metamask/transaction-controller'; @@ -66,6 +65,7 @@ import { withMetricsAwareness } from '../../../../components/hooks/useMetrics'; import { selectShouldUseSmartTransaction } from '../../../../selectors/smartTransactionsController'; import { STX_NO_HASH_ERROR } from '../../../../util/smart-transactions/smart-publish-hook'; import { toLowerCaseEquals } from '../../../../util/general'; +import TransactionTypes from '../../../../core/TransactionTypes'; const REVIEW = 'review'; const EDIT = 'edit'; @@ -365,7 +365,6 @@ class Send extends PureComponent { '0'; newTxMeta = { assetType: 'ERC20', - type: 'INDIVIDUAL_TOKEN_TRANSACTION', paymentRequest: true, selectedAsset, ensRecipient, diff --git a/app/components/Views/confirmations/SendFlow/Confirm/index.js b/app/components/Views/confirmations/SendFlow/Confirm/index.js index 2cb28cfc850..d4f15d65a96 100644 --- a/app/components/Views/confirmations/SendFlow/Confirm/index.js +++ b/app/components/Views/confirmations/SendFlow/Confirm/index.js @@ -19,7 +19,6 @@ import { balanceToFiat, isDecimal, hexToBN, - BNToHex, } from '../../../../../util/number'; import { getTicker, @@ -61,7 +60,6 @@ import { getDecimalChainId, } from '../../../../../util/networks'; import Text from '../../../../Base/Text'; -import { addHexPrefix } from 'ethereumjs-util'; import { removeFavoriteCollectible } from '../../../../../actions/collectibles'; import { SafeAreaView } from 'react-native-safe-area-context'; import AccountFromToInfoCard from '../../../../UI/AccountFromToInfoCard'; @@ -127,6 +125,7 @@ import { TransactionConfirmViewSelectorsIDs } from '../../../../../../e2e/select import { selectTransactionMetrics } from '../../../../../core/redux/slices/transactionMetrics'; import SimulationDetails from '../../../../UI/SimulationDetails/SimulationDetails'; import { selectUseTransactionSimulations } from '../../../../../selectors/preferencesController'; +import { buildTransactionParams } from '../../../../../util/confirmation/transactions'; const EDIT = 'edit'; const EDIT_NONCE = 'edit_nonce'; @@ -458,8 +457,10 @@ class Confirm extends PureComponent { } // add transaction const { TransactionController } = Engine.context; + const transactionParams = this.prepareTransactionToSend(); + const { result, transactionMeta } = - await TransactionController.addTransaction(this.props.transaction, { + await TransactionController.addTransaction(transactionParams, { deviceConfirmedOn: WalletDevice.MM_MOBILE, origin: TransactionTypes.MMM, }); @@ -695,38 +696,29 @@ class Confirm extends PureComponent { prepareTransactionToSend = () => { const { - transactionState: { transaction }, - showCustomNonce, gasEstimateType, + showCustomNonce, + transaction: rawTransaction, } = this.props; - const { fromSelectedAddress, legacyGasTransaction, EIP1559GasTransaction } = - this.state; - const { nonce } = this.props.transaction; - const transactionToSend = { ...transaction }; - - if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) { - transactionToSend.gas = EIP1559GasTransaction.gasLimitHex; - transactionToSend.maxFeePerGas = addHexPrefix( - EIP1559GasTransaction.suggestedMaxFeePerGasHex, - ); //'0x2540be400' - transactionToSend.maxPriorityFeePerGas = addHexPrefix( - EIP1559GasTransaction.suggestedMaxPriorityFeePerGasHex, - ); //'0x3b9aca00'; - transactionToSend.estimatedBaseFee = addHexPrefix( - EIP1559GasTransaction.estimatedBaseFeeHex, - ); - delete transactionToSend.gasPrice; - } else { - transactionToSend.gas = legacyGasTransaction.suggestedGasLimitHex; - transactionToSend.gasPrice = addHexPrefix( - legacyGasTransaction.suggestedGasPriceHex, - ); - } - transactionToSend.from = fromSelectedAddress; - if (showCustomNonce && nonce) transactionToSend.nonce = BNToHex(nonce); + const { + fromSelectedAddress: from, + legacyGasTransaction: gasDataLegacy, + EIP1559GasTransaction: gasDataEIP1559, + } = this.state; + + const transaction = { + ...rawTransaction, + from, + }; - return transactionToSend; + return buildTransactionParams({ + gasDataEIP1559, + gasDataLegacy, + gasEstimateType, + showCustomNonce, + transaction, + }); }; /** @@ -817,9 +809,6 @@ class Confirm extends PureComponent { // Manual cancel from UI or rejected from ledger device. try { if (!approve) { - TransactionController.hub.removeAllListeners( - `${transactionMeta.id}:finished`, - ); TransactionController.cancelTransaction(transactionMeta.id); } else { await new Promise((resolve) => resolve(result)); diff --git a/app/components/Views/confirmations/hooks/useApprovalRequest.test.ts b/app/components/Views/confirmations/hooks/useApprovalRequest.test.ts index 9443f613d6e..eac31d6c826 100644 --- a/app/components/Views/confirmations/hooks/useApprovalRequest.test.ts +++ b/app/components/Views/confirmations/hooks/useApprovalRequest.test.ts @@ -14,9 +14,8 @@ jest.mock('react', () => { return { ...originalReact, - // TODO: Replace "any" with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any - useCallback: (fn: any) => fn, + useCallback: (fn: unknown) => fn, + useMemo: (fn: () => unknown) => fn(), }; }); diff --git a/app/components/Views/confirmations/hooks/useApprovalRequest.ts b/app/components/Views/confirmations/hooks/useApprovalRequest.ts index f1192c83ec4..0eb31b4a468 100644 --- a/app/components/Views/confirmations/hooks/useApprovalRequest.ts +++ b/app/components/Views/confirmations/hooks/useApprovalRequest.ts @@ -1,5 +1,5 @@ import Engine from '../../../../core/Engine'; -import { useCallback } from 'react'; +import { useCallback, useMemo } from 'react'; import { providerErrors } from '@metamask/rpc-errors'; import { useSelector } from 'react-redux'; import { selectPendingApprovals } from '../../../../selectors/approvalController'; @@ -12,12 +12,16 @@ type ApprovalRequestType = ApprovalRequest; const useApprovalRequest = () => { const pendingApprovals = useSelector(selectPendingApprovals, isEqual); + const pendingApprovalList = Object.values(pendingApprovals ?? {}); - const approvalRequest = Object.values(pendingApprovals ?? {})[0] as + const firstPendingApproval = pendingApprovalList[0] as | ApprovalRequestType | undefined; - const pageMeta = approvalRequest?.requestData?.pageMeta ?? {}; + const approvalRequest = useMemo( + () => cloneDeep(firstPendingApproval), + [firstPendingApproval], + ); const onConfirm = useCallback( async ( @@ -44,8 +48,13 @@ const useApprovalRequest = () => { ); }, [approvalRequest]); + const pageMeta = useMemo( + () => approvalRequest?.requestData?.pageMeta ?? {}, + [approvalRequest], + ); + return { - approvalRequest: cloneDeep(approvalRequest), + approvalRequest, pageMeta, onConfirm, onReject, diff --git a/app/components/hooks/DeleteWallet/useDeleteWallet.test.tsx b/app/components/hooks/DeleteWallet/useDeleteWallet.test.tsx index fddd8207349..2f261b8c1f8 100644 --- a/app/components/hooks/DeleteWallet/useDeleteWallet.test.tsx +++ b/app/components/hooks/DeleteWallet/useDeleteWallet.test.tsx @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-native'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import useDeleteWallet from './useDeleteWallet'; import { Authentication } from '../../../core'; import AUTHENTICATION_TYPE from '../../../constants/userProperties'; @@ -16,6 +16,11 @@ jest.mock('../../../core/Engine', () => ({ }, })); +jest.mock('../../../store/storage-wrapper', () => ({ + getItem: jest.fn(), + removeItem: jest.fn(), +})); + describe('useDeleteWallet', () => { test('it should provide two outputs of type function', () => { const { result } = renderHook(() => useDeleteWallet()); @@ -44,7 +49,7 @@ describe('useDeleteWallet', () => { const { result } = renderHook(() => useDeleteWallet()); // eslint-disable-next-line @typescript-eslint/no-unused-vars const [_, deleteUser] = result.current; - const removeItemSpy = jest.spyOn(AsyncStorage, 'removeItem'); + const removeItemSpy = jest.spyOn(StorageWrapper, 'removeItem'); await deleteUser(); expect(removeItemSpy).toHaveBeenCalled(); }); diff --git a/app/components/hooks/DeleteWallet/useDeleteWallet.ts b/app/components/hooks/DeleteWallet/useDeleteWallet.ts index 3554a2baca1..e06b43e74fa 100644 --- a/app/components/hooks/DeleteWallet/useDeleteWallet.ts +++ b/app/components/hooks/DeleteWallet/useDeleteWallet.ts @@ -1,5 +1,5 @@ import { useCallback } from 'react'; -import AsyncStorage from '../../../store/async-storage-wrapper'; +import StorageWrapper from '../../../store/storage-wrapper'; import Logger from '../../../util/Logger'; import { EXISTING_USER } from '../../../constants/storage'; import { Authentication } from '../../../core'; @@ -26,12 +26,12 @@ const useDeleteWallet = () => { const deleteUser = async () => { try { - await AsyncStorage.removeItem(EXISTING_USER); + await StorageWrapper.removeItem(EXISTING_USER); await metrics.createDataDeletionTask(); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - const errorMsg = `Failed to remove key: ${EXISTING_USER} from AsyncStorage`; + const errorMsg = `Failed to remove key: ${EXISTING_USER} from MMKV`; Logger.log(error, errorMsg); } }; diff --git a/app/components/hooks/useAddressBalance/useAddressBalance.ts b/app/components/hooks/useAddressBalance/useAddressBalance.ts index 71c51307954..40591640db7 100644 --- a/app/components/hooks/useAddressBalance/useAddressBalance.ts +++ b/app/components/hooks/useAddressBalance/useAddressBalance.ts @@ -22,14 +22,10 @@ const useAddressBalance = ( ) => { const [addressBalance, setAddressBalance] = useState('0'); - const { accounts, contractBalances, selectedAddress } = useSelector( - // TODO: Replace "any" with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (state: any) => ({ - accounts: selectAccounts(state), - contractBalances: selectContractBalances(state), - selectedAddress: selectSelectedInternalAccountChecksummedAddress(state), - }), + const accounts = useSelector(selectAccounts); + const contractBalances = useSelector(selectContractBalances); + const selectedAddress = useSelector( + selectSelectedInternalAccountChecksummedAddress, ); const ticker = useSelector(selectTicker); diff --git a/app/components/hooks/useMetrics/useMetrics.ts b/app/components/hooks/useMetrics/useMetrics.ts index 05ea4ea7707..47116425eaa 100644 --- a/app/components/hooks/useMetrics/useMetrics.ts +++ b/app/components/hooks/useMetrics/useMetrics.ts @@ -2,6 +2,7 @@ import { InteractionManager } from 'react-native'; import { IMetaMetricsEvent, MetaMetrics } from '../../../core/Analytics'; import { JsonMap } from '@segment/analytics-react-native'; import { IUseMetricsHook } from './useMetrics.types'; +import { useCallback } from 'react'; /** * Hook to use MetaMetrics @@ -53,19 +54,22 @@ const useMetrics = (): IUseMetricsHook => { * * @see MetaMetrics.trackAnonymousEvent */ - const trackAnonymousEvent = ( - event: IMetaMetricsEvent, - properties: JsonMap = {}, - saveDataRecording = true, - ) => { - InteractionManager.runAfterInteractions(async () => { - MetaMetrics.getInstance().trackAnonymousEvent( - event, - properties, - saveDataRecording, - ); - }); - }; + const trackAnonymousEvent = useCallback( + ( + event: IMetaMetricsEvent, + properties: JsonMap = {}, + saveDataRecording = true, + ) => { + InteractionManager.runAfterInteractions(async () => { + MetaMetrics.getInstance().trackAnonymousEvent( + event, + properties, + saveDataRecording, + ); + }); + }, + [], + ); /** * Track an event - the regular way * @@ -86,19 +90,22 @@ const useMetrics = (): IUseMetricsHook => { * * @see MetaMetrics.trackEvent */ - const trackEvent = ( - event: IMetaMetricsEvent, - properties: JsonMap = {}, - saveDataRecording = true, - ) => { - InteractionManager.runAfterInteractions(async () => { - MetaMetrics.getInstance().trackEvent( - event, - properties, - saveDataRecording, - ); - }); - }; + const trackEvent = useCallback( + ( + event: IMetaMetricsEvent, + properties: JsonMap = {}, + saveDataRecording = true, + ) => { + InteractionManager.runAfterInteractions(async () => { + MetaMetrics.getInstance().trackEvent( + event, + properties, + saveDataRecording, + ); + }); + }, + [], + ); return { trackEvent, diff --git a/app/core/Analytics/MetaMetrics.test.ts b/app/core/Analytics/MetaMetrics.test.ts index beac29ed296..0420b3837f2 100644 --- a/app/core/Analytics/MetaMetrics.test.ts +++ b/app/core/Analytics/MetaMetrics.test.ts @@ -1,5 +1,5 @@ import MetaMetrics from './MetaMetrics'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../store/storage-wrapper'; import { AGREED, ANALYTICS_DATA_DELETION_DATE, @@ -16,7 +16,7 @@ import { IMetaMetricsEvent, } from './MetaMetrics.types'; -jest.mock('react-native-default-preference'); +jest.mock('../../store/storage-wrapper'); const mockGet = jest.fn(); const mockSet = jest.fn(); const mockClear = jest.fn(); @@ -34,9 +34,9 @@ class TestMetaMetrics extends MetaMetrics { describe('MetaMetrics', () => { beforeEach(async () => { - DefaultPreference.get = mockGet; - DefaultPreference.set = mockSet; - DefaultPreference.clear = mockClear; + StorageWrapper.getItem = mockGet; + StorageWrapper.setItem = mockSet; + StorageWrapper.clearAll = mockClear; TestMetaMetrics.resetInstance(); }); @@ -64,7 +64,7 @@ describe('MetaMetrics', () => { expect(await metaMetrics.configure()).toBeTruthy(); }); it('fails silently', async () => { - DefaultPreference.get = jest.fn().mockRejectedValue(new Error('error')); + StorageWrapper.getItem = jest.fn().mockRejectedValue(new Error('error')); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeFalsy(); }); @@ -76,7 +76,7 @@ describe('MetaMetrics', () => { const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); - expect(DefaultPreference.get).toHaveBeenCalledWith(METRICS_OPT_IN); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METRICS_OPT_IN); expect(metaMetrics.isEnabled()).toBeFalsy(); }); @@ -85,7 +85,7 @@ describe('MetaMetrics', () => { const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); - expect(DefaultPreference.get).toHaveBeenCalledWith(METRICS_OPT_IN); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METRICS_OPT_IN); expect(metaMetrics.isEnabled()).toBeTruthy(); }); @@ -94,7 +94,7 @@ describe('MetaMetrics', () => { expect(await metaMetrics.configure()).toBeTruthy(); await metaMetrics.enable(); - expect(DefaultPreference.set).toHaveBeenLastCalledWith( + expect(StorageWrapper.setItem).toHaveBeenLastCalledWith( METRICS_OPT_IN, AGREED, ); @@ -107,7 +107,7 @@ describe('MetaMetrics', () => { // Enable first as it is disabled by default await metaMetrics.enable(); // Test it is enabled before disabling - expect(DefaultPreference.set).toHaveBeenLastCalledWith( + expect(StorageWrapper.setItem).toHaveBeenLastCalledWith( METRICS_OPT_IN, AGREED, ); @@ -115,7 +115,7 @@ describe('MetaMetrics', () => { await metaMetrics.enable(false); - expect(DefaultPreference.set).toHaveBeenLastCalledWith( + expect(StorageWrapper.setItem).toHaveBeenLastCalledWith( METRICS_OPT_IN, DENIED, ); @@ -133,7 +133,7 @@ describe('MetaMetrics', () => { metaMetrics.trackEvent(event, properties); - expect(DefaultPreference.get).toHaveBeenCalledWith(METRICS_OPT_IN); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METRICS_OPT_IN); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any const { segmentMockClient } = global as any; @@ -151,7 +151,7 @@ describe('MetaMetrics', () => { metaMetrics.trackEvent(event); - expect(DefaultPreference.get).toHaveBeenCalledWith(METRICS_OPT_IN); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METRICS_OPT_IN); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any const { segmentMockClient } = global as any; @@ -169,7 +169,7 @@ describe('MetaMetrics', () => { metaMetrics.trackEvent(event, properties); - expect(DefaultPreference.get).toHaveBeenCalledWith(METRICS_OPT_IN); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METRICS_OPT_IN); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any const { segmentMockClient } = global as any; @@ -241,7 +241,7 @@ describe('MetaMetrics', () => { metaMetrics.trackEvent(event, properties, false); - expect(DefaultPreference.get).toHaveBeenCalledWith(METRICS_OPT_IN); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METRICS_OPT_IN); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any const { segmentMockClient } = global as any; @@ -379,7 +379,7 @@ describe('MetaMetrics', () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const { segmentMockClient } = global as any; expect(segmentMockClient.reset).toHaveBeenCalledWith(true); - expect(DefaultPreference.set).toHaveBeenCalledWith(METAMETRICS_ID, ''); + expect(StorageWrapper.setItem).toHaveBeenCalledWith(METAMETRICS_ID, ''); }); it('flushes the segment client', async () => { @@ -393,14 +393,14 @@ describe('MetaMetrics', () => { }); describe('Ids', () => { - it('is returned from DefaultPreference when instance not configured', async () => { + it('is returned from StorageWrapper when instance not configured', async () => { const UUID = '00000000-0000-0000-0000-000000000000'; mockGet.mockImplementation(async (key: string) => key === METAMETRICS_ID ? UUID : '', ); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.getMetaMetricsId()).toEqual(UUID); - expect(DefaultPreference.get).toHaveBeenCalledWith(METAMETRICS_ID); + expect(StorageWrapper.getItem).toHaveBeenCalledWith(METAMETRICS_ID); }); it('is returned from memory when instance configured', async () => { @@ -413,7 +413,7 @@ describe('MetaMetrics', () => { mockGet.mockClear(); expect(await metaMetrics.getMetaMetricsId()).toEqual(testID); - expect(DefaultPreference.get).not.toHaveBeenCalled(); + expect(StorageWrapper.getItem).not.toHaveBeenCalled(); }); it('uses Mixpanel ID if it is set', async () => { @@ -422,15 +422,15 @@ describe('MetaMetrics', () => { const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); - expect(DefaultPreference.get).toHaveBeenNthCalledWith( + expect(StorageWrapper.getItem).toHaveBeenNthCalledWith( 2, MIXPANEL_METAMETRICS_ID, ); - expect(DefaultPreference.set).toHaveBeenCalledWith( + expect(StorageWrapper.setItem).toHaveBeenCalledWith( METAMETRICS_ID, mixPanelUUID, ); - expect(DefaultPreference.get).not.toHaveBeenCalledWith(METAMETRICS_ID); + expect(StorageWrapper.getItem).not.toHaveBeenCalledWith(METAMETRICS_ID); expect(await metaMetrics.getMetaMetricsId()).toEqual(mixPanelUUID); }); @@ -442,12 +442,12 @@ describe('MetaMetrics', () => { const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); - expect(DefaultPreference.get).toHaveBeenNthCalledWith( + expect(StorageWrapper.getItem).toHaveBeenNthCalledWith( 2, MIXPANEL_METAMETRICS_ID, ); - expect(DefaultPreference.get).toHaveBeenNthCalledWith(3, METAMETRICS_ID); - expect(DefaultPreference.set).not.toHaveBeenCalled(); + expect(StorageWrapper.getItem).toHaveBeenNthCalledWith(3, METAMETRICS_ID); + expect(StorageWrapper.setItem).not.toHaveBeenCalled(); expect(await metaMetrics.getMetaMetricsId()).toEqual(UUID); }); @@ -460,11 +460,11 @@ describe('MetaMetrics', () => { // create a new instance and check that user id was not changed TestMetaMetrics.getInstance(); - expect(DefaultPreference.set).not.toHaveBeenCalledWith( + expect(StorageWrapper.setItem).not.toHaveBeenCalledWith( METAMETRICS_ID, '', ); - expect(DefaultPreference.get).toHaveBeenNthCalledWith(3, METAMETRICS_ID); + expect(StorageWrapper.getItem).toHaveBeenNthCalledWith(3, METAMETRICS_ID); expect(await metaMetrics.getMetaMetricsId()).toEqual(metricsId); }); @@ -478,7 +478,7 @@ describe('MetaMetrics', () => { await metaMetrics.reset(); // Check change on the MetaMerics class side - expect(DefaultPreference.set).toHaveBeenNthCalledWith( + expect(StorageWrapper.setItem).toHaveBeenNthCalledWith( 2, METAMETRICS_ID, '', @@ -515,7 +515,7 @@ describe('MetaMetrics', () => { expect(result).toEqual({ status: DataDeleteResponseStatus.ok }); - expect(DefaultPreference.set).toHaveBeenCalledWith( + expect(StorageWrapper.setItem).toHaveBeenCalledWith( METAMETRICS_DELETION_REGULATION_ID, 'TWV0YU1hc2t1c2Vzbm9wb2ludCE', ); @@ -524,7 +524,7 @@ describe('MetaMetrics', () => { const day = currentDate.getUTCDate(); const month = currentDate.getUTCMonth() + 1; const year = currentDate.getUTCFullYear(); - expect(DefaultPreference.set).toHaveBeenCalledWith( + expect(StorageWrapper.setItem).toHaveBeenCalledWith( ANALYTICS_DATA_DELETION_DATE, `${day}/${month}/${year}`, ); @@ -543,11 +543,11 @@ describe('MetaMetrics', () => { expect(result.status).toBe(DataDeleteResponseStatus.error); expect(result.error).toBe('Analytics Deletion Task Error'); - expect(DefaultPreference.set).not.toHaveBeenCalledWith( + expect(StorageWrapper.setItem).not.toHaveBeenCalledWith( METAMETRICS_DELETION_REGULATION_ID, expect.any(String), ); - expect(DefaultPreference.set).not.toHaveBeenCalledWith( + expect(StorageWrapper.setItem).not.toHaveBeenCalledWith( ANALYTICS_DATA_DELETION_DATE, expect.any(String), ); @@ -557,38 +557,38 @@ describe('MetaMetrics', () => { describe('Date', () => { it('gets date from preferences storage', async () => { const expectedDate = '04/05/2023'; - DefaultPreference.get = jest.fn().mockResolvedValue(expectedDate); + StorageWrapper.getItem = jest.fn().mockResolvedValue(expectedDate); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); expect(metaMetrics.getDeleteRegulationCreationDate()).toBe( expectedDate, ); - expect(DefaultPreference.get).toHaveBeenCalledWith( + expect(StorageWrapper.getItem).toHaveBeenCalledWith( ANALYTICS_DATA_DELETION_DATE, ); }); it('keeps date in instance', async () => { const expectedDate = '04/05/2023'; - DefaultPreference.get = jest.fn().mockResolvedValue(expectedDate); + StorageWrapper.getItem = jest.fn().mockResolvedValue(expectedDate); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); // this resets the call count and changes the return value to nothing - DefaultPreference.get = jest.fn().mockResolvedValue(null); + StorageWrapper.getItem = jest.fn().mockResolvedValue(null); expect(metaMetrics.getDeleteRegulationCreationDate()).toBe( expectedDate, ); - expect(DefaultPreference.get).not.toHaveBeenCalledWith( + expect(StorageWrapper.getItem).not.toHaveBeenCalledWith( ANALYTICS_DATA_DELETION_DATE, ); }); it('returns empty string if no date in preferences storage', async () => { - DefaultPreference.get = jest.fn().mockResolvedValue(undefined); + StorageWrapper.getItem = jest.fn().mockResolvedValue(undefined); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); expect(metaMetrics.getDeleteRegulationCreationDate()).toBeUndefined(); - expect(DefaultPreference.get).toHaveBeenCalledWith( + expect(StorageWrapper.getItem).toHaveBeenCalledWith( ANALYTICS_DATA_DELETION_DATE, ); }); @@ -597,38 +597,38 @@ describe('MetaMetrics', () => { describe('Regulation Id', () => { it('gets id from preferences storage', async () => { const expecterRegulationId = 'TWV0YU1hc2t1c2Vzbm9wb2ludCE'; - DefaultPreference.get = jest + StorageWrapper.getItem = jest .fn() .mockResolvedValue(expecterRegulationId); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); expect(metaMetrics.getDeleteRegulationId()).toBe(expecterRegulationId); - expect(DefaultPreference.get).toHaveBeenCalledWith( + expect(StorageWrapper.getItem).toHaveBeenCalledWith( METAMETRICS_DELETION_REGULATION_ID, ); }); it('keeps id in instance', async () => { const expecterRegulationId = 'TWV0YU1hc2t1c2Vzbm9wb2ludCE'; - DefaultPreference.get = jest + StorageWrapper.getItem = jest .fn() .mockResolvedValue(expecterRegulationId); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); // this resets the call count and changes the return value to nothing - DefaultPreference.get = jest.fn().mockResolvedValue(null); + StorageWrapper.getItem = jest.fn().mockResolvedValue(null); expect(metaMetrics.getDeleteRegulationId()).toBe(expecterRegulationId); - expect(DefaultPreference.get).not.toHaveBeenCalledWith( + expect(StorageWrapper.getItem).not.toHaveBeenCalledWith( METAMETRICS_DELETION_REGULATION_ID, ); }); it('returns empty string if no id in preferences storage', async () => { - DefaultPreference.get = jest.fn().mockResolvedValue(undefined); + StorageWrapper.getItem = jest.fn().mockResolvedValue(undefined); const metaMetrics = TestMetaMetrics.getInstance(); expect(await metaMetrics.configure()).toBeTruthy(); expect(metaMetrics.getDeleteRegulationId()).toBeUndefined(); - expect(DefaultPreference.get).toHaveBeenCalledWith( + expect(StorageWrapper.getItem).toHaveBeenCalledWith( METAMETRICS_DELETION_REGULATION_ID, ); }); @@ -636,7 +636,7 @@ describe('MetaMetrics', () => { describe('check request', () => { it('data deletion task check succeeds', async () => { - DefaultPreference.get = jest.fn((key) => { + StorageWrapper.getItem = jest.fn((key) => { switch (key) { case METAMETRICS_DELETION_REGULATION_ID: return Promise.resolve('TWV0YU1hc2t1c2Vzbm9wb2ludCE'); @@ -692,7 +692,7 @@ describe('MetaMetrics', () => { }); it('data deletion task check fails without METAMETRICS_DELETION_REGULATION_ID', async () => { - DefaultPreference.get = jest.fn().mockResolvedValue(undefined); + StorageWrapper.getItem = jest.fn().mockResolvedValue(undefined); const metaMetrics = TestMetaMetrics.getInstance(); const { diff --git a/app/core/Analytics/MetaMetrics.ts b/app/core/Analytics/MetaMetrics.ts index 82b1cebb691..6a4628bfa89 100644 --- a/app/core/Analytics/MetaMetrics.ts +++ b/app/core/Analytics/MetaMetrics.ts @@ -6,7 +6,7 @@ import { UserTraits, } from '@segment/analytics-react-native'; import axios, { AxiosHeaderValue } from 'axios'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../store/storage-wrapper'; import Logger from '../../util/Logger'; import { AGREED, @@ -177,7 +177,7 @@ class MetaMetrics implements IMetaMetrics { * @returns Promise containing the enabled state */ #isMetaMetricsEnabled = async (): Promise => { - const enabledPref = await DefaultPreference.get(METRICS_OPT_IN); + const enabledPref = await StorageWrapper.getItem(METRICS_OPT_IN); this.enabled = AGREED === enabledPref; if (__DEV__) Logger.log(`Current MetaMatrics enable state: ${this.enabled}`); @@ -189,21 +189,21 @@ class MetaMetrics implements IMetaMetrics { * @private */ #getIsDataRecordedFromPrefs = async (): Promise => - (await DefaultPreference.get(ANALYTICS_DATA_RECORDED)) === 'true'; + (await StorageWrapper.getItem(ANALYTICS_DATA_RECORDED)) === 'true'; /** * Retrieve the analytics deletion request date from the preference * @private */ #getDeleteRegulationDateFromPrefs = async (): Promise => - await DefaultPreference.get(ANALYTICS_DATA_DELETION_DATE); + await StorageWrapper.getItem(ANALYTICS_DATA_DELETION_DATE); /** * Retrieve the analytics deletion regulation ID from the preference * @private */ #getDeleteRegulationIdFromPrefs = async (): Promise => - await DefaultPreference.get(METAMETRICS_DELETION_REGULATION_ID); + await StorageWrapper.getItem(METAMETRICS_DELETION_REGULATION_ID); /** * Persist the analytics recording status @@ -212,7 +212,7 @@ class MetaMetrics implements IMetaMetrics { */ #setIsDataRecorded = async (isDataRecorded = false): Promise => { this.dataRecorded = isDataRecorded; - await DefaultPreference.set( + await StorageWrapper.setItem( ANALYTICS_DATA_RECORDED, String(isDataRecorded), ); @@ -228,7 +228,7 @@ class MetaMetrics implements IMetaMetrics { deleteRegulationId: string, ): Promise => { this.deleteRegulationId = deleteRegulationId; - await DefaultPreference.set( + await StorageWrapper.setItem( METAMETRICS_DELETION_REGULATION_ID, deleteRegulationId, ); @@ -249,7 +249,7 @@ class MetaMetrics implements IMetaMetrics { this.deleteRegulationDate = deletionDate; // similar to the one used in the legacy Analytics - await DefaultPreference.set(ANALYTICS_DATA_DELETION_DATE, deletionDate); + await StorageWrapper.setItem(ANALYTICS_DATA_DELETION_DATE, deletionDate); }; /** @@ -265,19 +265,21 @@ class MetaMetrics implements IMetaMetrics { // If user later enables MetaMetrics, // this same ID should be retrieved from preferences and reused. // look for a legacy ID from MixPanel integration and use it - const legacyId = await DefaultPreference.get(MIXPANEL_METAMETRICS_ID); + const legacyId = await StorageWrapper.getItem(MIXPANEL_METAMETRICS_ID); if (legacyId) { this.metametricsId = legacyId; - await DefaultPreference.set(METAMETRICS_ID, legacyId); + await StorageWrapper.setItem(METAMETRICS_ID, legacyId); return legacyId; } // look for a new Metametics ID and use it or generate a new one - const metametricsId = await DefaultPreference.get(METAMETRICS_ID); + const metametricsId: string | undefined = await StorageWrapper.getItem( + METAMETRICS_ID, + ); if (!metametricsId) { // keep the id format compatible with MixPanel but base it on a UUIDv4 this.metametricsId = uuidv4(); - await DefaultPreference.set(METAMETRICS_ID, this.metametricsId); + await StorageWrapper.setItem(METAMETRICS_ID, this.metametricsId); } else { this.metametricsId = metametricsId; } @@ -289,7 +291,7 @@ class MetaMetrics implements IMetaMetrics { */ #resetMetaMetricsId = async (): Promise => { try { - await DefaultPreference.set(METAMETRICS_ID, ''); + await StorageWrapper.setItem(METAMETRICS_ID, ''); this.metametricsId = await this.#getMetaMetricsId(); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -358,13 +360,13 @@ class MetaMetrics implements IMetaMetrics { /** * Update the user analytics preference and - * store in DefaultPreference + * store in StorageWrapper * * @param enabled - Boolean indicating if opts-in ({@link AGREED}) or opts-out ({@link DENIED}) */ #storeMetricsOptInPreference = async (enabled: boolean) => { try { - await DefaultPreference.set(METRICS_OPT_IN, enabled ? AGREED : DENIED); + await StorageWrapper.setItem(METRICS_OPT_IN, enabled ? AGREED : DENIED); // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { diff --git a/app/core/Authentication/Authentication.test.ts b/app/core/Authentication/Authentication.test.ts index 05d951415c4..e8be46072c4 100644 --- a/app/core/Authentication/Authentication.test.ts +++ b/app/core/Authentication/Authentication.test.ts @@ -1,4 +1,4 @@ -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; import { BIOMETRY_CHOICE_DISABLED, TRUE, @@ -13,6 +13,24 @@ import SecureKeychain from '../SecureKeychain'; import configureMockStore from 'redux-mock-store'; import Logger from '../../util/Logger'; +const storage: Record = {}; + +jest.mock('../../store/storage-wrapper', () => ({ + getItem: jest.fn((key) => Promise.resolve(storage[key] ?? null)), + setItem: jest.fn((key, value) => { + storage[key] = value; + return Promise.resolve(); + }), + removeItem: jest.fn((key) => { + delete storage[key]; + return Promise.resolve(); + }), + clearAll: jest.fn(() => { + Object.keys(storage).forEach((key) => delete storage[key]); + return Promise.resolve(); + }), +})); + describe('Authentication', () => { const initialState = { security: { @@ -27,7 +45,7 @@ describe('Authentication', () => { }); afterEach(() => { - AsyncStorage.clearAll(); + StorageWrapper.clearAll(); jest.restoreAllMocks(); }); @@ -44,8 +62,8 @@ describe('Authentication', () => { SecureKeychain.getSupportedBiometryType = jest .fn() .mockReturnValue(Keychain.BIOMETRY_TYPE.FACE_ID); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); const result = await Authentication.getType(); expect(result.availableBiometryType).toEqual('FaceID'); expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.PASSWORD); @@ -64,7 +82,7 @@ describe('Authentication', () => { SecureKeychain.getSupportedBiometryType = jest .fn() .mockReturnValue(Keychain.BIOMETRY_TYPE.FINGERPRINT); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); const result = await Authentication.getType(); expect(result.availableBiometryType).toEqual('Fingerprint'); expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.PASSCODE); @@ -74,8 +92,8 @@ describe('Authentication', () => { SecureKeychain.getSupportedBiometryType = jest .fn() .mockReturnValue(Keychain.BIOMETRY_TYPE.FINGERPRINT); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); const result = await Authentication.getType(); expect(result.availableBiometryType).toEqual('Fingerprint'); expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.PASSWORD); @@ -87,7 +105,7 @@ describe('Authentication', () => { SecureKeychain.getGenericPassword = jest .fn() .mockReturnValue(mockCredentials); - await AsyncStorage.setItem(EXISTING_USER, TRUE); + await StorageWrapper.setItem(EXISTING_USER, TRUE); const result = await Authentication.getType(); expect(result.availableBiometryType).toBeNull(); expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.REMEMBER_ME); @@ -95,29 +113,26 @@ describe('Authentication', () => { it('should return a type AUTHENTICATION_TYPE.PASSWORD if the user exists and there are no available biometrics options but the password does not exist in the keychain', async () => { SecureKeychain.getSupportedBiometryType = jest.fn().mockReturnValue(null); - await AsyncStorage.setItem(EXISTING_USER, TRUE); + await StorageWrapper.setItem(EXISTING_USER, TRUE); + SecureKeychain.getGenericPassword = jest.fn().mockReturnValue(null); const result = await Authentication.getType(); expect(result.availableBiometryType).toBeNull(); - expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.REMEMBER_ME); + expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.PASSWORD); }); - it('should return a type AUTHENTICATION_TYPE.PASSWORD if the user does not exists and there are no available biometrics options', async () => { + it('should return a type AUTHENTICATION_TYPE.PASSWORD if the user does not exist and there are no available biometrics options', async () => { SecureKeychain.getSupportedBiometryType = jest.fn().mockReturnValue(null); - const mockCredentials = { username: 'test', password: 'test' }; - SecureKeychain.getGenericPassword = jest - .fn() - .mockReturnValue(mockCredentials); - await AsyncStorage.setItem(EXISTING_USER, TRUE); + await StorageWrapper.setItem(EXISTING_USER, TRUE); const result = await Authentication.getType(); expect(result.availableBiometryType).toBeNull(); - expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.REMEMBER_ME); + expect(result.currentAuthType).toEqual(AUTHENTICATION_TYPE.PASSWORD); }); it('should return a auth type for components AUTHENTICATION_TYPE.REMEMBER_ME', async () => { SecureKeychain.getSupportedBiometryType = jest .fn() .mockReturnValue(Keychain.BIOMETRY_TYPE.FINGERPRINT); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); const result = await Authentication.componentAuthenticationType( false, true, @@ -130,8 +145,8 @@ describe('Authentication', () => { SecureKeychain.getSupportedBiometryType = jest .fn() .mockReturnValue(Keychain.BIOMETRY_TYPE.FINGERPRINT); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); const result = await Authentication.componentAuthenticationType( false, false, @@ -144,7 +159,7 @@ describe('Authentication', () => { SecureKeychain.getSupportedBiometryType = jest .fn() .mockReturnValue(Keychain.BIOMETRY_TYPE.FINGERPRINT); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); const result = await Authentication.componentAuthenticationType( true, false, diff --git a/app/core/Authentication/Authentication.ts b/app/core/Authentication/Authentication.ts index 3597710d6ae..7f39fa0a30a 100644 --- a/app/core/Authentication/Authentication.ts +++ b/app/core/Authentication/Authentication.ts @@ -28,7 +28,7 @@ import { AUTHENTICATION_RESET_PASSWORD_FAILED_MESSAGE, AUTHENTICATION_STORE_PASSWORD_FAILED, } from '../../constants/error'; -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; /** * Holds auth data used to determine auth configuration @@ -155,10 +155,10 @@ class AuthenticationService { // eslint-disable-next-line @typescript-eslint/no-explicit-any const availableBiometryType: any = await SecureKeychain.getSupportedBiometryType(); - const biometryPreviouslyDisabled = await AsyncStorage.getItem( + const biometryPreviouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); @@ -179,7 +179,7 @@ class AuthenticationService { availableBiometryType, }; } - const existingUser = await AsyncStorage.getItem(EXISTING_USER); + const existingUser = await StorageWrapper.getItem(EXISTING_USER); if (existingUser) { if (await SecureKeychain.getGenericPassword()) { return { @@ -286,10 +286,10 @@ class AuthenticationService { // eslint-disable-next-line @typescript-eslint/no-explicit-any const availableBiometryType: any = await SecureKeychain.getSupportedBiometryType(); - const biometryPreviouslyDisabled = await AsyncStorage.getItem( + const biometryPreviouslyDisabled = await StorageWrapper.getItem( BIOMETRY_CHOICE_DISABLED, ); - const passcodePreviouslyDisabled = await AsyncStorage.getItem( + const passcodePreviouslyDisabled = await StorageWrapper.getItem( PASSCODE_DISABLED, ); @@ -338,8 +338,8 @@ class AuthenticationService { try { await this.createWalletVaultAndKeychain(password); await this.storePassword(password, authData?.currentAuthType); - await AsyncStorage.setItem(EXISTING_USER, TRUE); - await AsyncStorage.removeItem(SEED_PHRASE_HINTS); + await StorageWrapper.setItem(EXISTING_USER, TRUE); + await StorageWrapper.removeItem(SEED_PHRASE_HINTS); this.dispatchLogin(); this.authData = authData; // TODO: Replace "any" with type @@ -371,8 +371,8 @@ class AuthenticationService { try { await this.newWalletVaultAndRestore(password, parsedSeed, clearEngine); await this.storePassword(password, authData.currentAuthType); - await AsyncStorage.setItem(EXISTING_USER, TRUE); - await AsyncStorage.removeItem(SEED_PHRASE_HINTS); + await StorageWrapper.setItem(EXISTING_USER, TRUE); + await StorageWrapper.removeItem(SEED_PHRASE_HINTS); this.dispatchLogin(); this.authData = authData; // TODO: Replace "any" with type diff --git a/app/core/BackgroundBridge/BackgroundBridge.js b/app/core/BackgroundBridge/BackgroundBridge.js index fa2f3fce29a..3070e382f60 100644 --- a/app/core/BackgroundBridge/BackgroundBridge.js +++ b/app/core/BackgroundBridge/BackgroundBridge.js @@ -97,7 +97,7 @@ export class BackgroundBridge extends EventEmitter { // This will only be used for WalletConnect for now this.addressSent = - Engine.context.PreferencesController.state.selectedAddress?.toLowerCase(); + Engine.context.AccountsController.getSelectedAccount().address.toLowerCase(); const portStream = new MobilePortStream(this.port, url); // setup multiplexing diff --git a/app/core/DeeplinkManager/Handlers/handleEthereumUrl.ts b/app/core/DeeplinkManager/Handlers/handleEthereumUrl.ts index 4c88276fe8b..9c2b2b68a50 100644 --- a/app/core/DeeplinkManager/Handlers/handleEthereumUrl.ts +++ b/app/core/DeeplinkManager/Handlers/handleEthereumUrl.ts @@ -5,7 +5,7 @@ import { strings } from '../../../../locales/i18n'; import DeeplinkManager from '../DeeplinkManager'; import formattedDeeplinkParsedValue from '../../../util/formattedDeeplinkParsedValue'; import { NetworkSwitchErrorType } from '../../../constants/error'; -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; import { getDecimalChainId } from '../../../util/networks'; async function handleEthereumUrl({ diff --git a/app/core/Engine.ts b/app/core/Engine.ts index eaece76f899..1269832365d 100644 --- a/app/core/Engine.ts +++ b/app/core/Engine.ts @@ -36,7 +36,7 @@ import { AddressBookController, AddressBookState, } from '@metamask/address-book-controller'; -import { BaseState, ControllerMessenger } from '@metamask/base-controller'; +import { BaseState } from '@metamask/base-controller'; import { ComposableController } from '@metamask/composable-controller'; import { KeyringController, @@ -66,7 +66,8 @@ import { } from '@metamask/preferences-controller'; import { TransactionController, - TransactionState, + TransactionControllerEvents, + TransactionControllerState, } from '@metamask/transaction-controller'; import { GasFeeController, @@ -213,6 +214,11 @@ import { SmartTransactionStatuses } from '@metamask/smart-transactions-controlle import { submitSmartTransactionHook } from '../util/smart-transactions/smart-publish-hook'; import { SmartTransactionsControllerState } from '@metamask/smart-transactions-controller/dist/SmartTransactionsController'; import { zeroAddress } from 'ethereumjs-util'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; +import { getPermittedAccounts } from './Permissions'; +import { ExtendedControllerMessenger } from './ExtendedControllerMessenger'; +import EthQuery from '@metamask/eth-query'; +import { TransactionControllerOptions } from '@metamask/transaction-controller/dist/types/TransactionController'; const NON_EMPTY = 'NON_EMPTY'; @@ -274,6 +280,7 @@ type GlobalActions = | PreferencesControllerActions | TokensControllerActions | TokenListControllerActions; + type GlobalEvents = | ApprovalControllerEvents | CurrencyRateStateChange @@ -291,7 +298,8 @@ type GlobalEvents = | AccountsControllerEvents | PreferencesControllerEvents | TokensControllerEvents - | TokenListControllerEvents; + | TokenListControllerEvents + | TransactionControllerEvents; type PermissionsByRpcMethod = ReturnType; type Permissions = PermissionsByRpcMethod[keyof PermissionsByRpcMethod]; @@ -309,7 +317,7 @@ export interface EngineState { PhishingController: PhishingControllerState; TokenBalancesController: TokenBalancesControllerState; TokenRatesController: TokenRatesState; - TransactionController: TransactionState; + TransactionController: TransactionControllerState; SmartTransactionsController: SmartTransactionsControllerState; SwapsController: SwapsState; GasFeeController: GasFeeState; @@ -398,7 +406,7 @@ class Engine { /** * The global controller messenger. */ - controllerMessenger: ControllerMessenger; + controllerMessenger: ExtendedControllerMessenger; /** * ComposableController reference containing all child controllers */ @@ -433,7 +441,7 @@ class Engine { initialState: Partial = {}, initialKeyringState?: KeyringControllerState | null, ) { - this.controllerMessenger = new ControllerMessenger(); + this.controllerMessenger = new ExtendedControllerMessenger(); /** * Subscribes a listener to the state change events of Preferences Controller. @@ -1109,15 +1117,43 @@ class Engine { this.transactionController = new TransactionController({ // @ts-expect-error at this point in time the provider will be defined by the `networkController.initializeProvider` blockTracker: networkController.getProviderAndBlockTracker().blockTracker, - disableSendFlowHistory: true, disableHistory: true, - getGasFeeEstimates: () => gasFeeController.fetchGasFeeEstimates(), + disableSendFlowHistory: true, + disableSwaps: true, + // @ts-expect-error TransactionController is missing networkClientId argument in type getCurrentNetworkEIP1559Compatibility: networkController.getEIP1559Compatibility.bind(networkController), - //@ts-expect-error Expected due to Transaction Controller do not have controller utils containing linea-sepolia data - // This can be removed when controller-utils be updated to v^9 + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + getExternalPendingTransactions: (address: string) => + this.smartTransactionsController.getTransactions({ + addressFrom: address, + status: SmartTransactionStatuses.PENDING, + }), + getGasFeeEstimates: + gasFeeController.fetchGasFeeEstimates.bind(gasFeeController), + // @ts-expect-error NetworkController in TransactionController is later version + // but only breaking change is Node version and bumped dependencies + getNetworkClientRegistry: + networkController.getNetworkClientRegistry.bind(networkController), getNetworkState: () => networkController.state, - getSelectedAddress: () => accountsController.getSelectedAccount().address, + getPermittedAccounts: (origin) => getPermittedAccounts(origin as string), + hooks: { + publish: (transactionMeta) => { + const shouldUseSmartTransaction = selectShouldUseSmartTransaction( + store.getState(), + ); + + return submitSmartTransactionHook({ + transactionMeta, + transactionController: this.transactionController, + smartTransactionsController: this.smartTransactionsController, + shouldUseSmartTransaction, + approvalController, + featureFlags: selectSwapsChainFeatureFlags(store.getState()), + }) as Promise<{ transactionHash: string }>; + }, + }, incomingTransactions: { isEnabled: () => { const currentHexChainId = @@ -1135,43 +1171,31 @@ class Engine { }, isSimulationEnabled: () => preferencesController.state.useTransactionSimulations, - // @ts-expect-error TODO: Resolve/patch mismatch between base-controller versions. Before: never, never. Now: string, string, which expects 3rd and 4th args to be informed for restrictedControllerMessengers + // @ts-expect-error TransactionController is using later BaseController version + // but only breaking change is Node version messenger: this.controllerMessenger.getRestricted({ name: 'TransactionController', - allowedActions: [`${approvalController.name}:addRequest`], + allowedActions: [ + `${accountsController.name}:getSelectedAccount`, + `${approvalController.name}:addRequest`, + `${networkController.name}:getNetworkClientById`, + ], + allowedEvents: [`NetworkController:stateChange`], }), onNetworkStateChange: (listener) => this.controllerMessenger.subscribe( AppConstants.NETWORK_STATE_CHANGE_EVENT, listener, ), + pendingTransactions: { + isResubmitEnabled: () => false, + }, // @ts-expect-error at this point in time the provider will be defined by the `networkController.initializeProvider` provider: networkController.getProviderAndBlockTracker().provider, - - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - getExternalPendingTransactions: (address: string) => - this.smartTransactionsController.getTransactions({ - addressFrom: address, - status: SmartTransactionStatuses.PENDING, - }), - - hooks: { - publish: (transactionMeta) => { - const shouldUseSmartTransaction = selectShouldUseSmartTransaction( - store.getState(), - ); - - return submitSmartTransactionHook({ - transactionMeta, - transactionController: this.transactionController, - smartTransactionsController: this.smartTransactionsController, - shouldUseSmartTransaction, - approvalController, - featureFlags: selectSwapsChainFeatureFlags(store.getState()), - }); - }, - }, + sign: keyringController.signTransaction.bind( + keyringController, + ) as unknown as TransactionControllerOptions['sign'], + state: initialState.TransactionController, }); const codefiTokenApiV2 = new CodefiTokenPricesServiceV2(); @@ -1206,7 +1230,7 @@ class Engine { getNonceLock: this.transactionController.getNonceLock.bind( this.transactionController, ), - // @ts-expect-error txController.getTransactions only uses txMeta.status and txMeta.hash, which v13 TxController has + // @ts-expect-error Older TransactionController version in SmartTransactionsController means TransactionMeta types don't match. getTransactions: this.transactionController.getTransactions.bind( this.transactionController, ), @@ -1462,22 +1486,18 @@ class Engine { {}, ) as typeof this.context; - const { - NftController: nfts, - KeyringController: keyring, - TransactionController: transaction, - } = this.context; + const { NftController: nfts } = this.context; if (process.env.MM_OPENSEA_KEY) { nfts.setApiKey(process.env.MM_OPENSEA_KEY); } - // @ts-expect-error TODO: Align transaction types between keyring and TransactionController - transaction.configure({ sign: keyring.signTransaction.bind(keyring) }); - - transaction.hub.on('incomingTransactionBlock', (blockNumber: number) => { - NotificationManager.gotIncomingTransaction(blockNumber); - }); + this.controllerMessenger.subscribe( + 'TransactionController:incomingTransactionBlockReceived', + (blockNumber: number) => { + NotificationManager.gotIncomingTransaction(blockNumber); + }, + ); this.controllerMessenger.subscribe( AppConstants.NETWORK_STATE_CHANGE_EVENT, @@ -1564,7 +1584,6 @@ class Engine { AssetsContractController, TokenDetectionController, NetworkController, - TransactionController, SwapsController, } = this.context; const { provider } = NetworkController.getProviderAndBlockTracker(); @@ -1582,7 +1601,6 @@ class Engine { chainId: NetworkController.state?.providerConfig?.chainId, pollCountLimit: AppConstants.SWAPS.POLL_COUNT_LIMIT, }); - TransactionController.hub.emit('networkChange'); TokenDetectionController.detectTokens(); AccountTrackerController.refresh(); } @@ -1595,14 +1613,16 @@ class Engine { } => { const { CurrencyRateController, - PreferencesController, + AccountsController, AccountTrackerController, TokenBalancesController, TokenRatesController, TokensController, NetworkController, } = this.context; - const { selectedAddress } = PreferencesController.state; + const selectedInternalAccount = AccountsController.getSelectedAccount(); + const selectSelectedInternalAccountChecksummedAddress = + toChecksumHexAddress(selectedInternalAccount.address); const { currentCurrency } = CurrencyRateController.state; const { chainId, ticker } = NetworkController.state.providerConfig; const { @@ -1626,9 +1646,15 @@ class Engine { let tokenFiat = 0; let tokenFiat1dAgo = 0; const decimalsToShow = (currentCurrency === 'usd' && 2) || undefined; - if (accountsByChainId?.[toHexadecimal(chainId)]?.[selectedAddress]) { + if ( + accountsByChainId?.[toHexadecimal(chainId)]?.[ + selectSelectedInternalAccountChecksummedAddress + ] + ) { ethFiat = weiToFiatNumber( - accountsByChainId[toHexadecimal(chainId)][selectedAddress].balance, + accountsByChainId[toHexadecimal(chainId)][ + selectSelectedInternalAccountChecksummedAddress + ].balance, conversionRate, decimalsToShow, ); @@ -1758,11 +1784,13 @@ class Engine { TokenBalancesController.reset(); TokenRatesController.update({ marketData: {} }); - TransactionController.update({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (TransactionController as any).update(() => ({ methodData: {}, transactions: [], lastFetchedBlockNumbers: {}, - }); + submitHistory: [], + })); LoggingController.clear(); }; @@ -1858,6 +1886,17 @@ class Engine { AccountsController.setAccountName(accountToBeNamed.id, label); PreferencesController.setAccountLabel(address, label); } + + getGlobalEthQuery(): EthQuery { + const { NetworkController } = this.context; + const { provider } = NetworkController.getSelectedNetworkClient() ?? {}; + + if (!provider) { + throw new Error('No selected network client'); + } + + return new EthQuery(provider); + } } /** @@ -1880,10 +1919,12 @@ export default { assertEngineExists(instance); return instance.context; }, + get controllerMessenger() { assertEngineExists(instance); return instance.controllerMessenger; }, + get state() { assertEngineExists(instance); const { @@ -1964,36 +2005,44 @@ export default { AccountsController, }; }, + get datamodel() { assertEngineExists(instance); return instance.datamodel; }, + getTotalFiatAccountBalance() { assertEngineExists(instance); return instance.getTotalFiatAccountBalance(); }, + hasFunds() { assertEngineExists(instance); return instance.hasFunds(); }, + resetState() { assertEngineExists(instance); return instance.resetState(); }, + destroyEngine() { instance?.destroyEngineInstance(); instance = null; }, + init(state: Record | undefined, keyringState = null) { instance = Engine.instance || new Engine(state, keyringState); Object.freeze(instance); return instance; }, + acceptPendingApproval: async ( id: string, requestData?: Record, opts?: AcceptOptions & { handleErrors?: boolean }, ) => instance?.acceptPendingApproval(id, requestData, opts), + rejectPendingApproval: ( id: string, reason: Error, @@ -2002,12 +2051,19 @@ export default { logErrors?: boolean; } = {}, ) => instance?.rejectPendingApproval(id, reason, opts), + setSelectedAddress: (address: string) => { assertEngineExists(instance); instance.setSelectedAccount(address); }, + setAccountLabel: (address: string, label: string) => { assertEngineExists(instance); instance.setAccountLabel(address, label); }, + + getGlobalEthQuery: (): EthQuery => { + assertEngineExists(instance); + return instance.getGlobalEthQuery(); + }, }; diff --git a/app/core/EngineService/EngineService.ts b/app/core/EngineService/EngineService.ts index 84d26c1324d..c766f1d7cdf 100644 --- a/app/core/EngineService/EngineService.ts +++ b/app/core/EngineService/EngineService.ts @@ -73,7 +73,10 @@ class EngineService { key: `${engine.context.TokenBalancesController.name}:stateChange`, }, { name: 'TokenRatesController' }, - { name: 'TransactionController' }, + { + name: 'TransactionController', + key: `${engine.context.TransactionController.name}:stateChange`, + }, { name: 'SmartTransactionsController' }, { name: 'SwapsController' }, { diff --git a/app/core/ExtendedControllerMessenger.test.ts b/app/core/ExtendedControllerMessenger.test.ts new file mode 100644 index 00000000000..c46e46abb78 --- /dev/null +++ b/app/core/ExtendedControllerMessenger.test.ts @@ -0,0 +1,64 @@ +import { ExtendedControllerMessenger } from './ExtendedControllerMessenger'; + +const EVENT_TYPE_MOCK = 'TestController:testEvent'; +const EVENT_ARG_MOCK = { test: 'value' }; + +interface EventMock { + type: typeof EVENT_TYPE_MOCK; + payload: [{ test: string }]; +} + +describe('ExtendedControllerMessenger', () => { + describe('subscribeOnceIf', () => { + it('calls handler once and only if criteria matches', () => { + const messenger = new ExtendedControllerMessenger(); + const handler = jest.fn(); + + const criteria = jest + .fn() + .mockReturnValueOnce(false) + .mockReturnValueOnce(true); + + messenger.subscribeOnceIf(EVENT_TYPE_MOCK, handler, criteria); + messenger.publish(EVENT_TYPE_MOCK, EVENT_ARG_MOCK); + messenger.publish(EVENT_TYPE_MOCK, EVENT_ARG_MOCK); + messenger.publish(EVENT_TYPE_MOCK, EVENT_ARG_MOCK); + + expect(handler).toHaveBeenCalledTimes(1); + expect(handler).toHaveBeenCalledWith(EVENT_ARG_MOCK); + + expect(criteria).toHaveBeenCalledTimes(2); + expect(criteria).toHaveBeenCalledWith(EVENT_ARG_MOCK); + }); + }); + + describe('tryUnsubscribe', () => { + it('unsubscribes handler', () => { + const messenger = new ExtendedControllerMessenger(); + const handler = jest.fn(); + + messenger.subscribe(EVENT_TYPE_MOCK, handler); + messenger.tryUnsubscribe(EVENT_TYPE_MOCK, handler); + messenger.publish(EVENT_TYPE_MOCK, EVENT_ARG_MOCK); + + expect(handler).not.toHaveBeenCalled(); + }); + + it('does nothing if no handler', () => { + const messenger = new ExtendedControllerMessenger(); + messenger.tryUnsubscribe(EVENT_TYPE_MOCK, undefined); + }); + + it('does nothing if already unsubscribed', () => { + const messenger = new ExtendedControllerMessenger(); + const handler = jest.fn(); + + messenger.subscribe(EVENT_TYPE_MOCK, handler); + messenger.tryUnsubscribe(EVENT_TYPE_MOCK, handler); + messenger.tryUnsubscribe(EVENT_TYPE_MOCK, handler); + messenger.publish(EVENT_TYPE_MOCK, EVENT_ARG_MOCK); + + expect(handler).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/app/core/ExtendedControllerMessenger.ts b/app/core/ExtendedControllerMessenger.ts new file mode 100644 index 00000000000..9d0c3dd42da --- /dev/null +++ b/app/core/ExtendedControllerMessenger.ts @@ -0,0 +1,46 @@ +import { + ActionConstraint, + ControllerMessenger, + EventConstraint, + ExtractEventHandler, +} from '@metamask/base-controller'; + +// eslint-disable-next-line import/prefer-default-export +export class ExtendedControllerMessenger< + Action extends ActionConstraint, + Event extends EventConstraint, +> extends ControllerMessenger { + subscribeOnceIf( + eventType: EventType, + handler: ExtractEventHandler, + criteria: ( + ...args: Parameters> + ) => boolean, + ): typeof handler { + const internalHandler = ((...data: Parameters) => { + if (!criteria || criteria(...data)) { + this.tryUnsubscribe(eventType, internalHandler); + handler(...data); + } + }) as typeof handler; + + this.subscribe(eventType, internalHandler); + + return internalHandler; + } + + tryUnsubscribe( + eventType: EventType, + handler?: ExtractEventHandler, + ) { + if (!handler) { + return; + } + + try { + this.unsubscribe(eventType, handler); + } catch (e) { + // Ignore + } + } +} diff --git a/app/core/NotificationManager.js b/app/core/NotificationManager.js index 24ed09d9f0e..9e5517dde3a 100644 --- a/app/core/NotificationManager.js +++ b/app/core/NotificationManager.js @@ -102,6 +102,12 @@ class NotificationManager { */ _transactionsWatchTable = {}; + _transactionFailedListener; + + _transactionConfirmedListener; + + _transactionSpeedupListener; + _handleAppStateChange = (appState) => { this._backgroundMode = appState === 'background'; }; @@ -111,10 +117,21 @@ class NotificationManager { this.goTo('TransactionsHome'); }; - _removeListeners = (transactionId) => { - const { TransactionController } = Engine.context; - TransactionController.hub.removeAllListeners(`${transactionId}:confirmed`); - TransactionController.hub.removeAllListeners(`${transactionId}:finished`); + _removeListeners = () => { + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:transactionConfirmed', + this._transactionConfirmedListener, + ); + + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:transactionFailed', + this._transactionFailedListener, + ); + + Engine.controllerMessenger.tryUnsubscribe( + 'TransactionController:speedupTransactionAdded', + this._transactionSpeedupListener, + ); }; // TODO: Refactor this method to use notifee's channels in combination with MM auth @@ -168,7 +185,7 @@ class NotificationManager { } } - _finishedCallback = (transactionMeta) => { + _failedCallback = (transactionMeta) => { // If it fails we hide the pending tx notification this._removeNotificationById(transactionMeta.id); const transaction = @@ -353,24 +370,32 @@ class NotificationManager { ? this._transactionsWatchTable[nonce].push(transactionMeta.id) : (this._transactionsWatchTable[nonce] = [transactionMeta.id]); - TransactionController.hub.once( - `${transaction.id}:confirmed`, - (transactionMeta) => { - this._confirmedCallback(transactionMeta, transaction); - }, - ); - TransactionController.hub.once( - `${transaction.id}:finished`, - (transactionMeta) => { - this._finishedCallback(transactionMeta); - }, - ); - TransactionController.hub.once( - `${transaction.id}:speedup`, - (transactionMeta) => { - this._speedupCallback(transactionMeta); - }, - ); + this._transactionConfirmedListener = + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionConfirmed', + (transactionMeta) => { + this._confirmedCallback(transactionMeta, transaction); + }, + (transactionMeta) => transactionMeta.id === transaction.id, + ); + + this._transactionFailedListener = + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:transactionFailed', + (transactionMeta) => { + this._failedCallback(transactionMeta); + }, + (transactionMeta) => transactionMeta.id === transaction.id, + ); + + this._transactionSpeedupListener = + Engine.controllerMessenger.subscribeOnceIf( + 'TransactionController:speedupTransactionAdded', + (transactionMeta) => { + this._speedupCallback(transactionMeta); + }, + (transactionMeta) => transactionMeta.id === transaction.id, + ); } /** @@ -380,13 +405,19 @@ class NotificationManager { const { AccountTrackerController, TransactionController, - PreferencesController, + AccountsController, } = Engine.context; - const { selectedAddress } = PreferencesController.state; + const selectedInternalAccount = AccountsController.getSelectedAccount(); + const selectedInternalAccountChecksummedAddress = safeToChecksumAddress( + selectedInternalAccount.address, + ); + const chainId = selectChainId(store.getState()); /// Find the incoming TX - const { transactions } = TransactionController.state; + const transactions = TransactionController.getTransactions({ + filterToCurrentNetwork: false, + }); // If a TX has been confirmed more than 10 min ago, it's considered old const oldestTimeAllowed = Date.now() - 1000 * 60 * 10; @@ -396,8 +427,10 @@ class NotificationManager { .reverse() .filter( (tx) => - safeToChecksumAddress(tx.txParams?.to) === selectedAddress && - safeToChecksumAddress(tx.txParams?.from) !== selectedAddress && + safeToChecksumAddress(tx.txParams?.to) === + selectedInternalAccountChecksummedAddress && + safeToChecksumAddress(tx.txParams?.from) !== + selectedInternalAccountChecksummedAddress && tx.chainId === chainId && tx.status === 'confirmed' && lastBlock <= parseInt(tx.blockNumber, 10) && diff --git a/app/core/Permissions/index.ts b/app/core/Permissions/index.ts index 7876ff72cf2..1597c1f780e 100644 --- a/app/core/Permissions/index.ts +++ b/app/core/Permissions/index.ts @@ -3,6 +3,10 @@ import { RestrictedMethods, CaveatTypes } from './constants'; import ImportedEngine from '../Engine'; import Logger from '../../util/Logger'; import { getUniqueList } from '../../util/general'; +import TransactionTypes from '../TransactionTypes'; + +const INTERNAL_ORIGINS = [process.env.MM_FOX_CODE, TransactionTypes.MMM]; + // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any const Engine = ImportedEngine as any; @@ -186,7 +190,16 @@ export const removeAccountsFromPermissions = async (addresses: string[]) => { export const getPermittedAccounts = async ( hostname: string, ): Promise => { + const { AccountsController } = Engine.context; + try { + if (INTERNAL_ORIGINS.includes(hostname)) { + const selectedAccountAddress = + AccountsController.getSelectedAccount().address; + + return [selectedAccountAddress]; + } + const accounts = await Engine.context.PermissionController.executeRestrictedMethod( hostname, diff --git a/app/core/RPCMethods/wallet_watchAsset.test.ts b/app/core/RPCMethods/wallet_watchAsset.test.ts index c1358126b6b..a639964288a 100644 --- a/app/core/RPCMethods/wallet_watchAsset.test.ts +++ b/app/core/RPCMethods/wallet_watchAsset.test.ts @@ -7,43 +7,52 @@ import { TOKEN_NOT_VALID, } from '../../constants/error'; -const mockEngine = Engine; -jest.mock('../Engine', () => ({ - init: () => mockEngine.init({}), - context: { - AssetsContractController: { - getERC20TokenDecimals: jest.fn(), - getERC721AssetSymbol: jest.fn().mockResolvedValue('WBTC'), - }, - NetworkController: { - state: { - networkConfigurations: {}, - providerConfig: { - chainId: '0x1', +jest.mock('../Engine', () => { + const { + createMockInternalAccount, + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires + } = require('../../util/test/accountsControllerTestUtils'); + const MOCK_ADDRESS = '0xc4955c0d639d99699bfd7ec54d9fafee40e4d272'; + const MOCK_INTERNAL_ACCOUNT = createMockInternalAccount( + MOCK_ADDRESS, + 'Account 1', + ); + return { + init: () => jest.fn(), + context: { + AssetsContractController: { + getERC20TokenDecimals: jest.fn(), + getERC721AssetSymbol: jest.fn().mockResolvedValue('WBTC'), + }, + NetworkController: { + state: { + networkConfigurations: {}, + providerConfig: { + chainId: '0x1', + }, }, }, - }, - TokensController: { - watchAsset: jest.fn(), - }, - TokenListController: { - state: { - tokenList: { - '0x1': [], + TokensController: { + watchAsset: jest.fn(), + }, + TokenListController: { + state: { + tokenList: { + '0x1': [], + }, }, }, - }, - PermissionController: { - requestPermissions: jest.fn(), - getPermissions: jest.fn(), - }, - PreferencesController: { - state: { - selectedAddress: '0x123', + PermissionController: { + requestPermissions: jest.fn(), + getPermissions: jest.fn(), + }, + AccountsController: { + getSelectedAccount: jest.fn().mockReturnValue(MOCK_INTERNAL_ACCOUNT), }, }, - }, -})); + }; +}); + const MockEngine = jest.mocked(Engine); jest.mock('../Permissions', () => ({ @@ -75,6 +84,7 @@ describe('wallet_watchAsset', () => { decimals: '8', image: 'https://metamask.github.io/test-dapp/metamask-fox.svg', }; + it('should throw an error if the token address is not valid', async () => { await expect( wallet_watchAsset({ @@ -102,6 +112,7 @@ describe('wallet_watchAsset', () => { }), ).rejects.toThrow(TOKEN_NOT_VALID); }); + it('should throw an error if the token address is not a smart contract address', async () => { jest .spyOn(transactionsUtils, 'isSmartContractAddress') @@ -168,9 +179,10 @@ describe('wallet_watchAsset', () => { expect(spyOnWatchAsset).toHaveBeenCalledWith({ asset: correctWBTC, type: ERC20, - interactingAddress: '0x123', + interactingAddress: '0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272', // Checksummed version of MOCK_ADDRESS }); }); + it('should call watchAsset with fake WBTC decimals and symbol', async () => { const fakeWBTC = { address: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', @@ -213,7 +225,7 @@ describe('wallet_watchAsset', () => { expect(spyOnWatchAsset).toHaveBeenCalledWith({ asset: correctWBTC, type: ERC20, - interactingAddress: '0x123', + interactingAddress: '0xC4955C0d639D99699Bfd7Ec54d9FaFEe40e4D272', // Checksummed version of MOCK_ADDRESS }); }); }); diff --git a/app/core/RPCMethods/wallet_watchAsset.ts b/app/core/RPCMethods/wallet_watchAsset.ts index e9b17279978..09e7dea5470 100644 --- a/app/core/RPCMethods/wallet_watchAsset.ts +++ b/app/core/RPCMethods/wallet_watchAsset.ts @@ -12,6 +12,7 @@ import { import { selectChainId } from '../../selectors/networkController'; import { isValidAddress } from 'ethereumjs-util'; import { JsonRpcRequest, PendingJsonRpcResponse } from 'json-rpc-engine'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; const wallet_watchAsset = async ({ req, @@ -64,11 +65,13 @@ const wallet_watchAsset = async ({ const permittedAccounts = await getPermittedAccounts(hostname); // This should return the current active account on the Dapp. - const selectedAddress = - Engine.context.PreferencesController.state.selectedAddress; + const selectedInternalAccountChecksummedAddress = toChecksumHexAddress( + Engine.context.AccountsController.getSelectedAccount().address, + ); // Fallback to wallet address if there is no connected account to Dapp. - const interactingAddress = permittedAccounts?.[0] || selectedAddress; + const interactingAddress = + permittedAccounts?.[0] || selectedInternalAccountChecksummedAddress; // This variables are to override the value of decimals and symbol from the dapp // if they are wrong accordingly to the token address // *This is an hotfix this logic should live on whatchAsset method on TokensController* diff --git a/app/core/ReviewManager.ts b/app/core/ReviewManager.ts index edceb47c9a9..d2d54f8400d 100644 --- a/app/core/ReviewManager.ts +++ b/app/core/ReviewManager.ts @@ -3,7 +3,7 @@ import { Platform, Linking } from 'react-native'; /* eslint-disable-next-line */ import { NavigationContainerRef } from '@react-navigation/core'; import InAppReview from 'react-native-in-app-review'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../store/storage-wrapper'; import { REVIEW_EVENT_COUNT, REVIEW_SHOWN_TIME } from '../constants/storage'; import Logger from '../util/Logger'; import { MM_APP_STORE_LINK, MM_PLAY_STORE_LINK } from '../constants/urls'; @@ -18,9 +18,9 @@ class ReviewManager { private addEventCount = async () => { try { const previousCount = - (await DefaultPreference.get(REVIEW_EVENT_COUNT)) || '0'; + (await StorageWrapper.getItem(REVIEW_EVENT_COUNT)) || '0'; const newCount = parseInt(previousCount) + 1; - await DefaultPreference.set(REVIEW_EVENT_COUNT, `${newCount}`); + await StorageWrapper.setItem(REVIEW_EVENT_COUNT, `${newCount}`); } catch (error) { // Failed to add event count } @@ -33,9 +33,9 @@ class ReviewManager { } try { - const eventCount = await DefaultPreference.get(REVIEW_EVENT_COUNT); + const eventCount = await StorageWrapper.getItem(REVIEW_EVENT_COUNT); const lastShownTime = - (await DefaultPreference.get(REVIEW_SHOWN_TIME)) || '0'; + (await StorageWrapper.getItem(REVIEW_SHOWN_TIME)) || '0'; const satisfiedEventCount = parseInt(eventCount || '0') >= EVENT_THRESHOLD; const satisfiedTime = @@ -49,8 +49,8 @@ class ReviewManager { private resetReviewCriteria = async () => { try { const currentUnixTime = Date.now(); - await DefaultPreference.set(REVIEW_EVENT_COUNT, '0'); - await DefaultPreference.set(REVIEW_SHOWN_TIME, `${currentUnixTime}`); + await StorageWrapper.setItem(REVIEW_EVENT_COUNT, '0'); + await StorageWrapper.setItem(REVIEW_SHOWN_TIME, `${currentUnixTime}`); } catch (error) { // Failed to reset criteria } diff --git a/app/core/SDKConnect/AndroidSDK/AndroidService.ts b/app/core/SDKConnect/AndroidSDK/AndroidService.ts index 8ebaa583977..e4b946333c1 100644 --- a/app/core/SDKConnect/AndroidSDK/AndroidService.ts +++ b/app/core/SDKConnect/AndroidSDK/AndroidService.ts @@ -25,7 +25,6 @@ import { SDKConnect } from '../SDKConnect'; import { KeyringController } from '@metamask/keyring-controller'; import { PermissionController } from '@metamask/permission-controller'; -import { PreferencesController } from '@metamask/preferences-controller'; import { PROTOCOLS } from '../../../constants/deeplinks'; import BatchRPCManager from '../BatchRPCManager'; import { DEFAULT_SESSION_TIMEOUT_MS } from '../SDKConnectConstants'; @@ -35,6 +34,8 @@ import AndroidSDKEventHandler from './AndroidNativeSDKEventHandler'; import sendMessage from './AndroidService/sendMessage'; import { DappClient, DappConnections } from './dapp-sdk-types'; import getDefaultBridgeParams from './getDefaultBridgeParams'; +import { AccountsController } from '@metamask/accounts-controller'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; export default class AndroidService extends EventEmitter2 { public communicationClient = NativeModules.CommunicationClient; @@ -355,13 +356,15 @@ export default class AndroidService extends EventEmitter2 { } } - const preferencesController = ( + const accountsController = ( Engine.context as { - PreferencesController: PreferencesController; + AccountsController: AccountsController; } - ).PreferencesController; + ).AccountsController; - const selectedAddress = preferencesController.state.selectedAddress; + const selectedInternalAccountChecksummedAddress = toChecksumHexAddress( + accountsController.getSelectedAccount().address, + ); const networkController = ( Engine.context as { @@ -377,7 +380,7 @@ export default class AndroidService extends EventEmitter2 { const processedRpc = await handleCustomRpcCalls({ batchRPCManager: this.batchRPCManager, selectedChainId: chainId, - selectedAddress, + selectedAddress: selectedInternalAccountChecksummedAddress, rpc: { id: data.id, method: data.method, params: data.params }, }); diff --git a/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.test.ts b/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.test.ts index 647b57884eb..b92fbb7036f 100644 --- a/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.test.ts +++ b/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.test.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import Logger from '../../../../util/Logger'; +import { createMockInternalAccount } from '../../../../util/test/accountsControllerTestUtils'; import Engine from '../../../Engine'; import { Minimizer } from '../../../NativeModules'; import { RPC_METHODS } from '../../SDKConnectConstants'; @@ -18,11 +19,16 @@ jest.mock('../../../../util/Logger'); jest.mock('../../utils/wait.util', () => ({ wait: jest.fn().mockResolvedValue(undefined), })); -jest.mock('@metamask/preferences-controller'); jest.mock('../AndroidService'); jest.mock('../../handlers/handleBatchRpcResponse', () => jest.fn()); jest.mock('../../utils/DevLogger'); +const MOCK_ADDRESS = '0x1'; +const mockInternalAccount = createMockInternalAccount( + MOCK_ADDRESS, + 'Account 1', +); + describe('sendMessage', () => { let instance: jest.Mocked; let message: any; @@ -62,10 +68,8 @@ describe('sendMessage', () => { }; (Engine.context as any) = { - PreferencesController: { - state: { - selectedAddress: '0x1', - }, + AccountsController: { + getSelectedAccount: jest.fn().mockReturnValue(mockInternalAccount), }, }; }); @@ -87,7 +91,15 @@ describe('sendMessage', () => { }); it('should send message without reordering if selectedAddress is not in result', async () => { - (Engine.context as any).PreferencesController.state.selectedAddress = '0x3'; + const MOCK_ADDRESS_2 = '0x3'; + const mockInternalAccount2 = createMockInternalAccount( + MOCK_ADDRESS_2.toLowerCase(), + 'Account 2', + ); + + (Engine.context as any).AccountsController.getSelectedAccount = jest + .fn() + .mockReturnValue(mockInternalAccount2); mockGetId.mockReturnValue(RPC_METHODS.ETH_REQUESTACCOUNTS); diff --git a/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.ts b/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.ts index b795c789d0b..f9b6c6642f6 100644 --- a/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.ts +++ b/app/core/SDKConnect/AndroidSDK/AndroidService/sendMessage.ts @@ -3,11 +3,11 @@ import Engine from '../../../Engine'; import { Minimizer } from '../../../NativeModules'; import Logger from '../../../../util/Logger'; import { wait } from '../../utils/wait.util'; -import { PreferencesController } from '@metamask/preferences-controller'; import AndroidService from '../AndroidService'; import { METHODS_TO_DELAY, RPC_METHODS } from '../../SDKConnectConstants'; import handleBatchRpcResponse from '../../handlers/handleBatchRpcResponse'; import DevLogger from '../../utils/DevLogger'; +import { AccountsController } from '@metamask/accounts-controller'; async function sendMessage( instance: AndroidService, @@ -20,14 +20,15 @@ async function sendMessage( const isConnectionResponse = rpcMethod === RPC_METHODS.ETH_REQUESTACCOUNTS; if (isConnectionResponse) { - const preferencesController = ( + const accountsController = ( Engine.context as { - PreferencesController: PreferencesController; + AccountsController: AccountsController; } - ).PreferencesController; + ).AccountsController; - const selectedAddress = - preferencesController.state.selectedAddress.toLowerCase(); + const selectedAddress = accountsController + .getSelectedAccount() + .address.toLowerCase(); const lowercaseAccounts = (message.data.result as string[]).map( (a: string) => a.toLowerCase(), diff --git a/app/core/SDKConnect/AndroidSDK/addDappConnection.test.ts b/app/core/SDKConnect/AndroidSDK/addDappConnection.test.ts index aca7173077b..fe4ddc84adb 100644 --- a/app/core/SDKConnect/AndroidSDK/addDappConnection.test.ts +++ b/app/core/SDKConnect/AndroidSDK/addDappConnection.test.ts @@ -5,8 +5,8 @@ import addDappConnection from './addDappConnection'; jest.mock('../Connection'); jest.mock('../SDKConnect'); jest.mock('../utils/DevLogger'); -jest.mock('react-native-default-preference', () => ({ - set: jest.fn().mockResolvedValue(''), +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue(''), })); jest.mock('../../../core/AppConstants'); diff --git a/app/core/SDKConnect/AndroidSDK/loadDappConnections.test.ts b/app/core/SDKConnect/AndroidSDK/loadDappConnections.test.ts index a90a76650b9..1922528a7b9 100644 --- a/app/core/SDKConnect/AndroidSDK/loadDappConnections.test.ts +++ b/app/core/SDKConnect/AndroidSDK/loadDappConnections.test.ts @@ -1,10 +1,10 @@ -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../../store/storage-wrapper'; import loadDappConnections from './loadDappConnections'; jest.mock('../../../core/AppConstants'); -jest.mock('react-native-default-preference', () => ({ - get: jest.fn().mockResolvedValue(''), - set: jest.fn().mockResolvedValue(''), +jest.mock('../../../store/storage-wrapper', () => ({ + getItem: jest.fn().mockResolvedValue(''), + setItem: jest.fn().mockResolvedValue(''), })); jest.mock('../utils/DevLogger'); jest.mock('../../../store', () => ({ @@ -32,7 +32,7 @@ describe('loadDappConnections', () => { it('should parse the retrieved connections', async () => { const mockConnections = {}; - (DefaultPreference.get as jest.Mock).mockResolvedValueOnce( + (StorageWrapper.getItem as jest.Mock).mockResolvedValueOnce( JSON.stringify(mockConnections), ); diff --git a/app/core/SDKConnect/ConnectionManagement/approveHost.test.ts b/app/core/SDKConnect/ConnectionManagement/approveHost.test.ts index 4a95b6f16b2..0b438ee1dc3 100644 --- a/app/core/SDKConnect/ConnectionManagement/approveHost.test.ts +++ b/app/core/SDKConnect/ConnectionManagement/approveHost.test.ts @@ -8,9 +8,9 @@ jest.mock('../../../core/AppConstants'); jest.mock('../SDKConnect'); jest.mock('../SDKConnectConstants'); jest.mock('../utils/DevLogger'); -jest.mock('react-native-default-preference', () => ({ - set: jest.fn().mockResolvedValue([]), - get: jest.fn().mockResolvedValue(JSON.stringify({})), +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue([]), + getItem: jest.fn().mockResolvedValue(JSON.stringify({})), })); describe('approveHost', () => { diff --git a/app/core/SDKConnect/ConnectionManagement/connectToChannel.test.ts b/app/core/SDKConnect/ConnectionManagement/connectToChannel.test.ts index baa6b5eb5ca..0bc1a9b266c 100644 --- a/app/core/SDKConnect/ConnectionManagement/connectToChannel.test.ts +++ b/app/core/SDKConnect/ConnectionManagement/connectToChannel.test.ts @@ -3,9 +3,9 @@ import { DEFAULT_SESSION_TIMEOUT_MS } from '../SDKConnectConstants'; import { SDKConnect } from './../SDKConnect'; import connectToChannel from './connectToChannel'; -jest.mock('react-native-default-preference', () => ({ - set: jest.fn().mockResolvedValue(''), - get: jest.fn().mockResolvedValue(''), +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue(''), + getItem: jest.fn().mockResolvedValue(''), })); jest.mock('../../AppConstants'); jest.mock('../Connection'); diff --git a/app/core/SDKConnect/ConnectionManagement/invalidateChannel.test.ts b/app/core/SDKConnect/ConnectionManagement/invalidateChannel.test.ts index 94d89889cb2..ef34b4c174e 100644 --- a/app/core/SDKConnect/ConnectionManagement/invalidateChannel.test.ts +++ b/app/core/SDKConnect/ConnectionManagement/invalidateChannel.test.ts @@ -4,9 +4,9 @@ import invalidateChannel from './invalidateChannel'; jest.mock('../../../core/AppConstants'); jest.mock('../SDKConnect'); -jest.mock('react-native-default-preference', () => ({ - set: jest.fn().mockResolvedValue([]), - get: jest.fn().mockResolvedValue(JSON.stringify({})), +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue([]), + getItem: jest.fn().mockResolvedValue(JSON.stringify({})), })); describe('invalidateChannel', () => { diff --git a/app/core/SDKConnect/ConnectionManagement/removeAll.test.ts b/app/core/SDKConnect/ConnectionManagement/removeAll.test.ts index 3e12cdf42ef..f4871d1b32b 100644 --- a/app/core/SDKConnect/ConnectionManagement/removeAll.test.ts +++ b/app/core/SDKConnect/ConnectionManagement/removeAll.test.ts @@ -1,10 +1,10 @@ import SDKConnect from '../SDKConnect'; import removeAll from './removeAll'; -jest.mock('react-native-default-preference', () => ({ - set: jest.fn().mockResolvedValue([]), - get: jest.fn().mockResolvedValue(JSON.stringify({})), - clear: jest.fn().mockResolvedValue([]), +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue([]), + getItem: jest.fn().mockResolvedValue(JSON.stringify({})), + clearAll: jest.fn().mockResolvedValue([]), })); jest.mock('../../AppConstants'); jest.mock('../SDKConnect'); diff --git a/app/core/SDKConnect/ConnectionManagement/removeChannel.test.ts b/app/core/SDKConnect/ConnectionManagement/removeChannel.test.ts index c6a63fa14a5..dd24c4a95ab 100644 --- a/app/core/SDKConnect/ConnectionManagement/removeChannel.test.ts +++ b/app/core/SDKConnect/ConnectionManagement/removeChannel.test.ts @@ -5,9 +5,9 @@ import removeChannel from './removeChannel'; jest.mock('../../../core/AppConstants'); jest.mock('../SDKConnect'); jest.mock('../utils/DevLogger'); -jest.mock('react-native-default-preference', () => ({ - set: jest.fn().mockResolvedValue([]), - get: jest.fn().mockResolvedValue(JSON.stringify({})), +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue([]), + getItem: jest.fn().mockResolvedValue(JSON.stringify({})), })); describe('removeChannel', () => { diff --git a/app/core/SDKConnect/InitializationManagement/asyncInit.test.ts b/app/core/SDKConnect/InitializationManagement/asyncInit.test.ts index 032baf9fb74..2f011a439f4 100644 --- a/app/core/SDKConnect/InitializationManagement/asyncInit.test.ts +++ b/app/core/SDKConnect/InitializationManagement/asyncInit.test.ts @@ -4,15 +4,10 @@ import { wait } from '../utils/wait.util'; import asyncInit from './asyncInit'; jest.mock('@react-navigation/native'); -jest.mock('react-native-default-preference', () => ({ - getMultiple: jest.fn().mockResolvedValue([]), - setMultiple: jest.fn().mockResolvedValue([]), - clearMultiple: jest.fn().mockResolvedValue([]), - set: jest.fn().mockResolvedValue([]), - clear: jest.fn().mockResolvedValue([]), - getAll: jest.fn().mockResolvedValue([]), - getAllKeys: jest.fn().mockResolvedValue([]), - get: jest.fn().mockResolvedValue(JSON.stringify({})), +jest.mock('../../../store/storage-wrapper', () => ({ + getItem: jest.fn().mockResolvedValue([]), + setItem: jest.fn(), + clearAll: jest.fn().mockResolvedValue([]), })); jest.mock('../../AppConstants'); jest.mock('../../../util/Logger'); diff --git a/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.test.ts b/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.test.ts index a91c09105ef..6868492f957 100644 --- a/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.test.ts +++ b/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.test.ts @@ -10,6 +10,8 @@ import DevLogger from '../utils/DevLogger'; import DeeplinkProtocolService from './DeeplinkProtocolService'; import AppConstants from '../../AppConstants'; import { DappClient } from '../AndroidSDK/dapp-sdk-types'; +import { createMockInternalAccount } from '../../../util/test/accountsControllerTestUtils'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; jest.mock('../SDKConnect'); jest.mock('../../../core/Engine'); @@ -20,6 +22,12 @@ jest.mock('../../../util/Logger'); jest.mock('../handlers/handleCustomRpcCalls'); jest.mock('../handlers/handleBatchRpcResponse'); +const MOCK_ADDRESS = '0xc4955c0d639d99699bfd7ec54d9fafee40e4d272'; +const mockInternalAccount = createMockInternalAccount( + MOCK_ADDRESS, + 'Account 1', +); + describe('DeeplinkProtocolService', () => { let service: DeeplinkProtocolService; @@ -48,7 +56,9 @@ describe('DeeplinkProtocolService', () => { }, KeyringController: { unlock: jest.fn() }, NetworkController: { state: { providerConfig: { chainId: '0x1' } } }, - PreferencesController: { state: { selectedAddress: '0xAddress' } }, + AccountsController: { + getSelectedAccount: jest.fn().mockReturnValue(mockInternalAccount), + }, }; (Linking.openURL as jest.Mock).mockResolvedValue(null); @@ -484,7 +494,7 @@ describe('DeeplinkProtocolService', () => { ).toString('base64'), channelId: 'channel1', scheme: 'scheme', - account: '0xAddress@1', + account: `${toChecksumHexAddress(MOCK_ADDRESS)}@1`, }; service.handleMessage(params); expect(DevLogger.log).toHaveBeenCalled(); diff --git a/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.ts b/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.ts index 59fa6bb96e9..c336a4fc19e 100644 --- a/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.ts +++ b/app/core/SDKConnect/SDKDeeplinkProtocol/DeeplinkProtocolService.ts @@ -1,7 +1,6 @@ import { KeyringController } from '@metamask/keyring-controller'; import { NetworkController } from '@metamask/network-controller'; import { PermissionController } from '@metamask/permission-controller'; -import { PreferencesController } from '@metamask/preferences-controller'; import { OriginatorInfo } from '@metamask/sdk-communication-layer'; import { Linking } from 'react-native'; import { PROTOCOLS } from '../../../constants/deeplinks'; @@ -23,6 +22,8 @@ import handleBatchRpcResponse from '../handlers/handleBatchRpcResponse'; import handleCustomRpcCalls from '../handlers/handleCustomRpcCalls'; import DevLogger from '../utils/DevLogger'; import { wait, waitForKeychainUnlocked } from '../utils/wait.util'; +import { AccountsController } from '@metamask/accounts-controller'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; export default class DeeplinkProtocolService { public connections: DappConnections = {}; @@ -557,11 +558,15 @@ export default class DeeplinkProtocolService { this.currentClientId ?? '', ); - const preferencesController = ( - Engine.context as { PreferencesController: PreferencesController } - ).PreferencesController; + const accountsController = ( + Engine.context as { + AccountsController: AccountsController; + } + ).AccountsController; - const selectedAddress = preferencesController.state.selectedAddress; + const selectedInternalAccountChecksummedAddress = toChecksumHexAddress( + accountsController.getSelectedAccount().address, + ); let connectedAddresses = permissions?.eth_accounts?.caveats?.[0] ?.value as string[]; @@ -580,15 +585,17 @@ export default class DeeplinkProtocolService { ); const isPartOfConnectedAddresses = lowerCaseConnectedAddresses.includes( - selectedAddress.toLowerCase(), + selectedInternalAccountChecksummedAddress.toLowerCase(), ); if (isPartOfConnectedAddresses) { // Create a new array with selectedAddress at the first position connectedAddresses = [ - selectedAddress, + selectedInternalAccountChecksummedAddress, ...connectedAddresses.filter( - (address) => address.toLowerCase() !== selectedAddress.toLowerCase(), + (address) => + address.toLowerCase() !== + selectedInternalAccountChecksummedAddress.toLowerCase(), ), ]; } @@ -597,20 +604,22 @@ export default class DeeplinkProtocolService { } public getSelectedAddress() { - const preferencesController = ( + const accountsController = ( Engine.context as { - PreferencesController: PreferencesController; + AccountsController: AccountsController; } - ).PreferencesController; + ).AccountsController; - const selectedAddress = preferencesController.state.selectedAddress; + const selectedInternalAccountChecksummedAddress = toChecksumHexAddress( + accountsController.getSelectedAccount().address, + ); DevLogger.log( `DeeplinkProtocolService::clients_connected selectedAddress`, - selectedAddress, + selectedInternalAccountChecksummedAddress, ); - return selectedAddress; + return selectedInternalAccountChecksummedAddress; } public handleMessage(params: { diff --git a/app/core/SDKConnect/StateManagement/updateOriginatorInfos.test.ts b/app/core/SDKConnect/StateManagement/updateOriginatorInfos.test.ts index b685eb08e5c..4eed5878bab 100644 --- a/app/core/SDKConnect/StateManagement/updateOriginatorInfos.test.ts +++ b/app/core/SDKConnect/StateManagement/updateOriginatorInfos.test.ts @@ -1,18 +1,22 @@ import { OriginatorInfo } from '@metamask/sdk-communication-layer'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../../store/storage-wrapper'; import SDKConnect from '../SDKConnect'; import updateOriginatorInfos from './updateOriginatorInfos'; jest.mock('@metamask/sdk-communication-layer'); jest.mock('../SDKConnect'); -jest.mock('react-native-default-preference'); +jest.mock('../../../store/storage-wrapper'); jest.mock('../../AppConstants'); +jest.mock('../../../store/storage-wrapper', () => ({ + setItem: jest.fn(), +})); + describe('updateOriginatorInfos', () => { let mockInstance = {} as unknown as SDKConnect; - const mockDefaultPreferenceSet = DefaultPreference.set as jest.MockedFunction< - typeof DefaultPreference.set + const mockStorageWrapperSet = StorageWrapper.setItem as jest.MockedFunction< + typeof StorageWrapper.setItem >; const mockEmit = jest.fn(); @@ -22,7 +26,7 @@ describe('updateOriginatorInfos', () => { beforeEach(() => { jest.clearAllMocks(); - mockDefaultPreferenceSet.mockResolvedValue(undefined); + mockStorageWrapperSet.mockResolvedValue(undefined); mockInstance = { state: { diff --git a/app/core/SDKConnect/handlers/handleConnectionMessage.test.ts b/app/core/SDKConnect/handlers/handleConnectionMessage.test.ts index 0ee62b5e055..34ba8640efb 100644 --- a/app/core/SDKConnect/handlers/handleConnectionMessage.test.ts +++ b/app/core/SDKConnect/handlers/handleConnectionMessage.test.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import { KeyringController } from '@metamask/keyring-controller'; import { NetworkController } from '@metamask/network-controller'; -import { PreferencesController } from '@metamask/preferences-controller'; import { CommunicationLayerMessage, MessageType, @@ -17,10 +16,14 @@ import checkPermissions from './checkPermissions'; import handleConnectionMessage from './handleConnectionMessage'; import handleCustomRpcCalls from './handleCustomRpcCalls'; import handleSendMessage from './handleSendMessage'; +import { createMockInternalAccount } from '../../../util/test/accountsControllerTestUtils'; +import { AccountsController } from '@metamask/accounts-controller'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; +jest.mock('../../Engine'); jest.mock('@metamask/keyring-controller'); jest.mock('@metamask/network-controller'); -jest.mock('@metamask/preferences-controller'); +jest.mock('@metamask/accounts-controller'); jest.mock('@metamask/sdk-communication-layer'); jest.mock('../utils/DevLogger'); jest.mock('../../../util/Logger'); @@ -29,6 +32,12 @@ jest.mock('./checkPermissions'); jest.mock('./handleCustomRpcCalls'); jest.mock('./handleSendMessage'); +const MOCK_ADDRESS = '0xc4955c0d639d99699bfd7ec54d9fafee40e4d272'; +const MOCK_INTERNAL_ACCOUNT = createMockInternalAccount( + MOCK_ADDRESS, + 'Account 1', +); + describe('handleConnectionMessage', () => { const mockHandleSendMessage = handleSendMessage as jest.MockedFunction< typeof handleSendMessage @@ -63,7 +72,6 @@ describe('handleConnectionMessage', () => { const mockBackgroundBridgeOnMessage = jest.fn(); let connection = {} as unknown as Connection; - let engine = {} as unknown as typeof Engine; let message = { id: '01', method: 'eth_requestAccounts', @@ -89,23 +97,19 @@ describe('handleConnectionMessage', () => { }, } as unknown as Connection; - engine = { - context: { - KeyringController: {} as unknown as KeyringController, - NetworkController: { - state: { - providerConfig: { - chainId: '0x1', - }, - }, - } as unknown as NetworkController, - PreferencesController: { - state: { - selectedAddress: '', + (Engine.context as unknown) = { + KeyringController: {} as unknown as KeyringController, + NetworkController: { + state: { + providerConfig: { + chainId: '0x1', }, - } as unknown as PreferencesController, - }, - } as unknown as typeof Engine; + }, + } as unknown as NetworkController, + AccountsController: { + getSelectedAccount: jest.fn().mockReturnValue(MOCK_INTERNAL_ACCOUNT), + } as unknown as AccountsController, + }; message = { type: MessageType.OTP, @@ -124,7 +128,7 @@ describe('handleConnectionMessage', () => { it('should handle termination messages correctly', async () => { message.type = MessageType.TERMINATE; - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(connection.onTerminate).toHaveBeenCalledTimes(1); expect(connection.onTerminate).toHaveBeenCalledWith({ @@ -134,7 +138,7 @@ describe('handleConnectionMessage', () => { it('should log and return on ping messages', async () => { message.type = MessageType.PING; - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockDevLoggerLog).toHaveBeenCalledTimes(1); expect(mockDevLoggerLog).toHaveBeenCalledWith( @@ -147,7 +151,7 @@ describe('handleConnectionMessage', () => { message.method = ''; message.id = ''; - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockDevLoggerLog).toHaveBeenCalledTimes(1); expect(mockDevLoggerLog).toHaveBeenCalledWith( @@ -164,29 +168,29 @@ describe('handleConnectionMessage', () => { message.id = '1'; }); it('should set loading to false', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockSetLoading).toHaveBeenCalledTimes(1); expect(mockSetLoading).toHaveBeenCalledWith(false); }); it('should wait for keychain to be unlocked before handling RPC calls', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockWaitForKeychainUnlocked).toHaveBeenCalledTimes(1); expect(mockWaitForKeychainUnlocked).toHaveBeenCalledWith({ - keyringController: engine.context.KeyringController, + keyringController: Engine.context.KeyringController, context: 'connection::on_message', }); }); it('should retrieve necessary data from the engine context', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); - expect(engine.context.KeyringController).toBeDefined(); - expect(engine.context.NetworkController).toBeDefined(); - expect(engine.context.PreferencesController).toBeDefined(); + expect(Engine.context.KeyringController).toBeDefined(); + expect(Engine.context.NetworkController).toBeDefined(); + expect(Engine.context.AccountsController).toBeDefined(); }); it('should wait for connection readiness', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockWaitForConnectionReadiness).toHaveBeenCalledTimes(1); expect(mockWaitForConnectionReadiness).toHaveBeenCalledWith({ @@ -194,7 +198,7 @@ describe('handleConnectionMessage', () => { }); }); it('should handle the sendAuthorized process', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockSendAuthorized).toHaveBeenCalledTimes(1); }); @@ -206,7 +210,7 @@ describe('handleConnectionMessage', () => { }); it('should send error message using handleSendMessage on permission error', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockCheckPermissions).toBeCalledTimes(1); @@ -230,17 +234,16 @@ describe('handleConnectionMessage', () => { mockCheckPermissions.mockResolvedValueOnce(true); }); it('should process custom RPC calls correctly', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockHandleCustomRpcCalls).toHaveBeenCalledTimes(1); expect(mockHandleCustomRpcCalls).toHaveBeenCalledWith({ batchRPCManager: connection.batchRPCManager, navigation: undefined, connection, - selectedAddress: - engine.context.PreferencesController.state.selectedAddress, + selectedAddress: toChecksumHexAddress(MOCK_ADDRESS), selectedChainId: - engine.context.NetworkController.state.providerConfig.chainId, + Engine.context.NetworkController.state.providerConfig.chainId, rpc: { method: message.method, params: message.params, @@ -280,7 +283,7 @@ describe('handleConnectionMessage', () => { mockHandleCustomRpcCalls.mockResolvedValueOnce(processedRpc); }); it('should add processed RPC to the RPC queue', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockRpcQueueManagerAdd).toHaveBeenCalledTimes(1); expect(mockRpcQueueManagerAdd).toHaveBeenCalledWith({ @@ -297,7 +300,7 @@ describe('handleConnectionMessage', () => { }); it('should add processed RPC to the RPC queue', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockRpcQueueManagerAdd).toHaveBeenCalledTimes(0); }); @@ -331,7 +334,7 @@ describe('handleConnectionMessage', () => { }); it('should send the processed RPC message to the background bridge', async () => { - await handleConnectionMessage({ message, engine, connection }); + await handleConnectionMessage({ message, engine: Engine, connection }); expect(mockBackgroundBridgeOnMessage).toHaveBeenCalledTimes(1); expect(mockBackgroundBridgeOnMessage).toHaveBeenCalledWith({ diff --git a/app/core/SDKConnect/handlers/handleConnectionMessage.ts b/app/core/SDKConnect/handlers/handleConnectionMessage.ts index ec804822d2e..fa4367c4f8a 100644 --- a/app/core/SDKConnect/handlers/handleConnectionMessage.ts +++ b/app/core/SDKConnect/handlers/handleConnectionMessage.ts @@ -1,6 +1,6 @@ import { KeyringController } from '@metamask/keyring-controller'; import { NetworkController } from '@metamask/network-controller'; -import { PreferencesController } from '@metamask/preferences-controller'; +import { AccountsController } from '@metamask/accounts-controller'; import { CommunicationLayerMessage, MessageType, @@ -18,6 +18,7 @@ import { import checkPermissions from './checkPermissions'; import handleCustomRpcCalls from './handleCustomRpcCalls'; import handleSendMessage from './handleSendMessage'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; // eslint-disable-next-line const { version } = require('../../../../package.json'); @@ -96,12 +97,15 @@ export const handleConnectionMessage = async ({ context: 'connection::on_message', }); - const preferencesController = ( - engine.context as { - PreferencesController: PreferencesController; + const accountsController = ( + Engine.context as { + AccountsController: AccountsController; } - ).PreferencesController; - const selectedAddress = preferencesController.state.selectedAddress; + ).AccountsController; + + const selectedInternalAccountChecksummedAddress = toChecksumHexAddress( + accountsController.getSelectedAccount().address, + ); const networkController = ( engine.context as { @@ -146,7 +150,7 @@ export const handleConnectionMessage = async ({ const processedRpc = await handleCustomRpcCalls({ batchRPCManager: connection.batchRPCManager, - selectedAddress, + selectedAddress: selectedInternalAccountChecksummedAddress, selectedChainId: chainId, connection, navigation: connection.navigation, diff --git a/app/core/SDKConnect/utils/wait.util.ts b/app/core/SDKConnect/utils/wait.util.ts index ae0f3642e83..686af0d1423 100644 --- a/app/core/SDKConnect/utils/wait.util.ts +++ b/app/core/SDKConnect/utils/wait.util.ts @@ -126,7 +126,7 @@ export const waitForUserLoggedIn = async ({ } const state = store.getState(); - let isLoggedIn = state.user.isLoggedIn ?? false; + let isLoggedIn = state.user.userLoggedIn ?? false; DevLogger.log( `wait:: waitForUserLoggedIn[${context}] isLoggedIn: ${isLoggedIn}`, @@ -138,7 +138,7 @@ export const waitForUserLoggedIn = async ({ `[wait.util] [${context}] Waiting for userLoggedIn... attempt ${i}`, ); } - isLoggedIn = state.user.isLoggedIn ?? false; + isLoggedIn = state.user.userLoggedIn ?? false; i += 1; } diff --git a/app/core/SecureKeychain.js b/app/core/SecureKeychain.js index 7118120453e..8a36e5ab1af 100644 --- a/app/core/SecureKeychain.js +++ b/app/core/SecureKeychain.js @@ -1,7 +1,7 @@ import * as Keychain from 'react-native-keychain'; // eslint-disable-line import/no-namespace import { Encryptor, LEGACY_DERIVATION_OPTIONS } from './Encryptor'; import { strings } from '../../locales/i18n'; -import AsyncStorage from '../store/async-storage-wrapper'; +import StorageWrapper from '../store/storage-wrapper'; import { Platform } from 'react-native'; import { MetaMetricsEvents, MetaMetrics } from '../core/Analytics'; import { @@ -80,8 +80,8 @@ export default { async resetGenericPassword() { const options = { service: defaultOptions.service }; - await AsyncStorage.removeItem(BIOMETRY_CHOICE); - await AsyncStorage.removeItem(PASSCODE_CHOICE); + await StorageWrapper.removeItem(BIOMETRY_CHOICE); + await StorageWrapper.removeItem(PASSCODE_CHOICE); // This is called to remove other auth types and set the user back to the default password login await MetaMetrics.getInstance().addTraitsToUser({ [UserProfileProperty.AUTHENTICATION_TYPE]: AUTHENTICATION_TYPE.PASSWORD, @@ -147,10 +147,10 @@ export default { }); if (type === this.TYPES.BIOMETRICS) { - await AsyncStorage.setItem(BIOMETRY_CHOICE, TRUE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); - await AsyncStorage.removeItem(PASSCODE_CHOICE); - await AsyncStorage.removeItem(BIOMETRY_CHOICE_DISABLED); + await StorageWrapper.setItem(BIOMETRY_CHOICE, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.removeItem(PASSCODE_CHOICE); + await StorageWrapper.removeItem(BIOMETRY_CHOICE_DISABLED); // If the user enables biometrics, we're trying to read the password // immediately so we get the permission prompt @@ -158,15 +158,15 @@ export default { await this.getGenericPassword(); } } else if (type === this.TYPES.PASSCODE) { - await AsyncStorage.removeItem(BIOMETRY_CHOICE); - await AsyncStorage.removeItem(PASSCODE_DISABLED); - await AsyncStorage.setItem(PASSCODE_CHOICE, TRUE); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.removeItem(BIOMETRY_CHOICE); + await StorageWrapper.removeItem(PASSCODE_DISABLED); + await StorageWrapper.setItem(PASSCODE_CHOICE, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); } else if (type === this.TYPES.REMEMBER_ME) { - await AsyncStorage.removeItem(BIOMETRY_CHOICE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); - await AsyncStorage.removeItem(PASSCODE_CHOICE); - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.removeItem(BIOMETRY_CHOICE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.removeItem(PASSCODE_CHOICE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); //Don't need to add any parameter } }, diff --git a/app/core/WalletConnect/WalletConnect.js b/app/core/WalletConnect/WalletConnect.js index 8a0a33007ee..d7f558c4378 100644 --- a/app/core/WalletConnect/WalletConnect.js +++ b/app/core/WalletConnect/WalletConnect.js @@ -4,7 +4,7 @@ import Engine from '../Engine'; import Logger from '../../util/Logger'; // eslint-disable-next-line import/no-nodejs-modules import { EventEmitter } from 'events'; -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; import { CLIENT_OPTIONS, WALLET_CONNECT_ORIGIN, @@ -59,7 +59,10 @@ const persistSessions = async () => { lastTimeConnected: new Date(), })); - await AsyncStorage.setItem(WALLETCONNECT_SESSIONS, JSON.stringify(sessions)); + await StorageWrapper.setItem( + WALLETCONNECT_SESSIONS, + JSON.stringify(sessions), + ); }; const waitForInitialization = async () => { @@ -171,7 +174,7 @@ class WalletConnect { if (payload.method === 'eth_sendTransaction') { try { const selectedAddress = - Engine.context.PreferencesController.state.selectedAddress?.toLowerCase(); + Engine.context.AccountsController.getSelectedAccount().address?.toLowerCase(); checkActiveAccountAndChainId({ address: payload.params[0].from, @@ -305,7 +308,7 @@ class WalletConnect { startSession = async (sessionData, existing) => { const chainId = selectChainId(store.getState()); const selectedAddress = - Engine.context.PreferencesController.state.selectedAddress?.toLowerCase(); + Engine.context.AccountsController.getSelectedAccount().address?.toLowerCase(); const approveData = { chainId: parseInt(chainId, 10), accounts: [selectedAddress], @@ -381,7 +384,7 @@ class WalletConnect { const instance = { async init() { - const sessionData = await AsyncStorage.getItem(WALLETCONNECT_SESSIONS); + const sessionData = await StorageWrapper.getItem(WALLETCONNECT_SESSIONS); if (sessionData) { const sessions = JSON.parse(sessionData); @@ -442,7 +445,7 @@ const instance = { }, getSessions: async () => { let sessions = []; - const sessionData = await AsyncStorage.getItem(WALLETCONNECT_SESSIONS); + const sessionData = await StorageWrapper.getItem(WALLETCONNECT_SESSIONS); if (sessionData) { sessions = JSON.parse(sessionData); } diff --git a/app/core/WalletConnect/WalletConnectV2.ts b/app/core/WalletConnect/WalletConnectV2.ts index cecb6e131dc..30ce6ddc240 100644 --- a/app/core/WalletConnect/WalletConnectV2.ts +++ b/app/core/WalletConnect/WalletConnectV2.ts @@ -4,7 +4,6 @@ import { Minimizer } from '../NativeModules'; import getRpcMethodMiddleware from '../RPCMethods/RPCMethodMiddleware'; import { KeyringController } from '@metamask/keyring-controller'; -import { PreferencesController } from '@metamask/preferences-controller'; import Logger from '../../util/Logger'; import { WalletDevice } from '@metamask/transaction-controller'; @@ -29,7 +28,7 @@ import { selectNetworkConfigurations, } from '../../selectors/networkController'; import { store } from '../../store'; -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; import Device from '../../util/device'; import { addTransaction } from '../../util/transaction-controller'; import Engine from '../Engine'; @@ -45,6 +44,8 @@ import parseWalletConnectUri, { showWCLoadingState, } from './wc-utils'; import { getDefaultNetworkByChainId } from '../../util/networks'; +import { AccountsController } from '@metamask/accounts-controller'; +import { toChecksumHexAddress } from '@metamask/controller-utils'; const { PROJECT_ID } = AppConstants.WALLET_CONNECT; export const isWC2Enabled = @@ -549,7 +550,7 @@ export class WC2Manager { const session = sessions?.[event.topic]; if (session && deeplinkSessions[session?.pairingTopic]) { delete deeplinkSessions[session.pairingTopic]; - await AsyncStorage.setItem( + await StorageWrapper.setItem( AppConstants.WALLET_CONNECT.DEEPLINK_SESSIONS, JSON.stringify(this.deeplinkSessions), ); @@ -557,10 +558,15 @@ export class WC2Manager { }, ); - const preferencesController = ( - Engine.context as { PreferencesController: PreferencesController } - ).PreferencesController; - const selectedAddress = preferencesController.state.selectedAddress; + const accountsController = ( + Engine.context as { + AccountsController: AccountsController; + } + ).AccountsController; + + const selectedInternalAccountChecksummedAddress = toChecksumHexAddress( + accountsController.getSelectedAccount().address, + ); // TODO: Misleading variable name, this is not the chain ID. This should be updated to use the chain ID. const chainId = selectChainId(store.getState()); @@ -640,7 +646,7 @@ export class WC2Manager { const nChainId = parseInt(chainId, 16); DevLogger.log( - `WC2::init updateSession session=${sessionKey} chainId=${chainId} nChainId=${nChainId} selectedAddress=${selectedAddress}`, + `WC2::init updateSession session=${sessionKey} chainId=${chainId} nChainId=${nChainId} selectedAddress=${selectedInternalAccountChecksummedAddress}`, approvedAccounts, ); await this.sessions[sessionKey].updateSession({ @@ -725,7 +731,7 @@ export class WC2Manager { let deeplinkSessions = {}; try { - const unparsedDeeplinkSessions = await AsyncStorage.getItem( + const unparsedDeeplinkSessions = await StorageWrapper.getItem( AppConstants.WALLET_CONNECT.DEEPLINK_SESSIONS, ); @@ -818,7 +824,7 @@ export class WC2Manager { }); }); - await AsyncStorage.setItem( + await StorageWrapper.setItem( AppConstants.WALLET_CONNECT.DEEPLINK_SESSIONS, JSON.stringify(this.deeplinkSessions), ); @@ -1029,7 +1035,7 @@ export class WC2Manager { origin, }; // keep list of deeplinked origin - await AsyncStorage.setItem( + await StorageWrapper.setItem( AppConstants.WALLET_CONNECT.DEEPLINK_SESSIONS, JSON.stringify(this.deeplinkSessions), ); diff --git a/app/reducers/index.ts b/app/reducers/index.ts index f5ea4d888be..141db3370ef 100644 --- a/app/reducers/index.ts +++ b/app/reducers/index.ts @@ -7,7 +7,7 @@ import settingsReducer from './settings'; import alertReducer from './alert'; import transactionReducer from './transaction'; import legalNoticesReducer from './legalNotices'; -import userReducer from './user'; +import userReducer, { IUserReducer } from './user'; import wizardReducer from './wizard'; import onboardingReducer from './onboarding'; import fiatOrders from './fiatOrders'; @@ -77,9 +77,7 @@ export interface RootState { // eslint-disable-next-line @typescript-eslint/no-explicit-any transaction: any; smartTransactions: StateFromReducer; - // TODO: Replace "any" with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any - user: any; + user: IUserReducer; // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any wizard: any; diff --git a/app/reducers/transaction/index.js b/app/reducers/transaction/index.js index 191f9bfe218..f1b0220041f 100644 --- a/app/reducers/transaction/index.js +++ b/app/reducers/transaction/index.js @@ -115,7 +115,6 @@ const transactionReducer = (state = initialState, action) => { const assetType = getAssetType(selectedAsset); return { ...state, - type: 'TOKENS_TRANSACTION', selectedAsset: action.asset, assetType, }; @@ -126,30 +125,9 @@ const transactionReducer = (state = initialState, action) => { symbol: 'ETH', assetType: 'ETH', selectedAsset: { isETH: true, symbol: 'ETH' }, - type: 'ETHER_TRANSACTION', ...getTxMeta(action.transaction), transaction: getTxData(action.transaction), }; - case 'SET_INDIVIDUAL_TOKEN_TRANSACTION': - return { - ...state, - selectedAsset: action.token, - type: 'INDIVIDUAL_TOKEN_TRANSACTION', - }; - case 'SET_INDIVIDUAL_COLLECTIBLE_TRANSACTION': - return { - ...state, - selectedAsset: action.collectible, - assetType: 'ERC721', - type: 'INDIVIDUAL_COLLECTIBLE_TRANSACTION', - }; - case 'SET_COLLECTIBLE_CONTRACT_TRANSACTION': - return { - ...state, - selectedAsset: action.collectible, - assetType: 'ERC721', - type: 'CONTRACT_COLLECTIBLE_TRANSACTION', - }; case 'SET_TRANSACTION_SECURITY_ALERT_RESPONSE': { const { transactionId, securityAlertResponse } = action; return { diff --git a/app/reducers/user/index.js b/app/reducers/user/index.ts similarity index 64% rename from app/reducers/user/index.js rename to app/reducers/user/index.ts index d5784284ecd..a942f0eb88d 100644 --- a/app/reducers/user/index.js +++ b/app/reducers/user/index.ts @@ -1,6 +1,21 @@ import { AppThemeKey } from '../../util/theme/models'; -const initialState = { +export interface IUserReducer { + loadingMsg: string; + loadingSet: boolean; + passwordSet: boolean; + seedphraseBackedUp: boolean; + backUpSeedphraseVisible: boolean; + protectWalletModalVisible: boolean; + gasEducationCarouselSeen: boolean; + userLoggedIn: boolean; + isAuthChecked: boolean; + initialScreen: string; + appTheme: AppThemeKey; + ambiguousAddressEntries: Record; +} + +export const userInitialState = { loadingMsg: '', loadingSet: false, passwordSet: false, @@ -15,7 +30,28 @@ const initialState = { ambiguousAddressEntries: {}, }; -const userReducer = (state = initialState, action) => { +// Define action types +type UserAction = + | { type: 'LOGIN' } + | { type: 'LOGOUT' } + | { type: 'LOADING_SET'; loadingMsg: string } + | { type: 'LOADING_UNSET' } + | { type: 'PASSWORD_SET' } + | { type: 'PASSWORD_UNSET' } + | { type: 'SEEDPHRASE_NOT_BACKED_UP' } + | { type: 'SEEDPHRASE_BACKED_UP' } + | { type: 'BACK_UP_SEEDPHRASE_VISIBLE' } + | { type: 'BACK_UP_SEEDPHRASE_NOT_VISIBLE' } + | { type: 'PROTECT_MODAL_VISIBLE' } + | { type: 'PROTECT_MODAL_NOT_VISIBLE' } + | { type: 'SET_GAS_EDUCATION_CAROUSEL_SEEN' } + | { type: 'SET_APP_THEME'; payload: { theme: AppThemeKey } }; + +const userReducer = ( + // eslint-disable-next-line @typescript-eslint/default-param-last + state: IUserReducer = userInitialState, + action: UserAction, +) => { switch (action.type) { case 'LOGIN': return { diff --git a/app/selectors/accountsController.test.ts b/app/selectors/accountsController.test.ts index abb7dbaa089..30150eed4fb 100644 --- a/app/selectors/accountsController.test.ts +++ b/app/selectors/accountsController.test.ts @@ -2,7 +2,7 @@ import { AccountsControllerState } from '@metamask/accounts-controller'; import { captureException } from '@sentry/react-native'; import { Hex, isValidChecksumAddress } from '@metamask/utils'; import { InternalAccount } from '@metamask/keyring-api'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../store/storage-wrapper'; import { selectSelectedInternalAccount, selectInternalAccounts, @@ -65,7 +65,7 @@ const mockedCaptureException = jest.mocked(captureException); describe('Accounts Controller Selectors', () => { beforeEach(() => { jest.resetAllMocks(); - DefaultPreference.get = jest.fn(() => Promise.resolve(AGREED)); + StorageWrapper.getItem = jest.fn(() => Promise.resolve(AGREED)); }); describe('selectSelectedInternalAccount', () => { it('returns selected internal account', () => { diff --git a/app/selectors/confirmTransaction.test.ts b/app/selectors/confirmTransaction.test.ts index 06ee8c2f2b9..b9c671e11c5 100644 --- a/app/selectors/confirmTransaction.test.ts +++ b/app/selectors/confirmTransaction.test.ts @@ -125,7 +125,6 @@ describe('Confirm Transaction Selectors', () => { expect(mergeGasFeeEstimatesMock).toHaveBeenCalledTimes(1); expect(mergeGasFeeEstimatesMock).toHaveBeenCalledWith({ - gasFeeControllerEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, gasFeeControllerEstimates: GAS_FEE_ESTIMATES_MOCK, transactionGasFeeEstimates: TRANSACTION_GAS_FEE_ESTIMATES_MOCK, }); diff --git a/app/selectors/confirmTransaction.ts b/app/selectors/confirmTransaction.ts index fa2000fb120..395c74129c1 100644 --- a/app/selectors/confirmTransaction.ts +++ b/app/selectors/confirmTransaction.ts @@ -1,9 +1,6 @@ import { selectTransactions } from './transactionController'; import { RootState } from '../reducers'; -import { - selectGasFeeControllerEstimateType, - selectGasFeeControllerEstimates, -} from './gasFeeController'; +import { selectGasFeeControllerEstimates } from './gasFeeController'; import { mergeGasFeeEstimates } from '@metamask/transaction-controller'; import { createSelector } from 'reselect'; import { createDeepEqualSelector } from './util'; @@ -33,19 +30,11 @@ export const selectCurrentTransactionGasFeeEstimates = createDeepEqualSelector( ); export const selectGasFeeEstimates = createSelector( - selectGasFeeControllerEstimateType, selectGasFeeControllerEstimates, selectCurrentTransactionGasFeeEstimates, - ( - gasFeeControllerEstimateType, - gasFeeControllerEstimates, - transactionGasFeeEstimates, - ) => { + (gasFeeControllerEstimates, transactionGasFeeEstimates) => { if (transactionGasFeeEstimates) { return mergeGasFeeEstimates({ - // TODO: Replace "any" with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any - gasFeeControllerEstimateType: gasFeeControllerEstimateType as any, // TODO: Replace "any" with type // eslint-disable-next-line @typescript-eslint/no-explicit-any gasFeeControllerEstimates: gasFeeControllerEstimates as any, diff --git a/app/selectors/preferencesController.ts b/app/selectors/preferencesController.ts index 7d1b6b9a6dd..f5765261004 100644 --- a/app/selectors/preferencesController.ts +++ b/app/selectors/preferencesController.ts @@ -5,30 +5,12 @@ import { RootState } from '../reducers'; const selectPreferencesControllerState = (state: RootState) => state.engine.backgroundState.PreferencesController; -/** - * @deprecated use selectInternalAccounts rom selectors/accountsController.ts instead - */ -export const selectIdentities = createSelector( - selectPreferencesControllerState, - (preferencesControllerState: PreferencesState) => - preferencesControllerState.identities, -); - export const selectIpfsGateway = createSelector( selectPreferencesControllerState, (preferencesControllerState: PreferencesState) => preferencesControllerState.ipfsGateway, ); -/** - * @deprecated use selectSelectedInternal or selectSelectedInternalAccountChecksummedAddress from selectors/accountsController.ts - */ -export const selectSelectedAddress = createSelector( - selectPreferencesControllerState, - (preferencesControllerState: PreferencesState) => - preferencesControllerState.selectedAddress, -); - export const selectUseNftDetection = createSelector( selectPreferencesControllerState, (preferencesControllerState: PreferencesState) => diff --git a/app/selectors/smartTransactionsController.test.ts b/app/selectors/smartTransactionsController.test.ts index 770852527ff..a3a5fdabee5 100644 --- a/app/selectors/smartTransactionsController.test.ts +++ b/app/selectors/smartTransactionsController.test.ts @@ -43,8 +43,6 @@ const getDefaultState = () => { }, }, }; - defaultState.engine.backgroundState.PreferencesController.selectedAddress = - '0xabc'; defaultState.engine.backgroundState.NetworkController.providerConfig = { rpcUrl: undefined, // default rpc for chain 0x1 chainId: '0x1', diff --git a/app/selectors/smartTransactionsController.ts b/app/selectors/smartTransactionsController.ts index 94e20c8e4d8..5f69e895553 100644 --- a/app/selectors/smartTransactionsController.ts +++ b/app/selectors/smartTransactionsController.ts @@ -1,8 +1,5 @@ import { NETWORKS_CHAIN_ID } from '../constants/network'; -import { - selectSelectedAddress, - selectSmartTransactionsOptInStatus, -} from './preferencesController'; +import { selectSmartTransactionsOptInStatus } from './preferencesController'; import { RootState } from '../reducers'; import { swapsSmartTxFlagEnabled } from '../reducers/swaps'; import { isHardwareAccount } from '../util/address'; @@ -11,6 +8,7 @@ import { SmartTransaction, SmartTransactionStatuses, } from '@metamask/smart-transactions-controller/dist/types'; +import { selectSelectedInternalAccountChecksummedAddress } from './accountsController'; export const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS = [ NETWORKS_CHAIN_ID.MAINNET, @@ -18,8 +16,11 @@ export const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS = [ NETWORKS_CHAIN_ID.SEPOLIA, ]; export const selectSmartTransactionsEnabled = (state: RootState) => { - const selectedAddress = selectSelectedAddress(state); - const addrIshardwareAccount = isHardwareAccount(selectedAddress); + const selectedAddress = + selectSelectedInternalAccountChecksummedAddress(state); + const addrIshardwareAccount = selectedAddress + ? isHardwareAccount(selectedAddress) + : false; const chainId = selectChainId(state); const providerConfigRpcUrl = selectProviderConfig(state).rpcUrl; @@ -56,7 +57,8 @@ export const selectShouldUseSmartTransaction = (state: RootState) => { }; export const selectPendingSmartTransactionsBySender = (state: RootState) => { - const selectedAddress = selectSelectedAddress(state); + const selectedAddress = + selectSelectedInternalAccountChecksummedAddress(state); const chainId = selectChainId(state); const smartTransactions: SmartTransaction[] = @@ -68,7 +70,7 @@ export const selectPendingSmartTransactionsBySender = (state: RootState) => { ?.filter((stx) => { const { txParams } = stx; return ( - txParams?.from.toLowerCase() === selectedAddress.toLowerCase() && + txParams?.from.toLowerCase() === selectedAddress?.toLowerCase() && ![ SmartTransactionStatuses.SUCCESS, SmartTransactionStatuses.CANCELLED, diff --git a/app/selectors/types.ts b/app/selectors/types.ts index 500a30f099b..5bf4921a87c 100644 --- a/app/selectors/types.ts +++ b/app/selectors/types.ts @@ -16,7 +16,7 @@ import { BaseState } from '@metamask/base-controller'; import { KeyringControllerMemState } from '@metamask/keyring-controller'; import { PreferencesState } from '@metamask/preferences-controller'; import { PhishingControllerState } from '@metamask/phishing-controller'; -import { TransactionState } from '@metamask/transaction-controller'; +import { TransactionControllerState } from '@metamask/transaction-controller'; import { GasFeeController } from '@metamask/gas-fee-controller'; import { PPOMState } from '@metamask/ppom-validator'; import { ApprovalControllerState } from '@metamask/approval-controller'; @@ -40,7 +40,7 @@ export interface EngineState { PPOMController: PPOMState; TokenBalancesController: TokenBalancesControllerState; TokenRatesController: TokenRatesState; - TransactionController: TransactionState; + TransactionController: TransactionControllerState; SwapsController: SwapsController; ///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps) SnapController: SnapController; diff --git a/app/store/migrations/023.test.js b/app/store/migrations/023.test.js index 084baced05c..ee0c61adb0b 100644 --- a/app/store/migrations/023.test.js +++ b/app/store/migrations/023.test.js @@ -4,6 +4,7 @@ import initialRootState, { backgroundState, } from '../../util/test/initial-root-state'; import { captureException } from '@sentry/react-native'; +import { userInitialState } from '../../reducers/user'; jest.mock('@sentry/react-native', () => ({ captureException: jest.fn(), @@ -211,7 +212,7 @@ describe('Migration #23', () => { const newState = migrate(state); - expect(newState.user).toStrictEqual({}); + expect(newState.user).toStrictEqual(userInitialState); expect(newState.engine.backgroundState).toStrictEqual( merge({}, backgroundState, { AddressBookController: { @@ -297,12 +298,14 @@ describe('Migration #23', () => { const newState = migrate(state); - expect(newState.user).toStrictEqual({ - ambiguousAddressEntries: { - 10: ['0x0000000000000000000000000000000000000002'], - 2415: ['0x0000000000000000000000000000000000000002'], - }, - }); + expect(newState.user).toStrictEqual( + merge({}, userInitialState, { + ambiguousAddressEntries: { + 10: ['0x0000000000000000000000000000000000000002'], + 2415: ['0x0000000000000000000000000000000000000002'], + }, + }), + ); expect(newState.engine.backgroundState).toStrictEqual( merge({}, backgroundState, { AddressBookController: { @@ -382,7 +385,7 @@ describe('Migration #23', () => { const newState = migrate(state); - expect(newState.user).toStrictEqual({}); + expect(newState.user).toStrictEqual(userInitialState); expect(newState.engine.backgroundState).toStrictEqual( merge({}, backgroundState, { AddressBookController: { diff --git a/app/store/migrations/033.test.ts b/app/store/migrations/033.test.ts index 06bb8479d0d..fa57c5e3be1 100644 --- a/app/store/migrations/033.test.ts +++ b/app/store/migrations/033.test.ts @@ -2,7 +2,7 @@ import migration from './033'; import { merge } from 'lodash'; import initialRootState from '../../util/test/initial-root-state'; import { captureException } from '@sentry/react-native'; -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; import { GOERLI, SEPOLIA } from '../../../app/constants/network'; import NetworkList from '../../../app/util/networks'; diff --git a/app/store/migrations/033.ts b/app/store/migrations/033.ts index a7c92e61d78..95430ba849e 100644 --- a/app/store/migrations/033.ts +++ b/app/store/migrations/033.ts @@ -1,4 +1,4 @@ -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; import { SEPOLIA } from '../../constants/network'; import { captureException } from '@sentry/react-native'; import { isObject } from '@metamask/utils'; diff --git a/app/store/migrations/046.test.ts b/app/store/migrations/046.test.ts index 6e080a23615..3ade28476e7 100644 --- a/app/store/migrations/046.test.ts +++ b/app/store/migrations/046.test.ts @@ -2,7 +2,7 @@ import migration from './046'; import { merge } from 'lodash'; import initialRootState from '../../util/test/initial-root-state'; import { captureException } from '@sentry/react-native'; -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; const oldState = { engine: { diff --git a/app/store/migrations/046.ts b/app/store/migrations/046.ts index c36e45a9c18..539d961e505 100644 --- a/app/store/migrations/046.ts +++ b/app/store/migrations/046.ts @@ -1,4 +1,4 @@ -import { CHAIN_IDS } from '@metamask/transaction-controller/dist/constants'; +import { CHAIN_IDS } from '@metamask/transaction-controller'; import { captureException } from '@sentry/react-native'; import { isObject } from '@metamask/utils'; import { NetworkState } from '@metamask/network-controller'; diff --git a/app/store/migrations/050.test.ts b/app/store/migrations/050.test.ts new file mode 100644 index 00000000000..57d97330cb4 --- /dev/null +++ b/app/store/migrations/050.test.ts @@ -0,0 +1,40 @@ +import migrate from './050'; +import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../storage-wrapper'; + +const defaultPreferenceItems: { [key: string]: string | null } = { + valueA: 'a', + valueB: 'true', + valueC: 'myValue', + valueD: null, +}; + +jest.mock('../storage-wrapper', () => ({ + setItem: jest.fn().mockResolvedValue(''), +})); +jest.mock('react-native-default-preference', () => ({ + set: jest.fn(), + clear: jest.fn(), + getAll: jest.fn().mockReturnValue(defaultPreferenceItems), +})); + +describe('Migration #50', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('migrates default preferences values to mmkv and clears DefaultPreference', async () => { + await migrate({}); + + expect(StorageWrapper.setItem).toHaveBeenCalledTimes(3); + expect(StorageWrapper.setItem).toHaveBeenCalledWith('valueA', 'a'); + expect(StorageWrapper.setItem).toHaveBeenCalledWith('valueB', 'true'); + expect(StorageWrapper.setItem).toHaveBeenCalledWith('valueC', 'myValue'); + + expect(DefaultPreference.clear).toHaveBeenCalledTimes(4); + expect(DefaultPreference.clear).toHaveBeenCalledWith('valueA'); + expect(DefaultPreference.clear).toHaveBeenCalledWith('valueB'); + expect(DefaultPreference.clear).toHaveBeenCalledWith('valueC'); + expect(DefaultPreference.clear).toHaveBeenCalledWith('valueD'); + }); +}); diff --git a/app/store/migrations/050.ts b/app/store/migrations/050.ts new file mode 100644 index 00000000000..70f24c1b885 --- /dev/null +++ b/app/store/migrations/050.ts @@ -0,0 +1,28 @@ +import DefaultPreference from 'react-native-default-preference'; +import { captureException } from '@sentry/react-native'; +import StorageWrapper from '../storage-wrapper'; + +/** + * The goal of this migration is set all the data that was on DefaultPreference to MMKV + * and clean DefaultPreference data + * @param state + * @returns state + */ +export default async function migrate(state: unknown) { + const keyValues = await DefaultPreference.getAll(); + + for (const key of Object.keys(keyValues)) { + try { + if (keyValues[key] != null) { + StorageWrapper.setItem(key, keyValues[key]); + } + await DefaultPreference.clear(key); + } catch (error) { + captureException( + `Migration 50: Failed to migrate key "${key}" from DefaultPreference to MMKV! Error: ${error}`, + ); + } + } + + return state; +} diff --git a/app/store/migrations/index.test.ts b/app/store/migrations/index.test.ts index 771cfd4c2c5..ce765e41efb 100644 --- a/app/store/migrations/index.test.ts +++ b/app/store/migrations/index.test.ts @@ -7,6 +7,11 @@ import { const defaultNodeEnv = process.env.NODE_ENV; jest.unmock('redux-persist'); jest.mock('../../store', () => jest.fn()); +jest.mock('react-native-default-preference', () => ({ + set: jest.fn(), + clear: jest.fn(), + getAll: jest.fn().mockReturnValue({}), +})); // Only test migrations 25 and up const migrationNumberToTestFrom = 25; diff --git a/app/store/migrations/index.ts b/app/store/migrations/index.ts index bfdbce04cb8..f56f82c8ce4 100644 --- a/app/store/migrations/index.ts +++ b/app/store/migrations/index.ts @@ -50,6 +50,7 @@ import migration46 from './046'; import migration47 from './047'; import migration48 from './048'; import migration49 from './049'; +import migration50 from './050'; type MigrationFunction = (state: unknown) => unknown; type AsyncMigrationFunction = (state: unknown) => Promise; @@ -112,6 +113,7 @@ export const migrationList: MigrationsList = { 47: migration47, 48: migration48, 49: migration49, + 50: migration50, }; // Enable both synchronous and asynchronous migrations diff --git a/app/store/persistConfig.ts b/app/store/persistConfig.ts index 2b18f1bb3c1..41679049ff7 100644 --- a/app/store/persistConfig.ts +++ b/app/store/persistConfig.ts @@ -1,11 +1,12 @@ import { createMigrate, createTransform } from 'redux-persist'; -import AsyncStorage from './async-storage-wrapper'; +import AsyncStorage from '@react-native-async-storage/async-storage'; import FilesystemStorage from 'redux-persist-filesystem-storage'; import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2'; import { RootState } from '../reducers'; import { migrations, version } from './migrations'; import Logger from '../util/Logger'; import Device from '../util/device'; +import { IUserReducer } from '../reducers/user'; const TIMEOUT = 40000; @@ -66,9 +67,7 @@ const persistTransform = createTransform( PhishingController, ...controllers } = inboundState.backgroundState || {}; - // TODO: Fix this type error - // @ts-expect-error Fix this typo, should be `tokensChainsCache` - const { tokenList, tokensChainCache, ...persistedTokenListController } = + const { tokenList, tokensChainsCache, ...persistedTokenListController } = TokenListController; const { aggregatorMetadata, @@ -80,9 +79,8 @@ const persistTransform = createTransform( topAssetsLastFetched, ...persistedSwapsController } = SwapsController; - // TODO: Fix this type error - // @ts-expect-error There is no `phishing` property in the phishing controller state - const { phishing, whitelist, ...persistedPhishingController } = + + const { phishingLists, whitelist, ...persistedPhishingController } = PhishingController; // Reconstruct data to persist @@ -101,10 +99,7 @@ const persistTransform = createTransform( ); const persistUserTransform = createTransform( - // TODO: Add types for the 'user' slice - // TODO: Replace "any" with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (inboundState: any) => { + (inboundState: IUserReducer) => { const { initialScreen, isAuthChecked, ...state } = inboundState; // Reconstruct data to persist return state; diff --git a/app/store/async-storage-wrapper.js b/app/store/storage-wrapper.js similarity index 96% rename from app/store/async-storage-wrapper.js rename to app/store/storage-wrapper.js index 32366f2869b..5d39cd1a993 100644 --- a/app/store/async-storage-wrapper.js +++ b/app/store/storage-wrapper.js @@ -7,7 +7,7 @@ import { MMKV } from 'react-native-mmkv'; * Wrapper class for AsyncStorage. * (Will want to eventuall re-name since no longer async once migratted to mmkv) */ -class AsyncStorageWrapper { +class StorageWrapper { constructor() { /** * The underlying storage implementation. @@ -66,4 +66,4 @@ class AsyncStorageWrapper { } } -export default new AsyncStorageWrapper(); +export default new StorageWrapper(); diff --git a/app/util/Logger/index.test.ts b/app/util/Logger/index.test.ts index 0b0ec078a4c..e2ac0a42be0 100644 --- a/app/util/Logger/index.test.ts +++ b/app/util/Logger/index.test.ts @@ -1,7 +1,7 @@ import Logger from '.'; import { captureException, withScope } from '@sentry/react-native'; import { AGREED, METRICS_OPT_IN } from '../../constants/storage'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../store/storage-wrapper'; jest.mock('@sentry/react-native', () => ({ captureException: jest.fn(), @@ -13,7 +13,7 @@ const mockedWithScope = jest.mocked(withScope); describe('Logger', () => { beforeEach(() => { - DefaultPreference.get = jest.fn((key: string) => { + StorageWrapper.getItem = jest.fn((key: string) => { switch (key) { case METRICS_OPT_IN: return Promise.resolve(AGREED); @@ -37,7 +37,7 @@ describe('Logger', () => { }); it('skips captureException if metrics is opted out', async () => { - DefaultPreference.get = jest.fn((key: string) => { + StorageWrapper.getItem = jest.fn((key: string) => { switch (key) { case METRICS_OPT_IN: return Promise.resolve(''); diff --git a/app/util/Logger/index.ts b/app/util/Logger/index.ts index 5b23c94788f..0a6a77f6706 100644 --- a/app/util/Logger/index.ts +++ b/app/util/Logger/index.ts @@ -3,7 +3,7 @@ import { captureException, withScope, } from '@sentry/react-native'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../store/storage-wrapper'; import { METRICS_OPT_IN, AGREED, DEBUG } from '../../constants/storage'; interface ExtraInfo { @@ -39,7 +39,7 @@ export class AsyncLogger { } // Check if user passed accepted opt-in to metrics - const metricsOptIn = await DefaultPreference.get(METRICS_OPT_IN); + const metricsOptIn = await StorageWrapper.getItem(METRICS_OPT_IN); if (metricsOptIn === AGREED) { addBreadcrumb({ message: JSON.stringify(args), @@ -70,7 +70,7 @@ export class AsyncLogger { } // Check if user passed accepted opt-in to metrics - const metricsOptIn = await DefaultPreference.get(METRICS_OPT_IN); + const metricsOptIn = await StorageWrapper.getItem(METRICS_OPT_IN); if (metricsOptIn === AGREED) { let exception = error; diff --git a/app/util/authentication/updateAuthTypeStorageFlags.ts b/app/util/authentication/updateAuthTypeStorageFlags.ts index 4b2eaa2b8bb..ed5ae44f9ea 100644 --- a/app/util/authentication/updateAuthTypeStorageFlags.ts +++ b/app/util/authentication/updateAuthTypeStorageFlags.ts @@ -1,4 +1,4 @@ -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; import { BIOMETRY_CHOICE_DISABLED, PASSCODE_DISABLED, @@ -10,10 +10,10 @@ export const updateAuthTypeStorageFlags = async ( newBiometryChoice: boolean, ) => { if (!newBiometryChoice) { - await AsyncStorage.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); - await AsyncStorage.setItem(PASSCODE_DISABLED, TRUE); + await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); + await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); } else { - await AsyncStorage.removeItem(BIOMETRY_CHOICE_DISABLED); - await AsyncStorage.removeItem(PASSCODE_DISABLED); + await StorageWrapper.removeItem(BIOMETRY_CHOICE_DISABLED); + await StorageWrapper.removeItem(PASSCODE_DISABLED); } }; diff --git a/app/util/confirmation/transactions.test.ts b/app/util/confirmation/transactions.test.ts new file mode 100644 index 00000000000..1c124ff1fd6 --- /dev/null +++ b/app/util/confirmation/transactions.test.ts @@ -0,0 +1,138 @@ +import { BN } from 'ethereumjs-util'; +import { buildTransactionParams } from './transactions'; +import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; +import { TransactionEnvelopeType } from '@metamask/transaction-controller'; + +const ADDRESS_MOCK = '0x1399b0dab86bf1f995BB8aAD9c03D090dA6dFd27'; + +describe('Confirmation Transactions Utils', () => { + describe('buildTransactionParams', () => { + it('checksums from and to address', () => { + const transactionParams = buildTransactionParams({ + gasDataEIP1559: {}, + gasDataLegacy: {}, + gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, + showCustomNonce: false, + transaction: { + from: ADDRESS_MOCK.toLowerCase(), + to: ADDRESS_MOCK.toLowerCase(), + }, + }); + + expect(transactionParams.from).toBe(ADDRESS_MOCK); + expect(transactionParams.to).toBe(ADDRESS_MOCK); + }); + + it('converts value to hexadecimal string', () => { + const transactionParams = buildTransactionParams({ + gasDataEIP1559: {}, + gasDataLegacy: {}, + gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, + showCustomNonce: false, + transaction: { + value: new BN(255), + }, + }); + + expect(transactionParams.value).toBe('0xff'); + }); + + it('converts nonce to hexadecimal string if showCustomNonce is true', () => { + const transactionParams = buildTransactionParams({ + gasDataEIP1559: {}, + gasDataLegacy: {}, + gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, + showCustomNonce: true, + transaction: { + nonce: new BN(255), + }, + }); + + expect(transactionParams.nonce).toBe('0xff'); + }); + + it('normalizes gas properties if estimate type is fee market and no envelope type', () => { + const transactionParams = buildTransactionParams({ + gasDataEIP1559: { + gasLimitHex: 'AA', + suggestedMaxFeePerGasHex: 'BB', + suggestedMaxPriorityFeePerGasHex: 'CC', + estimatedBaseFeeHex: 'DD', + }, + gasDataLegacy: {}, + gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, + showCustomNonce: false, + transaction: { + gas: '0x1', + gasPrice: '0x2', + maxFeePerGas: '0x3', + maxPriorityFeePerGas: '0x4', + estimatedBaseFee: '0x5', + }, + }); + + expect(transactionParams).toStrictEqual( + expect.objectContaining({ + gas: '0xAA', + gasPrice: undefined, + maxFeePerGas: '0xBB', + maxPriorityFeePerGas: '0xCC', + estimatedBaseFee: '0xDD', + }), + ); + }); + + it('normalizes gas properties if estimate type is fee market and envelope type is legacy', () => { + const transactionParams = buildTransactionParams({ + gasDataEIP1559: {}, + gasDataLegacy: { + suggestedGasLimitHex: 'AA', + suggestedGasPriceHex: 'BB', + }, + gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, + showCustomNonce: false, + transaction: { + type: TransactionEnvelopeType.legacy, + gas: '0x1', + gasPrice: '0x2', + maxFeePerGas: '0x3', + maxPriorityFeePerGas: '0x4', + estimatedBaseFee: '0x5', + }, + }); + + expect(transactionParams).toStrictEqual( + expect.objectContaining({ + gas: '0xAA', + gasPrice: '0xBB', + }), + ); + }); + + it('normalizes gas properties if estimate type is legacy', () => { + const transactionParams = buildTransactionParams({ + gasDataEIP1559: {}, + gasDataLegacy: { + suggestedGasLimitHex: 'AA', + suggestedGasPriceHex: 'BB', + }, + gasEstimateType: GAS_ESTIMATE_TYPES.LEGACY, + showCustomNonce: false, + transaction: { + gas: '0x1', + gasPrice: '0x2', + maxFeePerGas: '0x3', + maxPriorityFeePerGas: '0x4', + estimatedBaseFee: '0x5', + }, + }); + + expect(transactionParams).toStrictEqual( + expect.objectContaining({ + gas: '0xAA', + gasPrice: '0xBB', + }), + ); + }); + }); +}); diff --git a/app/util/confirmation/transactions.ts b/app/util/confirmation/transactions.ts new file mode 100644 index 00000000000..4efcfbb0df2 --- /dev/null +++ b/app/util/confirmation/transactions.ts @@ -0,0 +1,64 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { + GAS_ESTIMATE_TYPES, + GasEstimateType, +} from '@metamask/gas-fee-controller'; +import { + TransactionEnvelopeType, + TransactionParams, +} from '@metamask/transaction-controller'; +import { addHexPrefix, safeBNToHex } from '../number'; +import { safeToChecksumAddress } from '../address'; + +// eslint-disable-next-line import/prefer-default-export +export function buildTransactionParams({ + gasDataEIP1559, + gasDataLegacy, + gasEstimateType, + showCustomNonce, + transaction, +}: { + gasDataEIP1559: any; + gasDataLegacy: any; + gasEstimateType: GasEstimateType; + showCustomNonce: boolean; + transaction: any; +}): TransactionParams { + const transactionParams: TransactionParams = { ...transaction }; + const { nonce, value } = transaction; + const { type } = transactionParams; + + transactionParams.from = safeToChecksumAddress(transaction.from) as string; + transactionParams.nonce = showCustomNonce ? safeBNToHex(nonce) : undefined; + transactionParams.to = safeToChecksumAddress(transaction.to); + transactionParams.value = safeBNToHex(value); + + if ( + gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET && + type !== TransactionEnvelopeType.legacy + ) { + const { + estimatedBaseFeeHex, + gasLimitHex, + suggestedMaxFeePerGasHex, + suggestedMaxPriorityFeePerGasHex, + } = gasDataEIP1559; + + transactionParams.gas = addHexPrefix(gasLimitHex); + transactionParams.gasPrice = undefined; + transactionParams.maxFeePerGas = addHexPrefix(suggestedMaxFeePerGasHex); + transactionParams.maxPriorityFeePerGas = addHexPrefix( + suggestedMaxPriorityFeePerGasHex, + ); + transactionParams.estimatedBaseFee = addHexPrefix(estimatedBaseFeeHex); + } else { + const { suggestedGasLimitHex, suggestedGasPriceHex } = gasDataLegacy; + + transactionParams.gas = addHexPrefix(suggestedGasLimitHex); + transactionParams.gasPrice = addHexPrefix(suggestedGasPriceHex); + transactionParams.maxFeePerGas = undefined; + transactionParams.maxPriorityFeePerGas = undefined; + } + + return transactionParams; +} diff --git a/app/util/conversions.js b/app/util/conversions.js index cda381bb6a2..9b568005942 100644 --- a/app/util/conversions.js +++ b/app/util/conversions.js @@ -1,5 +1,4 @@ import { ETH, GWEI, WEI } from './custom-gas'; -import { addHexPrefix } from './number'; import { conversionUtil, addCurrencies, @@ -7,10 +6,6 @@ import { } from './conversion'; import { formatCurrency } from './confirm-tx.js'; -export function bnToHex(inputBn) { - return addHexPrefix(inputBn.toString(16)); -} - export function hexToDecimal(hexValue) { return conversionUtil(hexValue, { fromNumericBase: 'hex', diff --git a/app/util/importAdditionalAccounts.js b/app/util/importAdditionalAccounts.js index 20268bda465..9b015ce661b 100644 --- a/app/util/importAdditionalAccounts.js +++ b/app/util/importAdditionalAccounts.js @@ -1,6 +1,5 @@ import Engine from '../core/Engine'; import { BNToHex } from '../util/number'; -import EthQuery from 'ethjs-query'; import Logger from '../util/Logger'; import ExtendedKeyringTypes from '../../app/constants/keyringTypes'; @@ -30,10 +29,9 @@ const getBalance = async (address, ethQuery) => * Add additional accounts in the wallet based on balance */ export default async () => { - const { KeyringController, NetworkController } = Engine.context; - const { provider } = NetworkController.getProviderAndBlockTracker(); + const { KeyringController } = Engine.context; - const ethQuery = new EthQuery(provider); + const ethQuery = Engine.getGlobalEthQuery(); let accounts = await KeyringController.getAccounts(); let lastBalance = await getBalance(accounts[accounts.length - 1], ethQuery); diff --git a/app/util/metrics/UserSettingsAnalyticsMetaData/UserProfileAnalyticsMetaData.types.ts b/app/util/metrics/UserSettingsAnalyticsMetaData/UserProfileAnalyticsMetaData.types.ts index c91cdb5865d..353b7dae8cc 100644 --- a/app/util/metrics/UserSettingsAnalyticsMetaData/UserProfileAnalyticsMetaData.types.ts +++ b/app/util/metrics/UserSettingsAnalyticsMetaData/UserProfileAnalyticsMetaData.types.ts @@ -13,7 +13,8 @@ export enum UserProfileProperty { export interface UserProfileMetaData { [UserProfileProperty.ENABLE_OPENSEA_API]: string; [UserProfileProperty.NFT_AUTODETECTION]: string; - [UserProfileProperty.THEME]: string; + //Appearance.getColorScheme() can return null or undefined + [UserProfileProperty.THEME]: string | null | undefined; [UserProfileProperty.TOKEN_DETECTION]: string; [UserProfileProperty.MULTI_ACCOUNT_BALANCE]: string; [UserProfileProperty.SECURITY_PROVIDERS]: string; diff --git a/app/util/number/index.js b/app/util/number/index.js index 73b2a841f74..0e1a0d3f769 100644 --- a/app/util/number/index.js +++ b/app/util/number/index.js @@ -859,3 +859,11 @@ export const formatValueToMatchTokenDecimals = (value, decimal) => { } return value; }; + +export const safeBNToHex = (value) => { + if (value === null || value === undefined) { + return value; + } + + return BNToHex(value); +}; diff --git a/app/util/number/index.test.ts b/app/util/number/index.test.ts index aa314949193..190b0a0e44d 100644 --- a/app/util/number/index.test.ts +++ b/app/util/number/index.test.ts @@ -26,6 +26,7 @@ import { renderFiat, renderFromTokenMinimalUnit, renderFromWei, + safeBNToHex, safeNumberToBN, toBN, toHexadecimal, @@ -988,3 +989,16 @@ describe('Number utils :: formatValueToMatchTokenDecimals', () => { expect(formatValueToMatchTokenDecimals('1.234567', 4)).toBe('1.2346'); }); }); + +describe('Number utils :: safeBNToHex', () => { + it('returns hex string', () => { + expect(safeBNToHex(new BN('255'))).toBe('0xff'); + }); + + it.each([undefined, null])( + 'returns original value if input is %s', + (value) => { + expect(safeBNToHex(value)).toBe(value); + }, + ); +}); diff --git a/app/util/onboarding/index.test.ts b/app/util/onboarding/index.test.ts index baa62eb10e0..ed29990daca 100644 --- a/app/util/onboarding/index.test.ts +++ b/app/util/onboarding/index.test.ts @@ -1,5 +1,5 @@ import { shouldShowSmartTransactionsOptInModal } from './index'; -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; import { NETWORKS_CHAIN_ID } from '../../constants/network'; import { store } from '../../store'; @@ -9,7 +9,7 @@ const getMockState = (optInModalAppVersionSeen: string | null) => ({ }, }); -jest.mock('../../store/async-storage-wrapper'); +jest.mock('../../store/storage-wrapper'); jest.mock('../../store', () => ({ store: { @@ -21,12 +21,12 @@ jest.mock('../../store', () => ({ describe('shouldShowSmartTransactionOptInModal', () => { beforeEach(() => { // Clear all instances and calls to constructor and all methods: - (AsyncStorage.getItem as jest.Mock).mockClear(); + (StorageWrapper.getItem as jest.Mock).mockClear(); (store.getState as jest.Mock).mockClear(); }); it('returns true if a user has not seen the modal, is on Ethereum mainnet with default RPC URL and has non-zero balance', async () => { - (AsyncStorage.getItem as jest.Mock).mockResolvedValueOnce('7.24.0'); // currentAppVersion + (StorageWrapper.getItem as jest.Mock).mockResolvedValueOnce('7.24.0'); // currentAppVersion (store.getState as jest.Mock).mockReturnValueOnce(getMockState(null)); // versionSeen const result = await shouldShowSmartTransactionsOptInModal( @@ -53,7 +53,7 @@ describe('shouldShowSmartTransactionOptInModal', () => { ); it('returns false if user has seen the modal', async () => { - (AsyncStorage.getItem as jest.Mock).mockResolvedValueOnce('7.24.0'); // currentAppVersion + (StorageWrapper.getItem as jest.Mock).mockResolvedValueOnce('7.24.0'); // currentAppVersion (store.getState as jest.Mock).mockReturnValueOnce(getMockState('7.24.0')); // versionSeen const result = await shouldShowSmartTransactionsOptInModal( @@ -65,7 +65,7 @@ describe('shouldShowSmartTransactionOptInModal', () => { }); it('returns false if app version is not correct', async () => { - (AsyncStorage.getItem as jest.Mock).mockResolvedValueOnce('7.0.0'); // currentAppVersion + (StorageWrapper.getItem as jest.Mock).mockResolvedValueOnce('7.0.0'); // currentAppVersion (store.getState as jest.Mock).mockReturnValueOnce(getMockState(null)); // versionSeen const result = await shouldShowSmartTransactionsOptInModal( @@ -77,7 +77,7 @@ describe('shouldShowSmartTransactionOptInModal', () => { }); it('returns false if a user has 0 balance on Ethereum Mainnet with default RPC URL', async () => { - (AsyncStorage.getItem as jest.Mock).mockResolvedValueOnce('7.24.0'); // currentAppVersion + (StorageWrapper.getItem as jest.Mock).mockResolvedValueOnce('7.24.0'); // currentAppVersion (store.getState as jest.Mock).mockReturnValueOnce(getMockState(null)); // versionSeen const result = await shouldShowSmartTransactionsOptInModal( diff --git a/app/util/onboarding/index.ts b/app/util/onboarding/index.ts index a5c381a61a8..3afd4ad6a6c 100644 --- a/app/util/onboarding/index.ts +++ b/app/util/onboarding/index.ts @@ -6,7 +6,7 @@ import { LAST_APP_VERSION, } from '../../constants/storage'; import { whatsNewList } from '../../components/UI/WhatsNewModal'; -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; import { NETWORKS_CHAIN_ID } from '../../constants/network'; import { store } from '../../store'; @@ -40,7 +40,7 @@ export const shouldShowSmartTransactionsOptInModal = async ( const versionSeen = store.getState().smartTransactions.optInModalAppVersionSeen; - const currentAppVersion = await AsyncStorage.getItem(CURRENT_APP_VERSION); + const currentAppVersion = await StorageWrapper.getItem(CURRENT_APP_VERSION); // Check if user has seen const seen = isVersionSeenAndGreaterThanMinAppVersion( @@ -66,12 +66,12 @@ export const shouldShowSmartTransactionsOptInModal = async ( * @returns Boolean indicating whether or not to show whats new modal */ export const shouldShowWhatsNewModal = async () => { - const whatsNewAppVersionSeen = await AsyncStorage.getItem( + const whatsNewAppVersionSeen = await StorageWrapper.getItem( WHATS_NEW_APP_VERSION_SEEN, ); - const currentAppVersion = await AsyncStorage.getItem(CURRENT_APP_VERSION); - const lastAppVersion = await AsyncStorage.getItem(LAST_APP_VERSION); + const currentAppVersion = await StorageWrapper.getItem(CURRENT_APP_VERSION); + const lastAppVersion = await StorageWrapper.getItem(LAST_APP_VERSION); const isUpdate = !!lastAppVersion && currentAppVersion !== lastAppVersion; const seen = isVersionSeenAndGreaterThanMinAppVersion( diff --git a/app/util/sentry/utils.js b/app/util/sentry/utils.js index 353e839970f..d5edfa95593 100644 --- a/app/util/sentry/utils.js +++ b/app/util/sentry/utils.js @@ -2,7 +2,7 @@ import * as Sentry from '@sentry/react-native'; import { Dedupe, ExtraErrorData } from '@sentry/integrations'; import extractEthJsErrorMessage from '../extractEthJsErrorMessage'; -import DefaultPreference from 'react-native-default-preference'; +import StorageWrapper from '../../store/storage-wrapper'; import { regex } from '../regex'; import { AGREED, METRICS_OPT_IN } from '../../constants/storage'; import { isTest } from '../test/utils'; @@ -480,7 +480,7 @@ export function setupSentry() { const init = async () => { const dsn = process.env.MM_SENTRY_DSN; - const metricsOptIn = await DefaultPreference.get(METRICS_OPT_IN); + const metricsOptIn = await StorageWrapper.getItem(METRICS_OPT_IN); const integrations = [new Dedupe(), new ExtraErrorData()]; const environment = deriveSentryEnvironment( diff --git a/app/util/smart-transactions/smart-publish-hook.ts b/app/util/smart-transactions/smart-publish-hook.ts index 2756f9bb5db..15b15a922cd 100644 --- a/app/util/smart-transactions/smart-publish-hook.ts +++ b/app/util/smart-transactions/smart-publish-hook.ts @@ -434,9 +434,9 @@ class SmartTransactionHook { this.#transactionController.state.swapsTransactions || {}; newSwapsTransactions[id] = newSwapsTransactions[this.#transactionMeta.id]; - this.#transactionController.update({ - // @ts-expect-error This is not defined on the type, but is a field added in app/components/UI/Swaps/QuotesView.js - swapsTransactions: newSwapsTransactions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this.#transactionController as any).update((state: any) => { + state.swapsTransactions = newSwapsTransactions; }); }; } diff --git a/app/util/termsOfUse/termsOfUse.ts b/app/util/termsOfUse/termsOfUse.ts index f0686818081..e24eaacf2fb 100644 --- a/app/util/termsOfUse/termsOfUse.ts +++ b/app/util/termsOfUse/termsOfUse.ts @@ -4,10 +4,10 @@ import { TRUE, USE_TERMS } from '../../constants/storage'; import Routes from '../../constants/navigation/Routes'; import { strings } from '../../../locales/i18n'; import { TermsOfUseModalSelectorsIDs } from '../../../e2e/selectors/Modals/TermsOfUseModal.selectors'; -import AsyncStorage from '../../store/async-storage-wrapper'; +import StorageWrapper from '../../store/storage-wrapper'; const onConfirmUseTerms = async () => { - await AsyncStorage.setItem(USE_TERMS, TRUE); + await StorageWrapper.setItem(USE_TERMS, TRUE); MetaMetrics.getInstance().trackEvent(MetaMetricsEvents.USER_TERMS_ACCEPTED); }; @@ -20,7 +20,7 @@ export default async function navigateTermsOfUse( // eslint-disable-next-line @typescript-eslint/no-explicit-any navigate: (key: string, params: any) => void, ) { - const isUseTermsAccepted = await AsyncStorage.getItem(USE_TERMS); + const isUseTermsAccepted = await StorageWrapper.getItem(USE_TERMS); if (!isUseTermsAccepted) { navigate(Routes.MODAL.ROOT_MODAL_FLOW, { screen: Routes.MODAL.MODAL_MANDATORY, diff --git a/app/util/test/initial-root-state.ts b/app/util/test/initial-root-state.ts index 34592f70ff4..00340ebb8b6 100644 --- a/app/util/test/initial-root-state.ts +++ b/app/util/test/initial-root-state.ts @@ -7,6 +7,7 @@ import { initialState as initialSmartTransactions } from '../../core/redux/slice import { initialState as transactionMetrics } from '../../core/redux/slices/transactionMetrics'; import { initialState as originThrottling } from '../../core/redux/slices/originThrottling'; import initialBackgroundState from './initial-background-state.json'; +import { userInitialState } from '../../reducers/user'; // A cast is needed here because we use enums in some controllers, and TypeScript doesn't consider // the string value of an enum as satisfying an enum type. @@ -25,7 +26,7 @@ const initialRootState: RootState = { alert: undefined, transaction: undefined, smartTransactions: initialSmartTransactions, - user: {}, + user: userInitialState, wizard: undefined, onboarding: undefined, notification: undefined, diff --git a/app/util/test/testSetup.js b/app/util/test/testSetup.js index 3b8b49ba068..707c9202d89 100644 --- a/app/util/test/testSetup.js +++ b/app/util/test/testSetup.js @@ -313,9 +313,9 @@ jest.mock('redux-persist', () => ({ createMigrate: jest.fn(), })); -jest.mock('react-native-default-preference', () => ({ - get: jest.fn(), - set: jest.fn(), +jest.mock('../../store/storage-wrapper', () => ({ + getItem: jest.fn(), + setItem: jest.fn(), })); // eslint-disable-next-line import/no-commonjs diff --git a/app/util/transactions/index.js b/app/util/transactions/index.js index 7ce75b038c7..71614e75e97 100644 --- a/app/util/transactions/index.js +++ b/app/util/transactions/index.js @@ -353,9 +353,11 @@ export async function isSmartContractAddress(address, chainId) { ) { return Promise.resolve(true); } - const { TransactionController } = Engine.context; + + const ethQuery = Engine.getGlobalEthQuery(); + const code = address - ? await query(TransactionController.ethQuery, 'getCode', [address]) + ? await query(ethQuery, 'getCode', [address]) : undefined; const isSmartContract = isSmartContractCode(code); return isSmartContract; @@ -517,7 +519,7 @@ export function getEther(ticker) { * @param {object} config.addressBook - Object of address book entries * @param {string} config.chainId - network id * @param {string} config.toAddress - hex address of tx recipient - * @param {array} config.identities - array of accounts objects from AccountsController + * @param {array} config.internalAccounts - array of accounts objects from AccountsController * @param {string} config.ensRecipient - name of ens recipient * @returns {string} - recipient name */ diff --git a/app/util/transactions/index.test.ts b/app/util/transactions/index.test.ts index 8fe8e62b347..98c019f9696 100644 --- a/app/util/transactions/index.test.ts +++ b/app/util/transactions/index.test.ts @@ -53,11 +53,7 @@ const ENGINE_MOCK = Engine as jest.MockedClass; jest.mock('../../util/transaction-controller'); -ENGINE_MOCK.context = { - TransactionController: { - ethQuery: null, - }, -}; +ENGINE_MOCK.getGlobalEthQuery = () => null; const MOCK_ADDRESS1 = '0x0001'; const MOCK_ADDRESS2 = '0x0002'; diff --git a/locales/i18n.js b/locales/i18n.js index 9fcea45a053..06030b1346a 100644 --- a/locales/i18n.js +++ b/locales/i18n.js @@ -1,5 +1,5 @@ import ReactNative from 'react-native'; -import AsyncStorage from '../app/store/async-storage-wrapper'; +import StorageWrapper from '../app/store/storage-wrapper'; import I18n from 'react-native-i18n'; // eslint-disable-next-line import/no-nodejs-modules import { EventEmitter } from 'events'; @@ -98,7 +98,7 @@ export const isRTL = false; // currentLocale.indexOf('jaJp') === 0; export async function setLocale(locale) { I18n.locale = locale; // Platform.OS === 'ios' && getLocaleData(locale); - await AsyncStorage.setItem(LANGUAGE, locale); + await StorageWrapper.setItem(LANGUAGE, locale); I18nEvents.emit('localeChanged', locale); } @@ -133,7 +133,7 @@ export function strings(name, params = {}) { // Allow persist locale after app closed async function getUserPreferableLocale() { - const locale = await AsyncStorage.getItem(LANGUAGE); + const locale = await StorageWrapper.getItem(LANGUAGE); if (locale) { I18n.locale = locale; } diff --git a/locales/languages/en.json b/locales/languages/en.json index 86d43a486c5..a816896e42f 100644 --- a/locales/languages/en.json +++ b/locales/languages/en.json @@ -501,6 +501,29 @@ "token_details": "Token details" } }, + "nft_details": { + "bought_for": "Bought for", + "highest_floor_price": "Highest floor price", + "data_unavailable": "data unavailable", + "price_unavailable": "price unavailable", + "rank": "Rank", + "contract_address": "Contract address", + "token_id": "Token ID", + "token_symbol": "Token symbol", + "token_standard": "Token standard", + "date_created": "Date created", + "unique_token_holders": "Unique token holders", + "tokens_in_collection": "Tokens in collection", + "creator_address": "Creator address", + "last_sold": "Last sold", + "highest_current_bid": "Highest current bid", + "options" :{ + "view_on_os": "View on OpenSea", + "remove_nft": "Remove NFT" + }, + "attributes": "Attributes", + "disclaimer": "Disclaimer: MetaMask pulls the media file from the source URL. This URL is sometimes changed by the marketplace the NFT was minted on." + }, "activity_view": { "title": "Activity" }, diff --git a/package.json b/package.json index c87ca9ee328..222ada838a5 100644 --- a/package.json +++ b/package.json @@ -148,7 +148,7 @@ "@ledgerhq/react-native-hw-transport-ble": "^6.32.3", "@metamask/accounts-controller": "^14.0.0", "@metamask/address-book-controller": "^4.0.1", - "@metamask/approval-controller": "^3.5.2", + "@metamask/approval-controller": "^7.0.1", "@metamask/assets-controllers": "^30.0.0", "@metamask/base-controller": "^5.0.0", "@metamask/composable-controller": "^3.0.0", @@ -156,6 +156,7 @@ "@metamask/controller-utils": "^10.0.0", "@metamask/design-tokens": "^4.0.0", "@metamask/eth-ledger-bridge-keyring": "^4.1.0", + "@metamask/eth-query": "^4.0.0", "@metamask/eth-sig-util": "^7.0.2", "@metamask/etherscan-link": "^2.0.0", "@metamask/gas-fee-controller": "^18.0.0", @@ -191,7 +192,7 @@ "@metamask/snaps-utils": "^7.7.0", "@metamask/swappable-obj-proxy": "^2.1.0", "@metamask/swaps-controller": "^9.0.1", - "@metamask/transaction-controller": "^13.0.0", + "@metamask/transaction-controller": "^35.0.0", "@metamask/utils": "^8.1.0", "@ngraveio/bc-ur": "^1.1.6", "@notifee/react-native": "^7.8.2", diff --git a/patches/@metamask+approval-controller+3.5.2.patch b/patches/@metamask+approval-controller+3.5.2.patch deleted file mode 100644 index b7ffd41ac9e..00000000000 --- a/patches/@metamask+approval-controller+3.5.2.patch +++ /dev/null @@ -1,155 +0,0 @@ -diff --git a/node_modules/@metamask/approval-controller/dist/.patch.txt b/node_modules/@metamask/approval-controller/dist/.patch.txt -new file mode 100644 -index 0000000..a846e43 ---- /dev/null -+++ b/node_modules/@metamask/approval-controller/dist/.patch.txt -@@ -0,0 +1,7 @@ -+PATCH GENERATED FROM MetaMask/core branch: patch/mobile-approval-controller-3-5-2 -+This patch backports various transaction controller features from the main branch of MetaMask/core -+Steps to update patch: -+* Create a new core branch from: patch/mobile-approval-controller-3-5-2 -+* Run "yarn build" in the core monorepo -+* Run "yarn patch:approval " in the mobile repo -+* Once the new patch is merged, add your changes to: patch/mobile-approval-controller-3-5-2 -diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts b/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts -index 32f61cb..4e4d7a1 100644 ---- a/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts -+++ b/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts -@@ -99,6 +99,12 @@ export declare type AcceptOptions = { - * If false or unspecified, the promise will resolve immediately. - */ - waitForResult?: boolean; -+ /** -+ * Whether to delete the approval request after a result callback is called. -+ * If false or unspecified, the approval request will be deleted immediately. -+ * Ignored if `waitForResult` is false or unspecified. -+ */ -+ deleteAfterResult?: boolean; - }; - export declare type StartFlowOptions = OptionalField; - export declare type EndFlowOptions = Pick; -diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts.map b/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts.map -deleted file mode 100644 -index 1c9cfb4..0000000 ---- a/node_modules/@metamask/approval-controller/dist/ApprovalController.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"ApprovalController.d.ts","sourceRoot":"","sources":["../src/ApprovalController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAcnC,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAE7D,QAAA,MAAM,cAAc,uBAAuB,CAAC;AAyB5C,aAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AAEvD,aAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AAOxD,aAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,aAAK,aAAa,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC;CACvC,CAAC;AAIF,oBAAY,eAAe,CAAC,WAAW,SAAS,mBAAmB,IAAI;IACrE;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH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V,KAAK,CAAC,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC;IA8BxB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAIxC;;;;;OAKG;IACH,KAAK,CAAC,cAAc,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,IAAI;IAWtD;;;;;;OAMG;IACH,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI;IAYzD;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,uBAAuB;IAa/D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc;IAmB9B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,yBAAyB;IAcjE;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;IAQhE;;;;;;;;OAQG;IACG,KAAK,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;CAoO3D;AAED,eAAe,kBAAkB,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.js b/node_modules/@metamask/approval-controller/dist/ApprovalController.js -index 3709ab3..89f57c3 100644 ---- a/node_modules/@metamask/approval-controller/dist/ApprovalController.js -+++ b/node_modules/@metamask/approval-controller/dist/ApprovalController.js -@@ -19,7 +19,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; --var _ApprovalController_instances, _ApprovalController_approvals, _ApprovalController_origins, _ApprovalController_showApprovalRequest, _ApprovalController_typesExcludedFromRateLimiting, _ApprovalController_add, _ApprovalController_validateAddParams, _ApprovalController_addPendingApprovalOrigin, _ApprovalController_addToStore, _ApprovalController_delete, _ApprovalController_deleteApprovalAndGetCallbacks, _ApprovalController_result; -+var _ApprovalController_instances, _ApprovalController_approvals, _ApprovalController_origins, _ApprovalController_showApprovalRequest, _ApprovalController_typesExcludedFromRateLimiting, _ApprovalController_add, _ApprovalController_validateAddParams, _ApprovalController_addPendingApprovalOrigin, _ApprovalController_addToStore, _ApprovalController_delete, _ApprovalController_getCallbacks, _ApprovalController_result; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ApprovalController = exports.APPROVAL_TYPE_RESULT_SUCCESS = exports.APPROVAL_TYPE_RESULT_ERROR = exports.ORIGIN_METAMASK = void 0; - const base_controller_1 = require("@metamask/base-controller"); -@@ -227,7 +227,12 @@ class ApprovalController extends base_controller_1.BaseControllerV2 { - accept(id, value, options) { - // Safe to cast as the delete method below will throw if the ID is not found - const approval = this.get(id); -- const requestPromise = __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_deleteApprovalAndGetCallbacks).call(this, id); -+ const requestPromise = __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_getCallbacks).call(this, id); -+ let requestDeleted = false; -+ if (!(options === null || options === void 0 ? void 0 : options.deleteAfterResult) || !options.waitForResult) { -+ __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_delete).call(this, id); -+ requestDeleted = true; -+ } - return new Promise((resolve, reject) => { - const resultCallbacks = { - success: (acceptValue) => resolve({ value: acceptValue }), -@@ -245,6 +250,10 @@ class ApprovalController extends base_controller_1.BaseControllerV2 { - if (!(options === null || options === void 0 ? void 0 : options.waitForResult)) { - resolve({ value: undefined }); - } -+ }).finally(() => { -+ if (!requestDeleted) { -+ __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_delete).call(this, id); -+ } - }); - } - /** -@@ -255,7 +264,9 @@ class ApprovalController extends base_controller_1.BaseControllerV2 { - * @param error - The error to reject the approval promise with. - */ - reject(id, error) { -- __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_deleteApprovalAndGetCallbacks).call(this, id).reject(error); -+ const callbacks = __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_getCallbacks).call(this, id); -+ __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_delete).call(this, id); -+ callbacks.reject(error); - } - /** - * Rejects and deletes all approval requests. -@@ -441,10 +452,10 @@ _ApprovalController_approvals = new WeakMap(), _ApprovalController_origins = new - draftState.pendingApprovalCount = Object.keys(draftState.pendingApprovals).length; - }); - }, _ApprovalController_delete = function _ApprovalController_delete(id) { -+ if (!__classPrivateFieldGet(this, _ApprovalController_approvals, "f").has(id)) { -+ throw new errors_1.ApprovalRequestNotFoundError(id); -+ } - __classPrivateFieldGet(this, _ApprovalController_approvals, "f").delete(id); -- // This method is only called after verifying that the approval with the -- // specified id exists. -- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const { origin, type } = this.state.pendingApprovals[id]; - const originMap = __classPrivateFieldGet(this, _ApprovalController_origins, "f").get(origin); - const originTotalCount = this.getApprovalCount({ origin }); -@@ -459,12 +470,11 @@ _ApprovalController_approvals = new WeakMap(), _ApprovalController_origins = new - delete draftState.pendingApprovals[id]; - draftState.pendingApprovalCount = Object.keys(draftState.pendingApprovals).length; - }); --}, _ApprovalController_deleteApprovalAndGetCallbacks = function _ApprovalController_deleteApprovalAndGetCallbacks(id) { -+}, _ApprovalController_getCallbacks = function _ApprovalController_getCallbacks(id) { - const callbacks = __classPrivateFieldGet(this, _ApprovalController_approvals, "f").get(id); - if (!callbacks) { - throw new errors_1.ApprovalRequestNotFoundError(id); - } -- __classPrivateFieldGet(this, _ApprovalController_instances, "m", _ApprovalController_delete).call(this, id); - return callbacks; - }, _ApprovalController_result = function _ApprovalController_result(type, opts, requestData) { - return __awaiter(this, void 0, void 0, function* () { -diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.js.map b/node_modules/@metamask/approval-controller/dist/ApprovalController.js.map -deleted file mode 100644 -index 6235ddf..0000000 ---- a/node_modules/@metamask/approval-controller/dist/ApprovalController.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"ApprovalController.js","sourceRoot":"","sources":["../src/ApprovalController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAA6D;AAG7D,mDAA2C;AAE3C,mCAAgC;AAEhC,qCAMkB;AAElB,YAAY;AAEZ,0CAA0C;AAC7B,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,0BAA0B,GAAG,cAAc,CAAC;AAC5C,QAAA,4BAA4B,GAAG,gBAAgB,CAAC;AAE7D,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C,MAAM,aAAa,GAAG;IACpB,gBAAgB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;IACrD,oBAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;IAC1D,aAAa,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;CACpD,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE,CAChE,oBAAoB,IAAI,gCAAgC,MAAM,gBAAgB,CAAC;AAEjF,MAAM,eAAe,GAAG,GAA4B,EAAE;IACpD,OAAO;QACL,gBAAgB,EAAE,EAAE;QACpB,oBAAoB,EAAE,CAAC;QACvB,aAAa,EAAE,EAAE;KAClB,CAAC;AACJ,CAAC,CAAC;AAgSF;;;;;;;;GAQG;AACH,MAAa,kBAAmB,SAAQ,kCAIvC;IASC;;;;;;;;;OASG;IACH,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,KAAK,GAAG,EAAE,EACV,6BAA6B,GAAG,EAAE,GACR;QAC1B,KAAK,CAAC;YACJ,IAAI,EAAE,cAAc;YACpB,QAAQ,E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EAAE;oBACd,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;iBACnE;aACF;SACF;IACH,CAAC;;AAGH,kBAAe,kBAAkB,CAAC","sourcesContent":["import type { RestrictedControllerMessenger } from '@metamask/base-controller';\nimport { BaseControllerV2 } from '@metamask/base-controller';\nimport type { Json, OptionalField } from '@metamask/utils';\nimport type { EthereumRpcError } from 'eth-rpc-errors';\nimport { ethErrors } from 'eth-rpc-errors';\nimport type { Patch } from 'immer';\nimport { nanoid } from 'nanoid';\n\nimport {\n ApprovalRequestNotFoundError,\n ApprovalRequestNoResultSupportError,\n EndInvalidFlowError,\n NoApprovalFlowsError,\n MissingApprovalFlowError,\n} from './errors';\n\n// Constants\n\n// Avoiding dependency on controller-utils\nexport const ORIGIN_METAMASK = 'metamask';\nexport const APPROVAL_TYPE_RESULT_ERROR = 'result_error';\nexport const APPROVAL_TYPE_RESULT_SUCCESS = 'result_success';\n\nconst controllerName = 'ApprovalController';\n\nconst stateMetadata = {\n pendingApprovals: { persist: false, anonymous: true },\n pendingApprovalCount: { persist: false, anonymous: false },\n approvalFlows: { persist: false, anonymous: false },\n};\n\nconst getAlreadyPendingMessage = (origin: string, type: string) =>\n `Request of type '${type}' already pending for origin ${origin}. Please wait.`;\n\nconst getDefaultState = (): ApprovalControllerState => {\n return {\n pendingApprovals: {},\n pendingApprovalCount: 0,\n approvalFlows: [],\n };\n};\n\n// Internal Types\n\ntype ApprovalPromiseResolve = (value?: unknown | AddResult) => void;\n\ntype ApprovalPromiseReject = (error?: unknown) => void;\n\ntype ApprovalRequestData = Record | null;\n\ntype ApprovalRequestState = Record | null;\n\ntype ApprovalCallbacks = {\n resolve: ApprovalPromiseResolve;\n reject: ApprovalPromiseReject;\n};\n\ntype ApprovalFlow = {\n id: string;\n loadingText: string | null;\n};\n\ntype ResultOptions = {\n flowToEnd?: string;\n header?: (string | ResultComponent)[];\n};\n\n// Miscellaneous Types\n\nexport type ApprovalRequest = {\n /**\n * The ID of the approval request.\n */\n id: string;\n\n /**\n * The origin of the approval request.\n */\n origin: string;\n\n /**\n * The time that the request was received, per Date.now().\n */\n time: number;\n\n /**\n * The type of the approval request.\n */\n type: string;\n\n /**\n * Additional data associated with the request.\n * TODO:TS4.4 make optional\n */\n requestData: RequestData;\n\n /**\n * Additional mutable state associated with the request\n */\n requestState: ApprovalRequestState;\n\n /**\n * Whether the request expects a result object to be returned instead of just the approval value.\n */\n expectsResult: boolean;\n};\n\nexport type ApprovalFlowState = ApprovalFlow;\n\nexport type ApprovalControllerState = {\n pendingApprovals: Record>>;\n pendingApprovalCount: number;\n approvalFlows: ApprovalFlowState[];\n};\n\nexport type ApprovalControllerMessenger = RestrictedControllerMessenger<\n typeof controllerName,\n ApprovalControllerActions,\n ApprovalControllerEvents,\n string,\n string\n>;\n\n// Option Types\n\nexport type ShowApprovalRequest = () => void | Promise;\n\nexport type ResultComponent = {\n /**\n * A unique identifier for this instance of the component.\n */\n key: string;\n\n /**\n * The name of the component to render.\n */\n name: string;\n\n /**\n * Any properties required by the component.\n */\n properties?: Record;\n\n /**\n * Any child components to render inside the component.\n */\n children?: string | ResultComponent | (string | ResultComponent)[];\n};\n\nexport type ApprovalControllerOptions = {\n messenger: ApprovalControllerMessenger;\n showApprovalRequest: ShowApprovalRequest;\n state?: Partial;\n typesExcludedFromRateLimiting?: string[];\n};\n\nexport type AddApprovalOptions = {\n id?: string;\n origin: string;\n type: string;\n requestData?: Record;\n requestState?: Record;\n expectsResult?: boolean;\n};\n\nexport type UpdateRequestStateOptions = {\n id: string;\n requestState: Record;\n};\n\nexport type AcceptOptions = {\n /**\n * Whether to resolve the returned promise only when the request creator indicates the success of the\n * post-approval logic using the result callbacks.\n * If false or unspecified, the promise will resolve immediately.\n */\n waitForResult?: boolean;\n};\n\nexport type StartFlowOptions = OptionalField<\n ApprovalFlow,\n 'id' | 'loadingText'\n>;\n\nexport type EndFlowOptions = Pick;\n\nexport type SetFlowLoadingTextOptions = ApprovalFlow;\n\nexport type SuccessOptions = ResultOptions & {\n message?: string | ResultComponent | (string | ResultComponent)[];\n};\n\nexport type ErrorOptions = ResultOptions & {\n error?: string | ResultComponent | (string | ResultComponent)[];\n};\n\n// Result Types\n\nexport type AcceptResultCallbacks = {\n /**\n * Inform the request acceptor that the post-approval logic was successful.\n *\n * @param value - An optional value generated by the post-approval logic.\n */\n success: (value?: unknown) => void;\n\n /**\n * Inform the request acceptor that the post-approval logic failed.\n *\n * @param error - The reason for the failure.\n */\n error: (error: Error) => void;\n};\n\nexport type AddResult = {\n /**\n * An optional value provided by the request acceptor.\n */\n value?: unknown;\n\n /**\n * Callback functions that must be used to indicate to the request acceptor whether the post-approval logic was successful or not.\n * Will be undefined if the request acceptor did not specify that they want to wait for a result.\n */\n resultCallbacks?: AcceptResultCallbacks;\n};\n\nexport type AcceptResult = {\n /**\n * An optional value provided by the request creator when indicating a successful result.\n */\n value?: unknown;\n};\n\nexport type ApprovalFlowStartResult = ApprovalFlow;\n\nexport type SuccessResult = Record;\n\nexport type ErrorResult = Record;\n\n// Event Types\n\nexport type ApprovalStateChange = {\n type: `${typeof controllerName}:stateChange`;\n payload: [ApprovalControllerState, Patch[]];\n};\n\nexport type ApprovalControllerEvents = ApprovalStateChange;\n\n// Action Types\n\nexport type GetApprovalsState = {\n type: `${typeof controllerName}:getState`;\n handler: () => ApprovalControllerState;\n};\n\nexport type ClearApprovalRequests = {\n type: `${typeof controllerName}:clearRequests`;\n handler: (error: EthereumRpcError) => void;\n};\n\nexport type AddApprovalRequest = {\n type: `${typeof controllerName}:addRequest`;\n handler: (\n opts: AddApprovalOptions,\n shouldShowRequest: boolean,\n ) => ReturnType;\n};\n\nexport type HasApprovalRequest = {\n type: `${typeof controllerName}:hasRequest`;\n handler: ApprovalController['has'];\n};\n\nexport type AcceptRequest = {\n type: `${typeof controllerName}:acceptRequest`;\n handler: ApprovalController['accept'];\n};\n\nexport type RejectRequest = {\n type: `${typeof controllerName}:rejectRequest`;\n handler: ApprovalController['reject'];\n};\n\nexport type UpdateRequestState = {\n type: `${typeof controllerName}:updateRequestState`;\n handler: ApprovalController['updateRequestState'];\n};\n\nexport type StartFlow = {\n type: `${typeof controllerName}:startFlow`;\n handler: ApprovalController['startFlow'];\n};\n\nexport type EndFlow = {\n type: `${typeof controllerName}:endFlow`;\n handler: ApprovalController['endFlow'];\n};\n\nexport type SetFlowLoadingText = {\n type: `${typeof controllerName}:setFlowLoadingText`;\n handler: ApprovalController['setFlowLoadingText'];\n};\n\nexport type ShowSuccess = {\n type: `${typeof controllerName}:showSuccess`;\n handler: ApprovalController['success'];\n};\n\nexport type ShowError = {\n type: `${typeof controllerName}:showError`;\n handler: ApprovalController['error'];\n};\n\nexport type ApprovalControllerActions =\n | GetApprovalsState\n | ClearApprovalRequests\n | AddApprovalRequest\n | HasApprovalRequest\n | AcceptRequest\n | RejectRequest\n | UpdateRequestState\n | StartFlow\n | EndFlow\n | SetFlowLoadingText\n | ShowSuccess\n | ShowError;\n\n/**\n * Controller for managing requests that require user approval.\n *\n * Enables limiting the number of pending requests by origin and type, counting\n * pending requests, and more.\n *\n * Adding a request returns a promise that resolves or rejects when the request\n * is approved or denied, respectively.\n */\nexport class ApprovalController extends BaseControllerV2<\n typeof controllerName,\n ApprovalControllerState,\n ApprovalControllerMessenger\n> {\n #approvals: Map;\n\n #origins: Map>;\n\n #showApprovalRequest: () => void;\n\n #typesExcludedFromRateLimiting: string[];\n\n /**\n * Construct an Approval controller.\n *\n * @param options - The controller options.\n * @param options.showApprovalRequest - Function for opening the UI such that\n * the request can be displayed to the user.\n * @param options.messenger - The restricted controller messenger for the Approval controller.\n * @param options.state - The initial controller state.\n * @param options.typesExcludedFromRateLimiting - Array of aproval types which allow multiple pending approval requests from the same origin.\n */\n constructor({\n messenger,\n showApprovalRequest,\n state = {},\n typesExcludedFromRateLimiting = [],\n }: ApprovalControllerOptions) {\n super({\n name: controllerName,\n metadata: stateMetadata,\n messenger,\n state: { ...getDefaultState(), ...state },\n });\n\n this.#approvals = new Map();\n this.#origins = new Map();\n this.#showApprovalRequest = showApprovalRequest;\n this.#typesExcludedFromRateLimiting = typesExcludedFromRateLimiting;\n this.registerMessageHandlers();\n }\n\n /**\n * Constructor helper for registering this controller's messaging system\n * actions.\n */\n private registerMessageHandlers(): void {\n this.messagingSystem.registerActionHandler(\n `${controllerName}:clearRequests` as const,\n this.clear.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:addRequest` as const,\n (opts: AddApprovalOptions, shouldShowRequest: boolean) => {\n if (shouldShowRequest) {\n return this.addAndShowApprovalRequest(opts);\n }\n return this.add(opts);\n },\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:hasRequest` as const,\n this.has.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:acceptRequest` as const,\n this.accept.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:rejectRequest` as const,\n this.reject.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:updateRequestState` as const,\n this.updateRequestState.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:startFlow` as const,\n this.startFlow.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:endFlow` as const,\n this.endFlow.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:setFlowLoadingText` as const,\n this.setFlowLoadingText.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:showSuccess` as const,\n this.success.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:showError` as const,\n this.error.bind(this),\n );\n }\n\n /**\n * Adds an approval request per the given arguments, calls the show approval\n * request function, and returns the associated approval promise resolving to\n * an AddResult object.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * @param opts.requestState - Additional state associated with the request,\n * if any.\n * @returns The approval promise resolving to an AddResult object.\n */\n addAndShowApprovalRequest(\n opts: AddApprovalOptions & { expectsResult: true },\n ): Promise;\n\n /**\n * Adds an approval request per the given arguments, calls the show approval\n * request function, and returns the associated approval promise resolving\n * to a value provided during acceptance.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * @param opts.requestState - Additional state associated with the request,\n * if any.\n * @returns The approval promise resolving to a value provided during acceptance.\n */\n addAndShowApprovalRequest(opts: AddApprovalOptions): Promise;\n\n addAndShowApprovalRequest(opts: AddApprovalOptions): Promise {\n const promise = this.#add(\n opts.origin,\n opts.type,\n opts.id,\n opts.requestData,\n opts.requestState,\n opts.expectsResult,\n );\n this.#showApprovalRequest();\n return promise;\n }\n\n /**\n * Adds an approval request per the given arguments and returns the approval\n * promise resolving to an AddResult object.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * if any.\n * @returns The approval promise resolving to an AddResult object.\n */\n add(opts: AddApprovalOptions & { expectsResult: true }): Promise;\n\n /**\n * Adds an approval request per the given arguments and returns the approval\n * promise resolving to a value provided during acceptance.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * if any.\n * @returns The approval promise resolving to a value provided during acceptance.\n */\n add(opts: AddApprovalOptions): Promise;\n\n add(opts: AddApprovalOptions): Promise {\n return this.#add(\n opts.origin,\n opts.type,\n opts.id,\n opts.requestData,\n opts.requestState,\n opts.expectsResult,\n );\n }\n\n /**\n * Gets the info for the approval request with the given id.\n *\n * @param id - The id of the approval request.\n * @returns The approval request data associated with the id.\n */\n get(id: string): ApprovalRequest | undefined {\n return this.state.pendingApprovals[id];\n }\n\n /**\n * Gets the number of pending approvals, by origin and/or type.\n *\n * If only `origin` is specified, all approvals for that origin will be\n * counted, regardless of type.\n * If only `type` is specified, all approvals for that type will be counted,\n * regardless of origin.\n * If both `origin` and `type` are specified, 0 or 1 will be returned.\n *\n * @param opts - The approval count options.\n * @param opts.origin - An approval origin.\n * @param opts.type - The type of the approval request.\n * @returns The current approval request count for the given origin and/or\n * type.\n */\n getApprovalCount(opts: { origin?: string; type?: string } = {}): number {\n if (!opts.origin && !opts.type) {\n throw new Error('Must specify origin, type, or both.');\n }\n const { origin, type: _type } = opts;\n\n if (origin && _type) {\n return this.#origins.get(origin)?.get(_type) || 0;\n }\n\n if (origin) {\n return Array.from(\n (this.#origins.get(origin) || new Map()).values(),\n ).reduce((total, value) => total + value, 0);\n }\n\n // Only \"type\" was specified\n let count = 0;\n for (const approval of Object.values(this.state.pendingApprovals)) {\n if (approval.type === _type) {\n count += 1;\n }\n }\n return count;\n }\n\n /**\n * Get the total count of all pending approval requests for all origins.\n *\n * @returns The total pending approval request count.\n */\n getTotalApprovalCount(): number {\n return this.state.pendingApprovalCount;\n }\n\n /**\n * Checks if there's a pending approval request per the given parameters.\n * At least one parameter must be specified. An error will be thrown if the\n * parameters are invalid.\n *\n * If `id` is specified, all other parameters will be ignored.\n * If `id` is not specified, the method will check for requests that match\n * all of the specified parameters.\n *\n * @param opts - Options bag.\n * @param opts.id - The ID to check for.\n * @param opts.origin - The origin to check for.\n * @param opts.type - The type to check for.\n * @returns `true` if a matching approval is found, and `false` otherwise.\n */\n has(opts: { id?: string; origin?: string; type?: string } = {}): boolean {\n const { id, origin, type: _type } = opts;\n\n if (id) {\n if (typeof id !== 'string') {\n throw new Error('May not specify non-string id.');\n }\n return this.#approvals.has(id);\n }\n\n if (_type && typeof _type !== 'string') {\n throw new Error('May not specify non-string type.');\n }\n\n if (origin) {\n if (typeof origin !== 'string') {\n throw new Error('May not specify non-string origin.');\n }\n\n // Check origin and type pair if type also specified\n if (_type) {\n return Boolean(this.#origins.get(origin)?.get(_type));\n }\n return this.#origins.has(origin);\n }\n\n if (_type) {\n for (const approval of Object.values(this.state.pendingApprovals)) {\n if (approval.type === _type) {\n return true;\n }\n }\n return false;\n }\n throw new Error(\n 'Must specify a valid combination of id, origin, and type.',\n );\n }\n\n /**\n * Resolves the promise of the approval with the given id, and deletes the\n * approval. Throws an error if no such approval exists.\n *\n * @param id - The id of the approval request.\n * @param value - The value to resolve the approval promise with.\n * @param options - Options bag.\n * @returns A promise that either resolves once a result is provided by\n * the creator of the approval request, or immediately if `options.waitForResult`\n * is `false` or `undefined`.\n */\n accept(\n id: string,\n value?: unknown,\n options?: AcceptOptions,\n ): Promise {\n // Safe to cast as the delete method below will throw if the ID is not found\n const approval = this.get(id) as ApprovalRequest;\n const requestPromise = this.#deleteApprovalAndGetCallbacks(id);\n\n return new Promise((resolve, reject) => {\n const resultCallbacks: AcceptResultCallbacks = {\n success: (acceptValue?: unknown) => resolve({ value: acceptValue }),\n error: reject,\n };\n\n if (options?.waitForResult && !approval.expectsResult) {\n reject(new ApprovalRequestNoResultSupportError(id));\n return;\n }\n\n const resultValue = options?.waitForResult ? resultCallbacks : undefined;\n\n const resolveValue = approval.expectsResult\n ? { value, resultCallbacks: resultValue }\n : value;\n\n requestPromise.resolve(resolveValue);\n\n if (!options?.waitForResult) {\n resolve({ value: undefined });\n }\n });\n }\n\n /**\n * Rejects the promise of the approval with the given id, and deletes the\n * approval. Throws an error if no such approval exists.\n *\n * @param id - The id of the approval request.\n * @param error - The error to reject the approval promise with.\n */\n reject(id: string, error: unknown): void {\n this.#deleteApprovalAndGetCallbacks(id).reject(error);\n }\n\n /**\n * Rejects and deletes all approval requests.\n *\n * @param rejectionError - The EthereumRpcError to reject the approval\n * requests with.\n */\n clear(rejectionError: EthereumRpcError): void {\n for (const id of this.#approvals.keys()) {\n this.reject(id, rejectionError);\n }\n this.#origins.clear();\n this.update((draftState) => {\n draftState.pendingApprovals = {};\n draftState.pendingApprovalCount = 0;\n });\n }\n\n /**\n * Updates the request state of the approval with the given id.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request.\n * @param opts.requestState - Additional data associated with the request\n */\n updateRequestState(opts: UpdateRequestStateOptions): void {\n if (!this.state.pendingApprovals[opts.id]) {\n throw new ApprovalRequestNotFoundError(opts.id);\n }\n\n this.update((draftState) => {\n // Typecast: ts(2589)\n draftState.pendingApprovals[opts.id].requestState =\n opts.requestState as any;\n });\n }\n\n /**\n * Starts a new approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval flow.\n * @param opts.loadingText - The loading text that will be associated to the approval flow.\n * @returns The object containing the approval flow id.\n */\n startFlow(opts: StartFlowOptions = {}): ApprovalFlowStartResult {\n const id = opts.id ?? nanoid();\n const loadingText = opts.loadingText ?? null;\n\n this.update((draftState) => {\n draftState.approvalFlows.push({ id, loadingText });\n });\n\n this.#showApprovalRequest();\n\n return { id, loadingText };\n }\n\n /**\n * Ends the current approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval flow that will be finished.\n */\n endFlow({ id }: EndFlowOptions) {\n if (!this.state.approvalFlows.length) {\n throw new NoApprovalFlowsError();\n }\n\n const currentFlow = this.state.approvalFlows.slice(-1)[0];\n\n if (id !== currentFlow.id) {\n throw new EndInvalidFlowError(\n id,\n this.state.approvalFlows.map((flow) => flow.id),\n );\n }\n\n this.update((draftState) => {\n draftState.approvalFlows.pop();\n });\n }\n\n /**\n * Sets the loading text for the approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The approval flow loading text that will be displayed.\n * @param opts.loadingText - The loading text that will be associated to the approval flow.\n */\n setFlowLoadingText({ id, loadingText }: SetFlowLoadingTextOptions) {\n const flowIndex = this.state.approvalFlows.findIndex(\n (flow) => flow.id === id,\n );\n\n if (flowIndex === -1) {\n throw new MissingApprovalFlowError(id);\n }\n\n this.update((draftState) => {\n draftState.approvalFlows[flowIndex].loadingText = loadingText;\n });\n }\n\n /**\n * Show a success page.\n *\n * @param opts - Options bag.\n * @param opts.message - The message text or components to display in the page.\n * @param opts.header - The text or components to display in the header of the page.\n * @param opts.flowToEnd - The ID of the approval flow to end once the success page is approved.\n * @returns Empty object to support future additions.\n */\n async success(opts: SuccessOptions = {}): Promise {\n await this.#result(APPROVAL_TYPE_RESULT_SUCCESS, opts, {\n message: opts.message,\n header: opts.header,\n } as any);\n return {};\n }\n\n /**\n * Show an error page.\n *\n * @param opts - Options bag.\n * @param opts.message - The message text or components to display in the page.\n * @param opts.header - The text or components to display in the header of the page.\n * @param opts.flowToEnd - The ID of the approval flow to end once the error page is approved.\n * @returns Empty object to support future additions.\n */\n async error(opts: ErrorOptions = {}): Promise {\n await this.#result(APPROVAL_TYPE_RESULT_ERROR, opts, {\n error: opts.error,\n header: opts.header,\n } as any);\n return {};\n }\n\n /**\n * Implementation of add operation.\n *\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param id - The id of the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n * @param expectsResult - Whether the approval request expects a result object to be returned.\n * @returns The approval promise.\n */\n #add(\n origin: string,\n type: string,\n id: string = nanoid(),\n requestData?: Record,\n requestState?: Record,\n expectsResult?: boolean,\n ): Promise {\n this.#validateAddParams(id, origin, type, requestData, requestState);\n\n if (\n !this.#typesExcludedFromRateLimiting.includes(type) &&\n this.has({ origin, type })\n ) {\n throw ethErrors.rpc.resourceUnavailable(\n getAlreadyPendingMessage(origin, type),\n );\n }\n\n // add pending approval\n return new Promise((resolve, reject) => {\n this.#approvals.set(id, { resolve, reject });\n this.#addPendingApprovalOrigin(origin, type);\n\n this.#addToStore(\n id,\n origin,\n type,\n requestData,\n requestState,\n expectsResult,\n );\n });\n }\n\n /**\n * Validates parameters to the add method.\n *\n * @param id - The id of the approval request.\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n */\n #validateAddParams(\n id: string,\n origin: string,\n type: string,\n requestData?: Record,\n requestState?: Record,\n ): void {\n let errorMessage = null;\n if (!id || typeof id !== 'string') {\n errorMessage = 'Must specify non-empty string id.';\n } else if (this.#approvals.has(id)) {\n errorMessage = `Approval request with id '${id}' already exists.`;\n } else if (!origin || typeof origin !== 'string') {\n errorMessage = 'Must specify non-empty string origin.';\n } else if (!type || typeof type !== 'string') {\n errorMessage = 'Must specify non-empty string type.';\n } else if (\n requestData &&\n (typeof requestData !== 'object' || Array.isArray(requestData))\n ) {\n errorMessage = 'Request data must be a plain object if specified.';\n } else if (\n requestState &&\n (typeof requestState !== 'object' || Array.isArray(requestState))\n ) {\n errorMessage = 'Request state must be a plain object if specified.';\n }\n\n if (errorMessage) {\n throw ethErrors.rpc.internal(errorMessage);\n }\n }\n\n /**\n * Adds an entry to _origins.\n * Performs no validation.\n *\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n */\n #addPendingApprovalOrigin(origin: string, type: string): void {\n let originMap = this.#origins.get(origin);\n\n if (!originMap) {\n originMap = new Map();\n this.#origins.set(origin, originMap);\n }\n\n const currentValue = originMap.get(type) || 0;\n originMap.set(type, currentValue + 1);\n }\n\n /**\n * Adds an entry to the store.\n * Performs no validation.\n *\n * @param id - The id of the approval request.\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n * @param expectsResult - Whether the request expects a result object to be returned.\n */\n #addToStore(\n id: string,\n origin: string,\n type: string,\n requestData?: Record,\n requestState?: Record,\n expectsResult?: boolean,\n ): void {\n const approval: ApprovalRequest | null> = {\n id,\n origin,\n type,\n time: Date.now(),\n requestData: requestData || null,\n requestState: requestState || null,\n expectsResult: expectsResult || false,\n };\n\n this.update((draftState) => {\n // Typecast: ts(2589)\n draftState.pendingApprovals[id] = approval as any;\n draftState.pendingApprovalCount = Object.keys(\n draftState.pendingApprovals,\n ).length;\n });\n }\n\n /**\n * Deletes the approval with the given id. The approval promise must be\n * resolved or reject before this method is called.\n * Deletion is an internal operation because approval state is solely\n * managed by this controller.\n *\n * @param id - The id of the approval request to be deleted.\n */\n #delete(id: string): void {\n this.#approvals.delete(id);\n\n // This method is only called after verifying that the approval with the\n // specified id exists.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { origin, type } = this.state.pendingApprovals[id]!;\n\n const originMap = this.#origins.get(origin) as Map;\n const originTotalCount = this.getApprovalCount({ origin });\n const originTypeCount = originMap.get(type) as number;\n\n if (originTotalCount === 1) {\n this.#origins.delete(origin);\n } else {\n originMap.set(type, originTypeCount - 1);\n }\n\n this.update((draftState) => {\n delete draftState.pendingApprovals[id];\n draftState.pendingApprovalCount = Object.keys(\n draftState.pendingApprovals,\n ).length;\n });\n }\n\n /**\n * Gets the approval callbacks for the given id, deletes the entry, and then\n * returns the callbacks for promise resolution.\n * Throws an error if no approval is found for the given id.\n *\n * @param id - The id of the approval request.\n * @returns The promise callbacks associated with the approval request.\n */\n #deleteApprovalAndGetCallbacks(id: string): ApprovalCallbacks {\n const callbacks = this.#approvals.get(id);\n if (!callbacks) {\n throw new ApprovalRequestNotFoundError(id);\n }\n\n this.#delete(id);\n return callbacks;\n }\n\n async #result(\n type: string,\n opts: ResultOptions,\n requestData: Record,\n ) {\n try {\n await this.addAndShowApprovalRequest({\n origin: ORIGIN_METAMASK,\n type,\n requestData,\n });\n } catch (error) {\n console.info('Failed to display result page', error);\n } finally {\n if (opts.flowToEnd) {\n try {\n this.endFlow({ id: opts.flowToEnd });\n } catch (error) {\n console.info('Failed to end flow', { id: opts.flowToEnd, error });\n }\n }\n }\n }\n}\n\nexport default ApprovalController;\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/approval-controller/dist/errors.d.ts.map b/node_modules/@metamask/approval-controller/dist/errors.d.ts.map -deleted file mode 100644 -index 43e92d5..0000000 ---- a/node_modules/@metamask/approval-controller/dist/errors.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,EAAE,EAAE,MAAM;CAGvB;AAED,qBAAa,mCAAoC,SAAQ,KAAK;gBAChD,EAAE,EAAE,MAAM;CAKvB;AAED,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;CAO1C;AAED,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,EAAE,EAAE,MAAM;CAGvB"} -\ No newline at end of file -diff --git a/node_modules/@metamask/approval-controller/dist/errors.js.map b/node_modules/@metamask/approval-controller/dist/errors.js.map -deleted file mode 100644 -index c709895..0000000 ---- a/node_modules/@metamask/approval-controller/dist/errors.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,4BAA6B,SAAQ,KAAK;IACrD,YAAY,EAAU;QACpB,KAAK,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;CACF;AAJD,oEAIC;AAED,MAAa,mCAAoC,SAAQ,KAAK;IAC5D,YAAY,EAAU;QACpB,KAAK,CACH,6DAA6D,EAAE,wBAAwB,CACxF,CAAC;IACJ,CAAC;CACF;AAND,kFAMC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACpC,CAAC;CACF;AAJD,oDAIC;AAED,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,EAAU,EAAE,OAAiB;QACvC,KAAK,CACH,kCAAkC,EAAE,gDAClC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACrB,iBAAiB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtC,CAAC;IACJ,CAAC;CACF;AARD,kDAQC;AAED,MAAa,wBAAyB,SAAQ,KAAK;IACjD,YAAY,EAAU;QACpB,KAAK,CAAC,oCAAoC,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAJD,4DAIC","sourcesContent":["export class ApprovalRequestNotFoundError extends Error {\n constructor(id: string) {\n super(`Approval request with id '${id}' not found.`);\n }\n}\n\nexport class ApprovalRequestNoResultSupportError extends Error {\n constructor(id: string) {\n super(\n `Approval acceptance requested result but request with id '${id}' does not support it.`,\n );\n }\n}\n\nexport class NoApprovalFlowsError extends Error {\n constructor() {\n super(`No approval flows found.`);\n }\n}\n\nexport class EndInvalidFlowError extends Error {\n constructor(id: string, flowIds: string[]) {\n super(\n `Attempted to end flow with id '${id}' which does not match current flow with id '${\n flowIds.slice(-1)[0]\n }'. All Flows: ${flowIds.join(', ')}`,\n );\n }\n}\n\nexport class MissingApprovalFlowError extends Error {\n constructor(id: string) {\n super(`No approval flows found with id '${id}'.`);\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/approval-controller/dist/index.d.ts.map b/node_modules/@metamask/approval-controller/dist/index.d.ts.map -deleted file mode 100644 -index ae4b431..0000000 ---- a/node_modules/@metamask/approval-controller/dist/index.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/approval-controller/dist/index.js.map b/node_modules/@metamask/approval-controller/dist/index.js.map -deleted file mode 100644 -index af114e6..0000000 ---- a/node_modules/@metamask/approval-controller/dist/index.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2CAAyB","sourcesContent":["export * from './ApprovalController';\nexport * from './errors';\n"]} -\ No newline at end of file diff --git a/patches/@metamask+approval-controller+7.0.1.patch b/patches/@metamask+approval-controller+7.0.1.patch new file mode 100644 index 00000000000..00d9a66d426 --- /dev/null +++ b/patches/@metamask+approval-controller+7.0.1.patch @@ -0,0 +1,422 @@ +diff --git a/node_modules/@metamask/approval-controller/dist/.patch.txt b/node_modules/@metamask/approval-controller/dist/.patch.txt +new file mode 100644 +index 0000000..550de56 +--- /dev/null ++++ b/node_modules/@metamask/approval-controller/dist/.patch.txt +@@ -0,0 +1,7 @@ ++PATCH GENERATED FROM MetaMask/core branch: patch/mobile-approval-controller-7-0-1 ++This patch backports various transaction controller features from the main branch of MetaMask/core ++Steps to update patch: ++* Create a new core branch from: patch/mobile-approval-controller-7-0-1 ++* Run "yarn build" in the core monorepo ++* Run "yarn patch:approval " in the mobile repo ++* Once the new patch is merged, add your changes to: patch/mobile-approval-controller-7-0-1 +diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.js b/node_modules/@metamask/approval-controller/dist/ApprovalController.js +index 21178e9..db8fdcf 100644 +--- a/node_modules/@metamask/approval-controller/dist/ApprovalController.js ++++ b/node_modules/@metamask/approval-controller/dist/ApprovalController.js +@@ -4,7 +4,7 @@ + + + +-var _chunkPMXPCCKSjs = require('./chunk-PMXPCCKS.js'); ++var _chunkNONDXCHJjs = require('./chunk-NONDXCHJ.js'); + require('./chunk-LKCXZAKD.js'); + + +@@ -12,5 +12,5 @@ require('./chunk-LKCXZAKD.js'); + + + +-exports.APPROVAL_TYPE_RESULT_ERROR = _chunkPMXPCCKSjs.APPROVAL_TYPE_RESULT_ERROR; exports.APPROVAL_TYPE_RESULT_SUCCESS = _chunkPMXPCCKSjs.APPROVAL_TYPE_RESULT_SUCCESS; exports.ApprovalController = _chunkPMXPCCKSjs.ApprovalController; exports.ORIGIN_METAMASK = _chunkPMXPCCKSjs.ORIGIN_METAMASK; exports.default = _chunkPMXPCCKSjs.ApprovalController_default; ++exports.APPROVAL_TYPE_RESULT_ERROR = _chunkNONDXCHJjs.APPROVAL_TYPE_RESULT_ERROR; exports.APPROVAL_TYPE_RESULT_SUCCESS = _chunkNONDXCHJjs.APPROVAL_TYPE_RESULT_SUCCESS; exports.ApprovalController = _chunkNONDXCHJjs.ApprovalController; exports.ORIGIN_METAMASK = _chunkNONDXCHJjs.ORIGIN_METAMASK; exports.default = _chunkNONDXCHJjs.ApprovalController_default; + //# sourceMappingURL=ApprovalController.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.js.map b/node_modules/@metamask/approval-controller/dist/ApprovalController.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/approval-controller/dist/ApprovalController.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs b/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs +index a6f0950..664ec6b 100644 +--- a/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs ++++ b/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs +@@ -4,7 +4,7 @@ import { + ApprovalController, + ApprovalController_default, + ORIGIN_METAMASK +-} from "./chunk-PIJZDVKC.mjs"; ++} from "./chunk-CZANKQ6E.mjs"; + import "./chunk-C4VZRQ2J.mjs"; + export { + APPROVAL_TYPE_RESULT_ERROR, +diff --git a/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs.map b/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/approval-controller/dist/ApprovalController.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/chunk-C4VZRQ2J.mjs.map b/node_modules/@metamask/approval-controller/dist/chunk-C4VZRQ2J.mjs.map +deleted file mode 100644 +index 0df9138..0000000 +--- a/node_modules/@metamask/approval-controller/dist/chunk-C4VZRQ2J.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["export class ApprovalRequestNotFoundError extends Error {\n constructor(id: string) {\n super(`Approval request with id '${id}' not found.`);\n }\n}\n\nexport class ApprovalRequestNoResultSupportError extends Error {\n constructor(id: string) {\n super(\n `Approval acceptance requested result but request with id '${id}' does not support it.`,\n );\n }\n}\n\nexport class NoApprovalFlowsError extends Error {\n constructor() {\n super(`No approval flows found.`);\n }\n}\n\nexport class EndInvalidFlowError extends Error {\n constructor(id: string, flowIds: string[]) {\n super(\n `Attempted to end flow with id '${id}' which does not match current flow with id '${\n flowIds.slice(-1)[0]\n }'. All Flows: ${flowIds.join(', ')}`,\n );\n }\n}\n\nexport class MissingApprovalFlowError extends Error {\n constructor(id: string) {\n super(`No approval flows found with id '${id}'.`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,+BAAN,cAA2C,MAAM;AAAA,EACtD,YAAY,IAAY;AACtB,UAAM,6BAA6B,EAAE,cAAc;AAAA,EACrD;AACF;AAEO,IAAM,sCAAN,cAAkD,MAAM;AAAA,EAC7D,YAAY,IAAY;AACtB;AAAA,MACE,6DAA6D,EAAE;AAAA,IACjE;AAAA,EACF;AACF;AAEO,IAAM,uBAAN,cAAmC,MAAM;AAAA,EAC9C,cAAc;AACZ,UAAM,0BAA0B;AAAA,EAClC;AACF;AAEO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC7C,YAAY,IAAY,SAAmB;AACzC;AAAA,MACE,kCAAkC,EAAE,gDAClC,QAAQ,MAAM,EAAE,EAAE,CAAC,CACrB,iBAAiB,QAAQ,KAAK,IAAI,CAAC;AAAA,IACrC;AAAA,EACF;AACF;AAEO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EAClD,YAAY,IAAY;AACtB,UAAM,oCAAoC,EAAE,IAAI;AAAA,EAClD;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/chunk-PIJZDVKC.mjs b/node_modules/@metamask/approval-controller/dist/chunk-CZANKQ6E.mjs +similarity index 94% +rename from node_modules/@metamask/approval-controller/dist/chunk-PIJZDVKC.mjs +rename to node_modules/@metamask/approval-controller/dist/chunk-CZANKQ6E.mjs +index 57f7b7b..573794d 100644 +--- a/node_modules/@metamask/approval-controller/dist/chunk-PIJZDVKC.mjs ++++ b/node_modules/@metamask/approval-controller/dist/chunk-CZANKQ6E.mjs +@@ -33,7 +33,7 @@ var getDefaultState = () => { + approvalFlows: [] + }; + }; +-var _approvals, _origins, _showApprovalRequest, _typesExcludedFromRateLimiting, _add, add_fn, _validateAddParams, validateAddParams_fn, _addPendingApprovalOrigin, addPendingApprovalOrigin_fn, _addToStore, addToStore_fn, _delete, delete_fn, _deleteApprovalAndGetCallbacks, deleteApprovalAndGetCallbacks_fn, _result, result_fn; ++var _approvals, _origins, _showApprovalRequest, _typesExcludedFromRateLimiting, _add, add_fn, _validateAddParams, validateAddParams_fn, _addPendingApprovalOrigin, addPendingApprovalOrigin_fn, _addToStore, addToStore_fn, _delete, delete_fn, _getCallbacks, getCallbacks_fn, _result, result_fn; + var ApprovalController = class extends BaseController { + /** + * Construct an Approval controller. +@@ -100,23 +100,15 @@ var ApprovalController = class extends BaseController { + */ + __privateAdd(this, _addToStore); + /** +- * Deletes the approval with the given id. The approval promise must be +- * resolved or reject before this method is called. ++ * Deletes the approval with the given id. ++ * + * Deletion is an internal operation because approval state is solely + * managed by this controller. + * + * @param id - The id of the approval request to be deleted. + */ + __privateAdd(this, _delete); +- /** +- * Gets the approval callbacks for the given id, deletes the entry, and then +- * returns the callbacks for promise resolution. +- * Throws an error if no approval is found for the given id. +- * +- * @param id - The id of the approval request. +- * @returns The promise callbacks associated with the approval request. +- */ +- __privateAdd(this, _deleteApprovalAndGetCallbacks); ++ __privateAdd(this, _getCallbacks); + __privateAdd(this, _result); + __privateAdd(this, _approvals, void 0); + __privateAdd(this, _origins, void 0); +@@ -306,7 +298,12 @@ var ApprovalController = class extends BaseController { + */ + accept(id, value, options) { + const approval = this.get(id); +- const requestPromise = __privateMethod(this, _deleteApprovalAndGetCallbacks, deleteApprovalAndGetCallbacks_fn).call(this, id); ++ const requestPromise = __privateMethod(this, _getCallbacks, getCallbacks_fn).call(this, id); ++ let requestDeleted = false; ++ if (!options?.deleteAfterResult || !options.waitForResult) { ++ __privateMethod(this, _delete, delete_fn).call(this, id); ++ requestDeleted = true; ++ } + return new Promise((resolve, reject) => { + const resultCallbacks = { + success: (acceptValue) => resolve({ value: acceptValue }), +@@ -322,6 +319,10 @@ var ApprovalController = class extends BaseController { + if (!options?.waitForResult) { + resolve({ value: void 0 }); + } ++ }).finally(() => { ++ if (!requestDeleted) { ++ __privateMethod(this, _delete, delete_fn).call(this, id); ++ } + }); + } + /** +@@ -332,7 +333,9 @@ var ApprovalController = class extends BaseController { + * @param error - The error to reject the approval promise with. + */ + reject(id, error) { +- __privateMethod(this, _deleteApprovalAndGetCallbacks, deleteApprovalAndGetCallbacks_fn).call(this, id).reject(error); ++ const callbacks = __privateMethod(this, _getCallbacks, getCallbacks_fn).call(this, id); ++ __privateMethod(this, _delete, delete_fn).call(this, id); ++ callbacks.reject(error); + } + /** + * Rejects and deletes all approval requests. +@@ -533,6 +536,9 @@ addToStore_fn = function(id, origin, type, requestData, requestState, expectsRes + }; + _delete = new WeakSet(); + delete_fn = function(id) { ++ if (!__privateGet(this, _approvals).has(id)) { ++ throw new ApprovalRequestNotFoundError(id); ++ } + __privateGet(this, _approvals).delete(id); + const { origin, type } = this.state.pendingApprovals[id]; + const originMap = __privateGet(this, _origins).get(origin); +@@ -550,13 +556,12 @@ delete_fn = function(id) { + ).length; + }); + }; +-_deleteApprovalAndGetCallbacks = new WeakSet(); +-deleteApprovalAndGetCallbacks_fn = function(id) { ++_getCallbacks = new WeakSet(); ++getCallbacks_fn = function(id) { + const callbacks = __privateGet(this, _approvals).get(id); + if (!callbacks) { + throw new ApprovalRequestNotFoundError(id); + } +- __privateMethod(this, _delete, delete_fn).call(this, id); + return callbacks; + }; + _result = new WeakSet(); +@@ -588,4 +593,4 @@ export { + ApprovalController, + ApprovalController_default + }; +-//# sourceMappingURL=chunk-PIJZDVKC.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-CZANKQ6E.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/chunk-LKCXZAKD.js.map b/node_modules/@metamask/approval-controller/dist/chunk-LKCXZAKD.js.map +deleted file mode 100644 +index 4834941..0000000 +--- a/node_modules/@metamask/approval-controller/dist/chunk-LKCXZAKD.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,+BAAN,cAA2C,MAAM;AAAA,EACtD,YAAY,IAAY;AACtB,UAAM,6BAA6B,EAAE,cAAc;AAAA,EACrD;AACF;AAEO,IAAM,sCAAN,cAAkD,MAAM;AAAA,EAC7D,YAAY,IAAY;AACtB;AAAA,MACE,6DAA6D,EAAE;AAAA,IACjE;AAAA,EACF;AACF;AAEO,IAAM,uBAAN,cAAmC,MAAM;AAAA,EAC9C,cAAc;AACZ,UAAM,0BAA0B;AAAA,EAClC;AACF;AAEO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC7C,YAAY,IAAY,SAAmB;AACzC;AAAA,MACE,kCAAkC,EAAE,gDAClC,QAAQ,MAAM,EAAE,EAAE,CAAC,CACrB,iBAAiB,QAAQ,KAAK,IAAI,CAAC;AAAA,IACrC;AAAA,EACF;AACF;AAEO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EAClD,YAAY,IAAY;AACtB,UAAM,oCAAoC,EAAE,IAAI;AAAA,EAClD;AACF","sourcesContent":["export class ApprovalRequestNotFoundError extends Error {\n constructor(id: string) {\n super(`Approval request with id '${id}' not found.`);\n }\n}\n\nexport class ApprovalRequestNoResultSupportError extends Error {\n constructor(id: string) {\n super(\n `Approval acceptance requested result but request with id '${id}' does not support it.`,\n );\n }\n}\n\nexport class NoApprovalFlowsError extends Error {\n constructor() {\n super(`No approval flows found.`);\n }\n}\n\nexport class EndInvalidFlowError extends Error {\n constructor(id: string, flowIds: string[]) {\n super(\n `Attempted to end flow with id '${id}' which does not match current flow with id '${\n flowIds.slice(-1)[0]\n }'. All Flows: ${flowIds.join(', ')}`,\n );\n }\n}\n\nexport class MissingApprovalFlowError extends Error {\n constructor(id: string) {\n super(`No approval flows found with id '${id}'.`);\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/chunk-PMXPCCKS.js b/node_modules/@metamask/approval-controller/dist/chunk-NONDXCHJ.js +similarity index 94% +rename from node_modules/@metamask/approval-controller/dist/chunk-PMXPCCKS.js +rename to node_modules/@metamask/approval-controller/dist/chunk-NONDXCHJ.js +index d840c27..42b4765 100644 +--- a/node_modules/@metamask/approval-controller/dist/chunk-PMXPCCKS.js ++++ b/node_modules/@metamask/approval-controller/dist/chunk-NONDXCHJ.js +@@ -33,7 +33,7 @@ var getDefaultState = () => { + approvalFlows: [] + }; + }; +-var _approvals, _origins, _showApprovalRequest, _typesExcludedFromRateLimiting, _add, add_fn, _validateAddParams, validateAddParams_fn, _addPendingApprovalOrigin, addPendingApprovalOrigin_fn, _addToStore, addToStore_fn, _delete, delete_fn, _deleteApprovalAndGetCallbacks, deleteApprovalAndGetCallbacks_fn, _result, result_fn; ++var _approvals, _origins, _showApprovalRequest, _typesExcludedFromRateLimiting, _add, add_fn, _validateAddParams, validateAddParams_fn, _addPendingApprovalOrigin, addPendingApprovalOrigin_fn, _addToStore, addToStore_fn, _delete, delete_fn, _getCallbacks, getCallbacks_fn, _result, result_fn; + var ApprovalController = class extends _basecontroller.BaseController { + /** + * Construct an Approval controller. +@@ -100,23 +100,15 @@ var ApprovalController = class extends _basecontroller.BaseController { + */ + _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _addToStore); + /** +- * Deletes the approval with the given id. The approval promise must be +- * resolved or reject before this method is called. ++ * Deletes the approval with the given id. ++ * + * Deletion is an internal operation because approval state is solely + * managed by this controller. + * + * @param id - The id of the approval request to be deleted. + */ + _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _delete); +- /** +- * Gets the approval callbacks for the given id, deletes the entry, and then +- * returns the callbacks for promise resolution. +- * Throws an error if no approval is found for the given id. +- * +- * @param id - The id of the approval request. +- * @returns The promise callbacks associated with the approval request. +- */ +- _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _deleteApprovalAndGetCallbacks); ++ _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _getCallbacks); + _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _result); + _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _approvals, void 0); + _chunkLKCXZAKDjs.__privateAdd.call(void 0, this, _origins, void 0); +@@ -306,7 +298,12 @@ var ApprovalController = class extends _basecontroller.BaseController { + */ + accept(id, value, options) { + const approval = this.get(id); +- const requestPromise = _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _deleteApprovalAndGetCallbacks, deleteApprovalAndGetCallbacks_fn).call(this, id); ++ const requestPromise = _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _getCallbacks, getCallbacks_fn).call(this, id); ++ let requestDeleted = false; ++ if (!options?.deleteAfterResult || !options.waitForResult) { ++ _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _delete, delete_fn).call(this, id); ++ requestDeleted = true; ++ } + return new Promise((resolve, reject) => { + const resultCallbacks = { + success: (acceptValue) => resolve({ value: acceptValue }), +@@ -322,6 +319,10 @@ var ApprovalController = class extends _basecontroller.BaseController { + if (!options?.waitForResult) { + resolve({ value: void 0 }); + } ++ }).finally(() => { ++ if (!requestDeleted) { ++ _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _delete, delete_fn).call(this, id); ++ } + }); + } + /** +@@ -332,7 +333,9 @@ var ApprovalController = class extends _basecontroller.BaseController { + * @param error - The error to reject the approval promise with. + */ + reject(id, error) { +- _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _deleteApprovalAndGetCallbacks, deleteApprovalAndGetCallbacks_fn).call(this, id).reject(error); ++ const callbacks = _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _getCallbacks, getCallbacks_fn).call(this, id); ++ _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _delete, delete_fn).call(this, id); ++ callbacks.reject(error); + } + /** + * Rejects and deletes all approval requests. +@@ -533,6 +536,9 @@ addToStore_fn = function(id, origin, type, requestData, requestState, expectsRes + }; + _delete = new WeakSet(); + delete_fn = function(id) { ++ if (!_chunkLKCXZAKDjs.__privateGet.call(void 0, this, _approvals).has(id)) { ++ throw new (0, _chunkLKCXZAKDjs.ApprovalRequestNotFoundError)(id); ++ } + _chunkLKCXZAKDjs.__privateGet.call(void 0, this, _approvals).delete(id); + const { origin, type } = this.state.pendingApprovals[id]; + const originMap = _chunkLKCXZAKDjs.__privateGet.call(void 0, this, _origins).get(origin); +@@ -550,13 +556,12 @@ delete_fn = function(id) { + ).length; + }); + }; +-_deleteApprovalAndGetCallbacks = new WeakSet(); +-deleteApprovalAndGetCallbacks_fn = function(id) { ++_getCallbacks = new WeakSet(); ++getCallbacks_fn = function(id) { + const callbacks = _chunkLKCXZAKDjs.__privateGet.call(void 0, this, _approvals).get(id); + if (!callbacks) { + throw new (0, _chunkLKCXZAKDjs.ApprovalRequestNotFoundError)(id); + } +- _chunkLKCXZAKDjs.__privateMethod.call(void 0, this, _delete, delete_fn).call(this, id); + return callbacks; + }; + _result = new WeakSet(); +@@ -588,4 +593,4 @@ var ApprovalController_default = ApprovalController; + + + exports.ORIGIN_METAMASK = ORIGIN_METAMASK; exports.APPROVAL_TYPE_RESULT_ERROR = APPROVAL_TYPE_RESULT_ERROR; exports.APPROVAL_TYPE_RESULT_SUCCESS = APPROVAL_TYPE_RESULT_SUCCESS; exports.ApprovalController = ApprovalController; exports.ApprovalController_default = ApprovalController_default; +-//# sourceMappingURL=chunk-PMXPCCKS.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-NONDXCHJ.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/chunk-PIJZDVKC.mjs.map b/node_modules/@metamask/approval-controller/dist/chunk-PIJZDVKC.mjs.map +deleted file mode 100644 +index 11b7edd..0000000 +--- a/node_modules/@metamask/approval-controller/dist/chunk-PIJZDVKC.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/ApprovalController.ts"],"sourcesContent":["import type { ControllerGetStateAction } from '@metamask/base-controller';\nimport {\n BaseController,\n type ControllerStateChangeEvent,\n type RestrictedControllerMessenger,\n} from '@metamask/base-controller';\nimport type { JsonRpcError, DataWithOptionalCause } from '@metamask/rpc-errors';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { Json, OptionalField } from '@metamask/utils';\nimport { nanoid } from 'nanoid';\n\nimport {\n ApprovalRequestNotFoundError,\n ApprovalRequestNoResultSupportError,\n EndInvalidFlowError,\n NoApprovalFlowsError,\n MissingApprovalFlowError,\n} from './errors';\n\n// Constants\n\n// Avoiding dependency on controller-utils\nexport const ORIGIN_METAMASK = 'metamask';\nexport const APPROVAL_TYPE_RESULT_ERROR = 'result_error';\nexport const APPROVAL_TYPE_RESULT_SUCCESS = 'result_success';\n\nconst controllerName = 'ApprovalController';\n\nconst stateMetadata = {\n pendingApprovals: { persist: false, anonymous: true },\n pendingApprovalCount: { persist: false, anonymous: false },\n approvalFlows: { persist: false, anonymous: false },\n};\n\nconst getAlreadyPendingMessage = (origin: string, type: string) =>\n `Request of type '${type}' already pending for origin ${origin}. Please wait.`;\n\nconst getDefaultState = (): ApprovalControllerState => {\n return {\n pendingApprovals: {},\n pendingApprovalCount: 0,\n approvalFlows: [],\n };\n};\n\n// Internal Types\n\ntype ApprovalPromiseResolve = (value?: unknown | AddResult) => void;\n\ntype ApprovalPromiseReject = (error?: unknown) => void;\n\ntype ApprovalRequestData = Record | null;\n\ntype ApprovalRequestState = Record | null;\n\ntype ApprovalCallbacks = {\n resolve: ApprovalPromiseResolve;\n reject: ApprovalPromiseReject;\n};\n\ntype ApprovalFlow = {\n id: string;\n loadingText: string | null;\n};\n\ntype ResultOptions = {\n flowToEnd?: string;\n header?: (string | ResultComponent)[];\n icon?: string | null;\n title?: string | null;\n};\n\n// Miscellaneous Types\n\nexport type ApprovalRequest = {\n /**\n * The ID of the approval request.\n */\n id: string;\n\n /**\n * The origin of the approval request.\n */\n origin: string;\n\n /**\n * The time that the request was received, per Date.now().\n */\n time: number;\n\n /**\n * The type of the approval request.\n * Unfortunately, not all values will match the `ApprovalType` enum, so we are using `string` here.\n * TODO: Replace `string` with `ApprovalType` when all `type` values used by the clients can be encompassed by the `ApprovalType` enum.\n */\n type: string;\n\n /**\n * Additional data associated with the request.\n */\n requestData: RequestData;\n\n /**\n * Additional mutable state associated with the request\n */\n requestState: ApprovalRequestState;\n\n /**\n * Whether the request expects a result object to be returned instead of just the approval value.\n */\n expectsResult: boolean;\n};\n\nexport type ApprovalFlowState = ApprovalFlow;\n\nexport type ApprovalControllerState = {\n pendingApprovals: Record>>;\n pendingApprovalCount: number;\n approvalFlows: ApprovalFlowState[];\n};\n\nexport type ApprovalControllerMessenger = RestrictedControllerMessenger<\n typeof controllerName,\n ApprovalControllerActions,\n ApprovalControllerEvents,\n never,\n never\n>;\n\n// Option Types\n\nexport type ShowApprovalRequest = () => void | Promise;\n\nexport type ResultComponent = {\n /**\n * A unique identifier for this instance of the component.\n */\n key: string;\n\n /**\n * The name of the component to render.\n */\n name: string;\n\n /**\n * Any properties required by the component.\n */\n properties?: Record;\n\n /**\n * Any child components to render inside the component.\n */\n children?: string | ResultComponent | (string | ResultComponent)[];\n};\n\nexport type ApprovalControllerOptions = {\n messenger: ApprovalControllerMessenger;\n showApprovalRequest: ShowApprovalRequest;\n state?: Partial;\n typesExcludedFromRateLimiting?: string[];\n};\n\nexport type AddApprovalOptions = {\n id?: string;\n origin: string;\n type: string;\n requestData?: Record;\n requestState?: Record;\n expectsResult?: boolean;\n};\n\nexport type UpdateRequestStateOptions = {\n id: string;\n requestState: Record;\n};\n\nexport type AcceptOptions = {\n /**\n * Whether to resolve the returned promise only when the request creator indicates the success of the\n * post-approval logic using the result callbacks.\n * If false or unspecified, the promise will resolve immediately.\n */\n waitForResult?: boolean;\n};\n\nexport type StartFlowOptions = OptionalField<\n ApprovalFlow,\n 'id' | 'loadingText'\n> & { show?: boolean };\n\nexport type EndFlowOptions = Pick;\n\nexport type SetFlowLoadingTextOptions = ApprovalFlow;\n\nexport type SuccessOptions = ResultOptions & {\n message?: string | ResultComponent | (string | ResultComponent)[];\n};\n\nexport type ErrorOptions = ResultOptions & {\n error?: string | ResultComponent | (string | ResultComponent)[];\n};\n\n// Result Types\n\nexport type AcceptResultCallbacks = {\n /**\n * Inform the request acceptor that the post-approval logic was successful.\n *\n * @param value - An optional value generated by the post-approval logic.\n */\n success: (value?: unknown) => void;\n\n /**\n * Inform the request acceptor that the post-approval logic failed.\n *\n * @param error - The reason for the failure.\n */\n error: (error: Error) => void;\n};\n\nexport type AddResult = {\n /**\n * An optional value provided by the request acceptor.\n */\n value?: unknown;\n\n /**\n * Callback functions that must be used to indicate to the request acceptor whether the post-approval logic was successful or not.\n * Will be undefined if the request acceptor did not specify that they want to wait for a result.\n */\n resultCallbacks?: AcceptResultCallbacks;\n};\n\nexport type AcceptResult = {\n /**\n * An optional value provided by the request creator when indicating a successful result.\n */\n value?: unknown;\n};\n\nexport type ApprovalFlowStartResult = ApprovalFlow;\n\nexport type SuccessResult = Record;\n\nexport type ErrorResult = Record;\n\n// Event Types\n\nexport type ApprovalStateChange = ControllerStateChangeEvent<\n typeof controllerName,\n ApprovalControllerState\n>;\n\nexport type ApprovalControllerEvents = ApprovalStateChange;\n\n// Action Types\n\nexport type GetApprovalsState = ControllerGetStateAction<\n typeof controllerName,\n ApprovalControllerState\n>;\n\nexport type ClearApprovalRequests = {\n type: `${typeof controllerName}:clearRequests`;\n handler: (error: JsonRpcError) => void;\n};\n\nexport type AddApprovalRequest = {\n type: `${typeof controllerName}:addRequest`;\n handler: (\n opts: AddApprovalOptions,\n shouldShowRequest: boolean,\n ) => ReturnType;\n};\n\nexport type HasApprovalRequest = {\n type: `${typeof controllerName}:hasRequest`;\n handler: ApprovalController['has'];\n};\n\nexport type AcceptRequest = {\n type: `${typeof controllerName}:acceptRequest`;\n handler: ApprovalController['accept'];\n};\n\nexport type RejectRequest = {\n type: `${typeof controllerName}:rejectRequest`;\n handler: ApprovalController['reject'];\n};\n\nexport type UpdateRequestState = {\n type: `${typeof controllerName}:updateRequestState`;\n handler: ApprovalController['updateRequestState'];\n};\n\nexport type StartFlow = {\n type: `${typeof controllerName}:startFlow`;\n handler: ApprovalController['startFlow'];\n};\n\nexport type EndFlow = {\n type: `${typeof controllerName}:endFlow`;\n handler: ApprovalController['endFlow'];\n};\n\nexport type SetFlowLoadingText = {\n type: `${typeof controllerName}:setFlowLoadingText`;\n handler: ApprovalController['setFlowLoadingText'];\n};\n\nexport type ShowSuccess = {\n type: `${typeof controllerName}:showSuccess`;\n handler: ApprovalController['success'];\n};\n\nexport type ShowError = {\n type: `${typeof controllerName}:showError`;\n handler: ApprovalController['error'];\n};\n\nexport type ApprovalControllerActions =\n | GetApprovalsState\n | ClearApprovalRequests\n | AddApprovalRequest\n | HasApprovalRequest\n | AcceptRequest\n | RejectRequest\n | UpdateRequestState\n | StartFlow\n | EndFlow\n | SetFlowLoadingText\n | ShowSuccess\n | ShowError;\n\n/**\n * Controller for managing requests that require user approval.\n *\n * Enables limiting the number of pending requests by origin and type, counting\n * pending requests, and more.\n *\n * Adding a request returns a promise that resolves or rejects when the request\n * is approved or denied, respectively.\n */\nexport class ApprovalController extends BaseController<\n typeof controllerName,\n ApprovalControllerState,\n ApprovalControllerMessenger\n> {\n #approvals: Map;\n\n #origins: Map>;\n\n #showApprovalRequest: () => void;\n\n #typesExcludedFromRateLimiting: string[];\n\n /**\n * Construct an Approval controller.\n *\n * @param options - The controller options.\n * @param options.showApprovalRequest - Function for opening the UI such that\n * the request can be displayed to the user.\n * @param options.messenger - The restricted controller messenger for the Approval controller.\n * @param options.state - The initial controller state.\n * @param options.typesExcludedFromRateLimiting - Array of approval types which allow multiple pending approval requests from the same origin.\n */\n constructor({\n messenger,\n showApprovalRequest,\n state = {},\n typesExcludedFromRateLimiting = [],\n }: ApprovalControllerOptions) {\n super({\n name: controllerName,\n metadata: stateMetadata,\n messenger,\n state: { ...getDefaultState(), ...state },\n });\n\n this.#approvals = new Map();\n this.#origins = new Map();\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#showApprovalRequest = showApprovalRequest;\n this.#typesExcludedFromRateLimiting = typesExcludedFromRateLimiting;\n this.registerMessageHandlers();\n }\n\n /**\n * Constructor helper for registering this controller's messaging system\n * actions.\n */\n private registerMessageHandlers(): void {\n this.messagingSystem.registerActionHandler(\n `${controllerName}:clearRequests` as const,\n this.clear.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:addRequest` as const,\n (opts: AddApprovalOptions, shouldShowRequest: boolean) => {\n if (shouldShowRequest) {\n return this.addAndShowApprovalRequest(opts);\n }\n return this.add(opts);\n },\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:hasRequest` as const,\n this.has.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:acceptRequest` as const,\n this.accept.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:rejectRequest` as const,\n this.reject.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:updateRequestState` as const,\n this.updateRequestState.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:startFlow` as const,\n this.startFlow.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:endFlow` as const,\n this.endFlow.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:setFlowLoadingText` as const,\n this.setFlowLoadingText.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:showSuccess` as const,\n this.success.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:showError` as const,\n this.error.bind(this),\n );\n }\n\n /**\n * Adds an approval request per the given arguments, calls the show approval\n * request function, and returns the associated approval promise resolving to\n * an AddResult object.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * @param opts.requestState - Additional state associated with the request,\n * if any.\n * @returns The approval promise resolving to an AddResult object.\n */\n addAndShowApprovalRequest(\n opts: AddApprovalOptions & { expectsResult: true },\n ): Promise;\n\n /**\n * Adds an approval request per the given arguments, calls the show approval\n * request function, and returns the associated approval promise resolving\n * to a value provided during acceptance.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * @param opts.requestState - Additional state associated with the request,\n * if any.\n * @returns The approval promise resolving to a value provided during acceptance.\n */\n addAndShowApprovalRequest(opts: AddApprovalOptions): Promise;\n\n addAndShowApprovalRequest(opts: AddApprovalOptions): Promise {\n const promise = this.#add(\n opts.origin,\n opts.type,\n opts.id,\n opts.requestData,\n opts.requestState,\n opts.expectsResult,\n );\n this.#showApprovalRequest();\n return promise;\n }\n\n /**\n * Adds an approval request per the given arguments and returns the approval\n * promise resolving to an AddResult object.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * if any.\n * @returns The approval promise resolving to an AddResult object.\n */\n add(opts: AddApprovalOptions & { expectsResult: true }): Promise;\n\n /**\n * Adds an approval request per the given arguments and returns the approval\n * promise resolving to a value provided during acceptance.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * if any.\n * @returns The approval promise resolving to a value provided during acceptance.\n */\n add(opts: AddApprovalOptions): Promise;\n\n add(opts: AddApprovalOptions): Promise {\n return this.#add(\n opts.origin,\n opts.type,\n opts.id,\n opts.requestData,\n opts.requestState,\n opts.expectsResult,\n );\n }\n\n /**\n * Gets the info for the approval request with the given id.\n *\n * @param id - The id of the approval request.\n * @returns The approval request data associated with the id.\n */\n get(id: string): ApprovalRequest | undefined {\n return this.state.pendingApprovals[id];\n }\n\n /**\n * Gets the number of pending approvals, by origin and/or type.\n *\n * If only `origin` is specified, all approvals for that origin will be\n * counted, regardless of type.\n * If only `type` is specified, all approvals for that type will be counted,\n * regardless of origin.\n * If both `origin` and `type` are specified, 0 or 1 will be returned.\n *\n * @param opts - The approval count options.\n * @param opts.origin - An approval origin.\n * @param opts.type - The type of the approval request.\n * @returns The current approval request count for the given origin and/or\n * type.\n */\n getApprovalCount(opts: { origin?: string; type?: string } = {}): number {\n if (!opts.origin && !opts.type) {\n throw new Error('Must specify origin, type, or both.');\n }\n const { origin, type: _type } = opts;\n\n if (origin && _type) {\n return this.#origins.get(origin)?.get(_type) || 0;\n }\n\n if (origin) {\n return Array.from(\n (this.#origins.get(origin) || new Map()).values(),\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n ).reduce((total, value) => total + value, 0);\n }\n\n // Only \"type\" was specified\n let count = 0;\n for (const approval of Object.values(this.state.pendingApprovals)) {\n if (approval.type === _type) {\n count += 1;\n }\n }\n return count;\n }\n\n /**\n * Get the total count of all pending approval requests for all origins.\n *\n * @returns The total pending approval request count.\n */\n getTotalApprovalCount(): number {\n return this.state.pendingApprovalCount;\n }\n\n /**\n * Checks if there's a pending approval request per the given parameters.\n * At least one parameter must be specified. An error will be thrown if the\n * parameters are invalid.\n *\n * If `id` is specified, all other parameters will be ignored.\n * If `id` is not specified, the method will check for requests that match\n * all of the specified parameters.\n *\n * @param opts - Options bag.\n * @param opts.id - The ID to check for.\n * @param opts.origin - The origin to check for.\n * @param opts.type - The type to check for.\n * @returns `true` if a matching approval is found, and `false` otherwise.\n */\n has(opts: { id?: string; origin?: string; type?: string } = {}): boolean {\n const { id, origin, type: _type } = opts;\n\n if (id) {\n if (typeof id !== 'string') {\n throw new Error('May not specify non-string id.');\n }\n return this.#approvals.has(id);\n }\n\n if (_type && typeof _type !== 'string') {\n throw new Error('May not specify non-string type.');\n }\n\n if (origin) {\n if (typeof origin !== 'string') {\n throw new Error('May not specify non-string origin.');\n }\n\n // Check origin and type pair if type also specified\n if (_type) {\n return Boolean(this.#origins.get(origin)?.get(_type));\n }\n return this.#origins.has(origin);\n }\n\n if (_type) {\n for (const approval of Object.values(this.state.pendingApprovals)) {\n if (approval.type === _type) {\n return true;\n }\n }\n return false;\n }\n throw new Error(\n 'Must specify a valid combination of id, origin, and type.',\n );\n }\n\n /**\n * Resolves the promise of the approval with the given id, and deletes the\n * approval. Throws an error if no such approval exists.\n *\n * @param id - The id of the approval request.\n * @param value - The value to resolve the approval promise with.\n * @param options - Options bag.\n * @returns A promise that either resolves once a result is provided by\n * the creator of the approval request, or immediately if `options.waitForResult`\n * is `false` or `undefined`.\n */\n accept(\n id: string,\n value?: unknown,\n options?: AcceptOptions,\n ): Promise {\n // Safe to cast as the delete method below will throw if the ID is not found\n const approval = this.get(id) as ApprovalRequest;\n const requestPromise = this.#deleteApprovalAndGetCallbacks(id);\n\n return new Promise((resolve, reject) => {\n const resultCallbacks: AcceptResultCallbacks = {\n success: (acceptValue?: unknown) => resolve({ value: acceptValue }),\n error: reject,\n };\n\n if (options?.waitForResult && !approval.expectsResult) {\n reject(new ApprovalRequestNoResultSupportError(id));\n return;\n }\n\n const resultValue = options?.waitForResult ? resultCallbacks : undefined;\n\n const resolveValue = approval.expectsResult\n ? { value, resultCallbacks: resultValue }\n : value;\n\n requestPromise.resolve(resolveValue);\n\n if (!options?.waitForResult) {\n resolve({ value: undefined });\n }\n });\n }\n\n /**\n * Rejects the promise of the approval with the given id, and deletes the\n * approval. Throws an error if no such approval exists.\n *\n * @param id - The id of the approval request.\n * @param error - The error to reject the approval promise with.\n */\n reject(id: string, error: unknown): void {\n this.#deleteApprovalAndGetCallbacks(id).reject(error);\n }\n\n /**\n * Rejects and deletes all approval requests.\n *\n * @param rejectionError - The JsonRpcError to reject the approval\n * requests with.\n */\n clear(rejectionError: JsonRpcError): void {\n for (const id of this.#approvals.keys()) {\n this.reject(id, rejectionError);\n }\n this.#origins.clear();\n this.update((draftState) => {\n draftState.pendingApprovals = {};\n draftState.pendingApprovalCount = 0;\n });\n }\n\n /**\n * Updates the request state of the approval with the given id.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request.\n * @param opts.requestState - Additional data associated with the request\n */\n updateRequestState(opts: UpdateRequestStateOptions): void {\n if (!this.state.pendingApprovals[opts.id]) {\n throw new ApprovalRequestNotFoundError(opts.id);\n }\n\n this.update((draftState) => {\n draftState.pendingApprovals[opts.id].requestState =\n opts.requestState as never;\n });\n }\n\n /**\n * Starts a new approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval flow.\n * @param opts.loadingText - The loading text that will be associated to the approval flow.\n * @param opts.show - A flag to determine whether the approval should show to the user.\n * @returns The object containing the approval flow id.\n */\n startFlow(opts: StartFlowOptions = {}): ApprovalFlowStartResult {\n const id = opts.id ?? nanoid();\n const loadingText = opts.loadingText ?? null;\n\n this.update((draftState) => {\n draftState.approvalFlows.push({ id, loadingText });\n });\n\n // By default, if nothing else is specified, we always show the approval.\n if (opts.show !== false) {\n this.#showApprovalRequest();\n }\n\n return { id, loadingText };\n }\n\n /**\n * Ends the current approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval flow that will be finished.\n */\n endFlow({ id }: EndFlowOptions) {\n if (!this.state.approvalFlows.length) {\n throw new NoApprovalFlowsError();\n }\n\n const currentFlow = this.state.approvalFlows.slice(-1)[0];\n\n if (id !== currentFlow.id) {\n throw new EndInvalidFlowError(\n id,\n this.state.approvalFlows.map((flow) => flow.id),\n );\n }\n\n this.update((draftState) => {\n draftState.approvalFlows.pop();\n });\n }\n\n /**\n * Sets the loading text for the approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The approval flow loading text that will be displayed.\n * @param opts.loadingText - The loading text that will be associated to the approval flow.\n */\n setFlowLoadingText({ id, loadingText }: SetFlowLoadingTextOptions) {\n const flowIndex = this.state.approvalFlows.findIndex(\n (flow) => flow.id === id,\n );\n\n if (flowIndex === -1) {\n throw new MissingApprovalFlowError(id);\n }\n\n this.update((draftState) => {\n draftState.approvalFlows[flowIndex].loadingText = loadingText;\n });\n }\n\n /**\n * Show a success page.\n *\n * @param opts - Options bag.\n * @param opts.message - The message text or components to display in the page.\n * @param opts.header - The text or components to display in the header of the page.\n * @param opts.flowToEnd - The ID of the approval flow to end once the success page is approved.\n * @param opts.title - The title to display above the message. Shown by default but can be hidden with `null`.\n * @param opts.icon - The icon to display in the page. Shown by default but can be hidden with `null`.\n * @returns Empty object to support future additions.\n */\n async success(opts: SuccessOptions = {}): Promise {\n await this.#result(APPROVAL_TYPE_RESULT_SUCCESS, opts, {\n message: opts.message,\n header: opts.header,\n title: opts.title,\n icon: opts.icon,\n } as Record);\n\n return {};\n }\n\n /**\n * Show an error page.\n *\n * @param opts - Options bag.\n * @param opts.message - The message text or components to display in the page.\n * @param opts.header - The text or components to display in the header of the page.\n * @param opts.flowToEnd - The ID of the approval flow to end once the error page is approved.\n * @param opts.title - The title to display above the message. Shown by default but can be hidden with `null`.\n * @param opts.icon - The icon to display in the page. Shown by default but can be hidden with `null`.\n * @returns Empty object to support future additions.\n */\n async error(opts: ErrorOptions = {}): Promise {\n await this.#result(APPROVAL_TYPE_RESULT_ERROR, opts, {\n error: opts.error,\n header: opts.header,\n title: opts.title,\n icon: opts.icon,\n } as Record);\n\n return {};\n }\n\n /**\n * Implementation of add operation.\n *\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param id - The id of the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n * @param expectsResult - Whether the approval request expects a result object to be returned.\n * @returns The approval promise.\n */\n #add(\n origin: string,\n type: string,\n id: string = nanoid(),\n requestData?: Record,\n requestState?: Record,\n expectsResult?: boolean,\n ): Promise {\n this.#validateAddParams(id, origin, type, requestData, requestState);\n\n if (\n !this.#typesExcludedFromRateLimiting.includes(type) &&\n this.has({ origin, type })\n ) {\n throw rpcErrors.resourceUnavailable(\n getAlreadyPendingMessage(origin, type),\n );\n }\n\n // add pending approval\n return new Promise((resolve, reject) => {\n this.#approvals.set(id, { resolve, reject });\n this.#addPendingApprovalOrigin(origin, type);\n\n this.#addToStore(\n id,\n origin,\n type,\n requestData,\n requestState,\n expectsResult,\n );\n });\n }\n\n /**\n * Validates parameters to the add method.\n *\n * @param id - The id of the approval request.\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n */\n #validateAddParams(\n id: string,\n origin: string,\n type: string,\n requestData?: Record,\n requestState?: Record,\n ): void {\n let errorMessage = null;\n if (!id || typeof id !== 'string') {\n errorMessage = 'Must specify non-empty string id.';\n } else if (this.#approvals.has(id)) {\n errorMessage = `Approval request with id '${id}' already exists.`;\n } else if (!origin || typeof origin !== 'string') {\n errorMessage = 'Must specify non-empty string origin.';\n } else if (!type || typeof type !== 'string') {\n errorMessage = 'Must specify non-empty string type.';\n } else if (\n requestData &&\n (typeof requestData !== 'object' || Array.isArray(requestData))\n ) {\n errorMessage = 'Request data must be a plain object if specified.';\n } else if (\n requestState &&\n (typeof requestState !== 'object' || Array.isArray(requestState))\n ) {\n errorMessage = 'Request state must be a plain object if specified.';\n }\n\n if (errorMessage) {\n throw rpcErrors.internal(errorMessage);\n }\n }\n\n /**\n * Adds an entry to _origins.\n * Performs no validation.\n *\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n */\n #addPendingApprovalOrigin(origin: string, type: string): void {\n let originMap = this.#origins.get(origin);\n\n if (!originMap) {\n originMap = new Map();\n this.#origins.set(origin, originMap);\n }\n\n const currentValue = originMap.get(type) || 0;\n originMap.set(type, currentValue + 1);\n }\n\n /**\n * Adds an entry to the store.\n * Performs no validation.\n *\n * @param id - The id of the approval request.\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n * @param expectsResult - Whether the request expects a result object to be returned.\n */\n #addToStore(\n id: string,\n origin: string,\n type: string,\n requestData?: Record,\n requestState?: Record,\n expectsResult?: boolean,\n ): void {\n const approval = {\n id,\n origin,\n type,\n time: Date.now(),\n requestData: requestData || null,\n requestState: requestState || null,\n expectsResult: expectsResult || false,\n };\n\n this.update((draftState) => {\n draftState.pendingApprovals[id] = approval as never;\n\n draftState.pendingApprovalCount = Object.keys(\n draftState.pendingApprovals,\n ).length;\n });\n }\n\n /**\n * Deletes the approval with the given id. The approval promise must be\n * resolved or reject before this method is called.\n * Deletion is an internal operation because approval state is solely\n * managed by this controller.\n *\n * @param id - The id of the approval request to be deleted.\n */\n #delete(id: string): void {\n this.#approvals.delete(id);\n\n // This method is only called after verifying that the approval with the\n // specified id exists.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { origin, type } = this.state.pendingApprovals[id]!;\n\n const originMap = this.#origins.get(origin) as Map;\n const originTotalCount = this.getApprovalCount({ origin });\n const originTypeCount = originMap.get(type) as number;\n\n if (originTotalCount === 1) {\n this.#origins.delete(origin);\n } else {\n originMap.set(type, originTypeCount - 1);\n }\n\n this.update((draftState) => {\n delete draftState.pendingApprovals[id];\n draftState.pendingApprovalCount = Object.keys(\n draftState.pendingApprovals,\n ).length;\n });\n }\n\n /**\n * Gets the approval callbacks for the given id, deletes the entry, and then\n * returns the callbacks for promise resolution.\n * Throws an error if no approval is found for the given id.\n *\n * @param id - The id of the approval request.\n * @returns The promise callbacks associated with the approval request.\n */\n #deleteApprovalAndGetCallbacks(id: string): ApprovalCallbacks {\n const callbacks = this.#approvals.get(id);\n if (!callbacks) {\n throw new ApprovalRequestNotFoundError(id);\n }\n\n this.#delete(id);\n return callbacks;\n }\n\n async #result(\n type: string,\n opts: ResultOptions,\n requestData: Record,\n ) {\n try {\n await this.addAndShowApprovalRequest({\n origin: ORIGIN_METAMASK,\n type,\n requestData,\n });\n } catch (error) {\n console.info('Failed to display result page', error);\n } finally {\n if (opts.flowToEnd) {\n try {\n this.endFlow({ id: opts.flowToEnd });\n } catch (error) {\n console.info('Failed to end flow', { id: opts.flowToEnd, error });\n }\n }\n }\n }\n}\n\nexport default ApprovalController;\n"],"mappings":";;;;;;;;;;;;;AACA;AAAA,EACE;AAAA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OAAO;AACL,cAAU,IAAI,MAAM,kBAAkB,CAAC;AAAA,EACzC;AAEA,OAAK,OAAO,CAAC,eAAe;AAC1B,WAAO,WAAW,iBAAiB,EAAE;AACrC,eAAW,uBAAuB,OAAO;AAAA,MACvC,WAAW;AAAA,IACb,EAAE;AAAA,EACJ,CAAC;AACH;AAUA;AAAA,mCAA8B,SAAC,IAA+B;AAC5D,QAAM,YAAY,mBAAK,YAAW,IAAI,EAAE;AACxC,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,6BAA6B,EAAE;AAAA,EAC3C;AAEA,wBAAK,oBAAL,WAAa;AACb,SAAO;AACT;AAEM;AAAA,YAAO,eACX,MACA,MACA,aACA;AACA,MAAI;AACF,UAAM,KAAK,0BAA0B;AAAA,MACnC,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,KAAK,iCAAiC,KAAK;AAAA,EACrD,UAAE;AACA,QAAI,KAAK,WAAW;AAClB,UAAI;AACF,aAAK,QAAQ,EAAE,IAAI,KAAK,UAAU,CAAC;AAAA,MACrC,SAAS,OAAO;AACd,gBAAQ,KAAK,sBAAsB,EAAE,IAAI,KAAK,WAAW,MAAM,CAAC;AAAA,MAClE;AAAA,IACF;AAAA,EACF;AACF;AAGF,IAAO,6BAAQ;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/chunk-PMXPCCKS.js.map b/node_modules/@metamask/approval-controller/dist/chunk-PMXPCCKS.js.map +deleted file mode 100644 +index 3bf157a..0000000 +--- a/node_modules/@metamask/approval-controller/dist/chunk-PMXPCCKS.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/ApprovalController.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,OAGK;AAEP,SAAS,iBAAiB;AAE1B,SAAS,cAAc;AAahB,IAAM,kBAAkB;AACxB,IAAM,6BAA6B;AACnC,IAAM,+BAA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iBAAiB,EAAE;AACrC,eAAW,uBAAuB,OAAO;AAAA,MACvC,WAAW;AAAA,IACb,EAAE;AAAA,EACJ,CAAC;AACH;AAUA;AAAA,mCAA8B,SAAC,IAA+B;AAC5D,QAAM,YAAY,mBAAK,YAAW,IAAI,EAAE;AACxC,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,6BAA6B,EAAE;AAAA,EAC3C;AAEA,wBAAK,oBAAL,WAAa;AACb,SAAO;AACT;AAEM;AAAA,YAAO,eACX,MACA,MACA,aACA;AACA,MAAI;AACF,UAAM,KAAK,0BAA0B;AAAA,MACnC,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,KAAK,iCAAiC,KAAK;AAAA,EACrD,UAAE;AACA,QAAI,KAAK,WAAW;AAClB,UAAI;AACF,aAAK,QAAQ,EAAE,IAAI,KAAK,UAAU,CAAC;AAAA,MACrC,SAAS,OAAO;AACd,gBAAQ,KAAK,sBAAsB,EAAE,IAAI,KAAK,WAAW,MAAM,CAAC;AAAA,MAClE;AAAA,IACF;AAAA,EACF;AACF;AAGF,IAAO,6BAAQ","sourcesContent":["import type { ControllerGetStateAction } from '@metamask/base-controller';\nimport {\n BaseController,\n type ControllerStateChangeEvent,\n type RestrictedControllerMessenger,\n} from '@metamask/base-controller';\nimport type { JsonRpcError, DataWithOptionalCause } from '@metamask/rpc-errors';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { Json, OptionalField } from '@metamask/utils';\nimport { nanoid } from 'nanoid';\n\nimport {\n ApprovalRequestNotFoundError,\n ApprovalRequestNoResultSupportError,\n EndInvalidFlowError,\n NoApprovalFlowsError,\n MissingApprovalFlowError,\n} from './errors';\n\n// Constants\n\n// Avoiding dependency on controller-utils\nexport const ORIGIN_METAMASK = 'metamask';\nexport const APPROVAL_TYPE_RESULT_ERROR = 'result_error';\nexport const APPROVAL_TYPE_RESULT_SUCCESS = 'result_success';\n\nconst controllerName = 'ApprovalController';\n\nconst stateMetadata = {\n pendingApprovals: { persist: false, anonymous: true },\n pendingApprovalCount: { persist: false, anonymous: false },\n approvalFlows: { persist: false, anonymous: false },\n};\n\nconst getAlreadyPendingMessage = (origin: string, type: string) =>\n `Request of type '${type}' already pending for origin ${origin}. Please wait.`;\n\nconst getDefaultState = (): ApprovalControllerState => {\n return {\n pendingApprovals: {},\n pendingApprovalCount: 0,\n approvalFlows: [],\n };\n};\n\n// Internal Types\n\ntype ApprovalPromiseResolve = (value?: unknown | AddResult) => void;\n\ntype ApprovalPromiseReject = (error?: unknown) => void;\n\ntype ApprovalRequestData = Record | null;\n\ntype ApprovalRequestState = Record | null;\n\ntype ApprovalCallbacks = {\n resolve: ApprovalPromiseResolve;\n reject: ApprovalPromiseReject;\n};\n\ntype ApprovalFlow = {\n id: string;\n loadingText: string | null;\n};\n\ntype ResultOptions = {\n flowToEnd?: string;\n header?: (string | ResultComponent)[];\n icon?: string | null;\n title?: string | null;\n};\n\n// Miscellaneous Types\n\nexport type ApprovalRequest = {\n /**\n * The ID of the approval request.\n */\n id: string;\n\n /**\n * The origin of the approval request.\n */\n origin: string;\n\n /**\n * The time that the request was received, per Date.now().\n */\n time: number;\n\n /**\n * The type of the approval request.\n * Unfortunately, not all values will match the `ApprovalType` enum, so we are using `string` here.\n * TODO: Replace `string` with `ApprovalType` when all `type` values used by the clients can be encompassed by the `ApprovalType` enum.\n */\n type: string;\n\n /**\n * Additional data associated with the request.\n */\n requestData: RequestData;\n\n /**\n * Additional mutable state associated with the request\n */\n requestState: ApprovalRequestState;\n\n /**\n * Whether the request expects a result object to be returned instead of just the approval value.\n */\n expectsResult: boolean;\n};\n\nexport type ApprovalFlowState = ApprovalFlow;\n\nexport type ApprovalControllerState = {\n pendingApprovals: Record>>;\n pendingApprovalCount: number;\n approvalFlows: ApprovalFlowState[];\n};\n\nexport type ApprovalControllerMessenger = RestrictedControllerMessenger<\n typeof controllerName,\n ApprovalControllerActions,\n ApprovalControllerEvents,\n never,\n never\n>;\n\n// Option Types\n\nexport type ShowApprovalRequest = () => void | Promise;\n\nexport type ResultComponent = {\n /**\n * A unique identifier for this instance of the component.\n */\n key: string;\n\n /**\n * The name of the component to render.\n */\n name: string;\n\n /**\n * Any properties required by the component.\n */\n properties?: Record;\n\n /**\n * Any child components to render inside the component.\n */\n children?: string | ResultComponent | (string | ResultComponent)[];\n};\n\nexport type ApprovalControllerOptions = {\n messenger: ApprovalControllerMessenger;\n showApprovalRequest: ShowApprovalRequest;\n state?: Partial;\n typesExcludedFromRateLimiting?: string[];\n};\n\nexport type AddApprovalOptions = {\n id?: string;\n origin: string;\n type: string;\n requestData?: Record;\n requestState?: Record;\n expectsResult?: boolean;\n};\n\nexport type UpdateRequestStateOptions = {\n id: string;\n requestState: Record;\n};\n\nexport type AcceptOptions = {\n /**\n * Whether to resolve the returned promise only when the request creator indicates the success of the\n * post-approval logic using the result callbacks.\n * If false or unspecified, the promise will resolve immediately.\n */\n waitForResult?: boolean;\n};\n\nexport type StartFlowOptions = OptionalField<\n ApprovalFlow,\n 'id' | 'loadingText'\n> & { show?: boolean };\n\nexport type EndFlowOptions = Pick;\n\nexport type SetFlowLoadingTextOptions = ApprovalFlow;\n\nexport type SuccessOptions = ResultOptions & {\n message?: string | ResultComponent | (string | ResultComponent)[];\n};\n\nexport type ErrorOptions = ResultOptions & {\n error?: string | ResultComponent | (string | ResultComponent)[];\n};\n\n// Result Types\n\nexport type AcceptResultCallbacks = {\n /**\n * Inform the request acceptor that the post-approval logic was successful.\n *\n * @param value - An optional value generated by the post-approval logic.\n */\n success: (value?: unknown) => void;\n\n /**\n * Inform the request acceptor that the post-approval logic failed.\n *\n * @param error - The reason for the failure.\n */\n error: (error: Error) => void;\n};\n\nexport type AddResult = {\n /**\n * An optional value provided by the request acceptor.\n */\n value?: unknown;\n\n /**\n * Callback functions that must be used to indicate to the request acceptor whether the post-approval logic was successful or not.\n * Will be undefined if the request acceptor did not specify that they want to wait for a result.\n */\n resultCallbacks?: AcceptResultCallbacks;\n};\n\nexport type AcceptResult = {\n /**\n * An optional value provided by the request creator when indicating a successful result.\n */\n value?: unknown;\n};\n\nexport type ApprovalFlowStartResult = ApprovalFlow;\n\nexport type SuccessResult = Record;\n\nexport type ErrorResult = Record;\n\n// Event Types\n\nexport type ApprovalStateChange = ControllerStateChangeEvent<\n typeof controllerName,\n ApprovalControllerState\n>;\n\nexport type ApprovalControllerEvents = ApprovalStateChange;\n\n// Action Types\n\nexport type GetApprovalsState = ControllerGetStateAction<\n typeof controllerName,\n ApprovalControllerState\n>;\n\nexport type ClearApprovalRequests = {\n type: `${typeof controllerName}:clearRequests`;\n handler: (error: JsonRpcError) => void;\n};\n\nexport type AddApprovalRequest = {\n type: `${typeof controllerName}:addRequest`;\n handler: (\n opts: AddApprovalOptions,\n shouldShowRequest: boolean,\n ) => ReturnType;\n};\n\nexport type HasApprovalRequest = {\n type: `${typeof controllerName}:hasRequest`;\n handler: ApprovalController['has'];\n};\n\nexport type AcceptRequest = {\n type: `${typeof controllerName}:acceptRequest`;\n handler: ApprovalController['accept'];\n};\n\nexport type RejectRequest = {\n type: `${typeof controllerName}:rejectRequest`;\n handler: ApprovalController['reject'];\n};\n\nexport type UpdateRequestState = {\n type: `${typeof controllerName}:updateRequestState`;\n handler: ApprovalController['updateRequestState'];\n};\n\nexport type StartFlow = {\n type: `${typeof controllerName}:startFlow`;\n handler: ApprovalController['startFlow'];\n};\n\nexport type EndFlow = {\n type: `${typeof controllerName}:endFlow`;\n handler: ApprovalController['endFlow'];\n};\n\nexport type SetFlowLoadingText = {\n type: `${typeof controllerName}:setFlowLoadingText`;\n handler: ApprovalController['setFlowLoadingText'];\n};\n\nexport type ShowSuccess = {\n type: `${typeof controllerName}:showSuccess`;\n handler: ApprovalController['success'];\n};\n\nexport type ShowError = {\n type: `${typeof controllerName}:showError`;\n handler: ApprovalController['error'];\n};\n\nexport type ApprovalControllerActions =\n | GetApprovalsState\n | ClearApprovalRequests\n | AddApprovalRequest\n | HasApprovalRequest\n | AcceptRequest\n | RejectRequest\n | UpdateRequestState\n | StartFlow\n | EndFlow\n | SetFlowLoadingText\n | ShowSuccess\n | ShowError;\n\n/**\n * Controller for managing requests that require user approval.\n *\n * Enables limiting the number of pending requests by origin and type, counting\n * pending requests, and more.\n *\n * Adding a request returns a promise that resolves or rejects when the request\n * is approved or denied, respectively.\n */\nexport class ApprovalController extends BaseController<\n typeof controllerName,\n ApprovalControllerState,\n ApprovalControllerMessenger\n> {\n #approvals: Map;\n\n #origins: Map>;\n\n #showApprovalRequest: () => void;\n\n #typesExcludedFromRateLimiting: string[];\n\n /**\n * Construct an Approval controller.\n *\n * @param options - The controller options.\n * @param options.showApprovalRequest - Function for opening the UI such that\n * the request can be displayed to the user.\n * @param options.messenger - The restricted controller messenger for the Approval controller.\n * @param options.state - The initial controller state.\n * @param options.typesExcludedFromRateLimiting - Array of approval types which allow multiple pending approval requests from the same origin.\n */\n constructor({\n messenger,\n showApprovalRequest,\n state = {},\n typesExcludedFromRateLimiting = [],\n }: ApprovalControllerOptions) {\n super({\n name: controllerName,\n metadata: stateMetadata,\n messenger,\n state: { ...getDefaultState(), ...state },\n });\n\n this.#approvals = new Map();\n this.#origins = new Map();\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#showApprovalRequest = showApprovalRequest;\n this.#typesExcludedFromRateLimiting = typesExcludedFromRateLimiting;\n this.registerMessageHandlers();\n }\n\n /**\n * Constructor helper for registering this controller's messaging system\n * actions.\n */\n private registerMessageHandlers(): void {\n this.messagingSystem.registerActionHandler(\n `${controllerName}:clearRequests` as const,\n this.clear.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:addRequest` as const,\n (opts: AddApprovalOptions, shouldShowRequest: boolean) => {\n if (shouldShowRequest) {\n return this.addAndShowApprovalRequest(opts);\n }\n return this.add(opts);\n },\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:hasRequest` as const,\n this.has.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:acceptRequest` as const,\n this.accept.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:rejectRequest` as const,\n this.reject.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:updateRequestState` as const,\n this.updateRequestState.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:startFlow` as const,\n this.startFlow.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:endFlow` as const,\n this.endFlow.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:setFlowLoadingText` as const,\n this.setFlowLoadingText.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:showSuccess` as const,\n this.success.bind(this),\n );\n\n this.messagingSystem.registerActionHandler(\n `${controllerName}:showError` as const,\n this.error.bind(this),\n );\n }\n\n /**\n * Adds an approval request per the given arguments, calls the show approval\n * request function, and returns the associated approval promise resolving to\n * an AddResult object.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * @param opts.requestState - Additional state associated with the request,\n * if any.\n * @returns The approval promise resolving to an AddResult object.\n */\n addAndShowApprovalRequest(\n opts: AddApprovalOptions & { expectsResult: true },\n ): Promise;\n\n /**\n * Adds an approval request per the given arguments, calls the show approval\n * request function, and returns the associated approval promise resolving\n * to a value provided during acceptance.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * @param opts.requestState - Additional state associated with the request,\n * if any.\n * @returns The approval promise resolving to a value provided during acceptance.\n */\n addAndShowApprovalRequest(opts: AddApprovalOptions): Promise;\n\n addAndShowApprovalRequest(opts: AddApprovalOptions): Promise {\n const promise = this.#add(\n opts.origin,\n opts.type,\n opts.id,\n opts.requestData,\n opts.requestState,\n opts.expectsResult,\n );\n this.#showApprovalRequest();\n return promise;\n }\n\n /**\n * Adds an approval request per the given arguments and returns the approval\n * promise resolving to an AddResult object.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * if any.\n * @returns The approval promise resolving to an AddResult object.\n */\n add(opts: AddApprovalOptions & { expectsResult: true }): Promise;\n\n /**\n * Adds an approval request per the given arguments and returns the approval\n * promise resolving to a value provided during acceptance.\n *\n * There can only be one approval per origin and type. An error is thrown if\n * attempting to add an invalid or duplicate request.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request. A random id will be\n * generated if none is provided.\n * @param opts.origin - The origin of the approval request.\n * @param opts.type - The type associated with the approval request.\n * @param opts.requestData - Additional data associated with the request,\n * if any.\n * @returns The approval promise resolving to a value provided during acceptance.\n */\n add(opts: AddApprovalOptions): Promise;\n\n add(opts: AddApprovalOptions): Promise {\n return this.#add(\n opts.origin,\n opts.type,\n opts.id,\n opts.requestData,\n opts.requestState,\n opts.expectsResult,\n );\n }\n\n /**\n * Gets the info for the approval request with the given id.\n *\n * @param id - The id of the approval request.\n * @returns The approval request data associated with the id.\n */\n get(id: string): ApprovalRequest | undefined {\n return this.state.pendingApprovals[id];\n }\n\n /**\n * Gets the number of pending approvals, by origin and/or type.\n *\n * If only `origin` is specified, all approvals for that origin will be\n * counted, regardless of type.\n * If only `type` is specified, all approvals for that type will be counted,\n * regardless of origin.\n * If both `origin` and `type` are specified, 0 or 1 will be returned.\n *\n * @param opts - The approval count options.\n * @param opts.origin - An approval origin.\n * @param opts.type - The type of the approval request.\n * @returns The current approval request count for the given origin and/or\n * type.\n */\n getApprovalCount(opts: { origin?: string; type?: string } = {}): number {\n if (!opts.origin && !opts.type) {\n throw new Error('Must specify origin, type, or both.');\n }\n const { origin, type: _type } = opts;\n\n if (origin && _type) {\n return this.#origins.get(origin)?.get(_type) || 0;\n }\n\n if (origin) {\n return Array.from(\n (this.#origins.get(origin) || new Map()).values(),\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n ).reduce((total, value) => total + value, 0);\n }\n\n // Only \"type\" was specified\n let count = 0;\n for (const approval of Object.values(this.state.pendingApprovals)) {\n if (approval.type === _type) {\n count += 1;\n }\n }\n return count;\n }\n\n /**\n * Get the total count of all pending approval requests for all origins.\n *\n * @returns The total pending approval request count.\n */\n getTotalApprovalCount(): number {\n return this.state.pendingApprovalCount;\n }\n\n /**\n * Checks if there's a pending approval request per the given parameters.\n * At least one parameter must be specified. An error will be thrown if the\n * parameters are invalid.\n *\n * If `id` is specified, all other parameters will be ignored.\n * If `id` is not specified, the method will check for requests that match\n * all of the specified parameters.\n *\n * @param opts - Options bag.\n * @param opts.id - The ID to check for.\n * @param opts.origin - The origin to check for.\n * @param opts.type - The type to check for.\n * @returns `true` if a matching approval is found, and `false` otherwise.\n */\n has(opts: { id?: string; origin?: string; type?: string } = {}): boolean {\n const { id, origin, type: _type } = opts;\n\n if (id) {\n if (typeof id !== 'string') {\n throw new Error('May not specify non-string id.');\n }\n return this.#approvals.has(id);\n }\n\n if (_type && typeof _type !== 'string') {\n throw new Error('May not specify non-string type.');\n }\n\n if (origin) {\n if (typeof origin !== 'string') {\n throw new Error('May not specify non-string origin.');\n }\n\n // Check origin and type pair if type also specified\n if (_type) {\n return Boolean(this.#origins.get(origin)?.get(_type));\n }\n return this.#origins.has(origin);\n }\n\n if (_type) {\n for (const approval of Object.values(this.state.pendingApprovals)) {\n if (approval.type === _type) {\n return true;\n }\n }\n return false;\n }\n throw new Error(\n 'Must specify a valid combination of id, origin, and type.',\n );\n }\n\n /**\n * Resolves the promise of the approval with the given id, and deletes the\n * approval. Throws an error if no such approval exists.\n *\n * @param id - The id of the approval request.\n * @param value - The value to resolve the approval promise with.\n * @param options - Options bag.\n * @returns A promise that either resolves once a result is provided by\n * the creator of the approval request, or immediately if `options.waitForResult`\n * is `false` or `undefined`.\n */\n accept(\n id: string,\n value?: unknown,\n options?: AcceptOptions,\n ): Promise {\n // Safe to cast as the delete method below will throw if the ID is not found\n const approval = this.get(id) as ApprovalRequest;\n const requestPromise = this.#deleteApprovalAndGetCallbacks(id);\n\n return new Promise((resolve, reject) => {\n const resultCallbacks: AcceptResultCallbacks = {\n success: (acceptValue?: unknown) => resolve({ value: acceptValue }),\n error: reject,\n };\n\n if (options?.waitForResult && !approval.expectsResult) {\n reject(new ApprovalRequestNoResultSupportError(id));\n return;\n }\n\n const resultValue = options?.waitForResult ? resultCallbacks : undefined;\n\n const resolveValue = approval.expectsResult\n ? { value, resultCallbacks: resultValue }\n : value;\n\n requestPromise.resolve(resolveValue);\n\n if (!options?.waitForResult) {\n resolve({ value: undefined });\n }\n });\n }\n\n /**\n * Rejects the promise of the approval with the given id, and deletes the\n * approval. Throws an error if no such approval exists.\n *\n * @param id - The id of the approval request.\n * @param error - The error to reject the approval promise with.\n */\n reject(id: string, error: unknown): void {\n this.#deleteApprovalAndGetCallbacks(id).reject(error);\n }\n\n /**\n * Rejects and deletes all approval requests.\n *\n * @param rejectionError - The JsonRpcError to reject the approval\n * requests with.\n */\n clear(rejectionError: JsonRpcError): void {\n for (const id of this.#approvals.keys()) {\n this.reject(id, rejectionError);\n }\n this.#origins.clear();\n this.update((draftState) => {\n draftState.pendingApprovals = {};\n draftState.pendingApprovalCount = 0;\n });\n }\n\n /**\n * Updates the request state of the approval with the given id.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval request.\n * @param opts.requestState - Additional data associated with the request\n */\n updateRequestState(opts: UpdateRequestStateOptions): void {\n if (!this.state.pendingApprovals[opts.id]) {\n throw new ApprovalRequestNotFoundError(opts.id);\n }\n\n this.update((draftState) => {\n draftState.pendingApprovals[opts.id].requestState =\n opts.requestState as never;\n });\n }\n\n /**\n * Starts a new approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval flow.\n * @param opts.loadingText - The loading text that will be associated to the approval flow.\n * @param opts.show - A flag to determine whether the approval should show to the user.\n * @returns The object containing the approval flow id.\n */\n startFlow(opts: StartFlowOptions = {}): ApprovalFlowStartResult {\n const id = opts.id ?? nanoid();\n const loadingText = opts.loadingText ?? null;\n\n this.update((draftState) => {\n draftState.approvalFlows.push({ id, loadingText });\n });\n\n // By default, if nothing else is specified, we always show the approval.\n if (opts.show !== false) {\n this.#showApprovalRequest();\n }\n\n return { id, loadingText };\n }\n\n /**\n * Ends the current approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The id of the approval flow that will be finished.\n */\n endFlow({ id }: EndFlowOptions) {\n if (!this.state.approvalFlows.length) {\n throw new NoApprovalFlowsError();\n }\n\n const currentFlow = this.state.approvalFlows.slice(-1)[0];\n\n if (id !== currentFlow.id) {\n throw new EndInvalidFlowError(\n id,\n this.state.approvalFlows.map((flow) => flow.id),\n );\n }\n\n this.update((draftState) => {\n draftState.approvalFlows.pop();\n });\n }\n\n /**\n * Sets the loading text for the approval flow.\n *\n * @param opts - Options bag.\n * @param opts.id - The approval flow loading text that will be displayed.\n * @param opts.loadingText - The loading text that will be associated to the approval flow.\n */\n setFlowLoadingText({ id, loadingText }: SetFlowLoadingTextOptions) {\n const flowIndex = this.state.approvalFlows.findIndex(\n (flow) => flow.id === id,\n );\n\n if (flowIndex === -1) {\n throw new MissingApprovalFlowError(id);\n }\n\n this.update((draftState) => {\n draftState.approvalFlows[flowIndex].loadingText = loadingText;\n });\n }\n\n /**\n * Show a success page.\n *\n * @param opts - Options bag.\n * @param opts.message - The message text or components to display in the page.\n * @param opts.header - The text or components to display in the header of the page.\n * @param opts.flowToEnd - The ID of the approval flow to end once the success page is approved.\n * @param opts.title - The title to display above the message. Shown by default but can be hidden with `null`.\n * @param opts.icon - The icon to display in the page. Shown by default but can be hidden with `null`.\n * @returns Empty object to support future additions.\n */\n async success(opts: SuccessOptions = {}): Promise {\n await this.#result(APPROVAL_TYPE_RESULT_SUCCESS, opts, {\n message: opts.message,\n header: opts.header,\n title: opts.title,\n icon: opts.icon,\n } as Record);\n\n return {};\n }\n\n /**\n * Show an error page.\n *\n * @param opts - Options bag.\n * @param opts.message - The message text or components to display in the page.\n * @param opts.header - The text or components to display in the header of the page.\n * @param opts.flowToEnd - The ID of the approval flow to end once the error page is approved.\n * @param opts.title - The title to display above the message. Shown by default but can be hidden with `null`.\n * @param opts.icon - The icon to display in the page. Shown by default but can be hidden with `null`.\n * @returns Empty object to support future additions.\n */\n async error(opts: ErrorOptions = {}): Promise {\n await this.#result(APPROVAL_TYPE_RESULT_ERROR, opts, {\n error: opts.error,\n header: opts.header,\n title: opts.title,\n icon: opts.icon,\n } as Record);\n\n return {};\n }\n\n /**\n * Implementation of add operation.\n *\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param id - The id of the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n * @param expectsResult - Whether the approval request expects a result object to be returned.\n * @returns The approval promise.\n */\n #add(\n origin: string,\n type: string,\n id: string = nanoid(),\n requestData?: Record,\n requestState?: Record,\n expectsResult?: boolean,\n ): Promise {\n this.#validateAddParams(id, origin, type, requestData, requestState);\n\n if (\n !this.#typesExcludedFromRateLimiting.includes(type) &&\n this.has({ origin, type })\n ) {\n throw rpcErrors.resourceUnavailable(\n getAlreadyPendingMessage(origin, type),\n );\n }\n\n // add pending approval\n return new Promise((resolve, reject) => {\n this.#approvals.set(id, { resolve, reject });\n this.#addPendingApprovalOrigin(origin, type);\n\n this.#addToStore(\n id,\n origin,\n type,\n requestData,\n requestState,\n expectsResult,\n );\n });\n }\n\n /**\n * Validates parameters to the add method.\n *\n * @param id - The id of the approval request.\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n */\n #validateAddParams(\n id: string,\n origin: string,\n type: string,\n requestData?: Record,\n requestState?: Record,\n ): void {\n let errorMessage = null;\n if (!id || typeof id !== 'string') {\n errorMessage = 'Must specify non-empty string id.';\n } else if (this.#approvals.has(id)) {\n errorMessage = `Approval request with id '${id}' already exists.`;\n } else if (!origin || typeof origin !== 'string') {\n errorMessage = 'Must specify non-empty string origin.';\n } else if (!type || typeof type !== 'string') {\n errorMessage = 'Must specify non-empty string type.';\n } else if (\n requestData &&\n (typeof requestData !== 'object' || Array.isArray(requestData))\n ) {\n errorMessage = 'Request data must be a plain object if specified.';\n } else if (\n requestState &&\n (typeof requestState !== 'object' || Array.isArray(requestState))\n ) {\n errorMessage = 'Request state must be a plain object if specified.';\n }\n\n if (errorMessage) {\n throw rpcErrors.internal(errorMessage);\n }\n }\n\n /**\n * Adds an entry to _origins.\n * Performs no validation.\n *\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n */\n #addPendingApprovalOrigin(origin: string, type: string): void {\n let originMap = this.#origins.get(origin);\n\n if (!originMap) {\n originMap = new Map();\n this.#origins.set(origin, originMap);\n }\n\n const currentValue = originMap.get(type) || 0;\n originMap.set(type, currentValue + 1);\n }\n\n /**\n * Adds an entry to the store.\n * Performs no validation.\n *\n * @param id - The id of the approval request.\n * @param origin - The origin of the approval request.\n * @param type - The type associated with the approval request.\n * @param requestData - The request data associated with the approval request.\n * @param requestState - The request state associated with the approval request.\n * @param expectsResult - Whether the request expects a result object to be returned.\n */\n #addToStore(\n id: string,\n origin: string,\n type: string,\n requestData?: Record,\n requestState?: Record,\n expectsResult?: boolean,\n ): void {\n const approval = {\n id,\n origin,\n type,\n time: Date.now(),\n requestData: requestData || null,\n requestState: requestState || null,\n expectsResult: expectsResult || false,\n };\n\n this.update((draftState) => {\n draftState.pendingApprovals[id] = approval as never;\n\n draftState.pendingApprovalCount = Object.keys(\n draftState.pendingApprovals,\n ).length;\n });\n }\n\n /**\n * Deletes the approval with the given id. The approval promise must be\n * resolved or reject before this method is called.\n * Deletion is an internal operation because approval state is solely\n * managed by this controller.\n *\n * @param id - The id of the approval request to be deleted.\n */\n #delete(id: string): void {\n this.#approvals.delete(id);\n\n // This method is only called after verifying that the approval with the\n // specified id exists.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { origin, type } = this.state.pendingApprovals[id]!;\n\n const originMap = this.#origins.get(origin) as Map;\n const originTotalCount = this.getApprovalCount({ origin });\n const originTypeCount = originMap.get(type) as number;\n\n if (originTotalCount === 1) {\n this.#origins.delete(origin);\n } else {\n originMap.set(type, originTypeCount - 1);\n }\n\n this.update((draftState) => {\n delete draftState.pendingApprovals[id];\n draftState.pendingApprovalCount = Object.keys(\n draftState.pendingApprovals,\n ).length;\n });\n }\n\n /**\n * Gets the approval callbacks for the given id, deletes the entry, and then\n * returns the callbacks for promise resolution.\n * Throws an error if no approval is found for the given id.\n *\n * @param id - The id of the approval request.\n * @returns The promise callbacks associated with the approval request.\n */\n #deleteApprovalAndGetCallbacks(id: string): ApprovalCallbacks {\n const callbacks = this.#approvals.get(id);\n if (!callbacks) {\n throw new ApprovalRequestNotFoundError(id);\n }\n\n this.#delete(id);\n return callbacks;\n }\n\n async #result(\n type: string,\n opts: ResultOptions,\n requestData: Record,\n ) {\n try {\n await this.addAndShowApprovalRequest({\n origin: ORIGIN_METAMASK,\n type,\n requestData,\n });\n } catch (error) {\n console.info('Failed to display result page', error);\n } finally {\n if (opts.flowToEnd) {\n try {\n this.endFlow({ id: opts.flowToEnd });\n } catch (error) {\n console.info('Failed to end flow', { id: opts.flowToEnd, error });\n }\n }\n }\n }\n}\n\nexport default ApprovalController;\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/errors.js.map b/node_modules/@metamask/approval-controller/dist/errors.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/approval-controller/dist/errors.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/errors.mjs.map b/node_modules/@metamask/approval-controller/dist/errors.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/approval-controller/dist/errors.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/index.js b/node_modules/@metamask/approval-controller/dist/index.js +index 59a39d3..e1c5c4d 100644 +--- a/node_modules/@metamask/approval-controller/dist/index.js ++++ b/node_modules/@metamask/approval-controller/dist/index.js +@@ -3,7 +3,7 @@ + + + +-var _chunkPMXPCCKSjs = require('./chunk-PMXPCCKS.js'); ++var _chunkNONDXCHJjs = require('./chunk-NONDXCHJ.js'); + + + +@@ -21,5 +21,5 @@ var _chunkLKCXZAKDjs = require('./chunk-LKCXZAKD.js'); + + + +-exports.APPROVAL_TYPE_RESULT_ERROR = _chunkPMXPCCKSjs.APPROVAL_TYPE_RESULT_ERROR; exports.APPROVAL_TYPE_RESULT_SUCCESS = _chunkPMXPCCKSjs.APPROVAL_TYPE_RESULT_SUCCESS; exports.ApprovalController = _chunkPMXPCCKSjs.ApprovalController; exports.ApprovalRequestNoResultSupportError = _chunkLKCXZAKDjs.ApprovalRequestNoResultSupportError; exports.ApprovalRequestNotFoundError = _chunkLKCXZAKDjs.ApprovalRequestNotFoundError; exports.EndInvalidFlowError = _chunkLKCXZAKDjs.EndInvalidFlowError; exports.MissingApprovalFlowError = _chunkLKCXZAKDjs.MissingApprovalFlowError; exports.NoApprovalFlowsError = _chunkLKCXZAKDjs.NoApprovalFlowsError; exports.ORIGIN_METAMASK = _chunkPMXPCCKSjs.ORIGIN_METAMASK; ++exports.APPROVAL_TYPE_RESULT_ERROR = _chunkNONDXCHJjs.APPROVAL_TYPE_RESULT_ERROR; exports.APPROVAL_TYPE_RESULT_SUCCESS = _chunkNONDXCHJjs.APPROVAL_TYPE_RESULT_SUCCESS; exports.ApprovalController = _chunkNONDXCHJjs.ApprovalController; exports.ApprovalRequestNoResultSupportError = _chunkLKCXZAKDjs.ApprovalRequestNoResultSupportError; exports.ApprovalRequestNotFoundError = _chunkLKCXZAKDjs.ApprovalRequestNotFoundError; exports.EndInvalidFlowError = _chunkLKCXZAKDjs.EndInvalidFlowError; exports.MissingApprovalFlowError = _chunkLKCXZAKDjs.MissingApprovalFlowError; exports.NoApprovalFlowsError = _chunkLKCXZAKDjs.NoApprovalFlowsError; exports.ORIGIN_METAMASK = _chunkNONDXCHJjs.ORIGIN_METAMASK; + //# sourceMappingURL=index.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/index.js.map b/node_modules/@metamask/approval-controller/dist/index.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/approval-controller/dist/index.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/index.mjs b/node_modules/@metamask/approval-controller/dist/index.mjs +index c1c5b95..c482411 100644 +--- a/node_modules/@metamask/approval-controller/dist/index.mjs ++++ b/node_modules/@metamask/approval-controller/dist/index.mjs +@@ -3,7 +3,7 @@ import { + APPROVAL_TYPE_RESULT_SUCCESS, + ApprovalController, + ORIGIN_METAMASK +-} from "./chunk-PIJZDVKC.mjs"; ++} from "./chunk-CZANKQ6E.mjs"; + import { + ApprovalRequestNoResultSupportError, + ApprovalRequestNotFoundError, +diff --git a/node_modules/@metamask/approval-controller/dist/index.mjs.map b/node_modules/@metamask/approval-controller/dist/index.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/approval-controller/dist/index.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/tsconfig.build.tsbuildinfo b/node_modules/@metamask/approval-controller/dist/tsconfig.build.tsbuildinfo +index fca9670..c0271fb 100644 +--- a/node_modules/@metamask/approval-controller/dist/tsconfig.build.tsbuildinfo ++++ b/node_modules/@metamask/approval-controller/dist/tsconfig.build.tsbuildinfo +@@ -1 +1 @@ +-{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../types/eth-ens-namehash.d.ts","../../../types/ethereum-ens-network-map.d.ts","../../../types/ethjs-query.d.ts","../../../types/global.d.ts","../../../types/single-call-balance-checker-abi.d.ts","../../../types/@metamask/contract-metadata.d.ts","../../../types/@metamask/eth-hd-keyring.d.ts","../../../types/@metamask/eth-simple-keyring.d.ts","../../../types/@metamask/ethjs-provider-http.d.ts","../../../types/@metamask/ethjs-unit.d.ts","../../../types/@metamask/metamask-eth-abis.d.ts","../../../types/eth-json-rpc-infura/src/createProvider.d.ts","../../../types/eth-phishing-detect/src/config.json.d.ts","../../../types/eth-phishing-detect/src/detector.d.ts","../../base-controller/dist/types/BaseControllerV1.d.ts","../../../node_modules/@metamask/superstruct/dist/error.d.cts","../../../node_modules/@metamask/superstruct/dist/utils.d.cts","../../../node_modules/@metamask/superstruct/dist/struct.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/coercions.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/refinements.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/types.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/utilities.d.cts","../../../node_modules/@metamask/superstruct/dist/index.d.cts","../../../node_modules/@metamask/utils/dist/assert.d.cts","../../../node_modules/@metamask/utils/dist/base64.d.cts","../../../node_modules/@metamask/utils/dist/hex.d.cts","../../../node_modules/@metamask/utils/dist/bytes.d.cts","../../../node_modules/@metamask/utils/dist/caip-types.d.cts","../../../node_modules/@metamask/utils/dist/checksum.d.cts","../../../node_modules/@metamask/utils/dist/coercers.d.cts","../../../node_modules/@metamask/utils/dist/collections.d.cts","../../../node_modules/@metamask/utils/dist/encryption-types.d.cts","../../../node_modules/@metamask/utils/dist/errors.d.cts","../../../node_modules/@metamask/utils/dist/json.d.cts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@ethereumjs/common/dist/enums.d.ts","../../../node_modules/@ethereumjs/common/dist/types.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@ethereumjs/util/dist/constants.d.ts","../../../node_modules/@ethereumjs/util/dist/units.d.ts","../../../node_modules/@ethereumjs/util/dist/address.d.ts","../../../node_modules/@ethereumjs/util/dist/bytes.d.ts","../../../node_modules/@ethereumjs/util/dist/types.d.ts","../../../node_modules/@ethereumjs/util/dist/account.d.ts","../../../node_modules/@ethereumjs/util/dist/withdrawal.d.ts","../../../node_modules/@ethereumjs/util/dist/signature.d.ts","../../../node_modules/@ethereumjs/util/dist/encoding.d.ts","../../../node_modules/@ethereumjs/util/dist/asyncEventEmitter.d.ts","../../../node_modules/@ethereumjs/util/dist/internal.d.ts","../../../node_modules/@ethereumjs/util/dist/lock.d.ts","../../../node_modules/@ethereumjs/util/dist/provider.d.ts","../../../node_modules/@ethereumjs/util/dist/index.d.ts","../../../node_modules/@ethereumjs/common/dist/common.d.ts","../../../node_modules/@ethereumjs/common/dist/utils.d.ts","../../../node_modules/@ethereumjs/common/dist/index.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip2930Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/legacyTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/types.d.ts","../../../node_modules/@ethereumjs/tx/dist/baseTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip1559Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/transactionFactory.d.ts","../../../node_modules/@ethereumjs/tx/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/keyring.d.cts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@metamask/utils/dist/logging.d.cts","../../../node_modules/@metamask/utils/dist/misc.d.cts","../../../node_modules/@metamask/utils/dist/number.d.cts","../../../node_modules/@metamask/utils/dist/opaque.d.cts","../../../node_modules/@metamask/utils/dist/promise.d.cts","../../../node_modules/@metamask/utils/dist/time.d.cts","../../../node_modules/@metamask/utils/dist/transaction-types.d.cts","../../../node_modules/@metamask/utils/dist/versions.d.cts","../../../node_modules/@metamask/utils/dist/index.d.cts","../../../node_modules/immer/dist/utils/env.d.ts","../../../node_modules/immer/dist/utils/errors.d.ts","../../../node_modules/immer/dist/types/types-external.d.ts","../../../node_modules/immer/dist/types/types-internal.d.ts","../../../node_modules/immer/dist/utils/common.d.ts","../../../node_modules/immer/dist/utils/plugins.d.ts","../../../node_modules/immer/dist/core/scope.d.ts","../../../node_modules/immer/dist/core/finalize.d.ts","../../../node_modules/immer/dist/core/proxy.d.ts","../../../node_modules/immer/dist/core/immerClass.d.ts","../../../node_modules/immer/dist/core/current.d.ts","../../../node_modules/immer/dist/internal.d.ts","../../../node_modules/immer/dist/plugins/es5.d.ts","../../../node_modules/immer/dist/plugins/patches.d.ts","../../../node_modules/immer/dist/plugins/mapset.d.ts","../../../node_modules/immer/dist/plugins/all.d.ts","../../../node_modules/immer/dist/immer.d.ts","../../base-controller/dist/types/RestrictedControllerMessenger.d.ts","../../base-controller/dist/types/ControllerMessenger.d.ts","../../base-controller/dist/types/BaseControllerV2.d.ts","../../base-controller/dist/types/index.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/utils.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/classes.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/errors.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/error-constants.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/index.d.ts","../../../node_modules/nanoid/index.d.ts","../src/errors.ts","../src/ApprovalController.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/bn.js/index.d.ts","../../../node_modules/@types/deep-freeze-strict/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../node_modules/pretty-format/build/types.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/diffLines.d.ts","../../../node_modules/jest-diff/build/printDiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/jest-when/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/pbkdf2/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/punycode/index.d.ts","../../../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../../../node_modules/@types/readable-stream/index.d.ts","../../../node_modules/@types/secp256k1/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"70bbfaec021ac4a0c805374225b55d70887f987df8b8dd7711d79464bb7b4385","869089d60b67219f63e6aca810284c89bae1b384b5cbc7ce64e53d82ad223ed5","fe8f00e1ffe6c8069f2568844debb342a661980c30e52b132f002b93f66de47e",{"version":"f31113ac9492fdd6e78bf6151b338c92e5b1837be426ef4aa0648ce82d13b518","affectsGlobalScope":true},"62a0875a0397b35a2364f1d401c0ce17975dfa4d47bf6844de858ae04da349f9","ee7491d0318d1fafcba97d5b72b450eb52671570f7a4ecd9e8898d40eaae9472","e3e7d217d89b380c1f34395eadc9289542851b0f0a64007dfe1fb7cf7423d24e","fd79909e93b4d50fd0ed9f3d39ddf8ba0653290bac25c295aac49f6befbd081b","345a9cc2945406f53051cd0e9b51f82e1e53929848eab046fdda91ee8aa7da31","9debe2de883da37a914e5e784a7be54c201b8f1d783822ad6f443ff409a5ea21","dee5d5c5440cda1f3668f11809a5503c30db0476ad117dd450f7ba5a45300e8f","f5e396c1424c391078c866d6f84afe0b4d2f7f85a160b9c756cd63b5b1775d93","5caa6f4fff16066d377d4e254f6c34c16540da3809cd66cd626a303bc33c419f","730d055528bdf12c8524870bb33d237991be9084c57634e56e5d8075f6605e02","75b22c74010ba649de1a1676a4c4b8b5bb4294fecd05089e2094429b16d7840c","226def015ca59289682893af2c50f8d4adf6f77c4dcf00a0b77ba98adc00ca71","8cf46f3330f63e926bceb41243d46a55467bfa34ec4f01563e770e599feeb5cc","db85c964d3cd1ac9bfb59d42d6bde05f1f69b53229a8ee7ae4c7d14267fc34c8","72547bb96edca3d3775f58b850d24011f78b3e1103f661fcdce4b30a6a8e04c8","c44607e1dad6e87f9d44a2f896ec5791786572f905046182775fe98a61fd9fa5","0db170dda7c3b1671b166fc9719f7aee2a02fa7bf3e371f0c2a041dd8bdaaa22","8940d83825ccd3354cceeb4a29da3041b519c49f09c2852c35f5bad63aca27df","2f4183d0867b13b6dd80beb7e66c99053a920a9a3c92116ad5b501b10ee3b8e6","15937e4f5c00092805a7a0678ad03283cd568da3f9bb50d053b8ecfd01de175b","05b1add73885e5aa904fe4338166ecbadcad4708dc588bf9a1e5a48b6cb8b465","002d7e799a3b2dcbc410b85fa133557684d1875c5b47a6d548e7f1ae4586e300","01e26613f651ee6379c3876807868b5769d552f9865fcc811739e31b52a42e02","6c705c8fd5e5092dee8c978f3554a067332c0e27c633f9e84ca34fb373a4275a","c171fdcdf31d40e5dc5b56549b24f9c23e94e192f4b5b8df889c465da83f78d3","f865972ce21092d23c55578fa5d39b9637eef538c21be38827034c1ae84a7766","778b6fdafb19116da5427d642015a004ac68918cbad199fee74b23049cbe43d8","71ee902d0dcd6ae22f694d323d5153326802f85cd1b709ff73090588b816aa80","f08b55e3d374a242f86079e2df4653a4b834a13505f68ed3c19a857fbdf1becf","7112ad05075706b35bc2d43a7aafe2f7060c0f1b69de7fbac62083d5ffbb207c","5b3cd03ae354ea96eff1f74d7c410fe4852e6382227e8b0ecf87ab5e3a5bbcd4","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"056097110efd16869ec118cedb44ecbac9a019576eee808d61304ca6d5cb2cbe","affectsGlobalScope":true},"f51b4042a3ac86f1f707500a9768f88d0b0c1fc3f3e45a73333283dea720cdc6",{"version":"6fb8358e10ed92a7f515b7d79da3904c955a3ffd4e14aa9df6f0ea113041f1cf","affectsGlobalScope":true},"45c831238c6dac21c72da5f335747736a56a3847192bf03c84b958a7e9ec93e2","661a11d16ad2e3543a77c53bcd4017ee9a450f47ab7def3ab493a86eae4d550c",{"version":"8cdc646cec7819581ef343b83855b1bfe4fe674f2c84f4fb8dc90d82fb56bd3a","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","9dd56225cc2d8cb8fe5ceb0043ff386987637e12fecc6078896058a99deae284","2375ed4b439215aa3b6d0c6fd175c78a4384b30cb43cbadaecbf0a18954c98cb","7693b90b3075deaccafd5efb467bf9f2b747a3075be888652ef73e64396d8628","41231da15bb5e3e806a8395bd15c7befd2ec90f9f4e3c9d0ae1356bccb76dbb0","fccfef201d057cb407fa515311bd608549bab6c7b8adcf8f2df31f5d3b796478",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},"5f20d20b7607174caf1a6da9141aeb9f2142159ae2410ca30c7a0fccd1d19c99",{"version":"464762c6213566d072f1ced5e8e9a954785ec5e53883b7397198abb5ef5b8f71","affectsGlobalScope":true},"6387920dc3e18927335b086deec75bf8e50f879a5e273d32ee7bb7a55ba50572","9bba37424094688c4663c177a1379b229f919b8912889a472f32fdc5f08ddb4d","29a4be13b3a30d3e66667b75c58ec61fb2df8fa0422534fdee3cfb30c5dbf450","83366d901beda79d6eb37aaaf6ca248dcd88946302b2a7d975590783be51e88e","bf268a0aea37ad4ae3b7a9b58559190b6fc01ea16a31e35cd05817a0a60f895a","43ec77c369473e92e2ecebf0554a0fdaa9c256644a6070f28228dfcceec77351",{"version":"d7dad6db394a3d9f7b49755e4b610fbf8ed6eb0c9810ae5f1a119f6b5d76de45","affectsGlobalScope":true},"95ed02bacb4502c985b69742ec82a4576d4ff4a6620ecc91593f611d502ae546","bf755525c4e6f85a970b98c4755d98e8aa1b6dbd83a5d8fcc57d3d497351b936","dd67d2b5e4e8a182a38de8e69fb736945eaa4588e0909c14e01a14bd3cc1fd1e",{"version":"28084e15b63e6211769db2fe646d8bc5c4c6776321e0deffe2d12eefd52cb6b9","affectsGlobalScope":true},{"version":"aed37dabf86c99d6c8508700576ecede86688397bc12523541858705a0c737c2","affectsGlobalScope":true},"cc6ef5733d4ea6d2e06310a32dffd2c16418b467c5033d49cecc4f3a25de7497","94768454c3348b6ebe48e45fbad8c92e2bb7af4a35243edbe2b90823d0bd7f9a","0be79b3ff0f16b6c2f9bc8c4cc7097ea417d8d67f8267f7e1eec8e32b548c2ff","1c61ffa3a71b77363b30d19832c269ef62fba787f5610cac7254728d3b69ab2e","84da3c28344e621fd1d591f2c09e9595292d2b70018da28a553268ac122597d4","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","6e191fea1db6e9e4fa828259cf489e820ec9170effff57fb081a2f3295db4722","aed943465fbce1efe49ee16b5ea409050f15cd8eaf116f6fadb64ef0772e7d95","70d08483a67bf7050dbedace398ef3fee9f436fcd60517c97c4c1e22e3c6f3e8","c40fdf7b2e18df49ce0568e37f0292c12807a0748be79e272745e7216bed2606",{"version":"e933de8143e1d12dd51d89b398760fd5a9081896be366dad88a922d0b29f3c69","affectsGlobalScope":true},"4e228e78c1e9b0a75c70588d59288f63a6258e8b1fe4a67b0c53fe03461421d9","b38d55d08708c2410a3039687db70b4a5bfa69fc4845617c313b5a10d9c5c637","205d50c24359ead003dc537b9b65d2a64208dfdffe368f403cf9e0357831db9e","1265fddcd0c68be9d2a3b29805d0280484c961264dd95e0b675f7bd91f777e78",{"version":"a05e2d784c9be7051c4ac87a407c66d2106e23490c18c038bbd0712bde7602fd","affectsGlobalScope":true},{"version":"df90b9d0e9980762da8daf8adf6ffa0c853e76bfd269c377be0d07a9ad87acd2","affectsGlobalScope":true},"cf434b5c04792f62d6f4bdd5e2c8673f36e638e910333c172614d5def9b17f98","1d65d4798df9c2df008884035c41d3e67731f29db5ecb64cd7378797c7c53a2f","0faee6b555890a1cb106e2adc5d3ffd89545b1da894d474e9d436596d654998f","c6c01ea1c42508edf11a36d13b70f6e35774f74355ba5d358354d4a77cc67ea1","867f95abf1df444aab146b19847391fc2f922a55f6a970a27ed8226766cee29f",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b0297b09e607bec9698cac7cf55463d6731406efb1161ee4d448293b47397c84","175323e2a79a6076e0bada8a390d535a3ea817158bf1b1f46e31efca9028a0a2","7a10053aadc19335532a4d02756db4865974fd69bea5439ddcc5bfdf062d9476","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","aed9e712a9b168345362e8f3a949f16c99ca1e05d21328f05735dfdbb24414ef","b04fe6922ed3db93afdbd49cdda8576aa75f744592fceea96fb0d5f32158c4f5","ed8d6c8de90fc2a4faaebc28e91f2469928738efd5208fb75ade0fa607e892b7","d7c52b198d680fe65b1a8d1b001f0173ffa2536ca2e7082431d726ce1f6714cd","c07f251e1c4e415a838e5498380b55cfea94f3513229de292d2aa85ae52fc3e9","0ed401424892d6bf294a5374efe512d6951b54a71e5dd0290c55b6d0d915f6f7","b945be6da6a3616ef3a250bfe223362b1c7c6872e775b0c4d82a1bf7a28ff902","beea49237dd7c7110fabf3c7509919c9cb9da841d847c53cac162dc3479e2f87","0f45f8a529c450d8f394106cc622bff79e44a1716e1ac9c3cc68b43f7ecf65ee","c624ce90b04c27ce4f318ba6330d39bde3d4e306f0f497ce78d4bda5ab8e22ca","9b8253aa5cb2c82d505f72afdbf96e83b15cc6b9a6f4fadbbbab46210d5f1977","86a8f52e4b1ac49155e889376bcfa8528a634c90c27fec65aa0e949f77b740c5","aab5dd41c1e2316cc0b42a7dd15684f8582d5a1d16c0516276a2a8a7d0fecd9c","59948226626ee210045296ba1fc6cb0fe748d1ff613204e08e7157ab6862dee7","ec3e54d8b713c170fdc8110a7e4a6a97513a7ab6b05ac9e1100cb064d2bb7349","43beb30ecb39a603fde4376554887310b0699f25f7f39c5c91e3147b51bb3a26","666b77d7f06f49da114b090a399abbfa66d5b6c01a3fd9dc4f063a52ace28507","31997714a93fbc570f52d47d6a8ebfb021a34a68ea9ba58bbb69cdec9565657e","6032e4262822160128e644de3fc4410bcd7517c2f137525fd2623d2bb23cb0d3","8bd5c9b1016629c144fd228983395b9dbf0676a576716bc3d316cab612c33cd5","2ed90bd3925b23aed8f859ffd0e885250be0424ca2b57e9866dabef152e1d6b7","93f6bd17d92dab9db7897e1430a5aeaa03bcf51623156213d8397710367a76ce","3f62b770a42e8c47c7008726f95aa383e69d97e85e680d237b99fcb0ee601dd8","5b84cfe78028c35c3bb89c042f18bf08d09da11e82d275c378ae4d07d8477e6c","5c47cbe6feac3dd6c48e9c94257d0667c4a2ceb1d060cc096606e0bcaf70f929","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","fd8a907aa6143fa6baf0704ebb62b0f7b30bbc7da8dee7589a7d134ea5a41249","31c49bbd6efb206cc015afeee7e11155019e69233b05b59eea4a2106416e1e35","7a9a4d1b2f0591f6d37c1be3614ada1beb3f660882f2c38efe7f7dd1258aab53","081d47424b8007ee83a0f29e63063d05f3327c8cc46ec0cf7dfc646e07f9d7b5","be083ac10d3e177c2a1308a95047d939bd800aac32674d82decc96f3e95b286b","2261de2116a4757f3a68f2dc29c70727cec328ef6db3a1d5af69e8be6d0b7891","081e1fc213fd2737f0071d57ecf58ebd94a1e3640aef98549d9566ef3a8a0944","0e3600f285bf84f39ea5dc699ae8253035d9780805bdfa45c84c67c0afddc4a0","89066b64da62e15ff8682b15d6b828d4d85402e0392cc5321228c99a0ec83e32","4df0891b133884cd9ed752d31c7d0ec0a09234e9ed5394abffd3c660761598db","b603b62d3dcd31ef757dc7339b4fa8acdbca318b0fb9ac485f9a1351955615f9","e642bd47b75ad6b53cbf0dfd7ddfa0f120bd10193f0c58ec37d87b59bf604aca","be90b24d2ee6f875ce3aaa482e7c41a54278856b03d04212681c4032df62baf9","78f5ff400b3cb37e7b90eef1ff311253ed31c8cb66505e9828fad099bffde021","372c47090e1131305d163469a895ff2938f33fa73aad988df31cd31743f9efb6","71c67dc6987bdbd5599353f90009ff825dd7db0450ef9a0aee5bb0c574d18512","6f12403b5eca6ae7ca8e3efe3eeb9c683b06ce3e3844ccfd04098d83cd7e4957","282c535df88175d64d9df4550d2fd1176fd940c1c6822f1e7584003237f179d3","c3a4752cf103e4c6034d5bd449c8f9d5e7b352d22a5f8f9a41a8efb11646f9c2","11a9e38611ac3c77c74240c58b6bd64a0032128b29354e999650f1de1e034b1c","4ed103ca6fff9cb244f7c4b86d1eb28ce8069c32db720784329946731badb5bb","d738f282842970e058672663311c6875482ee36607c88b98ffb6604fba99cb2a","ec859cd8226aa623e41bbb47c249a55ee16dc1b8647359585244d57d3a5ed0c7","8891c6e959d253a66434ff5dc9ae46058fb3493e84b4ca39f710ef2d350656b1","c4463cf02535444dcbc3e67ecd29f1972490f74e49957d6fd4282a1013796ba6","0cb0a957ff02de0b25fd0f3f37130ca7f22d1e0dea256569c714c1f73c6791f8","2f5075dc512d51786b1ba3b1696565641dfaae3ac854f5f13d61fa12ef81a47e","ca3353cc82b1981f0d25d71d7432d583a6ef882ccdea82d65fbe49af37be51cb","50679a8e27aacf72f8c40bcab15d7ef5e83494089b4726b83eec4554344d5cdc","45351e0d51780b6f4088277a4457b9879506ee2720a887de232df0f1efcb33d8","5db0d05675408b569c509ee587d83e57a30506732efe710d38f6eafcb0d479f2","e0c2ca5792ca4524d848ac489640ed7c01963613c77bd71418ddb570091ffcea","030519c351f800551cac2658038804969ca4584d2c0175a710602ac234ca1340","0278a6939ca83cd040b08ff8c5fc7838b6693ddc52f22526bf158e6b10e0246c","068e9f2e03a27afdcb15528fa5ce998607c16e31c7108d78b76366e7e8ad6965","a45ee7555d019a67fbe092898d1aef0b1d02a9f6679ab84461ff515b4460d706",{"version":"47fc8d3105da26422943e3728d068da7766aab6aa2c475e4fbc406b09e1ac4df","signature":"df3fe991057a951202c2f6d5eedcf210e75fb6bf29bf262bd5cd40e7ae1bf17e"},{"version":"ab900400b6c68e69fc4661f17af3b528ba97f90618ef9228c08530130bee21df","signature":"a4bf9f436e49c5eef442d1ce8220a657fa63024a8c375e880c0f94caf21df9ac"},"f207c76b09220a4c22a544ef660cb257e0af11a3d63f163efab6701b641c1cea","4489c6a9fde8934733aa7df6f7911461ee6e9e4ad092736bd416f6b2cc20b2c6","2c8e55457aaf4902941dfdba4061935922e8ee6e120539c9801cd7b400fae050","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","8aceb205dcc6f814ad99635baf1e40b6e01d06d3fe27b72fd766c6d0b8c0c600","8c95f96ccd4be0674944077aec1e4f2cccd515ca06d4327562dd017250e7d3fc",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","bc3cba7b0af2d52e7425299aee518db479d44004eff6fbbd206d1ee7e5ec3fb5","afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"ccfd8774cd9b929f63ff7dcf657977eb0652e3547f1fcac1b3a1dc5db22d4d58","affectsGlobalScope":true},"d92dc90fecd2552db74d8dc3c6fb4db9145b2aa0efe2c127236ba035969068d4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","254d9fb8c872d73d34594be8a200fd7311dbfa10a4116bfc465fba408052f2b3","d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","2ccea88888048bbfcacbc9531a5596ea48a3e7dcd0a25f531a81bb717903ba4f","5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","f07a137bbe2de7a122c37bfea00e761975fb264c49f18003d398d71b3fb35a5f","d8f7109e14f20eb735225a62fd3f8366da1a8349e90331cdad57f4b04caf6c5a","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","9d92b037978bb9525bc4b673ebddd443277542e010c0aef019c03a170ccdaa73","ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","ae271d475b632ce7b03fea6d9cf6da72439e57a109672671cbc79f54e1386938"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":true,"module":1,"outDir":"./types","rootDir":"../src","sourceMap":true,"strict":true,"target":7},"fileIdsList":[[199],[93,129,130,131,146],[130,131,147,148],[129,130],[129,146,149,152],[129,149,152,153],[150,151,152,154,155],[129,152],[129,146,149,150,151,154],[129,137],[129],[93,129],[81,129],[133,134,135,136,137,138,139,140,141,142,143,144,145],[129,135,136],[129,135,137],[168,190],[190,191],[190,191,192,193],[168],[58,59,60,61,62,63,64],[58,59],[60],[59,60],[58,60],[65],[68],[65,68],[66,67,68,69,70,71,72,73,74,75,76,157,160,161,162,163,164,165,166,167],[65,66],[68,74,76,156],[159],[68,69],[65,163],[199,200,201,202,203],[199,201],[158],[207,208,209],[94,129],[212],[213],[224],[218,223],[227,229,230,231,232,233,234,235,236,237,238,239],[227,228,230,231,232,233,234,235,236,237,238,239],[228,229,230,231,232,233,234,235,236,237,238,239],[227,228,229,231,232,233,234,235,236,237,238,239],[227,228,229,230,232,233,234,235,236,237,238,239],[227,228,229,230,231,233,234,235,236,237,238,239],[227,228,229,230,231,232,234,235,236,237,238,239],[227,228,229,230,231,232,233,235,236,237,238,239],[227,228,229,230,231,232,233,234,236,237,238,239],[227,228,229,230,231,232,233,234,235,237,238,239],[227,228,229,230,231,232,233,234,235,236,238,239],[227,228,229,230,231,232,233,234,235,236,237,239],[227,228,229,230,231,232,233,234,235,236,237,238],[77],[80],[81,86,113],[82,93,94,101,110,121],[82,83,93,101],[84,122],[85,86,94,102],[86,110,118],[87,89,93,101],[88],[89,90],[93],[92,93],[80,93],[93,94,95,110,121],[93,94,95,110],[93,96,101,110,121],[93,94,96,97,101,110,118,121],[96,98,110,118,121],[77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128],[93,99],[100,121,126],[89,93,101,110],[102],[103],[80,104],[105,120,126],[106],[107],[93,108],[108,109,122,124],[81,93,110,111,112],[81,110,112],[110,111],[113],[114],[93,116,117],[116,117],[86,101,110,118],[119],[101,120],[81,96,107,121],[86,122],[110,123],[124],[125],[81,86,93,95,104,110,121,124,126],[110,127],[129,245],[248,287],[248,272,287],[287],[248],[248,273,287],[248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286],[273,287],[288],[292],[180],[180,181,182,183,184],[169,170,171,172,173,174,175,176,177,178,179],[216,219],[216,219,220,221],[218],[215,222],[217],[168,189,194,195,196],[196,197],[168,185,186,187],[186],[187],[57,186,187,188],[168,189,194]],"referencedMap":[[201,1],[147,2],[149,3],[131,4],[153,5],[154,6],[150,6],[156,7],[151,6],[155,8],[152,9],[138,10],[135,11],[142,12],[136,10],[133,13],[146,14],[140,11],[137,15],[139,16],[191,17],[192,18],[194,19],[190,20],[65,21],[60,22],[61,23],[62,23],[63,24],[64,24],[59,25],[66,26],[67,26],[69,27],[70,26],[71,26],[72,28],[68,26],[168,29],[76,30],[157,31],[160,32],[162,27],[166,33],[167,34],[204,35],[200,1],[202,36],[203,1],[205,11],[159,37],[210,38],[211,39],[213,40],[214,41],[225,42],[224,43],[228,44],[229,45],[227,46],[230,47],[231,48],[232,49],[233,50],[234,51],[235,52],[236,53],[237,54],[238,55],[239,56],[77,57],[78,57],[80,58],[81,59],[82,60],[83,61],[84,62],[85,63],[86,64],[87,65],[88,66],[89,67],[90,67],[91,68],[92,69],[93,70],[94,71],[95,72],[96,73],[97,74],[98,75],[129,76],[99,77],[100,78],[101,79],[102,80],[103,81],[104,82],[105,83],[106,84],[107,85],[108,86],[109,87],[110,88],[112,89],[111,90],[113,91],[114,92],[116,93],[117,94],[118,95],[119,96],[120,97],[121,98],[122,99],[123,100],[124,101],[125,102],[126,103],[127,104],[242,11],[246,105],[247,11],[272,106],[273,107],[248,108],[251,108],[270,106],[271,106],[261,106],[260,109],[258,106],[253,106],[266,106],[264,106],[268,106],[252,106],[265,106],[269,106],[254,106],[255,106],[267,106],[249,106],[256,106],[257,106],[259,106],[263,106],[274,110],[262,106],[250,106],[287,111],[281,110],[283,112],[282,110],[275,110],[276,110],[278,110],[280,110],[284,112],[285,112],[277,112],[279,112],[289,113],[293,114],[176,115],[178,115],[177,115],[175,115],[185,116],[180,117],[171,115],[172,115],[173,115],[174,115],[220,118],[222,119],[221,118],[219,120],[223,121],[218,122],[197,123],[198,124],[188,125],[187,126],[186,127],[189,128]],"exportedModulesMap":[[201,1],[147,2],[149,3],[131,4],[153,5],[154,6],[150,6],[156,7],[151,6],[155,8],[152,9],[138,10],[135,11],[142,12],[136,10],[133,13],[146,14],[140,11],[137,15],[139,16],[191,17],[192,18],[194,19],[190,20],[65,21],[60,22],[61,23],[62,23],[63,24],[64,24],[59,25],[66,26],[67,26],[69,27],[70,26],[71,26],[72,28],[68,26],[168,29],[76,30],[157,31],[160,32],[162,27],[166,33],[167,34],[204,35],[200,1],[202,36],[203,1],[205,11],[159,37],[210,38],[211,39],[213,40],[214,41],[225,42],[224,43],[228,44],[229,45],[227,46],[230,47],[231,48],[232,49],[233,50],[234,51],[235,52],[236,53],[237,54],[238,55],[239,56],[77,57],[78,57],[80,58],[81,59],[82,60],[83,61],[84,62],[85,63],[86,64],[87,65],[88,66],[89,67],[90,67],[91,68],[92,69],[93,70],[94,71],[95,72],[96,73],[97,74],[98,75],[129,76],[99,77],[100,78],[101,79],[102,80],[103,81],[104,82],[105,83],[106,84],[107,85],[108,86],[109,87],[110,88],[112,89],[111,90],[113,91],[114,92],[116,93],[117,94],[118,95],[119,96],[120,97],[121,98],[122,99],[123,100],[124,101],[125,102],[126,103],[127,104],[242,11],[246,105],[247,11],[272,106],[273,107],[248,108],[251,108],[270,106],[271,106],[261,106],[260,109],[258,106],[253,106],[266,106],[264,106],[268,106],[252,106],[265,106],[269,106],[254,106],[255,106],[267,106],[249,106],[256,106],[257,106],[259,106],[263,106],[274,110],[262,106],[250,106],[287,111],[281,110],[283,112],[282,110],[275,110],[276,110],[278,110],[280,110],[284,112],[285,112],[277,112],[279,112],[289,113],[293,114],[176,115],[178,115],[177,115],[175,115],[185,116],[180,117],[171,115],[172,115],[173,115],[174,115],[220,118],[222,119],[221,118],[219,120],[223,121],[218,122],[197,129],[198,124],[188,125],[187,126],[186,127],[189,128]],"semanticDiagnosticsPerFile":[201,199,147,130,149,131,148,153,154,150,156,151,155,152,138,135,142,136,133,141,146,143,144,145,140,137,134,139,191,193,192,194,190,58,65,60,61,62,63,64,59,66,67,69,70,71,72,73,74,75,68,168,76,157,160,161,162,163,164,165,166,167,204,200,202,203,205,159,206,207,210,208,211,212,213,214,225,224,209,226,228,229,227,230,231,232,233,234,235,236,237,238,239,240,158,77,78,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,79,128,96,97,98,129,99,100,101,102,103,104,105,106,107,108,109,110,112,111,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,241,242,243,244,246,245,247,272,273,248,251,270,271,261,260,258,253,266,264,268,252,265,269,254,255,267,249,256,257,259,263,274,262,250,287,286,281,283,282,275,276,278,280,284,285,277,279,289,288,290,291,292,293,132,215,179,176,178,177,175,185,180,184,181,183,182,171,172,173,169,170,174,216,220,222,221,219,223,195,218,217,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,197,196,198,57,188,187,186,189,48,49,50,51,52,53,43,54,55,56,44,45,46,47],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.9.5"} +\ No newline at end of file ++{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../types/eth-ens-namehash.d.ts","../../../types/ethereum-ens-network-map.d.ts","../../../types/ethjs-query.d.ts","../../../types/global.d.ts","../../../types/single-call-balance-checker-abi.d.ts","../../../types/@metamask/contract-metadata.d.ts","../../../types/@metamask/eth-hd-keyring.d.ts","../../../types/@metamask/eth-simple-keyring.d.ts","../../../types/@metamask/ethjs-provider-http.d.ts","../../../types/@metamask/ethjs-unit.d.ts","../../../types/@metamask/metamask-eth-abis.d.ts","../../../types/eth-json-rpc-infura/src/createprovider.d.ts","../../../types/eth-phishing-detect/src/config.json.d.ts","../../../types/eth-phishing-detect/src/detector.d.ts","../../base-controller/dist/types/basecontrollerv1.d.ts","../../../node_modules/@metamask/superstruct/dist/error.d.cts","../../../node_modules/@metamask/superstruct/dist/utils.d.cts","../../../node_modules/@metamask/superstruct/dist/struct.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/coercions.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/refinements.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/types.d.cts","../../../node_modules/@metamask/superstruct/dist/structs/utilities.d.cts","../../../node_modules/@metamask/superstruct/dist/index.d.cts","../../../node_modules/@metamask/utils/dist/assert.d.cts","../../../node_modules/@metamask/utils/dist/base64.d.cts","../../../node_modules/@metamask/utils/dist/hex.d.cts","../../../node_modules/@metamask/utils/dist/bytes.d.cts","../../../node_modules/@metamask/utils/dist/caip-types.d.cts","../../../node_modules/@metamask/utils/dist/checksum.d.cts","../../../node_modules/@metamask/utils/dist/coercers.d.cts","../../../node_modules/@metamask/utils/dist/collections.d.cts","../../../node_modules/@metamask/utils/dist/encryption-types.d.cts","../../../node_modules/@metamask/utils/dist/errors.d.cts","../../../node_modules/@metamask/utils/dist/json.d.cts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@ethereumjs/common/dist/enums.d.ts","../../../node_modules/@ethereumjs/common/dist/types.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@ethereumjs/util/dist/constants.d.ts","../../../node_modules/@ethereumjs/util/dist/units.d.ts","../../../node_modules/@ethereumjs/util/dist/address.d.ts","../../../node_modules/@ethereumjs/util/dist/bytes.d.ts","../../../node_modules/@ethereumjs/util/dist/types.d.ts","../../../node_modules/@ethereumjs/util/dist/account.d.ts","../../../node_modules/@ethereumjs/util/dist/withdrawal.d.ts","../../../node_modules/@ethereumjs/util/dist/signature.d.ts","../../../node_modules/@ethereumjs/util/dist/encoding.d.ts","../../../node_modules/@ethereumjs/util/dist/asynceventemitter.d.ts","../../../node_modules/@ethereumjs/util/dist/internal.d.ts","../../../node_modules/@ethereumjs/util/dist/lock.d.ts","../../../node_modules/@ethereumjs/util/dist/provider.d.ts","../../../node_modules/@ethereumjs/util/dist/index.d.ts","../../../node_modules/@ethereumjs/common/dist/common.d.ts","../../../node_modules/@ethereumjs/common/dist/utils.d.ts","../../../node_modules/@ethereumjs/common/dist/index.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip2930transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/legacytransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/types.d.ts","../../../node_modules/@ethereumjs/tx/dist/basetransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip1559transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/transactionfactory.d.ts","../../../node_modules/@ethereumjs/tx/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/keyring.d.cts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@metamask/utils/dist/logging.d.cts","../../../node_modules/@metamask/utils/dist/misc.d.cts","../../../node_modules/@metamask/utils/dist/number.d.cts","../../../node_modules/@metamask/utils/dist/opaque.d.cts","../../../node_modules/@metamask/utils/dist/promise.d.cts","../../../node_modules/@metamask/utils/dist/time.d.cts","../../../node_modules/@metamask/utils/dist/transaction-types.d.cts","../../../node_modules/@metamask/utils/dist/versions.d.cts","../../../node_modules/@metamask/utils/dist/index.d.cts","../../../node_modules/immer/dist/utils/env.d.ts","../../../node_modules/immer/dist/utils/errors.d.ts","../../../node_modules/immer/dist/types/types-external.d.ts","../../../node_modules/immer/dist/types/types-internal.d.ts","../../../node_modules/immer/dist/utils/common.d.ts","../../../node_modules/immer/dist/utils/plugins.d.ts","../../../node_modules/immer/dist/core/scope.d.ts","../../../node_modules/immer/dist/core/finalize.d.ts","../../../node_modules/immer/dist/core/proxy.d.ts","../../../node_modules/immer/dist/core/immerclass.d.ts","../../../node_modules/immer/dist/core/current.d.ts","../../../node_modules/immer/dist/internal.d.ts","../../../node_modules/immer/dist/plugins/es5.d.ts","../../../node_modules/immer/dist/plugins/patches.d.ts","../../../node_modules/immer/dist/plugins/mapset.d.ts","../../../node_modules/immer/dist/plugins/all.d.ts","../../../node_modules/immer/dist/immer.d.ts","../../base-controller/dist/types/restrictedcontrollermessenger.d.ts","../../base-controller/dist/types/controllermessenger.d.ts","../../base-controller/dist/types/basecontrollerv2.d.ts","../../base-controller/dist/types/index.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/utils.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/classes.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/errors.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/error-constants.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/index.d.ts","../../../node_modules/nanoid/index.d.ts","../src/errors.ts","../src/approvalcontroller.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/bn.js/index.d.ts","../../../node_modules/@types/deep-freeze-strict/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/jest-diff/build/cleanupsemantic.d.ts","../../../node_modules/pretty-format/build/types.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/difflines.d.ts","../../../node_modules/jest-diff/build/printdiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/jest-when/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/pbkdf2/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/punycode/index.d.ts","../../../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../../../node_modules/@types/readable-stream/index.d.ts","../../../node_modules/@types/secp256k1/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"70bbfaec021ac4a0c805374225b55d70887f987df8b8dd7711d79464bb7b4385","869089d60b67219f63e6aca810284c89bae1b384b5cbc7ce64e53d82ad223ed5","fe8f00e1ffe6c8069f2568844debb342a661980c30e52b132f002b93f66de47e",{"version":"f31113ac9492fdd6e78bf6151b338c92e5b1837be426ef4aa0648ce82d13b518","affectsGlobalScope":true},"62a0875a0397b35a2364f1d401c0ce17975dfa4d47bf6844de858ae04da349f9","ee7491d0318d1fafcba97d5b72b450eb52671570f7a4ecd9e8898d40eaae9472","e3e7d217d89b380c1f34395eadc9289542851b0f0a64007dfe1fb7cf7423d24e","fd79909e93b4d50fd0ed9f3d39ddf8ba0653290bac25c295aac49f6befbd081b","345a9cc2945406f53051cd0e9b51f82e1e53929848eab046fdda91ee8aa7da31","9debe2de883da37a914e5e784a7be54c201b8f1d783822ad6f443ff409a5ea21","dee5d5c5440cda1f3668f11809a5503c30db0476ad117dd450f7ba5a45300e8f","f5e396c1424c391078c866d6f84afe0b4d2f7f85a160b9c756cd63b5b1775d93","5caa6f4fff16066d377d4e254f6c34c16540da3809cd66cd626a303bc33c419f","730d055528bdf12c8524870bb33d237991be9084c57634e56e5d8075f6605e02","75b22c74010ba649de1a1676a4c4b8b5bb4294fecd05089e2094429b16d7840c","226def015ca59289682893af2c50f8d4adf6f77c4dcf00a0b77ba98adc00ca71","8cf46f3330f63e926bceb41243d46a55467bfa34ec4f01563e770e599feeb5cc","db85c964d3cd1ac9bfb59d42d6bde05f1f69b53229a8ee7ae4c7d14267fc34c8","72547bb96edca3d3775f58b850d24011f78b3e1103f661fcdce4b30a6a8e04c8","c44607e1dad6e87f9d44a2f896ec5791786572f905046182775fe98a61fd9fa5","0db170dda7c3b1671b166fc9719f7aee2a02fa7bf3e371f0c2a041dd8bdaaa22","8940d83825ccd3354cceeb4a29da3041b519c49f09c2852c35f5bad63aca27df","2f4183d0867b13b6dd80beb7e66c99053a920a9a3c92116ad5b501b10ee3b8e6","15937e4f5c00092805a7a0678ad03283cd568da3f9bb50d053b8ecfd01de175b","05b1add73885e5aa904fe4338166ecbadcad4708dc588bf9a1e5a48b6cb8b465","002d7e799a3b2dcbc410b85fa133557684d1875c5b47a6d548e7f1ae4586e300","01e26613f651ee6379c3876807868b5769d552f9865fcc811739e31b52a42e02","6c705c8fd5e5092dee8c978f3554a067332c0e27c633f9e84ca34fb373a4275a","c171fdcdf31d40e5dc5b56549b24f9c23e94e192f4b5b8df889c465da83f78d3","f865972ce21092d23c55578fa5d39b9637eef538c21be38827034c1ae84a7766","778b6fdafb19116da5427d642015a004ac68918cbad199fee74b23049cbe43d8","71ee902d0dcd6ae22f694d323d5153326802f85cd1b709ff73090588b816aa80","f08b55e3d374a242f86079e2df4653a4b834a13505f68ed3c19a857fbdf1becf","7112ad05075706b35bc2d43a7aafe2f7060c0f1b69de7fbac62083d5ffbb207c","5b3cd03ae354ea96eff1f74d7c410fe4852e6382227e8b0ecf87ab5e3a5bbcd4","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"056097110efd16869ec118cedb44ecbac9a019576eee808d61304ca6d5cb2cbe","affectsGlobalScope":true},"f51b4042a3ac86f1f707500a9768f88d0b0c1fc3f3e45a73333283dea720cdc6",{"version":"6fb8358e10ed92a7f515b7d79da3904c955a3ffd4e14aa9df6f0ea113041f1cf","affectsGlobalScope":true},"45c831238c6dac21c72da5f335747736a56a3847192bf03c84b958a7e9ec93e2","661a11d16ad2e3543a77c53bcd4017ee9a450f47ab7def3ab493a86eae4d550c",{"version":"8cdc646cec7819581ef343b83855b1bfe4fe674f2c84f4fb8dc90d82fb56bd3a","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","9dd56225cc2d8cb8fe5ceb0043ff386987637e12fecc6078896058a99deae284","2375ed4b439215aa3b6d0c6fd175c78a4384b30cb43cbadaecbf0a18954c98cb","7693b90b3075deaccafd5efb467bf9f2b747a3075be888652ef73e64396d8628","41231da15bb5e3e806a8395bd15c7befd2ec90f9f4e3c9d0ae1356bccb76dbb0","fccfef201d057cb407fa515311bd608549bab6c7b8adcf8f2df31f5d3b796478",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},"5f20d20b7607174caf1a6da9141aeb9f2142159ae2410ca30c7a0fccd1d19c99",{"version":"464762c6213566d072f1ced5e8e9a954785ec5e53883b7397198abb5ef5b8f71","affectsGlobalScope":true},"6387920dc3e18927335b086deec75bf8e50f879a5e273d32ee7bb7a55ba50572","9bba37424094688c4663c177a1379b229f919b8912889a472f32fdc5f08ddb4d","29a4be13b3a30d3e66667b75c58ec61fb2df8fa0422534fdee3cfb30c5dbf450","83366d901beda79d6eb37aaaf6ca248dcd88946302b2a7d975590783be51e88e","bf268a0aea37ad4ae3b7a9b58559190b6fc01ea16a31e35cd05817a0a60f895a","43ec77c369473e92e2ecebf0554a0fdaa9c256644a6070f28228dfcceec77351",{"version":"d7dad6db394a3d9f7b49755e4b610fbf8ed6eb0c9810ae5f1a119f6b5d76de45","affectsGlobalScope":true},"95ed02bacb4502c985b69742ec82a4576d4ff4a6620ecc91593f611d502ae546","bf755525c4e6f85a970b98c4755d98e8aa1b6dbd83a5d8fcc57d3d497351b936","dd67d2b5e4e8a182a38de8e69fb736945eaa4588e0909c14e01a14bd3cc1fd1e",{"version":"28084e15b63e6211769db2fe646d8bc5c4c6776321e0deffe2d12eefd52cb6b9","affectsGlobalScope":true},{"version":"aed37dabf86c99d6c8508700576ecede86688397bc12523541858705a0c737c2","affectsGlobalScope":true},"cc6ef5733d4ea6d2e06310a32dffd2c16418b467c5033d49cecc4f3a25de7497","94768454c3348b6ebe48e45fbad8c92e2bb7af4a35243edbe2b90823d0bd7f9a","0be79b3ff0f16b6c2f9bc8c4cc7097ea417d8d67f8267f7e1eec8e32b548c2ff","1c61ffa3a71b77363b30d19832c269ef62fba787f5610cac7254728d3b69ab2e","84da3c28344e621fd1d591f2c09e9595292d2b70018da28a553268ac122597d4","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","6e191fea1db6e9e4fa828259cf489e820ec9170effff57fb081a2f3295db4722","aed943465fbce1efe49ee16b5ea409050f15cd8eaf116f6fadb64ef0772e7d95","70d08483a67bf7050dbedace398ef3fee9f436fcd60517c97c4c1e22e3c6f3e8","c40fdf7b2e18df49ce0568e37f0292c12807a0748be79e272745e7216bed2606",{"version":"e933de8143e1d12dd51d89b398760fd5a9081896be366dad88a922d0b29f3c69","affectsGlobalScope":true},"4e228e78c1e9b0a75c70588d59288f63a6258e8b1fe4a67b0c53fe03461421d9","b38d55d08708c2410a3039687db70b4a5bfa69fc4845617c313b5a10d9c5c637","205d50c24359ead003dc537b9b65d2a64208dfdffe368f403cf9e0357831db9e","1265fddcd0c68be9d2a3b29805d0280484c961264dd95e0b675f7bd91f777e78",{"version":"a05e2d784c9be7051c4ac87a407c66d2106e23490c18c038bbd0712bde7602fd","affectsGlobalScope":true},{"version":"df90b9d0e9980762da8daf8adf6ffa0c853e76bfd269c377be0d07a9ad87acd2","affectsGlobalScope":true},"cf434b5c04792f62d6f4bdd5e2c8673f36e638e910333c172614d5def9b17f98","1d65d4798df9c2df008884035c41d3e67731f29db5ecb64cd7378797c7c53a2f","0faee6b555890a1cb106e2adc5d3ffd89545b1da894d474e9d436596d654998f","c6c01ea1c42508edf11a36d13b70f6e35774f74355ba5d358354d4a77cc67ea1","867f95abf1df444aab146b19847391fc2f922a55f6a970a27ed8226766cee29f",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b0297b09e607bec9698cac7cf55463d6731406efb1161ee4d448293b47397c84","175323e2a79a6076e0bada8a390d535a3ea817158bf1b1f46e31efca9028a0a2","7a10053aadc19335532a4d02756db4865974fd69bea5439ddcc5bfdf062d9476","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","aed9e712a9b168345362e8f3a949f16c99ca1e05d21328f05735dfdbb24414ef","b04fe6922ed3db93afdbd49cdda8576aa75f744592fceea96fb0d5f32158c4f5","ed8d6c8de90fc2a4faaebc28e91f2469928738efd5208fb75ade0fa607e892b7","d7c52b198d680fe65b1a8d1b001f0173ffa2536ca2e7082431d726ce1f6714cd","c07f251e1c4e415a838e5498380b55cfea94f3513229de292d2aa85ae52fc3e9","0ed401424892d6bf294a5374efe512d6951b54a71e5dd0290c55b6d0d915f6f7","b945be6da6a3616ef3a250bfe223362b1c7c6872e775b0c4d82a1bf7a28ff902","beea49237dd7c7110fabf3c7509919c9cb9da841d847c53cac162dc3479e2f87","0f45f8a529c450d8f394106cc622bff79e44a1716e1ac9c3cc68b43f7ecf65ee","c624ce90b04c27ce4f318ba6330d39bde3d4e306f0f497ce78d4bda5ab8e22ca","9b8253aa5cb2c82d505f72afdbf96e83b15cc6b9a6f4fadbbbab46210d5f1977","86a8f52e4b1ac49155e889376bcfa8528a634c90c27fec65aa0e949f77b740c5","aab5dd41c1e2316cc0b42a7dd15684f8582d5a1d16c0516276a2a8a7d0fecd9c","59948226626ee210045296ba1fc6cb0fe748d1ff613204e08e7157ab6862dee7","ec3e54d8b713c170fdc8110a7e4a6a97513a7ab6b05ac9e1100cb064d2bb7349","43beb30ecb39a603fde4376554887310b0699f25f7f39c5c91e3147b51bb3a26","666b77d7f06f49da114b090a399abbfa66d5b6c01a3fd9dc4f063a52ace28507","31997714a93fbc570f52d47d6a8ebfb021a34a68ea9ba58bbb69cdec9565657e","6032e4262822160128e644de3fc4410bcd7517c2f137525fd2623d2bb23cb0d3","8bd5c9b1016629c144fd228983395b9dbf0676a576716bc3d316cab612c33cd5","2ed90bd3925b23aed8f859ffd0e885250be0424ca2b57e9866dabef152e1d6b7","93f6bd17d92dab9db7897e1430a5aeaa03bcf51623156213d8397710367a76ce","3f62b770a42e8c47c7008726f95aa383e69d97e85e680d237b99fcb0ee601dd8","5b84cfe78028c35c3bb89c042f18bf08d09da11e82d275c378ae4d07d8477e6c","5c47cbe6feac3dd6c48e9c94257d0667c4a2ceb1d060cc096606e0bcaf70f929","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","fd8a907aa6143fa6baf0704ebb62b0f7b30bbc7da8dee7589a7d134ea5a41249","31c49bbd6efb206cc015afeee7e11155019e69233b05b59eea4a2106416e1e35","7a9a4d1b2f0591f6d37c1be3614ada1beb3f660882f2c38efe7f7dd1258aab53","081d47424b8007ee83a0f29e63063d05f3327c8cc46ec0cf7dfc646e07f9d7b5","be083ac10d3e177c2a1308a95047d939bd800aac32674d82decc96f3e95b286b","2261de2116a4757f3a68f2dc29c70727cec328ef6db3a1d5af69e8be6d0b7891","081e1fc213fd2737f0071d57ecf58ebd94a1e3640aef98549d9566ef3a8a0944","0e3600f285bf84f39ea5dc699ae8253035d9780805bdfa45c84c67c0afddc4a0","89066b64da62e15ff8682b15d6b828d4d85402e0392cc5321228c99a0ec83e32","4df0891b133884cd9ed752d31c7d0ec0a09234e9ed5394abffd3c660761598db","b603b62d3dcd31ef757dc7339b4fa8acdbca318b0fb9ac485f9a1351955615f9","e642bd47b75ad6b53cbf0dfd7ddfa0f120bd10193f0c58ec37d87b59bf604aca","be90b24d2ee6f875ce3aaa482e7c41a54278856b03d04212681c4032df62baf9","78f5ff400b3cb37e7b90eef1ff311253ed31c8cb66505e9828fad099bffde021","372c47090e1131305d163469a895ff2938f33fa73aad988df31cd31743f9efb6","71c67dc6987bdbd5599353f90009ff825dd7db0450ef9a0aee5bb0c574d18512","6f12403b5eca6ae7ca8e3efe3eeb9c683b06ce3e3844ccfd04098d83cd7e4957","282c535df88175d64d9df4550d2fd1176fd940c1c6822f1e7584003237f179d3","c3a4752cf103e4c6034d5bd449c8f9d5e7b352d22a5f8f9a41a8efb11646f9c2","11a9e38611ac3c77c74240c58b6bd64a0032128b29354e999650f1de1e034b1c","4ed103ca6fff9cb244f7c4b86d1eb28ce8069c32db720784329946731badb5bb","d738f282842970e058672663311c6875482ee36607c88b98ffb6604fba99cb2a","ec859cd8226aa623e41bbb47c249a55ee16dc1b8647359585244d57d3a5ed0c7","8891c6e959d253a66434ff5dc9ae46058fb3493e84b4ca39f710ef2d350656b1","c4463cf02535444dcbc3e67ecd29f1972490f74e49957d6fd4282a1013796ba6","0cb0a957ff02de0b25fd0f3f37130ca7f22d1e0dea256569c714c1f73c6791f8","2f5075dc512d51786b1ba3b1696565641dfaae3ac854f5f13d61fa12ef81a47e","ca3353cc82b1981f0d25d71d7432d583a6ef882ccdea82d65fbe49af37be51cb","50679a8e27aacf72f8c40bcab15d7ef5e83494089b4726b83eec4554344d5cdc","45351e0d51780b6f4088277a4457b9879506ee2720a887de232df0f1efcb33d8","5db0d05675408b569c509ee587d83e57a30506732efe710d38f6eafcb0d479f2","e0c2ca5792ca4524d848ac489640ed7c01963613c77bd71418ddb570091ffcea","030519c351f800551cac2658038804969ca4584d2c0175a710602ac234ca1340","0278a6939ca83cd040b08ff8c5fc7838b6693ddc52f22526bf158e6b10e0246c","068e9f2e03a27afdcb15528fa5ce998607c16e31c7108d78b76366e7e8ad6965","a45ee7555d019a67fbe092898d1aef0b1d02a9f6679ab84461ff515b4460d706",{"version":"47fc8d3105da26422943e3728d068da7766aab6aa2c475e4fbc406b09e1ac4df","signature":"df3fe991057a951202c2f6d5eedcf210e75fb6bf29bf262bd5cd40e7ae1bf17e"},{"version":"9a786177a1d701e55bdf6ae8aaccff07185cd47d3217f60b8d2541455b96fa1f","signature":"dc1eb42b3964192340c3cda3cf3882f1a660fd158bd67cf01f8c01dd789090c6"},"f207c76b09220a4c22a544ef660cb257e0af11a3d63f163efab6701b641c1cea","4489c6a9fde8934733aa7df6f7911461ee6e9e4ad092736bd416f6b2cc20b2c6","2c8e55457aaf4902941dfdba4061935922e8ee6e120539c9801cd7b400fae050","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","8aceb205dcc6f814ad99635baf1e40b6e01d06d3fe27b72fd766c6d0b8c0c600","8c95f96ccd4be0674944077aec1e4f2cccd515ca06d4327562dd017250e7d3fc",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","bc3cba7b0af2d52e7425299aee518db479d44004eff6fbbd206d1ee7e5ec3fb5","afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"ccfd8774cd9b929f63ff7dcf657977eb0652e3547f1fcac1b3a1dc5db22d4d58","affectsGlobalScope":true},"d92dc90fecd2552db74d8dc3c6fb4db9145b2aa0efe2c127236ba035969068d4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","254d9fb8c872d73d34594be8a200fd7311dbfa10a4116bfc465fba408052f2b3","d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","2ccea88888048bbfcacbc9531a5596ea48a3e7dcd0a25f531a81bb717903ba4f","5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","f07a137bbe2de7a122c37bfea00e761975fb264c49f18003d398d71b3fb35a5f","d8f7109e14f20eb735225a62fd3f8366da1a8349e90331cdad57f4b04caf6c5a","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","9d92b037978bb9525bc4b673ebddd443277542e010c0aef019c03a170ccdaa73","ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","ae271d475b632ce7b03fea6d9cf6da72439e57a109672671cbc79f54e1386938"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":true,"module":1,"outDir":"./types","rootDir":"../src","sourceMap":true,"strict":true,"target":7},"fileIdsList":[[199],[93,129,130,131,146],[130,131,147,148],[129,130],[129,146,149,152],[129,149,152,153],[150,151,152,154,155],[129,152],[129,146,149,150,151,154],[129,137],[129],[93,129],[81,129],[133,134,135,136,137,138,139,140,141,142,143,144,145],[129,135,136],[129,135,137],[168,190],[190,191],[190,191,192,193],[168],[58,59,60,61,62,63,64],[58,59],[60],[59,60],[58,60],[65],[68],[65,68],[66,67,68,69,70,71,72,73,74,75,76,157,160,161,162,163,164,165,166,167],[65,66],[68,74,76,156],[159],[68,69],[65,163],[199,200,201,202,203],[199,201],[158],[207,208,209],[94,129],[212],[213],[224],[218,223],[227,229,230,231,232,233,234,235,236,237,238,239],[227,228,230,231,232,233,234,235,236,237,238,239],[228,229,230,231,232,233,234,235,236,237,238,239],[227,228,229,231,232,233,234,235,236,237,238,239],[227,228,229,230,232,233,234,235,236,237,238,239],[227,228,229,230,231,233,234,235,236,237,238,239],[227,228,229,230,231,232,234,235,236,237,238,239],[227,228,229,230,231,232,233,235,236,237,238,239],[227,228,229,230,231,232,233,234,236,237,238,239],[227,228,229,230,231,232,233,234,235,237,238,239],[227,228,229,230,231,232,233,234,235,236,238,239],[227,228,229,230,231,232,233,234,235,236,237,239],[227,228,229,230,231,232,233,234,235,236,237,238],[77],[80],[81,86,113],[82,93,94,101,110,121],[82,83,93,101],[84,122],[85,86,94,102],[86,110,118],[87,89,93,101],[88],[89,90],[93],[92,93],[80,93],[93,94,95,110,121],[93,94,95,110],[93,96,101,110,121],[93,94,96,97,101,110,118,121],[96,98,110,118,121],[77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128],[93,99],[100,121,126],[89,93,101,110],[102],[103],[80,104],[105,120,126],[106],[107],[93,108],[108,109,122,124],[81,93,110,111,112],[81,110,112],[110,111],[113],[114],[93,116,117],[116,117],[86,101,110,118],[119],[101,120],[81,96,107,121],[86,122],[110,123],[124],[125],[81,86,93,95,104,110,121,124,126],[110,127],[129,245],[248,287],[248,272,287],[287],[248],[248,273,287],[248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286],[273,287],[288],[292],[180],[180,181,182,183,184],[169,170,171,172,173,174,175,176,177,178,179],[216,219],[216,219,220,221],[218],[215,222],[217],[168,189,194,195,196],[196,197],[168,185,186,187],[186],[57,186,187,188],[187],[168,189,194]],"referencedMap":[[201,1],[147,2],[149,3],[131,4],[153,5],[154,6],[150,6],[156,7],[151,6],[155,8],[152,9],[138,10],[135,11],[142,12],[136,10],[133,13],[146,14],[140,11],[137,15],[139,16],[191,17],[192,18],[194,19],[190,20],[65,21],[60,22],[61,23],[62,23],[63,24],[64,24],[59,25],[66,26],[67,26],[69,27],[70,26],[71,26],[72,28],[68,26],[168,29],[76,30],[157,31],[160,32],[162,27],[166,33],[167,34],[204,35],[200,1],[202,36],[203,1],[205,11],[159,37],[210,38],[211,39],[213,40],[214,41],[225,42],[224,43],[228,44],[229,45],[227,46],[230,47],[231,48],[232,49],[233,50],[234,51],[235,52],[236,53],[237,54],[238,55],[239,56],[77,57],[78,57],[80,58],[81,59],[82,60],[83,61],[84,62],[85,63],[86,64],[87,65],[88,66],[89,67],[90,67],[91,68],[92,69],[93,70],[94,71],[95,72],[96,73],[97,74],[98,75],[129,76],[99,77],[100,78],[101,79],[102,80],[103,81],[104,82],[105,83],[106,84],[107,85],[108,86],[109,87],[110,88],[112,89],[111,90],[113,91],[114,92],[116,93],[117,94],[118,95],[119,96],[120,97],[121,98],[122,99],[123,100],[124,101],[125,102],[126,103],[127,104],[242,11],[246,105],[247,11],[272,106],[273,107],[248,108],[251,108],[270,106],[271,106],[261,106],[260,109],[258,106],[253,106],[266,106],[264,106],[268,106],[252,106],[265,106],[269,106],[254,106],[255,106],[267,106],[249,106],[256,106],[257,106],[259,106],[263,106],[274,110],[262,106],[250,106],[287,111],[281,110],[283,112],[282,110],[275,110],[276,110],[278,110],[280,110],[284,112],[285,112],[277,112],[279,112],[289,113],[293,114],[176,115],[178,115],[177,115],[175,115],[185,116],[180,117],[171,115],[172,115],[173,115],[174,115],[220,118],[222,119],[221,118],[219,120],[223,121],[218,122],[197,123],[198,124],[188,125],[187,126],[189,127],[186,128]],"exportedModulesMap":[[201,1],[147,2],[149,3],[131,4],[153,5],[154,6],[150,6],[156,7],[151,6],[155,8],[152,9],[138,10],[135,11],[142,12],[136,10],[133,13],[146,14],[140,11],[137,15],[139,16],[191,17],[192,18],[194,19],[190,20],[65,21],[60,22],[61,23],[62,23],[63,24],[64,24],[59,25],[66,26],[67,26],[69,27],[70,26],[71,26],[72,28],[68,26],[168,29],[76,30],[157,31],[160,32],[162,27],[166,33],[167,34],[204,35],[200,1],[202,36],[203,1],[205,11],[159,37],[210,38],[211,39],[213,40],[214,41],[225,42],[224,43],[228,44],[229,45],[227,46],[230,47],[231,48],[232,49],[233,50],[234,51],[235,52],[236,53],[237,54],[238,55],[239,56],[77,57],[78,57],[80,58],[81,59],[82,60],[83,61],[84,62],[85,63],[86,64],[87,65],[88,66],[89,67],[90,67],[91,68],[92,69],[93,70],[94,71],[95,72],[96,73],[97,74],[98,75],[129,76],[99,77],[100,78],[101,79],[102,80],[103,81],[104,82],[105,83],[106,84],[107,85],[108,86],[109,87],[110,88],[112,89],[111,90],[113,91],[114,92],[116,93],[117,94],[118,95],[119,96],[120,97],[121,98],[122,99],[123,100],[124,101],[125,102],[126,103],[127,104],[242,11],[246,105],[247,11],[272,106],[273,107],[248,108],[251,108],[270,106],[271,106],[261,106],[260,109],[258,106],[253,106],[266,106],[264,106],[268,106],[252,106],[265,106],[269,106],[254,106],[255,106],[267,106],[249,106],[256,106],[257,106],[259,106],[263,106],[274,110],[262,106],[250,106],[287,111],[281,110],[283,112],[282,110],[275,110],[276,110],[278,110],[280,110],[284,112],[285,112],[277,112],[279,112],[289,113],[293,114],[176,115],[178,115],[177,115],[175,115],[185,116],[180,117],[171,115],[172,115],[173,115],[174,115],[220,118],[222,119],[221,118],[219,120],[223,121],[218,122],[197,129],[198,124],[188,125],[187,126],[189,127],[186,128]],"semanticDiagnosticsPerFile":[201,199,147,130,149,131,148,153,154,150,156,151,155,152,138,135,142,136,133,141,146,143,144,145,140,137,134,139,191,193,192,194,190,58,65,60,61,62,63,64,59,66,67,69,70,71,72,73,74,75,68,168,76,157,160,161,162,163,164,165,166,167,204,200,202,203,205,159,206,207,210,208,211,212,213,214,225,224,209,226,228,229,227,230,231,232,233,234,235,236,237,238,239,240,158,77,78,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,79,128,96,97,98,129,99,100,101,102,103,104,105,106,107,108,109,110,112,111,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,241,242,243,244,246,245,247,272,273,248,251,270,271,261,260,258,253,266,264,268,252,265,269,254,255,267,249,256,257,259,263,274,262,250,287,286,281,283,282,275,276,278,280,284,285,277,279,289,288,290,291,292,293,132,215,179,176,178,177,175,185,180,184,181,183,182,171,172,173,169,170,174,216,220,222,221,219,223,195,218,217,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,197,196,198,57,188,187,189,186,48,49,50,51,52,53,43,54,55,56,44,45,46,47],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.9.5"} +\ No newline at end of file +diff --git a/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts b/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts +index 2b9ad4d..2c90f90 100644 +--- a/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts ++++ b/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts +@@ -101,6 +101,12 @@ export type AcceptOptions = { + * If false or unspecified, the promise will resolve immediately. + */ + waitForResult?: boolean; ++ /** ++ * Whether to delete the approval request after a result callback is called. ++ * If false or unspecified, the approval request will be deleted immediately. ++ * Ignored if `waitForResult` is false or unspecified. ++ */ ++ deleteAfterResult?: boolean; + }; + export type StartFlowOptions = OptionalField & { + show?: boolean; +diff --git a/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts.map b/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts.map +index 76f79a1..0c8c942 100644 +--- a/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts.map ++++ b/node_modules/@metamask/approval-controller/dist/types/ApprovalController.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"ApprovalController.d.ts","sourceRoot":"","sources":["../../src/ApprovalController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YA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AK,EAAE,OAAO,GAAG,IAAI;IAIxC;;;;;OAKG;IACH,KAAK,CAAC,cAAc,EAAE,YAAY,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAWhE;;;;;;OAMG;IACH,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI;IAWzD;;;;;;;;OAQG;IACH,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,uBAAuB;IAgB/D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc;IAmB9B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,yBAAyB;IAcjE;;;;;;;;;;OAUG;IACG,OAAO,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;IAWhE;;;;;;;;;;OAUG;IACG,KAAK,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;CAuO3D;AAED,eAAe,kBAAkB,CAAC"} +\ No newline at end of file ++{"version":3,"file":"ApprovalController.d.ts","sourceRoot":"","sources":["../../src/ApprovalController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAc3D,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAE7D,QAAA,MAAM,cAAc,uBAAuB,CAAC;AAyB5C,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG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AC,EAAE,EAAE,EAAE,EAAE,cAAc;IAmB9B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,yBAAyB;IAcjE;;;;;;;;;;OAUG;IACG,OAAO,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;IAWhE;;;;;;;;;;OAUG;IACG,KAAK,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;CAgO3D;AAED,eAAe,kBAAkB,CAAC"} +\ No newline at end of file diff --git a/patches/@metamask+nonce-tracker+5.0.0.patch b/patches/@metamask+nonce-tracker+5.0.0.patch new file mode 100644 index 00000000000..e8e6c1dcbd2 --- /dev/null +++ b/patches/@metamask+nonce-tracker+5.0.0.patch @@ -0,0 +1,30 @@ +diff --git a/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js b/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js +index 7cfa1e1962c930a425b3dbf6e1520450f0bf1747..2f4ff77a678fe0501e96a92d16f63a8e5f299401 100644 +--- a/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js ++++ b/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js +@@ -12,7 +12,6 @@ class NonceTracker { + constructor(opts) { + this.provider = opts.provider; + this.blockTracker = opts.blockTracker; +- this.web3 = new Web3Provider(opts.provider); + this.getPendingTransactions = opts.getPendingTransactions; + this.getConfirmedTransactions = opts.getConfirmedTransactions; + this.lockMap = {}; +@@ -96,7 +95,7 @@ class NonceTracker { + // we need to make sure our base count + // and pending count are from the same block + const blockNumber = await this.blockTracker.getLatestBlock(); +- const baseCount = await this.web3.getTransactionCount(address, blockNumber); ++ const baseCount = await new Web3Provider(this.provider).getTransactionCount(address, blockNumber); + assert_1.default(Number.isInteger(baseCount), `nonce-tracker - baseCount is not an integer - got: (${typeof baseCount}) "${baseCount}"`); + return { + name: 'network', +diff --git a/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js.map b/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js.map +index 70e16afc468187dddb2ba1a6752e60c0aadb0f82..0e9d43aed1f7c5ccc2e16f91318aaab88da104ea 100644 +--- a/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js.map ++++ b/node_modules/@metamask/nonce-tracker/dist/NonceTracker.js.map +@@ -1 +1 @@ +-{"version":3,"file":"NonceTracker.js","sourceRoot":"","sources":["../src/NonceTracker.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6CAAoC;AAGpC,qGAAqG;AACrG,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAqF7D,MAAa,YAAY;IAavB,YAAY,IAAyB;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAC1D,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,wBAAwB,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QACjB,MAAM,WAAW,GAAU,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvD,0BAA0B;QAC1B,MAAM,WAAW,GAAiB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAAC,OAAe;QAChC,0BAA0B;QAC1B,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,kCAAkC;QAClC,MAAM,WAAW,GAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAA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E,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,MAAM,YAAY,GAAW,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,yBAAyB,CACvB,MAAqB,EACrB,UAAkB;QAElB,MAAM,MAAM,GAAa,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;YAClC,gBAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,8BAA8B,CAAC,CAAC;YAClE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,GAAW,UAAU,CAAC;QACjC,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC,CAAC;SACd;QAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IAC7E,CAAC;CACF;AAzLD,oCAyLC"} +\ No newline at end of file diff --git a/patches/@metamask+rpc-errors+6.2.1.patch b/patches/@metamask+rpc-errors+6.2.1.patch deleted file mode 100644 index a71cf1e2058..00000000000 --- a/patches/@metamask+rpc-errors+6.2.1.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/node_modules/@metamask/rpc-errors/dist/chunk-77LIU62I.js b/node_modules/@metamask/rpc-errors/dist/chunk-77LIU62I.js -index f7be896..534305f 100644 ---- a/node_modules/@metamask/rpc-errors/dist/chunk-77LIU62I.js -+++ b/node_modules/@metamask/rpc-errors/dist/chunk-77LIU62I.js -@@ -35,9 +35,14 @@ var JsonRpcError = class extends Error { - serialized.data.cause = _chunkLIUXO4DWjs.serializeCause.call(void 0, this.data.cause); - } - } -+ /** -+ * passing the stack creates a loop, possible conflicting with hermes, since it's hermes that throws an error -+ */ -+ /* - if (this.stack) { - serialized.stack = this.stack; - } -+ */ - return serialized; - } - /** diff --git a/patches/@metamask+rpc-errors+6.3.1.patch b/patches/@metamask+rpc-errors+6.3.1.patch new file mode 100644 index 00000000000..a7ba2358c78 --- /dev/null +++ b/patches/@metamask+rpc-errors+6.3.1.patch @@ -0,0 +1,19 @@ +diff --git a/node_modules/@metamask/rpc-errors/dist/chunk-PV5NRPSS.js b/node_modules/@metamask/rpc-errors/dist/chunk-PV5NRPSS.js +index b92b1bc..467d025 100644 +--- a/node_modules/@metamask/rpc-errors/dist/chunk-PV5NRPSS.js ++++ b/node_modules/@metamask/rpc-errors/dist/chunk-PV5NRPSS.js +@@ -46,9 +46,14 @@ var JsonRpcError = class extends Error { + serialized.data.cause = _chunkXOYARAPPjs.serializeCause.call(void 0, this.data.cause); + } + } ++ /** ++ * passing the stack creates a loop, possible conflicting with hermes, since it's hermes that throws an error ++ */ ++ /* + if (this.stack) { + serialized.stack = this.stack; + } ++ */ + return serialized; + } + /** diff --git a/patches/@metamask+transaction-controller+13.0.0.patch b/patches/@metamask+transaction-controller+13.0.0.patch deleted file mode 100644 index 37d479799ac..00000000000 --- a/patches/@metamask+transaction-controller+13.0.0.patch +++ /dev/null @@ -1,3552 +0,0 @@ -diff --git a/node_modules/@metamask/transaction-controller/dist/.patch.txt b/node_modules/@metamask/transaction-controller/dist/.patch.txt -new file mode 100644 -index 0000000..550de56 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/.patch.txt -@@ -0,0 +1,7 @@ -+PATCH GENERATED FROM MetaMask/core branch: patch/mobile-transaction-controller-13-0-0 -+This patch backports various transaction controller features from the main branch of MetaMask/core -+Steps to update patch: -+* Create a new core branch from: patch/mobile-transaction-controller-13-0-0 -+* Run "yarn build" in the core monorepo -+* Run "yarn patch:tx " in the mobile repo -+* Once the new patch is merged, add your changes to: patch/mobile-transaction-controller-13-0-0 -diff --git a/node_modules/@metamask/transaction-controller/dist/EtherscanRemoteTransactionSource.d.ts.map b/node_modules/@metamask/transaction-controller/dist/EtherscanRemoteTransactionSource.d.ts.map -deleted file mode 100644 -index 9a28bf5..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/EtherscanRemoteTransactionSource.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"EtherscanRemoteTransactionSource.d.ts","sourceRoot":"","sources":["../src/EtherscanRemoteTransactionSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAiB3C,OAAO,KAAK,EACV,uBAAuB,EACvB,8BAA8B,EAC9B,eAAe,EAChB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,qBAAa,gCACX,YAAW,uBAAuB;;gBAMtB,EACV,qBAAqB,GACtB,GAAE;QAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAO;IAK3C,kBAAkB,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAIzC,sBAAsB,IAAI,MAAM,EAAE;IAI5B,iBAAiB,CACrB,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,eAAe,EAAE,CAAC;CAkI9B"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/EtherscanRemoteTransactionSource.js.map b/node_modules/@metamask/transaction-controller/dist/EtherscanRemoteTransactionSource.js.map -deleted file mode 100644 -index 4b10444..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/EtherscanRemoteTransactionSource.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"EtherscanRemoteTransactionSource.js","sourceRoot":"","sources":["../src/EtherscanRemoteTransactionSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAqD;AAErD,qDAAqC;AACrC,+BAAoC;AAEpC,2CAA2D;AAQ3D,2CAGqB;AACrB,qCAA6D;AAM7D,mC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E,IAAA,0BAAO,EAAC,IAAI,oBAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACxC,KAAK,EAAE,IAAA,0BAAO,EAAC,IAAI,oBAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,KAAK,EAAE,IAAA,0BAAO,EAAC,IAAI,oBAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACrC;QACD,oBAAoB,EAAE,KAAK;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["import { BNToHex } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\nimport { BN } from 'ethereumjs-util';\nimport { v1 as random } from 'uuid';\n\nimport { ETHERSCAN_SUPPORTED_NETWORKS } from './constants';\nimport type {\n EtherscanTokenTransactionMeta,\n EtherscanTransactionMeta,\n EtherscanTransactionMetaBase,\n EtherscanTransactionRequest,\n EtherscanTransactionResponse,\n} from './etherscan';\nimport {\n fetchEtherscanTokenTransactions,\n fetchEtherscanTransactions,\n} from './etherscan';\nimport { incomingTransactionsLogger as log } from './logger';\nimport type {\n RemoteTransactionSource,\n RemoteTransactionSourceRequest,\n TransactionMeta,\n} from './types';\nimport { TransactionStatus } from './types';\n\n/**\n * A RemoteTransactionSource that fetches transaction data from Etherscan.\n */\nexport class EtherscanRemoteTransactionSource\n implements RemoteTransactionSource\n{\n #includeTokenTransfers: boolean;\n\n #isTokenRequestPending: boolean;\n\n constructor({\n includeTokenTransfers,\n }: { includeTokenTransfers?: boolean } = {}) {\n this.#includeTokenTransfers = includeTokenTransfers ?? true;\n this.#isTokenRequestPending = false;\n }\n\n isSupportedNetwork(chainId: Hex): boolean {\n return Object.keys(ETHERSCAN_SUPPORTED_NETWORKS).includes(chainId);\n }\n\n getLastBlockVariations(): string[] {\n return [this.#isTokenRequestPending ? 'token' : 'normal'];\n }\n\n async fetchTransactions(\n request: RemoteTransactionSourceRequest,\n ): Promise {\n const etherscanRequest: EtherscanTransactionRequest = {\n ...request,\n chainId: request.currentChainId,\n };\n\n const transactions = this.#isTokenRequestPending\n ? await this.#fetchTokenTransactions(request, etherscanRequest)\n : await this.#fetchNormalTransactions(request, etherscanRequest);\n\n if (this.#includeTokenTransfers) {\n this.#isTokenRequestPending = !this.#isTokenRequestPending;\n }\n\n return transactions;\n }\n\n #fetchNormalTransactions = async (\n request: RemoteTransactionSourceRequest,\n etherscanRequest: EtherscanTransactionRequest,\n ) => {\n const { currentChainId } = request;\n\n const etherscanTransactions = await fetchEtherscanTransactions(\n etherscanRequest,\n );\n\n return this.#getResponseTransactions(etherscanTransactions).map((tx) =>\n this.#normalizeTransaction(tx, currentChainId),\n );\n };\n\n #fetchTokenTransactions = async (\n request: RemoteTransactionSourceRequest,\n etherscanRequest: EtherscanTransactionRequest,\n ) => {\n const { currentChainId } = request;\n\n const etherscanTransactions = await fetchEtherscanTokenTransactions(\n etherscanRequest,\n );\n\n return this.#getResponseTransactions(etherscanTransactions).map((tx) =>\n this.#normalizeTokenTransaction(tx, currentChainId),\n );\n };\n\n #getResponseTransactions(\n response: EtherscanTransactionResponse,\n ): T[] {\n let result = response.result as T[];\n\n if (response.status === '0') {\n result = [];\n\n if (response.result.length) {\n log('Ignored Etherscan request error', {\n message: response.result,\n type: this.#isTokenRequestPending ? 'token' : 'normal',\n });\n }\n }\n\n return result;\n }\n\n #normalizeTransaction(\n txMeta: EtherscanTransactionMeta,\n currentChainId: Hex,\n ): TransactionMeta {\n const base = this.#normalizeTransactionBase(txMeta, currentChainId);\n\n return {\n ...base,\n txParams: {\n ...base.txParams,\n data: txMeta.input,\n },\n ...(txMeta.isError === '0'\n ? { status: TransactionStatus.confirmed }\n : {\n error: new Error('Transaction failed'),\n status: TransactionStatus.failed,\n }),\n };\n }\n\n #normalizeTokenTransaction(\n txMeta: EtherscanTokenTransactionMeta,\n currentChainId: Hex,\n ): TransactionMeta {\n const base = this.#normalizeTransactionBase(txMeta, currentChainId);\n\n return {\n ...base,\n isTransfer: true,\n transferInformation: {\n contractAddress: txMeta.contractAddress,\n decimals: Number(txMeta.tokenDecimal),\n symbol: txMeta.tokenSymbol,\n },\n };\n }\n\n #normalizeTransactionBase(\n txMeta: EtherscanTransactionMetaBase,\n currentChainId: Hex,\n ): TransactionMeta {\n const time = parseInt(txMeta.timeStamp, 10) * 1000;\n\n return {\n blockNumber: txMeta.blockNumber,\n chainId: currentChainId,\n hash: txMeta.hash,\n id: random({ msecs: time }),\n status: TransactionStatus.confirmed,\n time,\n txParams: {\n chainId: currentChainId,\n from: txMeta.from,\n gas: BNToHex(new BN(txMeta.gas)),\n gasPrice: BNToHex(new BN(txMeta.gasPrice)),\n gasUsed: BNToHex(new BN(txMeta.gasUsed)),\n nonce: BNToHex(new BN(txMeta.nonce)),\n to: txMeta.to,\n value: BNToHex(new BN(txMeta.value)),\n },\n verifiedOnBlockchain: false,\n };\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/IncomingTransactionHelper.d.ts.map b/node_modules/@metamask/transaction-controller/dist/IncomingTransactionHelper.d.ts.map -deleted file mode 100644 -index 5d3ae50..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/IncomingTransactionHelper.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"IncomingTransactionHelper.d.ts","sourceRoot":"","sources":["../src/IncomingTransactionHelper.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AASxE,qBAAa,yBAAyB;;IACpC,GAAG,EAAE,YAAY,CAAC;gBA4BN,EACV,YAAY,EACZ,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,GACnB,EAAE;QACD,YAAY,EAAE,YAAY,CAAC;QAC3B,iBAAiB,EAAE,MAAM,MAAM,CAAC;QAChC,0BAA0B,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzD,oBAAoB,CAAC,EAAE,MAAM,eAAe,EAAE,CAAC;QAC/C,eAAe,EAAE,MAAM,YAAY,CAAC;QACpC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;QAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,uBAAuB,EAAE,uBAAuB,CAAC;QACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;IA0BD,KAAK;IAaL,IAAI;IAKE,MAAM,CAAC,oBAAoB,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAmMxD"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/IncomingTransactionHelper.js.map b/node_modules/@metamask/transaction-controller/dist/IncomingTransactionHelper.js.map -deleted file mode 100644 -index a45b30c..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/IncomingTransactionHelper.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"IncomingTransactionHelper.js","sourceRoot":"","sources":["../src/IncomingTransactionHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAAoC;AACpC,oDAAkC;AAElC,qCAA6D;AAG7D,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,MAAM,aAAa,GAAyC;IAC1D,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM;IACzB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;CACpC,CAAC;AAEF,MAAa,yBAAyB;IA6BpC,YAAY,EACV,YAAY,EACZ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B,EAAE;QAC3C,OAAO;KACR;IAED,uBAAuB,CAAC,cAAc,CAAC,GAAG,sBAAsB,CAAC;IAEjE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gCAAgC,EAAE;QAC9C,uBAAuB;QACvB,WAAW,EAAE,sBAAsB;KACpC,CAAC,CAAC;AACL,CAAC,uGAEkB,cAAwB;IACzC,MAAM,cAAc,GAAG,uBAAA,IAAI,0FAAmB,MAAvB,IAAI,CAAqB,CAAC;IACjD,MAAM,cAAc,GAAG,uBAAA,IAAI,oDAAmB,MAAvB,IAAI,CAAqB,CAAC,WAAW,EAAE,CAAC;IAE/D,OAAO,CAAC,cAAc,EAAE,cAAc,EAAE,GAAG,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvE,CAAC;IAGC,MAAM,SAAS,GAAG,uBAAA,IAAI,4CAAW,MAAf,IAAI,CAAa,CAAC;IACpC,MAAM,cAAc,GAAG,uBAAA,IAAI,0FAAmB,MAAvB,IAAI,CAAqB,CAAC;IAEjD,MAAM,kBAAkB,GACtB,uBAAA,IAAI,0DAAyB,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAEnE,OAAO,SAAS,IAAI,kBAAkB,CAAC;AACzC,CAAC;IAGC,OAAO,uBAAA,IAAI,kDAAiB,MAArB,IAAI,CAAmB,CAAC,cAAc,CAAC,OAAO,CAAC;AACxD,CAAC","sourcesContent":["import type { BlockTracker, NetworkState } from '@metamask/network-controller';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport EventEmitter from 'events';\n\nimport { incomingTransactionsLogger as log } from './logger';\nimport type { RemoteTransactionSource, TransactionMeta } from './types';\n\nconst RECENT_HISTORY_BLOCK_RANGE = 10;\n\nconst UPDATE_CHECKS: ((txMeta: TransactionMeta) => any)[] = [\n (txMeta) => txMeta.status,\n (txMeta) => txMeta.txParams.gasUsed,\n];\n\nexport class IncomingTransactionHelper {\n hub: EventEmitter;\n\n #blockTracker: BlockTracker;\n\n #getCurrentAccount: () => string;\n\n #getLastFetchedBlockNumbers: () => Record;\n\n #getLocalTransactions: () => TransactionMeta[];\n\n #getNetworkState: () => NetworkState;\n\n #isEnabled: () => boolean;\n\n #isRunning: boolean;\n\n #mutex = new Mutex();\n\n #onLatestBlock: (blockNumberHex: Hex) => Promise;\n\n #queryEntireHistory: boolean;\n\n #remoteTransactionSource: RemoteTransactionSource;\n\n #transactionLimit?: number;\n\n #updateTransactions: boolean;\n\n constructor({\n blockTracker,\n getCurrentAccount,\n getLastFetchedBlockNumbers,\n getLocalTransactions,\n getNetworkState,\n isEnabled,\n queryEntireHistory,\n remoteTransactionSource,\n transactionLimit,\n updateTransactions,\n }: {\n blockTracker: BlockTracker;\n getCurrentAccount: () => string;\n getLastFetchedBlockNumbers: () => Record;\n getLocalTransactions?: () => TransactionMeta[];\n getNetworkState: () => NetworkState;\n isEnabled?: () => boolean;\n queryEntireHistory?: boolean;\n remoteTransactionSource: RemoteTransactionSource;\n transactionLimit?: number;\n updateTransactions?: boolean;\n }) {\n this.hub = new EventEmitter();\n\n this.#blockTracker = blockTracker;\n this.#getCurrentAccount = getCurrentAccount;\n this.#getLastFetchedBlockNumbers = getLastFetchedBlockNumbers;\n this.#getLocalTransactions = getLocalTransactions || (() => []);\n this.#getNetworkState = getNetworkState;\n this.#isEnabled = isEnabled ?? (() => true);\n this.#isRunning = false;\n this.#queryEntireHistory = queryEntireHistory ?? true;\n this.#remoteTransactionSource = remoteTransactionSource;\n this.#transactionLimit = transactionLimit;\n this.#updateTransactions = updateTransactions ?? false;\n\n // Using a property instead of a method to provide a listener reference\n // with the correct scope that we can remove later if stopped.\n this.#onLatestBlock = async (blockNumberHex: Hex) => {\n try {\n await this.update(blockNumberHex);\n } catch (error) {\n console.error('Error while checking incoming transactions', error);\n }\n };\n }\n\n start() {\n if (this.#isRunning) {\n return;\n }\n\n if (!this.#canStart()) {\n return;\n }\n\n this.#blockTracker.addListener('latest', this.#onLatestBlock);\n this.#isRunning = true;\n }\n\n stop() {\n this.#blockTracker.removeListener('latest', this.#onLatestBlock);\n this.#isRunning = false;\n }\n\n async update(latestBlockNumberHex?: Hex): Promise {\n const releaseLock = await this.#mutex.acquire();\n\n log('Checking for incoming transactions');\n\n try {\n if (!this.#canStart()) {\n return;\n }\n\n const latestBlockNumber = parseInt(\n latestBlockNumberHex || (await this.#blockTracker.getLatestBlock()),\n 16,\n );\n\n const additionalLastFetchedKeys =\n this.#remoteTransactionSource.getLastBlockVariations?.() ?? [];\n\n const fromBlock = this.#getFromBlock(\n latestBlockNumber,\n additionalLastFetchedKeys,\n );\n\n const address = this.#getCurrentAccount();\n const currentChainId = this.#getCurrentChainId();\n\n let remoteTransactions = [];\n\n try {\n remoteTransactions =\n await this.#remoteTransactionSource.fetchTransactions({\n address,\n currentChainId,\n fromBlock,\n limit: this.#transactionLimit,\n });\n } catch (error: any) {\n log('Error while fetching remote transactions', error);\n return;\n }\n\n if (!this.#updateTransactions) {\n remoteTransactions = remoteTransactions.filter(\n (tx) => tx.txParams.to?.toLowerCase() === address.toLowerCase(),\n );\n }\n\n const localTransactions = !this.#updateTransactions\n ? []\n : this.#getLocalTransactions();\n\n const newTransactions = this.#getNewTransactions(\n remoteTransactions,\n localTransactions,\n );\n\n const updatedTransactions = this.#getUpdatedTransactions(\n remoteTransactions,\n localTransactions,\n );\n\n if (newTransactions.length > 0 || updatedTransactions.length > 0) {\n this.#sortTransactionsByTime(newTransactions);\n this.#sortTransactionsByTime(updatedTransactions);\n\n log('Found incoming transactions', {\n new: newTransactions,\n updated: updatedTransactions,\n });\n\n this.hub.emit('transactions', {\n added: newTransactions,\n updated: updatedTransactions,\n });\n }\n\n this.#updateLastFetchedBlockNumber(\n remoteTransactions,\n additionalLastFetchedKeys,\n );\n } finally {\n releaseLock();\n }\n }\n\n #sortTransactionsByTime(transactions: TransactionMeta[]) {\n transactions.sort((a, b) => (a.time < b.time ? -1 : 1));\n }\n\n #getNewTransactions(\n remoteTxs: TransactionMeta[],\n localTxs: TransactionMeta[],\n ): TransactionMeta[] {\n return remoteTxs.filter(\n (tx) => !localTxs.some(({ hash }) => hash === tx.hash),\n );\n }\n\n #getUpdatedTransactions(\n remoteTxs: TransactionMeta[],\n localTxs: TransactionMeta[],\n ): TransactionMeta[] {\n return remoteTxs.filter((remoteTx) =>\n localTxs.some(\n (localTx) =>\n remoteTx.hash === localTx.hash &&\n this.#isTransactionOutdated(remoteTx, localTx),\n ),\n );\n }\n\n #isTransactionOutdated(\n remoteTx: TransactionMeta,\n localTx: TransactionMeta,\n ): boolean {\n return UPDATE_CHECKS.some(\n (getValue) => getValue(remoteTx) !== getValue(localTx),\n );\n }\n\n #getFromBlock(\n latestBlockNumber: number,\n additionalKeys: string[],\n ): number | undefined {\n const lastFetchedKey = this.#getBlockNumberKey(additionalKeys);\n\n const lastFetchedBlockNumber =\n this.#getLastFetchedBlockNumbers()[lastFetchedKey];\n\n if (lastFetchedBlockNumber) {\n return lastFetchedBlockNumber + 1;\n }\n\n return this.#queryEntireHistory\n ? undefined\n : latestBlockNumber - RECENT_HISTORY_BLOCK_RANGE;\n }\n\n #updateLastFetchedBlockNumber(\n remoteTxs: TransactionMeta[],\n additionalKeys: string[],\n ) {\n let lastFetchedBlockNumber = -1;\n\n for (const tx of remoteTxs) {\n const currentBlockNumberValue = tx.blockNumber\n ? parseInt(tx.blockNumber, 10)\n : -1;\n\n lastFetchedBlockNumber = Math.max(\n lastFetchedBlockNumber,\n currentBlockNumberValue,\n );\n }\n\n if (lastFetchedBlockNumber === -1) {\n return;\n }\n\n const lastFetchedKey = this.#getBlockNumberKey(additionalKeys);\n const lastFetchedBlockNumbers = this.#getLastFetchedBlockNumbers();\n const previousValue = lastFetchedBlockNumbers[lastFetchedKey];\n\n if (previousValue >= lastFetchedBlockNumber) {\n return;\n }\n\n lastFetchedBlockNumbers[lastFetchedKey] = lastFetchedBlockNumber;\n\n this.hub.emit('updatedLastFetchedBlockNumbers', {\n lastFetchedBlockNumbers,\n blockNumber: lastFetchedBlockNumber,\n });\n }\n\n #getBlockNumberKey(additionalKeys: string[]): string {\n const currentChainId = this.#getCurrentChainId();\n const currentAccount = this.#getCurrentAccount().toLowerCase();\n\n return [currentChainId, currentAccount, ...additionalKeys].join('#');\n }\n\n #canStart(): boolean {\n const isEnabled = this.#isEnabled();\n const currentChainId = this.#getCurrentChainId();\n\n const isSupportedNetwork =\n this.#remoteTransactionSource.isSupportedNetwork(currentChainId);\n\n return isEnabled && isSupportedNetwork;\n }\n\n #getCurrentChainId(): Hex {\n return this.#getNetworkState().providerConfig.chainId;\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/TransactionController.d.ts b/node_modules/@metamask/transaction-controller/dist/TransactionController.d.ts -index d8fa996..caf3ea3 100644 ---- a/node_modules/@metamask/transaction-controller/dist/TransactionController.d.ts -+++ b/node_modules/@metamask/transaction-controller/dist/TransactionController.d.ts -@@ -1,15 +1,15 @@ - /// --import { Hardfork } from '@ethereumjs/common'; - import type { TypedTransaction } from '@ethereumjs/tx'; - import type { AddApprovalRequest } from '@metamask/approval-controller'; - import type { BaseConfig, BaseState, RestrictedControllerMessenger } from '@metamask/base-controller'; - import { BaseController } from '@metamask/base-controller'; -+import type { GasFeeState } from '@metamask/gas-fee-controller'; - import type { BlockTracker, NetworkState, Provider } from '@metamask/network-controller'; - import type { Hex } from '@metamask/utils'; - import { EventEmitter } from 'events'; --import type { TransactionParams, TransactionMeta, TransactionReceipt, SendFlowHistoryEntry, WalletDevice } from './types'; -+import type { NonceLock, Transaction as NonceTrackerTransaction } from 'nonce-tracker/dist/NonceTracker'; -+import type { TransactionParams, TransactionMeta, TransactionReceipt, SecurityAlertResponse, SendFlowHistoryEntry, WalletDevice, SubmitHistoryEntry } from './types'; - import { TransactionType } from './types'; --export declare const HARDFORK = Hardfork.London; - /** - * @type Result - * @property result - Promise resolving to a new transaction hash -@@ -65,11 +65,12 @@ export interface TransactionState extends BaseState { - lastFetchedBlockNumbers: { - [key: string]: number; - }; -+ submitHistory: SubmitHistoryEntry[]; - } - /** - * Multiplier used to determine a transaction's increased gas fee during cancellation - */ --export declare const CANCEL_RATE = 1.5; -+export declare const CANCEL_RATE = 1.1; - /** - * Multiplier used to determine a transaction's increased gas fee during speed up - */ -@@ -90,6 +91,7 @@ export declare type TransactionControllerMessenger = RestrictedControllerMesseng - * Controller responsible for submitting and managing transactions. - */ - export declare class TransactionController extends BaseController { -+ #private; - private ethQuery; - private readonly isHistoryDisabled; - private readonly isSendFlowHistoryDisabled; -@@ -98,11 +100,18 @@ export declare class TransactionController extends BaseController Promise; -- getCurrentNetworkEIP1559Compatibility: () => Promise; -+ getCurrentNetworkEIP1559Compatibility: () => Promise; -+ getGasFeeEstimates: () => Promise; - getNetworkState: () => NetworkState; - getSelectedAddress: () => string; -+ getExternalPendingTransactions?: (address: string) => NonceTrackerTransaction[]; - incomingTransactions: { - includeTokenTransfers?: boolean; - isEnabled?: () => boolean; - queryEntireHistory?: boolean; - updateTransactions?: boolean; - }; -+ isSimulationEnabled?: () => boolean; - messenger: TransactionControllerMessenger; - onNetworkStateChange: (listener: (state: NetworkState) => void) => void; - provider: Provider; -+ hooks: { -+ publish?: (transactionMeta: TransactionMeta) => Promise<{ -+ transactionHash: string | undefined; -+ }>; -+ }; - }, config?: Partial, state?: Partial); - /** - * Starts a new polling interval. -@@ -191,7 +213,7 @@ export declare class TransactionController extends BaseController; -+ securityAlertResponse?: SecurityAlertResponse; - sendFlowHistory?: SendFlowHistoryEntry[]; - type?: TransactionType; - }): Promise; -@@ -247,13 +269,14 @@ export declare class TransactionController extends BaseController; -+ updateTransaction(transactionMeta: TransactionMeta, note: string): void; - /** -- * Updates an existing transaction in state. -+ * Update the security alert response for a transaction. - * -- * @param transactionMeta - The new transaction to store in state. -- * @param note - A note or update reason to include in the transaction history. -+ * @param transactionId - ID of the transaction. -+ * @param securityAlertResponse - The new security alert response for the transaction. - */ -- updateTransaction(transactionMeta: TransactionMeta, note: string): void; -+ updateSecurityAlertResponse(transactionId: string, securityAlertResponse: SecurityAlertResponse): void; - /** - * Removes all transactions from state, optionally based on the current network. - * -@@ -313,6 +336,33 @@ export declare class TransactionController extends BaseController; - private processApproval; - /** - * Approves a transaction and updates it's status in state. If this is not a -@@ -330,6 +380,14 @@ export declare class TransactionController extends BaseController; - /** - * Trim the amount of transactions that are set on the state. Checks - * if the length of the tx history is longer then desired persistence -@@ -431,6 +489,14 @@ export declare class TransactionController extends BaseController false), "f"); - this.registry = new eth_method_registry_1.default({ provider }); - this.getCurrentAccountEIP1559Compatibility = - getCurrentAccountEIP1559Compatibility; - this.getCurrentNetworkEIP1559Compatibility = - getCurrentNetworkEIP1559Compatibility; -- this.nonceTracker = new nonce_tracker_1.default({ -+ this.getExternalPendingTransactions = -+ getExternalPendingTransactions !== null && getExternalPendingTransactions !== void 0 ? getExternalPendingTransactions : (() => []); -+ this.publish = -+ (_a = hooks === null || hooks === void 0 ? void 0 : hooks.publish) !== null && _a !== void 0 ? _a : (() => Promise.resolve({ transactionHash: undefined })); -+ this.getSelectedAddress = getSelectedAddress; -+ this.nonceTracker = new NonceTracker_1.NonceTracker({ - provider, - blockTracker, -- getPendingTransactions: (address) => (0, utils_1.getAndFormatTransactionsForNonceTracker)(address, types_1.TransactionStatus.submitted, this.state.transactions), -- getConfirmedTransactions: (address) => (0, utils_1.getAndFormatTransactionsForNonceTracker)(address, types_1.TransactionStatus.confirmed, this.state.transactions), -+ getPendingTransactions: this.getNonceTrackerPendingTransactions.bind(this), -+ getConfirmedTransactions: this.getNonceTrackerTransactions.bind(this, types_1.TransactionStatus.confirmed), - }); - this.incomingTransactionHelper = new IncomingTransactionHelper_1.IncomingTransactionHelper({ - blockTracker, - getCurrentAccount: getSelectedAddress, - getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers, -+ getLocalTransactions: () => this.state.transactions, - getNetworkState, - isEnabled: incomingTransactions.isEnabled, - queryEntireHistory: incomingTransactions.queryEntireHistory, -@@ -125,6 +162,18 @@ class TransactionController extends base_controller_1.BaseController { - }); - this.incomingTransactionHelper.hub.on('transactions', this.onIncomingTransactions.bind(this)); - this.incomingTransactionHelper.hub.on('updatedLastFetchedBlockNumbers', this.onUpdatedLastFetchedBlockNumbers.bind(this)); -+ this.gasFeeFlows = this.getGasFeeFlows(); -+ const gasFeePoller = new GasFeePoller_1.GasFeePoller({ -+ gasFeeFlows: this.gasFeeFlows, -+ getChainIds: () => [this.getNetworkState().providerConfig.chainId], -+ getEthQuery: () => this.ethQuery, -+ getGasFeeControllerEstimates: this.getGasFeeEstimates, -+ getTransactions: () => this.state.transactions, -+ onStateChange: (listener) => { -+ this.subscribe(listener); -+ }, -+ }); -+ gasFeePoller.hub.on('transaction-updated', __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_onGasFeePollerTransactionUpdate).bind(this)); - onNetworkStateChange(() => { - this.ethQuery = new eth_query_1.default(this.provider); - this.registry = new eth_method_registry_1.default({ provider: this.provider }); -@@ -166,13 +215,14 @@ class TransactionController extends base_controller_1.BaseController { - */ - handleMethodData(fourBytePrefix) { - return __awaiter(this, void 0, void 0, function* () { -- const releaseLock = yield this.mutex.acquire(); -+ let releaseLock; - try { - const { methodData } = this.state; - const knownMethod = Object.keys(methodData).find((knownFourBytePrefix) => fourBytePrefix === knownFourBytePrefix); - if (knownMethod) { - return methodData[fourBytePrefix]; - } -+ releaseLock = yield this.lookupRegistryMutex.acquire(); - const registry = yield this.registryLookup(fourBytePrefix); - this.update({ - methodData: Object.assign(Object.assign({}, methodData), { [fourBytePrefix]: registry }), -@@ -180,7 +230,9 @@ class TransactionController extends base_controller_1.BaseController { - return registry; - } - finally { -- releaseLock(); -+ if (releaseLock) { -+ releaseLock(); -+ } - } - }); - } -@@ -204,7 +256,7 @@ class TransactionController extends base_controller_1.BaseController { - return __awaiter(this, void 0, void 0, function* () { - const chainId = this.getChainId(); - const { transactions } = this.state; -- txParams = (0, utils_1.normalizeTxParams)(txParams); -+ txParams = (0, utils_1.normalizeTransactionParams)(txParams); - const isEIP1559Compatible = yield this.getEIP1559Compatibility(); - (0, utils_1.validateTxParams)(txParams, isEIP1559Compatible); - const dappSuggestedGasFees = this.generateDappSuggestedGasFees(txParams, origin); -@@ -250,6 +302,13 @@ class TransactionController extends base_controller_1.BaseController { - this.update({ - transactions: this.trimTransactionsForState(transactions), - }); -+ if (requireApproval !== false) { -+ // eslint-disable-next-line @typescript-eslint/no-floating-promises -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateSimulationData).call(this, transactionMeta); -+ } -+ else { -+ (0, logger_1.projectLogger)('Skipping simulation as approval not required'); -+ } - this.hub.emit(`unapprovedTransaction`, transactionMeta); - } - return { -@@ -353,7 +412,7 @@ class TransactionController extends base_controller_1.BaseController { - const signedTx = yield this.sign(unsignedEthTx, transactionMeta.txParams.from); - yield this.updateTransactionMetaRSV(transactionMeta, signedTx); - const rawTx = (0, ethereumjs_util_1.bufferToHex)(signedTx.serialize()); -- yield (0, controller_utils_1.query)(this.ethQuery, 'sendRawTransaction', [rawTx]); -+ yield this.publishTransaction(rawTx, txParams, transactionMeta.chainId, 'cancel'); - transactionMeta.estimatedBaseFee = estimatedBaseFee; - transactionMeta.status = types_1.TransactionStatus.cancelled; - this.hub.emit(`${transactionMeta.id}:finished`, transactionMeta); -@@ -414,7 +473,7 @@ class TransactionController extends base_controller_1.BaseController { - const signedTx = yield this.sign(unsignedEthTx, transactionMeta.txParams.from); - yield this.updateTransactionMetaRSV(transactionMeta, signedTx); - const rawTx = (0, ethereumjs_util_1.bufferToHex)(signedTx.serialize()); -- const hash = yield (0, controller_utils_1.query)(this.ethQuery, 'sendRawTransaction', [rawTx]); -+ const hash = yield this.publishTransaction(rawTx, txParams, transactionMeta.chainId, controller_utils_1.ORIGIN_METAMASK); - const baseTransactionMeta = Object.assign(Object.assign({}, transactionMeta), { estimatedBaseFee, id: (0, uuid_1.v1)(), time: Date.now(), hash, - actionId, originalGasEstimate: transactionMeta.txParams.gas, type: types_1.TransactionType.retry }); - const newTransactionMeta = newMaxFeePerGas && newMaxPriorityFeePerGas -@@ -474,6 +533,8 @@ class TransactionController extends base_controller_1.BaseController { - } - catch (error) { - estimateGasError = utils_1.ESTIMATE_GAS_ERROR; -+ // Fallback to 95% of the block gasLimit. -+ gasHex = estimatedTransaction.gas; - } - // 4. Pad estimated gas without exceeding the most recent block gasLimit. If the network is a - // a custom network then return the eth_estimateGas value. -@@ -503,9 +564,13 @@ class TransactionController extends base_controller_1.BaseController { - return __awaiter(this, void 0, void 0, function* () { - const { transactions } = this.state; - const currentChainId = this.getChainId(); -+ const selectedAddress = this.getSelectedAddress(); - let gotUpdates = false; - yield (0, controller_utils_1.safelyExecute)(() => Promise.all(transactions.map((meta, index) => __awaiter(this, void 0, void 0, function* () { -- if (!meta.verifiedOnBlockchain && meta.chainId === currentChainId) { -+ if (!meta.verifiedOnBlockchain && -+ meta.chainId === currentChainId && -+ (meta.txParams.from === selectedAddress || -+ meta.txParams.to === selectedAddress)) { - const [reconciledTx, updateRequired] = yield this.blockchainTransactionStateReconciler(meta); - if (updateRequired) { - transactions[index] = reconciledTx; -@@ -521,22 +586,26 @@ class TransactionController extends base_controller_1.BaseController { - } - }); - } -+ updateTransaction(transactionMeta, note) { -+ const { id: transactionId } = transactionMeta; -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, note }, () => (Object.assign({}, transactionMeta))); -+ } - /** -- * Updates an existing transaction in state. -+ * Update the security alert response for a transaction. - * -- * @param transactionMeta - The new transaction to store in state. -- * @param note - A note or update reason to include in the transaction history. -+ * @param transactionId - ID of the transaction. -+ * @param securityAlertResponse - The new security alert response for the transaction. - */ -- updateTransaction(transactionMeta, note) { -- const { transactions } = this.state; -- transactionMeta.txParams = (0, utils_1.normalizeTxParams)(transactionMeta.txParams); -- (0, utils_1.validateTxParams)(transactionMeta.txParams); -- if (!this.isHistoryDisabled) { -- (0, history_1.updateTransactionHistory)(transactionMeta, note); -+ updateSecurityAlertResponse(transactionId, securityAlertResponse) { -+ if (!securityAlertResponse) { -+ throw new Error('updateSecurityAlertResponse: securityAlertResponse should not be null'); - } -- const index = transactions.findIndex(({ id }) => transactionMeta.id === id); -- transactions[index] = transactionMeta; -- this.update({ transactions: this.trimTransactionsForState(transactions) }); -+ const transactionMeta = this.getTransaction(transactionId); -+ if (!transactionMeta) { -+ throw new Error(`Cannot update security alert response as no transaction metadata found`); -+ } -+ const updatedMeta = (0, lodash_1.merge)(transactionMeta, { securityAlertResponse }); -+ this.updateTransaction(updatedMeta, `${controllerName}:updatesecurityAlertResponse - securityAlertResponse updated`); - } - /** - * Removes all transactions from state, optionally based on the current network. -@@ -676,6 +745,150 @@ class TransactionController extends base_controller_1.BaseController { - this.updateTransaction(updatedMeta, 'TransactionController:updateTransactionGasFees - gas values updated'); - return this.getTransaction(transactionId); - } -+ /** -+ * Search transaction metadata for matching entries. -+ * -+ * @param opts - Options bag. -+ * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with. -+ * @param opts.initialList - The transactions to search. Defaults to the current state. -+ * @param opts.filterToCurrentNetwork - Whether to filter the results to the current network. Defaults to true. -+ * @param opts.limit - The maximum number of transactions to return. No limit by default. -+ * @returns An array of transactions matching the provided options. -+ */ -+ getTransactions({ searchCriteria = {}, initialList, filterToCurrentNetwork = true, limit, } = {}) { -+ const chainId = this.getChainId(); -+ // searchCriteria is an object that might have values that aren't predicate -+ // methods. When providing any other value type (string, number, etc), we -+ // consider this shorthand for "check the value at key for strict equality -+ // with the provided value". To conform this object to be only methods, we -+ // mapValues (lodash) such that every value on the object is a method that -+ // returns a boolean. -+ const predicateMethods = (0, lodash_1.mapValues)(searchCriteria, (predicate) => { -+ return typeof predicate === 'function' -+ ? predicate -+ : // TODO: Replace `any` with type -+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -+ (v) => v === predicate; -+ }); -+ const transactionsToFilter = initialList !== null && initialList !== void 0 ? initialList : this.state.transactions; -+ // Combine sortBy and pickBy to transform our state object into an array of -+ // matching transactions that are sorted by time. -+ const filteredTransactions = (0, lodash_1.sortBy)((0, lodash_1.pickBy)(transactionsToFilter, (transaction) => { -+ if (filterToCurrentNetwork && transaction.chainId !== chainId) { -+ return false; -+ } -+ // iterate over the predicateMethods keys to check if the transaction -+ // matches the searchCriteria -+ for (const [key, predicate] of Object.entries(predicateMethods)) { -+ // We return false early as soon as we know that one of the specified -+ // search criteria do not match the transaction. This prevents -+ // needlessly checking all criteria when we already know the criteria -+ // are not fully satisfied. We check both txParams and the base -+ // object as predicate keys can be either. -+ if (key in transaction.txParams) { -+ // TODO: Replace `any` with type -+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -+ if (predicate(transaction.txParams[key]) === false) { -+ return false; -+ } -+ // TODO: Replace `any` with type -+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -+ } -+ else if (predicate(transaction[key]) === false) { -+ return false; -+ } -+ } -+ return true; -+ }), 'time'); -+ if (limit !== undefined) { -+ // We need to have all transactions of a given nonce in order to display -+ // necessary details in the UI. We use the size of this set to determine -+ // whether we have reached the limit provided, thus ensuring that all -+ // transactions of nonces we include will be sent to the UI. -+ const nonces = new Set(); -+ const txs = []; -+ // By default, the transaction list we filter from is sorted by time ASC. -+ // To ensure that filtered results prefers the newest transactions we -+ // iterate from right to left, inserting transactions into front of a new -+ // array. The original order is preserved, but we ensure that newest txs -+ // are preferred. -+ for (let i = filteredTransactions.length - 1; i > -1; i--) { -+ const txMeta = filteredTransactions[i]; -+ const { nonce } = txMeta.txParams; -+ if (!nonces.has(nonce)) { -+ if (nonces.size < limit) { -+ nonces.add(nonce); -+ } -+ else { -+ continue; -+ } -+ } -+ // Push transaction into the beginning of our array to ensure the -+ // original order is preserved. -+ txs.unshift(txMeta); -+ } -+ return txs; -+ } -+ return filteredTransactions; -+ } -+ /** -+ * Signs and returns the raw transaction data for provided transaction params list. -+ * -+ * @param listOfTxParams - The list of transaction params to approve. -+ * @param opts - Options bag. -+ * @param opts.hasNonce - Whether the transactions already have a nonce. -+ * @returns The raw transactions. -+ */ -+ approveTransactionsWithSameNonce(listOfTxParams = [], { hasNonce } = {}) { -+ return __awaiter(this, void 0, void 0, function* () { -+ (0, logger_1.projectLogger)('Approving transactions with same nonce', { -+ transactions: listOfTxParams, -+ }); -+ if (listOfTxParams.length === 0) { -+ return ''; -+ } -+ const initialTx = listOfTxParams[0]; -+ const common = this.getCommonConfiguration(); -+ const initialTxAsEthTx = tx_1.TransactionFactory.fromTxData(initialTx, { -+ common, -+ }); -+ const initialTxAsSerializedHex = (0, ethereumjs_util_1.bufferToHex)(initialTxAsEthTx.serialize()); -+ if (this.inProcessOfSigning.has(initialTxAsSerializedHex)) { -+ return ''; -+ } -+ this.inProcessOfSigning.add(initialTxAsSerializedHex); -+ let rawTransactions, nonceLock; -+ try { -+ // TODO: we should add a check to verify that all transactions have the same from address -+ const fromAddress = initialTx.from; -+ const requiresNonce = hasNonce !== true; -+ nonceLock = requiresNonce -+ ? yield this.nonceTracker.getNonceLock(fromAddress) -+ : undefined; -+ const nonce = nonceLock -+ ? (0, ethereumjs_util_1.addHexPrefix)(nonceLock.nextNonce.toString(16)) -+ : initialTx.nonce; -+ if (nonceLock) { -+ (0, logger_1.projectLogger)('Using nonce from nonce tracker', nonce, nonceLock.nonceDetails); -+ } -+ rawTransactions = yield Promise.all(listOfTxParams.map((txParams) => { -+ txParams.nonce = nonce; -+ return this.signExternalTransaction(txParams); -+ })); -+ } -+ catch (err) { -+ (0, logger_1.projectLogger)('Error while signing transactions with same nonce', err); -+ // Must set transaction to submitted/failed before releasing lock -+ // continue with error chain -+ throw err; -+ } -+ finally { -+ nonceLock === null || nonceLock === void 0 ? void 0 : nonceLock.releaseLock(); -+ this.inProcessOfSigning.delete(initialTxAsSerializedHex); -+ } -+ return rawTransactions; -+ }); -+ } - processApproval(transactionMeta, { isExisting = false, requireApproval, shouldShowRequest = true, }) { - return __awaiter(this, void 0, void 0, function* () { - const transactionId = transactionMeta.id; -@@ -757,12 +970,16 @@ class TransactionController extends base_controller_1.BaseController { - this.failTransaction(transactionMeta, new Error('No chainId defined.')); - return; - } -+ if (this.inProcessOfSigning.has(transactionId)) { -+ (0, logger_1.projectLogger)('Skipping approval as signing in progress', transactionId); -+ return; -+ } - const { approved: status } = types_1.TransactionStatus; - let nonceToUse = nonce; - // if a nonce already exists on the transactionMeta it means this is a speedup or cancel transaction - // so we want to reuse that nonce and hope that it beats the previous attempt to chain. Otherwise use a new locked nonce - if (!nonceToUse) { -- nonceLock = yield this.nonceTracker.getNonceLock(from); -+ nonceLock = yield this.getNonceLock(from); - nonceToUse = (0, ethereumjs_util_1.addHexPrefix)(nonceLock.nextNonce.toString(16)); - } - transactionMeta.status = status; -@@ -779,6 +996,7 @@ class TransactionController extends base_controller_1.BaseController { - delete txParams.gasPrice; - } - const unsignedEthTx = this.prepareUnsignedEthTx(txParams); -+ this.inProcessOfSigning.add(transactionMeta.id); - const signedTx = yield this.sign(unsignedEthTx, from); - yield this.updateTransactionMetaRSV(transactionMeta, signedTx); - transactionMeta.status = types_1.TransactionStatus.signed; -@@ -786,7 +1004,10 @@ class TransactionController extends base_controller_1.BaseController { - const rawTx = (0, ethereumjs_util_1.bufferToHex)(signedTx.serialize()); - transactionMeta.rawTx = rawTx; - this.updateTransaction(transactionMeta, 'TransactionController#approveTransaction - RawTransaction added'); -- const hash = yield (0, controller_utils_1.query)(this.ethQuery, 'sendRawTransaction', [rawTx]); -+ let { transactionHash: hash } = yield this.publish(transactionMeta, rawTx); -+ if (hash === undefined) { -+ hash = yield this.publishTransaction(rawTx, txParams, chainId, transactionMeta.origin); -+ } - transactionMeta.hash = hash; - transactionMeta.status = types_1.TransactionStatus.submitted; - transactionMeta.submittedTime = new Date().getTime(); -@@ -797,11 +1018,11 @@ class TransactionController extends base_controller_1.BaseController { - this.failTransaction(transactionMeta, error); - } - finally { -- // must set transaction to submitted/failed before releasing lock -+ this.inProcessOfSigning.delete(transactionId); -+ releaseLock(); - if (nonceLock) { - nonceLock.releaseLock(); - } -- releaseLock(); - } - }); - } -@@ -821,6 +1042,18 @@ class TransactionController extends base_controller_1.BaseController { - const transactions = this.state.transactions.filter(({ id }) => id !== transactionId); - this.update({ transactions: this.trimTransactionsForState(transactions) }); - } -+ /** -+ * Gets the next nonce according to the nonce-tracker. -+ * Ensure `releaseLock` is called once processing of the `nonce` value is complete. -+ * -+ * @param address - The hex string address for the transaction. -+ * @returns object with the `nextNonce` `nonceDetails`, and the releaseLock. -+ */ -+ getNonceLock(address) { -+ return __awaiter(this, void 0, void 0, function* () { -+ return this.nonceTracker.getNonceLock(address); -+ }); -+ } - /** - * Trim the amount of transactions that are set on the state. Checks - * if the length of the tx history is longer then desired persistence -@@ -903,6 +1136,7 @@ class TransactionController extends base_controller_1.BaseController { - } - const txBlock = yield (0, controller_utils_1.query)(this.ethQuery, 'getBlockByHash', [ - txReceipt.blockHash, -+ false, - ]); - meta.verifiedOnBlockchain = true; - meta.txParams.gasUsed = txReceipt.gasUsed; -@@ -932,9 +1166,17 @@ class TransactionController extends base_controller_1.BaseController { - } - /* istanbul ignore next */ - if (txObj === null || txObj === void 0 ? void 0 : txObj.blockNumber) { -- meta.status = types_1.TransactionStatus.confirmed; -- this.hub.emit(`${meta.id}:confirmed`, meta); -- return [meta, true]; -+ // transactions can be added to a block and still fail, so we need to check the transaction status before emitting the confirmed event -+ const txStatusFailed = yield this.checkTxReceiptStatusIsFailed(hash); -+ if (txStatusFailed) { -+ const error = new Error('Transaction failed. The transaction was reversed'); -+ this.failTransaction(meta, error); -+ } -+ else { -+ meta.status = types_1.TransactionStatus.confirmed; -+ this.hub.emit(`${meta.id}:confirmed`, meta); -+ return [meta, true]; -+ } - } - return [meta, false]; - default: -@@ -1016,13 +1258,14 @@ class TransactionController extends base_controller_1.BaseController { - const { providerConfig: { type: chain, chainId, nickname: name }, } = this.getNetworkState(); - if (chain !== controller_utils_1.RPC && - chain !== controller_utils_1.NetworkType['linea-goerli'] && -+ chain !== 'linea-sepolia' && - chain !== controller_utils_1.NetworkType['linea-mainnet']) { -- return new common_1.Common({ chain, hardfork: exports.HARDFORK }); -+ return new common_1.Common({ chain, hardfork: HARDFORK }); - } - const customChainParams = { - name, - chainId: parseInt(chainId, 16), -- defaultHardfork: exports.HARDFORK, -+ defaultHardfork: HARDFORK, - }; - return common_1.Common.custom(customChainParams); - } -@@ -1182,7 +1425,180 @@ class TransactionController extends base_controller_1.BaseController { - return (currentNetworkIsEIP1559Compatible && currentAccountIsEIP1559Compatible); - }); - } -+ getNonceTrackerTransactions(status, address) { -+ const currentChainId = this.getChainId(); -+ return (0, utils_1.getAndFormatTransactionsForNonceTracker)(currentChainId, address, status, this.state.transactions); -+ } -+ publishTransaction(rawTransaction, transaction, chainId, origin) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const transactionHash = yield (0, controller_utils_1.query)(this.ethQuery, 'sendRawTransaction', [ -+ rawTransaction, -+ ]); -+ this.updateSubmitHistory(rawTransaction, transactionHash, transaction, chainId, origin); -+ return transactionHash; -+ }); -+ } -+ updateSubmitHistory(rawTransaction, hash, transaction, chainId, origin) { -+ const { rpcUrl: networkUrl, type: networkType } = this.getNetworkState().providerConfig; -+ const submitHistoryEntry = { -+ chainId, -+ hash, -+ networkType, -+ networkUrl, -+ origin, -+ time: Date.now(), -+ transaction, -+ rawTransaction, -+ }; -+ const submitHistory = [submitHistoryEntry, ...this.state.submitHistory]; -+ if (submitHistory.length > SUBMIT_HISTORY_LIMIT) { -+ submitHistory.pop(); -+ } -+ this.update({ submitHistory }); -+ } -+ getGasFeeFlows() { -+ return [new LineaGasFeeFlow_1.LineaGasFeeFlow()]; -+ } -+ getNonceTrackerPendingTransactions(address) { -+ const standardPendingTransactions = this.getNonceTrackerTransactions(types_1.TransactionStatus.submitted, address); -+ const externalPendingTransactions = this.getExternalPendingTransactions(address); -+ return [...standardPendingTransactions, ...externalPendingTransactions]; -+ } -+ updatePostBalance(transactionMeta) { -+ return __awaiter(this, void 0, void 0, function* () { -+ try { -+ if (transactionMeta.type !== types_1.TransactionType.swap) { -+ return; -+ } -+ const { updatedTransactionMeta, approvalTransactionMeta } = yield (0, swaps_1.updatePostTransactionBalance)(transactionMeta, { -+ ethQuery: this.ethQuery, -+ getTransaction: this.getTransaction.bind(this), -+ updateTransaction: this.updateTransaction.bind(this), -+ }); -+ this.hub.emit('post-transaction-balance-updated', { -+ transactionMeta: updatedTransactionMeta, -+ approvalTransactionMeta, -+ }); -+ } -+ catch (error) { -+ console.error('Error while updating post transaction balance', error); -+ } -+ }); -+ } -+ signExternalTransaction(transactionParams) { -+ return __awaiter(this, void 0, void 0, function* () { -+ if (!this.sign) { -+ throw new Error('No sign method defined.'); -+ } -+ const normalizedTransactionParams = (0, utils_1.normalizeTransactionParams)(transactionParams); -+ const chainId = this.getChainId(); -+ const type = (0, utils_1.isEIP1559Transaction)(normalizedTransactionParams) -+ ? types_1.TransactionEnvelopeType.feeMarket -+ : types_1.TransactionEnvelopeType.legacy; -+ const updatedTransactionParams = Object.assign(Object.assign({}, normalizedTransactionParams), { type, gasLimit: normalizedTransactionParams.gas, chainId }); -+ const { from } = updatedTransactionParams; -+ const common = this.getCommonConfiguration(); -+ const unsignedTransaction = tx_1.TransactionFactory.fromTxData(updatedTransactionParams, { common }); -+ const signedTransaction = yield this.sign(unsignedTransaction, from); -+ const rawTransaction = (0, ethereumjs_util_1.bufferToHex)(signedTransaction.serialize()); -+ return rawTransaction; -+ }); -+ } -+ onTransactionStatusChange(transactionMeta) { -+ this.hub.emit('transaction-status-update', { transactionMeta }); -+ } - } - exports.TransactionController = TransactionController; -+_TransactionController_isSimulationEnabled = new WeakMap(), _TransactionController_instances = new WeakSet(), _TransactionController_updateTransactionInternal = function _TransactionController_updateTransactionInternal({ transactionId, note, skipHistory, }, callback) { -+ let updatedTransactionParams = []; -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateWithCallback).call(this, (state) => { -+ var _a; -+ const index = state.transactions.findIndex(({ id }) => id === transactionId); -+ let transactionMeta = state.transactions[index]; -+ // eslint-disable-next-line n/callback-return -+ transactionMeta = (_a = callback(transactionMeta)) !== null && _a !== void 0 ? _a : transactionMeta; -+ transactionMeta.txParams = (0, utils_1.normalizeTransactionParams)(transactionMeta.txParams); -+ (0, utils_1.validateTxParams)(transactionMeta.txParams); -+ updatedTransactionParams = -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_checkIfTransactionParamsUpdated).call(this, transactionMeta); -+ if (!this.isHistoryDisabled && skipHistory !== true) { -+ (0, history_1.updateTransactionHistory)(transactionMeta, note !== null && note !== void 0 ? note : 'Transaction updated'); -+ } -+ state.transactions[index] = transactionMeta; -+ }); -+ const transactionMeta = this.getTransaction(transactionId); -+ if (updatedTransactionParams.length > 0) { -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_onTransactionParamsUpdated).call(this, transactionMeta, updatedTransactionParams); -+ } -+ return transactionMeta; -+}, _TransactionController_checkIfTransactionParamsUpdated = function _TransactionController_checkIfTransactionParamsUpdated(newTransactionMeta) { -+ var _a; -+ const { id: transactionId, txParams: newParams } = newTransactionMeta; -+ const originalParams = (_a = this.getTransaction(transactionId)) === null || _a === void 0 ? void 0 : _a.txParams; -+ if (!originalParams || (0, lodash_1.isEqual)(originalParams, newParams)) { -+ return []; -+ } -+ const params = Object.keys(newParams); -+ const updatedProperties = params.filter((param) => newParams[param] !== originalParams[param]); -+ (0, logger_1.projectLogger)('Transaction parameters have been updated', transactionId, updatedProperties, originalParams, newParams); -+ return updatedProperties; -+}, _TransactionController_onTransactionParamsUpdated = function _TransactionController_onTransactionParamsUpdated(transactionMeta, updatedParams) { -+ if (['to', 'value', 'data'].some((param) => updatedParams.includes(param))) { -+ (0, logger_1.projectLogger)('Updating simulation data due to transaction parameter update'); -+ // eslint-disable-next-line @typescript-eslint/no-floating-promises -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateSimulationData).call(this, transactionMeta); -+ } -+}, _TransactionController_updateSimulationData = function _TransactionController_updateSimulationData(transactionMeta) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const { id: transactionId, chainId, txParams } = transactionMeta; -+ const { from, to, value, data } = txParams; -+ let simulationData = { -+ error: { -+ code: types_1.SimulationErrorCode.Disabled, -+ message: 'Simulation disabled', -+ }, -+ tokenBalanceChanges: [], -+ }; -+ if (__classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this)) { -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, skipHistory: true }, (txMeta) => { -+ txMeta.simulationData = undefined; -+ }); -+ simulationData = yield (0, simulation_1.getSimulationData)({ -+ chainId, -+ from: from, -+ to: to, -+ value: value, -+ data: data, -+ }); -+ } -+ const finalTransactionMeta = this.getTransaction(transactionId); -+ if (!finalTransactionMeta) { -+ (0, logger_1.projectLogger)('Cannot update simulation data as transaction not found', transactionId, simulationData); -+ return; -+ } -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { -+ transactionId, -+ note: 'TransactionController#updateSimulationData - Update simulation data', -+ }, (txMeta) => { -+ txMeta.simulationData = simulationData; -+ }); -+ (0, logger_1.projectLogger)('Updated simulation data', transactionId, simulationData); -+ }); -+}, _TransactionController_updateWithCallback = function _TransactionController_updateWithCallback(callback) { -+ var _a; -+ const currentState = (0, lodash_1.cloneDeep)(this.state); -+ // eslint-disable-next-line n/callback-return -+ const updatedState = (_a = callback(currentState)) !== null && _a !== void 0 ? _a : currentState; -+ this.update(updatedState); -+}, _TransactionController_onGasFeePollerTransactionUpdate = function _TransactionController_onGasFeePollerTransactionUpdate({ id, gasFeeEstimates, gasFeeEstimatesLoaded, }) { -+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId: id, skipHistory: true }, (txMeta) => { -+ if (gasFeeEstimates) { -+ txMeta.gasFeeEstimates = gasFeeEstimates; -+ } -+ if (gasFeeEstimatesLoaded !== undefined) { -+ txMeta.gasFeeEstimatesLoaded = gasFeeEstimatesLoaded; -+ } -+ }); -+}; - exports.default = TransactionController; - //# sourceMappingURL=TransactionController.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/TransactionController.js.map b/node_modules/@metamask/transaction-controller/dist/TransactionController.js.map -deleted file mode 100644 -index b4ead51..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/TransactionController.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"TransactionController.js","sourceRoot":"","sources":["../src/TransactionController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAwE;AAExE,uCAAoD;AAWpD,+DAA2D;AAC3D,iEAWoC;AACpC,oEAA2C;AAM3C,qDAA6E;AAE7E,6CAAoC;AACpC,8EAAiD;AACjD,qDAA4D;AAC5D,mCAAsC;AACtC,mCAAuC;AACvC,kEAAyC;AACzC,+BAAoC;AAEpC,yFAAsF;AACtF,mEAA+E;AAC/E,uCAAgF;AAChF,2EAAwE;AACxE,yDAA8D;AAS9D,mCAA6D;AAC7D,mCAYiB;AAEJ,QAAA,QAAQ,GAAG,iBAAQ,CAAC,MAAM,CAAC;AA4DxC;;GAEG;AACU,QAAA,WAAW,GAAG,GAAG,CAAC;AAE/B;;GAEG;AACU,QAAA,aAAa,GAAG,GAAG,CAAC;AAEjC;;GAEG;AACH,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAkB/C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,gCAG1C;IAgEC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YACE,EACE,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,qCAAqC,EACrC,qCAAqC,EACrC,eAAe,EACf,kBAAkB,EAClB,oBAAoB,GAAG,EAAE,EACzB,SAAS,EACT,oBAAoB,EACpB,QAAQ,GAkBT,EACD,MAAmC,EACnC,KAAiC;QAEjC,KAAK,CAAC,MAAM,EAAE,KA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CAAiC,GACrC,MAAM,IAAI,CAAC,qCAAqC,EAAE,CAAC;YACrD,MAAM,iCAAiC,GACrC,MAAA,MAAA,IAAI,CAAC,qCAAqC,oDAAI,mCAAI,IAAI,CAAC;YAEzD,OAAO,CACL,iCAAiC,IAAI,iCAAiC,CACvE,CAAC;;KACH;CACF;AAhoDD,sDAgoDC;AAED,kBAAe,qBAAqB,CAAC","sourcesContent":["import { Hardfork, Common, type ChainConfig } from '@ethereumjs/common';\nimport type { TypedTransaction } from '@ethereumjs/tx';\nimport { TransactionFactory } from '@ethereumjs/tx';\nimport type {\n AcceptResultCallbacks,\n AddApprovalRequest,\n AddResult,\n} from '@metamask/approval-controller';\nimport type {\n BaseConfig,\n BaseState,\n RestrictedControllerMessenger,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport {\n BNToHex,\n fractionBN,\n hexToBN,\n safelyExecute,\n query,\n NetworkType,\n RPC,\n ApprovalType,\n ORIGIN_METAMASK,\n convertHexToDecimal,\n} from '@metamask/controller-utils';\nimport EthQuery from '@metamask/eth-query';\nimport type {\n BlockTracker,\n NetworkState,\n Provider,\n} from '@metamask/network-controller';\nimport { errorCodes, rpcErrors, providerErrors } from '@metamask/rpc-errors';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport MethodRegistry from 'eth-method-registry';\nimport { addHexPrefix, bufferToHex } from 'ethereumjs-util';\nimport { EventEmitter } from 'events';\nimport { merge, pickBy } from 'lodash';\nimport NonceTracker from 'nonce-tracker';\nimport { v1 as random } from 'uuid';\n\nimport { EtherscanRemoteTransactionSource } from './EtherscanRemoteTransactionSource';\nimport { validateConfirmedExternalTransaction } from './external-transactions';\nimport { addInitialHistorySnapshot, updateTransactionHistory } from './history';\nimport { IncomingTransactionHelper } from './IncomingTransactionHelper';\nimport { determineTransactionType } from './transaction-type';\nimport type {\n DappSuggestedGasFees,\n TransactionParams,\n TransactionMeta,\n TransactionReceipt,\n SendFlowHistoryEntry,\n WalletDevice,\n} from './types';\nimport { TransactionType, TransactionStatus } from './types';\nimport {\n getAndFormatTransactionsForNonceTracker,\n getIncreasedPriceFromExisting,\n normalizeTxParams,\n isEIP1559Transaction,\n isFeeMarketEIP1559Values,\n isGasPriceValue,\n validateGasValues,\n validateIfTransactionUnapproved,\n validateMinimumIncrease,\n validateTxParams,\n ESTIMATE_GAS_ERROR,\n} from './utils';\n\nexport const HARDFORK = Hardfork.London;\n\n/**\n * @type Result\n * @property result - Promise resolving to a new transaction hash\n * @property transactionMeta - Meta information about this new transaction\n */\nexport interface Result {\n result: Promise;\n transactionMeta: TransactionMeta;\n}\n\nexport interface GasPriceValue {\n gasPrice: string;\n}\n\nexport interface FeeMarketEIP1559Values {\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n}\n\n/**\n * @type TransactionConfig\n *\n * Transaction controller configuration\n * @property interval - Polling interval used to fetch new currency rate\n * @property provider - Provider used to create a new underlying EthQuery instance\n * @property sign - Method used to sign transactions\n */\nexport interface TransactionConfig extends BaseConfig {\n interval: number;\n sign?: (txParams: TransactionParams, from: string) => Promise;\n txHistoryLimit: number;\n}\n\n/**\n * @type MethodData\n *\n * Method data registry object\n * @property registryMethod - Registry method raw string\n * @property parsedRegistryMethod - Registry method object, containing name and method arguments\n */\nexport interface MethodData {\n registryMethod: string;\n parsedRegistryMethod: Record;\n}\n\n/**\n * @type TransactionState\n *\n * Transaction controller state\n * @property transactions - A list of TransactionMeta objects\n * @property methodData - Object containing all known method data information\n */\nexport interface TransactionState extends BaseState {\n transactions: TransactionMeta[];\n methodData: { [key: string]: MethodData };\n lastFetchedBlockNumbers: { [key: string]: number };\n}\n\n/**\n * Multiplier used to determine a transaction's increased gas fee during cancellation\n */\nexport const CANCEL_RATE = 1.5;\n\n/**\n * Multiplier used to determine a transaction's increased gas fee during speed up\n */\nexport const SPEED_UP_RATE = 1.1;\n\n/**\n * The name of the {@link TransactionController}.\n */\nconst controllerName = 'TransactionController';\n\n/**\n * The external actions available to the {@link TransactionController}.\n */\ntype AllowedActions = AddApprovalRequest;\n\n/**\n * The messenger of the {@link TransactionController}.\n */\nexport type TransactionControllerMessenger = RestrictedControllerMessenger<\n typeof controllerName,\n AllowedActions,\n never,\n AllowedActions['type'],\n never\n>;\n\n/**\n * Controller responsible for submitting and managing transactions.\n */\nexport class TransactionController extends BaseController<\n TransactionConfig,\n TransactionState\n> {\n private ethQuery: EthQuery;\n\n private readonly isHistoryDisabled: boolean;\n\n private readonly isSendFlowHistoryDisabled: boolean;\n\n private readonly nonceTracker: NonceTracker;\n\n private registry: any;\n\n private readonly provider: Provider;\n\n private handle?: ReturnType;\n\n private readonly mutex = new Mutex();\n\n private readonly getNetworkState: () => NetworkState;\n\n private readonly getCurrentAccountEIP1559Compatibility: () => Promise;\n\n private readonly getCurrentNetworkEIP1559Compatibility: () => Promise;\n\n private readonly messagingSystem: TransactionControllerMessenger;\n\n private readonly incomingTransactionHelper: IncomingTransactionHelper;\n\n private failTransaction(transactionMeta: TransactionMeta, error: Error) {\n const newTransactionMeta = {\n ...transactionMeta,\n error,\n status: TransactionStatus.failed,\n };\n this.updateTransaction(\n newTransactionMeta,\n 'TransactionController#failTransaction - Add error message and set status to failed',\n );\n this.hub.emit(`${transactionMeta.id}:finished`, newTransactionMeta);\n }\n\n private async registryLookup(fourBytePrefix: string): Promise {\n const registryMethod = await this.registry.lookup(fourBytePrefix);\n const parsedRegistryMethod = this.registry.parse(registryMethod);\n return { registryMethod, parsedRegistryMethod };\n }\n\n /**\n * EventEmitter instance used to listen to specific transactional events\n */\n hub = new EventEmitter();\n\n /**\n * Name of this controller used during composition\n */\n override name = 'TransactionController';\n\n /**\n * Method used to sign transactions\n */\n sign?: (\n transaction: TypedTransaction,\n from: string,\n ) => Promise;\n\n /**\n * Creates a TransactionController instance.\n *\n * @param options - The controller options.\n * @param options.blockTracker - The block tracker used to poll for new blocks data.\n * @param options.disableHistory - Whether to disable storing history in transaction metadata.\n * @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.\n * @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.\n * @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.\n * @param options.getNetworkState - Gets the state of the network controller.\n * @param options.getSelectedAddress - Gets the address of the currently selected account.\n * @param options.incomingTransactions - Configuration options for incoming transaction support.\n * @param options.incomingTransactions.includeTokenTransfers - Whether or not to include ERC20 token transfers.\n * @param options.incomingTransactions.isEnabled - Whether or not incoming transaction retrieval is enabled.\n * @param options.incomingTransactions.queryEntireHistory - Whether to initially query the entire transaction history or only recent blocks.\n * @param options.incomingTransactions.updateTransactions - Whether to update local transactions using remote transaction data.\n * @param options.messenger - The controller messenger.\n * @param options.onNetworkStateChange - Allows subscribing to network controller state changes.\n * @param options.provider - The provider used to create the underlying EthQuery instance.\n * @param config - Initial options used to configure this controller.\n * @param state - Initial state to set on this controller.\n */\n constructor(\n {\n blockTracker,\n disableHistory,\n disableSendFlowHistory,\n getCurrentAccountEIP1559Compatibility,\n getCurrentNetworkEIP1559Compatibility,\n getNetworkState,\n getSelectedAddress,\n incomingTransactions = {},\n messenger,\n onNetworkStateChange,\n provider,\n }: {\n blockTracker: BlockTracker;\n disableHistory: boolean;\n disableSendFlowHistory: boolean;\n getCurrentAccountEIP1559Compatibility: () => Promise;\n getCurrentNetworkEIP1559Compatibility: () => Promise;\n getNetworkState: () => NetworkState;\n getSelectedAddress: () => string;\n incomingTransactions: {\n includeTokenTransfers?: boolean;\n isEnabled?: () => boolean;\n queryEntireHistory?: boolean;\n updateTransactions?: boolean;\n };\n messenger: TransactionControllerMessenger;\n onNetworkStateChange: (listener: (state: NetworkState) => void) => void;\n provider: Provider;\n },\n config?: Partial,\n state?: Partial,\n ) {\n super(config, state);\n\n this.defaultConfig = {\n interval: 15000,\n txHistoryLimit: 40,\n };\n\n this.defaultState = {\n methodData: {},\n transactions: [],\n lastFetchedBlockNumbers: {},\n };\n\n this.initialize();\n\n this.provider = provider;\n this.messagingSystem = messenger;\n this.getNetworkState = getNetworkState;\n this.ethQuery = new EthQuery(provider);\n this.isSendFlowHistoryDisabled = disableSendFlowHistory ?? false;\n this.isHistoryDisabled = disableHistory ?? false;\n this.registry = new MethodRegistry({ provider });\n this.getCurrentAccountEIP1559Compatibility =\n getCurrentAccountEIP1559Compatibility;\n this.getCurrentNetworkEIP1559Compatibility =\n getCurrentNetworkEIP1559Compatibility;\n\n this.nonceTracker = new NonceTracker({\n provider,\n blockTracker,\n getPendingTransactions: (address) =>\n getAndFormatTransactionsForNonceTracker(\n address,\n TransactionStatus.submitted,\n this.state.transactions,\n ),\n getConfirmedTransactions: (address) =>\n getAndFormatTransactionsForNonceTracker(\n address,\n TransactionStatus.confirmed,\n this.state.transactions,\n ),\n });\n\n this.incomingTransactionHelper = new IncomingTransactionHelper({\n blockTracker,\n getCurrentAccount: getSelectedAddress,\n getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers,\n getNetworkState,\n isEnabled: incomingTransactions.isEnabled,\n queryEntireHistory: incomingTransactions.queryEntireHistory,\n remoteTransactionSource: new EtherscanRemoteTransactionSource({\n includeTokenTransfers: incomingTransactions.includeTokenTransfers,\n }),\n transactionLimit: this.config.txHistoryLimit,\n updateTransactions: incomingTransactions.updateTransactions,\n });\n\n this.incomingTransactionHelper.hub.on(\n 'transactions',\n this.onIncomingTransactions.bind(this),\n );\n\n this.incomingTransactionHelper.hub.on(\n 'updatedLastFetchedBlockNumbers',\n this.onUpdatedLastFetchedBlockNumbers.bind(this),\n );\n\n onNetworkStateChange(() => {\n this.ethQuery = new EthQuery(this.provider);\n this.registry = new MethodRegistry({ provider: this.provider });\n });\n\n this.poll();\n }\n\n /**\n * Starts a new polling interval.\n *\n * @param interval - The polling interval used to fetch new transaction statuses.\n */\n async poll(interval?: number): Promise {\n interval && this.configure({ interval }, false, false);\n this.handle && clearTimeout(this.handle);\n await safelyExecute(() => this.queryTransactionStatuses());\n this.handle = setTimeout(() => {\n this.poll(this.config.interval);\n }, this.config.interval);\n }\n\n /**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @returns The method data object corresponding to the given signature prefix.\n */\n async handleMethodData(fourBytePrefix: string): Promise {\n const releaseLock = await this.mutex.acquire();\n try {\n const { methodData } = this.state;\n const knownMethod = Object.keys(methodData).find(\n (knownFourBytePrefix) => fourBytePrefix === knownFourBytePrefix,\n );\n if (knownMethod) {\n return methodData[fourBytePrefix];\n }\n const registry = await this.registryLookup(fourBytePrefix);\n this.update({\n methodData: { ...methodData, ...{ [fourBytePrefix]: registry } },\n });\n return registry;\n } finally {\n releaseLock();\n }\n }\n\n /**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction id will be generated, and gas and gasPrice will be calculated\n * if not provided. If A `:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param opts - Additional options to control how the transaction is added.\n * @param opts.actionId - Unique ID to prevent duplicate requests.\n * @param opts.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.\n * @param opts.origin - The origin of the transaction request, such as a dApp hostname.\n * @param opts.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.\n * @param opts.securityAlertResponse - Response from security validator.\n * @param opts.sendFlowHistory - The sendFlowHistory entries to add.\n * @param opts.type - Type of transaction to add, such as 'cancel' or 'swap'.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\n async addTransaction(\n txParams: TransactionParams,\n {\n actionId,\n deviceConfirmedOn,\n origin,\n requireApproval,\n securityAlertResponse,\n sendFlowHistory,\n type,\n }: {\n actionId?: string;\n deviceConfirmedOn?: WalletDevice;\n origin?: string;\n requireApproval?: boolean | undefined;\n securityAlertResponse?: Record;\n sendFlowHistory?: SendFlowHistoryEntry[];\n type?: TransactionType;\n } = {},\n ): Promise {\n const chainId = this.getChainId();\n const { transactions } = this.state;\n txParams = normalizeTxParams(txParams);\n const isEIP1559Compatible = await this.getEIP1559Compatibility();\n validateTxParams(txParams, isEIP1559Compatible);\n\n const dappSuggestedGasFees = this.generateDappSuggestedGasFees(\n txParams,\n origin,\n );\n\n const transactionType =\n type ?? (await determineTransactionType(txParams, this.ethQuery)).type;\n\n const existingTransactionMeta = this.getTransactionWithActionId(actionId);\n // If a request to add a transaction with the same actionId is submitted again, a new transaction will not be created for it.\n const transactionMeta: TransactionMeta = existingTransactionMeta || {\n // Add actionId to txMeta to check if same actionId is seen again\n actionId,\n chainId,\n dappSuggestedGasFees,\n deviceConfirmedOn,\n id: random(),\n origin,\n securityAlertResponse,\n status: TransactionStatus.unapproved as TransactionStatus.unapproved,\n time: Date.now(),\n txParams,\n userEditedGasLimit: false,\n verifiedOnBlockchain: false,\n type: transactionType,\n };\n\n try {\n const { gas, estimateGasError } = await this.estimateGas(txParams);\n txParams.gas = gas;\n txParams.estimateGasError = estimateGasError;\n transactionMeta.originalGasEstimate = gas;\n } catch (error: any) {\n this.failTransaction(transactionMeta, error);\n return Promise.reject(error);\n }\n\n // Checks if a transaction already exists with a given actionId\n if (!existingTransactionMeta) {\n if (!this.isSendFlowHistoryDisabled) {\n transactionMeta.sendFlowHistory = sendFlowHistory ?? [];\n }\n // Initial history push\n if (!this.isHistoryDisabled) {\n addInitialHistorySnapshot(transactionMeta);\n }\n transactions.push(transactionMeta);\n this.update({\n transactions: this.trimTransactionsForState(transactions),\n });\n this.hub.emit(`unapprovedTransaction`, transactionMeta);\n }\n\n return {\n result: this.processApproval(transactionMeta, {\n isExisting: Boolean(existingTransactionMeta),\n requireApproval,\n }),\n transactionMeta,\n };\n }\n\n startIncomingTransactionPolling() {\n this.incomingTransactionHelper.start();\n }\n\n stopIncomingTransactionPolling() {\n this.incomingTransactionHelper.stop();\n }\n\n async updateIncomingTransactions() {\n await this.incomingTransactionHelper.update();\n }\n\n /**\n * Creates approvals for all unapproved transactions persisted.\n */\n initApprovals() {\n const chainId = this.getChainId();\n const unapprovedTxs = this.state.transactions.filter(\n (transaction) =>\n transaction.status === TransactionStatus.unapproved &&\n transaction.chainId === chainId,\n );\n\n for (const txMeta of unapprovedTxs) {\n this.processApproval(txMeta, {\n shouldShowRequest: false,\n }).catch((error) => {\n /* istanbul ignore next */\n console.error('Error during persisted transaction approval', error);\n });\n }\n }\n\n /**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\n async stopTransaction(\n transactionId: string,\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n { estimatedBaseFee }: { estimatedBaseFee?: string } = {},\n ) {\n if (gasValues) {\n validateGasValues(gasValues);\n }\n const transactionMeta = this.state.transactions.find(\n ({ id }) => id === transactionId,\n );\n if (!transactionMeta) {\n return;\n }\n\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n // gasPrice (legacy non EIP1559)\n const minGasPrice = getIncreasedPriceFromExisting(\n transactionMeta.txParams.gasPrice,\n CANCEL_RATE,\n );\n\n const gasPriceFromValues = isGasPriceValue(gasValues) && gasValues.gasPrice;\n\n const newGasPrice =\n (gasPriceFromValues &&\n validateMinimumIncrease(gasPriceFromValues, minGasPrice)) ||\n minGasPrice;\n\n // maxFeePerGas (EIP1559)\n const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;\n const minMaxFeePerGas = getIncreasedPriceFromExisting(\n existingMaxFeePerGas,\n CANCEL_RATE,\n );\n const maxFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxFeePerGas;\n const newMaxFeePerGas =\n (maxFeePerGasValues &&\n validateMinimumIncrease(maxFeePerGasValues, minMaxFeePerGas)) ||\n (existingMaxFeePerGas && minMaxFeePerGas);\n\n // maxPriorityFeePerGas (EIP1559)\n const existingMaxPriorityFeePerGas =\n transactionMeta.txParams?.maxPriorityFeePerGas;\n const minMaxPriorityFeePerGas = getIncreasedPriceFromExisting(\n existingMaxPriorityFeePerGas,\n CANCEL_RATE,\n );\n const maxPriorityFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxPriorityFeePerGas;\n const newMaxPriorityFeePerGas =\n (maxPriorityFeePerGasValues &&\n validateMinimumIncrease(\n maxPriorityFeePerGasValues,\n minMaxPriorityFeePerGas,\n )) ||\n (existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas);\n\n const txParams =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n from: transactionMeta.txParams.from,\n gasLimit: transactionMeta.txParams.gas,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n type: 2,\n nonce: transactionMeta.txParams.nonce,\n to: transactionMeta.txParams.from,\n value: '0x0',\n }\n : {\n from: transactionMeta.txParams.from,\n gasLimit: transactionMeta.txParams.gas,\n gasPrice: newGasPrice,\n nonce: transactionMeta.txParams.nonce,\n to: transactionMeta.txParams.from,\n value: '0x0',\n };\n\n const unsignedEthTx = this.prepareUnsignedEthTx(txParams);\n\n const signedTx = await this.sign(\n unsignedEthTx,\n transactionMeta.txParams.from,\n );\n await this.updateTransactionMetaRSV(transactionMeta, signedTx);\n const rawTx = bufferToHex(signedTx.serialize());\n await query(this.ethQuery, 'sendRawTransaction', [rawTx]);\n transactionMeta.estimatedBaseFee = estimatedBaseFee;\n transactionMeta.status = TransactionStatus.cancelled;\n this.hub.emit(`${transactionMeta.id}:finished`, transactionMeta);\n }\n\n /**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\n async speedUpTransaction(\n transactionId: string,\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n {\n actionId,\n estimatedBaseFee,\n }: { actionId?: string; estimatedBaseFee?: string } = {},\n ) {\n // If transaction is found for same action id, do not create a new speed up transaction.\n if (this.getTransactionWithActionId(actionId)) {\n return;\n }\n\n if (gasValues) {\n validateGasValues(gasValues);\n }\n const transactionMeta = this.state.transactions.find(\n ({ id }) => id === transactionId,\n );\n /* istanbul ignore next */\n if (!transactionMeta) {\n return;\n }\n\n /* istanbul ignore next */\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n const { transactions } = this.state;\n\n // gasPrice (legacy non EIP1559)\n const minGasPrice = getIncreasedPriceFromExisting(\n transactionMeta.txParams.gasPrice,\n SPEED_UP_RATE,\n );\n\n const gasPriceFromValues = isGasPriceValue(gasValues) && gasValues.gasPrice;\n\n const newGasPrice =\n (gasPriceFromValues &&\n validateMinimumIncrease(gasPriceFromValues, minGasPrice)) ||\n minGasPrice;\n\n // maxFeePerGas (EIP1559)\n const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;\n const minMaxFeePerGas = getIncreasedPriceFromExisting(\n existingMaxFeePerGas,\n SPEED_UP_RATE,\n );\n const maxFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxFeePerGas;\n const newMaxFeePerGas =\n (maxFeePerGasValues &&\n validateMinimumIncrease(maxFeePerGasValues, minMaxFeePerGas)) ||\n (existingMaxFeePerGas && minMaxFeePerGas);\n\n // maxPriorityFeePerGas (EIP1559)\n const existingMaxPriorityFeePerGas =\n transactionMeta.txParams?.maxPriorityFeePerGas;\n const minMaxPriorityFeePerGas = getIncreasedPriceFromExisting(\n existingMaxPriorityFeePerGas,\n SPEED_UP_RATE,\n );\n const maxPriorityFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxPriorityFeePerGas;\n const newMaxPriorityFeePerGas =\n (maxPriorityFeePerGasValues &&\n validateMinimumIncrease(\n maxPriorityFeePerGasValues,\n minMaxPriorityFeePerGas,\n )) ||\n (existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas);\n\n const txParams =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n type: 2,\n }\n : {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n gasPrice: newGasPrice,\n };\n\n const unsignedEthTx = this.prepareUnsignedEthTx(txParams);\n\n const signedTx = await this.sign(\n unsignedEthTx,\n transactionMeta.txParams.from,\n );\n await this.updateTransactionMetaRSV(transactionMeta, signedTx);\n const rawTx = bufferToHex(signedTx.serialize());\n const hash = await query(this.ethQuery, 'sendRawTransaction', [rawTx]);\n const baseTransactionMeta = {\n ...transactionMeta,\n estimatedBaseFee,\n id: random(),\n time: Date.now(),\n hash,\n actionId,\n originalGasEstimate: transactionMeta.txParams.gas,\n type: TransactionType.retry,\n };\n const newTransactionMeta =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n ...baseTransactionMeta,\n txParams: {\n ...transactionMeta.txParams,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n },\n }\n : {\n ...baseTransactionMeta,\n txParams: {\n ...transactionMeta.txParams,\n gasPrice: newGasPrice,\n },\n };\n transactions.push(newTransactionMeta);\n this.update({ transactions: this.trimTransactionsForState(transactions) });\n this.hub.emit(`${transactionMeta.id}:speedup`, newTransactionMeta);\n }\n\n /**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @returns The gas and gas price.\n */\n async estimateGas(transaction: TransactionParams) {\n const estimatedTransaction = { ...transaction };\n const {\n gas,\n gasPrice: providedGasPrice,\n to,\n value,\n data,\n } = estimatedTransaction;\n const gasPrice =\n typeof providedGasPrice === 'undefined'\n ? await query(this.ethQuery, 'gasPrice')\n : providedGasPrice;\n const { providerConfig } = this.getNetworkState();\n const isCustomNetwork = providerConfig.type === NetworkType.rpc;\n // 1. If gas is already defined on the transaction, use it\n if (typeof gas !== 'undefined') {\n return { gas, gasPrice };\n }\n const { gasLimit } = await query(this.ethQuery, 'getBlockByNumber', [\n 'latest',\n false,\n ]);\n\n // 2. If to is not defined or this is not a contract address, and there is no data use 0x5208 / 21000.\n // If the network is a custom network then bypass this check and fetch 'estimateGas'.\n /* istanbul ignore next */\n const code = to ? await query(this.ethQuery, 'getCode', [to]) : undefined;\n /* istanbul ignore next */\n if (\n !isCustomNetwork &&\n (!to || (to && !data && (!code || code === '0x')))\n ) {\n return { gas: '0x5208', gasPrice };\n }\n\n // if data, should be hex string format\n estimatedTransaction.data = !data\n ? data\n : /* istanbul ignore next */ addHexPrefix(data);\n\n // 3. If this is a contract address, safely estimate gas using RPC\n estimatedTransaction.value =\n typeof value === 'undefined' ? '0x0' : /* istanbul ignore next */ value;\n const gasLimitBN = hexToBN(gasLimit);\n estimatedTransaction.gas = BNToHex(fractionBN(gasLimitBN, 19, 20));\n\n let gasHex;\n let estimateGasError;\n try {\n gasHex = await query(this.ethQuery, 'estimateGas', [\n estimatedTransaction,\n ]);\n } catch (error) {\n estimateGasError = ESTIMATE_GAS_ERROR;\n }\n // 4. Pad estimated gas without exceeding the most recent block gasLimit. If the network is a\n // a custom network then return the eth_estimateGas value.\n const gasBN = hexToBN(gasHex);\n const maxGasBN = gasLimitBN.muln(0.9);\n const paddedGasBN = gasBN.muln(1.5);\n /* istanbul ignore next */\n if (gasBN.gt(maxGasBN) || isCustomNetwork) {\n return { gas: addHexPrefix(gasHex), gasPrice, estimateGasError };\n }\n\n /* istanbul ignore next */\n if (paddedGasBN.lt(maxGasBN)) {\n return {\n gas: addHexPrefix(BNToHex(paddedGasBN)),\n gasPrice,\n estimateGasError,\n };\n }\n return { gas: addHexPrefix(BNToHex(maxGasBN)), gasPrice, estimateGasError };\n }\n\n /**\n * Check the status of submitted transactions on the network to determine whether they have\n * been included in a block. Any that have been included in a block are marked as confirmed.\n */\n async queryTransactionStatuses() {\n const { transactions } = this.state;\n const currentChainId = this.getChainId();\n let gotUpdates = false;\n await safelyExecute(() =>\n Promise.all(\n transactions.map(async (meta, index) => {\n if (!meta.verifiedOnBlockchain && meta.chainId === currentChainId) {\n const [reconciledTx, updateRequired] =\n await this.blockchainTransactionStateReconciler(meta);\n if (updateRequired) {\n transactions[index] = reconciledTx;\n gotUpdates = updateRequired;\n }\n }\n }),\n ),\n );\n\n /* istanbul ignore else */\n if (gotUpdates) {\n this.update({\n transactions: this.trimTransactionsForState(transactions),\n });\n }\n }\n\n /**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to include in the transaction history.\n */\n updateTransaction(transactionMeta: TransactionMeta, note: string) {\n const { transactions } = this.state;\n transactionMeta.txParams = normalizeTxParams(transactionMeta.txParams);\n validateTxParams(transactionMeta.txParams);\n if (!this.isHistoryDisabled) {\n updateTransactionHistory(transactionMeta, note);\n }\n const index = transactions.findIndex(({ id }) => transactionMeta.id === id);\n transactions[index] = transactionMeta;\n this.update({ transactions: this.trimTransactionsForState(transactions) });\n }\n\n /**\n * Removes all transactions from state, optionally based on the current network.\n *\n * @param ignoreNetwork - Determines whether to wipe all transactions, or just those on the\n * current network. If `true`, all transactions are wiped.\n * @param address - If specified, only transactions originating from this address will be\n * wiped on current network.\n */\n wipeTransactions(ignoreNetwork?: boolean, address?: string) {\n /* istanbul ignore next */\n if (ignoreNetwork && !address) {\n this.update({ transactions: [] });\n return;\n }\n const currentChainId = this.getChainId();\n const newTransactions = this.state.transactions.filter(\n ({ chainId, txParams }) => {\n const isMatchingNetwork = ignoreNetwork || chainId === currentChainId;\n\n if (!isMatchingNetwork) {\n return true;\n }\n\n const isMatchingAddress =\n !address || txParams.from?.toLowerCase() === address.toLowerCase();\n\n return !isMatchingAddress;\n },\n );\n\n this.update({\n transactions: this.trimTransactionsForState(newTransactions),\n });\n }\n\n startIncomingTransactionProcessing() {\n this.incomingTransactionHelper.start();\n }\n\n stopIncomingTransactionProcessing() {\n this.incomingTransactionHelper.stop();\n }\n\n /**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\n async confirmExternalTransaction(\n transactionMeta: TransactionMeta,\n transactionReceipt: TransactionReceipt,\n baseFeePerGas: Hex,\n ) {\n // Run validation and add external transaction to state.\n this.addExternalTransaction(transactionMeta);\n\n try {\n const transactionId = transactionMeta.id;\n\n // Make sure status is confirmed and define gasUsed as in receipt.\n transactionMeta.status = TransactionStatus.confirmed;\n transactionMeta.txReceipt = transactionReceipt;\n if (baseFeePerGas) {\n transactionMeta.baseFeePerGas = baseFeePerGas;\n }\n\n // Update same nonce local transactions as dropped and define replacedBy properties.\n this.markNonceDuplicatesDropped(transactionId);\n\n // Update external provided transaction with updated gas values and confirmed status.\n this.updateTransaction(\n transactionMeta,\n 'TransactionController:confirmExternalTransaction - Add external transaction',\n );\n } catch (error) {\n console.error(error);\n }\n }\n\n /**\n * Append new send flow history to a transaction.\n *\n * @param transactionID - The ID of the transaction to update.\n * @param currentSendFlowHistoryLength - The length of the current sendFlowHistory array.\n * @param sendFlowHistoryToAdd - The sendFlowHistory entries to add.\n * @returns The updated transactionMeta.\n */\n updateTransactionSendFlowHistory(\n transactionID: string,\n currentSendFlowHistoryLength: number,\n sendFlowHistoryToAdd: SendFlowHistoryEntry[],\n ): TransactionMeta {\n if (this.isSendFlowHistoryDisabled) {\n throw new Error(\n 'Send flow history is disabled for the current transaction controller',\n );\n }\n\n const transactionMeta = this.getTransaction(transactionID);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update send flow history as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateTransactionSendFlowHistory',\n );\n\n if (\n currentSendFlowHistoryLength ===\n (transactionMeta?.sendFlowHistory?.length || 0)\n ) {\n transactionMeta.sendFlowHistory = [\n ...(transactionMeta?.sendFlowHistory ?? []),\n ...sendFlowHistoryToAdd,\n ];\n this.updateTransaction(\n transactionMeta,\n 'TransactionController:updateTransactionSendFlowHistory - sendFlowHistory updated',\n );\n }\n\n return this.getTransaction(transactionID) as TransactionMeta;\n }\n\n /**\n * Update the gas values of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param gasValues - Gas values to update.\n * @param gasValues.gas - Same as transaction.gasLimit.\n * @param gasValues.gasLimit - Maxmimum number of units of gas to use for this transaction.\n * @param gasValues.gasPrice - Price per gas for legacy transactions.\n * @param gasValues.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param gasValues.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param gasValues.estimateUsed - Which estimate level was used.\n * @param gasValues.estimateSuggested - Which estimate level that the API suggested.\n * @param gasValues.defaultGasEstimates - The default estimate for gas.\n * @param gasValues.originalGasEstimate - Original estimate for gas.\n * @param gasValues.userEditedGasLimit - The gas limit supplied by user.\n * @param gasValues.userFeeLevel - Estimate level user selected.\n * @returns The updated transactionMeta.\n */\n updateTransactionGasFees(\n transactionId: string,\n {\n defaultGasEstimates,\n estimateUsed,\n estimateSuggested,\n gas,\n gasLimit,\n gasPrice,\n maxPriorityFeePerGas,\n maxFeePerGas,\n originalGasEstimate,\n userEditedGasLimit,\n userFeeLevel,\n }: {\n defaultGasEstimates?: string;\n estimateUsed?: string;\n estimateSuggested?: string;\n gas?: string;\n gasLimit?: string;\n gasPrice?: string;\n maxPriorityFeePerGas?: string;\n maxFeePerGas?: string;\n originalGasEstimate?: string;\n userEditedGasLimit?: boolean;\n userFeeLevel?: string;\n },\n ): TransactionMeta {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update transaction as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateTransactionGasFees',\n );\n\n let transactionGasFees = {\n txParams: {\n gas,\n gasLimit,\n gasPrice,\n maxPriorityFeePerGas,\n maxFeePerGas,\n },\n defaultGasEstimates,\n estimateUsed,\n estimateSuggested,\n originalGasEstimate,\n userEditedGasLimit,\n userFeeLevel,\n } as any;\n\n // only update what is defined\n transactionGasFees.txParams = pickBy(transactionGasFees.txParams);\n transactionGasFees = pickBy(transactionGasFees);\n\n // merge updated gas values with existing transaction meta\n const updatedMeta = merge(transactionMeta, transactionGasFees);\n\n this.updateTransaction(\n updatedMeta,\n 'TransactionController:updateTransactionGasFees - gas values updated',\n );\n\n return this.getTransaction(transactionId) as TransactionMeta;\n }\n\n private async processApproval(\n transactionMeta: TransactionMeta,\n {\n isExisting = false,\n requireApproval,\n shouldShowRequest = true,\n }: {\n isExisting?: boolean;\n requireApproval?: boolean | undefined;\n shouldShowRequest?: boolean;\n },\n ): Promise {\n const transactionId = transactionMeta.id;\n let resultCallbacks: AcceptResultCallbacks | undefined;\n const { meta, isCompleted } = this.isTransactionCompleted(transactionId);\n const finishedPromise = isCompleted\n ? Promise.resolve(meta)\n : this.waitForTransactionFinished(transactionId);\n\n if (meta && !isExisting && !isCompleted) {\n try {\n if (requireApproval !== false) {\n const acceptResult = await this.requestApproval(transactionMeta, {\n shouldShowRequest,\n });\n resultCallbacks = acceptResult.resultCallbacks;\n }\n\n const { isCompleted: isTxCompleted } =\n this.isTransactionCompleted(transactionId);\n\n if (!isTxCompleted) {\n await this.approveTransaction(transactionId);\n }\n } catch (error: any) {\n const { isCompleted: isTxCompleted } =\n this.isTransactionCompleted(transactionId);\n if (!isTxCompleted) {\n if (error.code === errorCodes.provider.userRejectedRequest) {\n this.cancelTransaction(transactionId);\n\n throw providerErrors.userRejectedRequest(\n 'User rejected the transaction',\n );\n } else {\n this.failTransaction(meta, error);\n }\n }\n }\n }\n\n const finalMeta = await finishedPromise;\n\n switch (finalMeta?.status) {\n case TransactionStatus.failed:\n resultCallbacks?.error(finalMeta.error);\n throw rpcErrors.internal(finalMeta.error.message);\n\n case TransactionStatus.cancelled:\n const cancelError = rpcErrors.internal(\n 'User cancelled the transaction',\n );\n\n resultCallbacks?.error(cancelError);\n throw cancelError;\n\n case TransactionStatus.submitted:\n resultCallbacks?.success();\n return finalMeta.hash as string;\n\n default:\n const internalError = rpcErrors.internal(\n `MetaMask Tx Signature: Unknown problem: ${JSON.stringify(\n finalMeta || transactionId,\n )}`,\n );\n\n resultCallbacks?.error(internalError);\n throw internalError;\n }\n }\n\n /**\n * Approves a transaction and updates it's status in state. If this is not a\n * retry transaction, a nonce will be generated. The transaction is signed\n * using the sign configuration property, then published to the blockchain.\n * A `:finished` hub event is fired after success or failure.\n *\n * @param transactionId - The ID of the transaction to approve.\n */\n private async approveTransaction(transactionId: string) {\n const { transactions } = this.state;\n const releaseLock = await this.mutex.acquire();\n const chainId = this.getChainId();\n const index = transactions.findIndex(({ id }) => transactionId === id);\n const transactionMeta = transactions[index];\n const {\n txParams: { nonce, from },\n } = transactionMeta;\n let nonceLock;\n try {\n if (!this.sign) {\n releaseLock();\n this.failTransaction(\n transactionMeta,\n new Error('No sign method defined.'),\n );\n return;\n } else if (!chainId) {\n releaseLock();\n this.failTransaction(transactionMeta, new Error('No chainId defined.'));\n return;\n }\n\n const { approved: status } = TransactionStatus;\n let nonceToUse = nonce;\n // if a nonce already exists on the transactionMeta it means this is a speedup or cancel transaction\n // so we want to reuse that nonce and hope that it beats the previous attempt to chain. Otherwise use a new locked nonce\n if (!nonceToUse) {\n nonceLock = await this.nonceTracker.getNonceLock(from);\n nonceToUse = addHexPrefix(nonceLock.nextNonce.toString(16));\n }\n\n transactionMeta.status = status;\n transactionMeta.txParams.nonce = nonceToUse;\n transactionMeta.txParams.chainId = chainId;\n\n const baseTxParams = {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n };\n\n const isEIP1559 = isEIP1559Transaction(transactionMeta.txParams);\n\n const txParams = isEIP1559\n ? {\n ...baseTxParams,\n maxFeePerGas: transactionMeta.txParams.maxFeePerGas,\n maxPriorityFeePerGas: transactionMeta.txParams.maxPriorityFeePerGas,\n estimatedBaseFee: transactionMeta.txParams.estimatedBaseFee,\n // specify type 2 if maxFeePerGas and maxPriorityFeePerGas are set\n type: 2,\n }\n : baseTxParams;\n\n // delete gasPrice if maxFeePerGas and maxPriorityFeePerGas are set\n if (isEIP1559) {\n delete txParams.gasPrice;\n }\n\n const unsignedEthTx = this.prepareUnsignedEthTx(txParams);\n const signedTx = await this.sign(unsignedEthTx, from);\n await this.updateTransactionMetaRSV(transactionMeta, signedTx);\n transactionMeta.status = TransactionStatus.signed;\n this.updateTransaction(\n transactionMeta,\n 'TransactionController#approveTransaction - Transaction signed',\n );\n\n const rawTx = bufferToHex(signedTx.serialize());\n transactionMeta.rawTx = rawTx;\n this.updateTransaction(\n transactionMeta,\n 'TransactionController#approveTransaction - RawTransaction added',\n );\n const hash = await query(this.ethQuery, 'sendRawTransaction', [rawTx]);\n transactionMeta.hash = hash;\n transactionMeta.status = TransactionStatus.submitted;\n transactionMeta.submittedTime = new Date().getTime();\n this.updateTransaction(\n transactionMeta,\n 'TransactionController#approveTransaction - Transaction submitted',\n );\n this.hub.emit(`${transactionMeta.id}:finished`, transactionMeta);\n } catch (error: any) {\n this.failTransaction(transactionMeta, error);\n } finally {\n // must set transaction to submitted/failed before releasing lock\n if (nonceLock) {\n nonceLock.releaseLock();\n }\n releaseLock();\n }\n }\n\n /**\n * Cancels a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n */\n private cancelTransaction(transactionId: string) {\n const transactionMeta = this.state.transactions.find(\n ({ id }) => id === transactionId,\n );\n if (!transactionMeta) {\n return;\n }\n transactionMeta.status = TransactionStatus.rejected;\n this.hub.emit(`${transactionMeta.id}:finished`, transactionMeta);\n const transactions = this.state.transactions.filter(\n ({ id }) => id !== transactionId,\n );\n this.update({ transactions: this.trimTransactionsForState(transactions) });\n }\n\n /**\n * Trim the amount of transactions that are set on the state. Checks\n * if the length of the tx history is longer then desired persistence\n * limit and then if it is removes the oldest confirmed or rejected tx.\n * Pending or unapproved transactions will not be removed by this\n * operation. For safety of presenting a fully functional transaction UI\n * representation, this function will not break apart transactions with the\n * same nonce, created on the same day, per network. Not accounting for transactions of the same\n * nonce, same day and network combo can result in confusing or broken experiences\n * in the UI. The transactions are then updated using the BaseController update.\n *\n * @param transactions - The transactions to be applied to the state.\n * @returns The trimmed list of transactions.\n */\n private trimTransactionsForState(\n transactions: TransactionMeta[],\n ): TransactionMeta[] {\n const nonceNetworkSet = new Set();\n\n const txsToKeep = transactions\n .sort((a, b) => (a.time > b.time ? -1 : 1)) // Descending time order\n .filter((tx) => {\n const { chainId, status, txParams, time } = tx;\n\n if (txParams) {\n const key = `${txParams.nonce}-${convertHexToDecimal(\n chainId,\n )}-${new Date(time).toDateString()}`;\n\n if (nonceNetworkSet.has(key)) {\n return true;\n } else if (\n nonceNetworkSet.size < this.config.txHistoryLimit ||\n !this.isFinalState(status)\n ) {\n nonceNetworkSet.add(key);\n return true;\n }\n }\n\n return false;\n });\n\n txsToKeep.reverse(); // Ascending time order\n return txsToKeep;\n }\n\n /**\n * Determines if the transaction is in a final state.\n *\n * @param status - The transaction status.\n * @returns Whether the transaction is in a final state.\n */\n private isFinalState(status: TransactionStatus): boolean {\n return (\n status === TransactionStatus.rejected ||\n status === TransactionStatus.confirmed ||\n status === TransactionStatus.failed ||\n status === TransactionStatus.cancelled\n );\n }\n\n /**\n * Whether the transaction has at least completed all local processing.\n *\n * @param status - The transaction status.\n * @returns Whether the transaction is in a final state.\n */\n private isLocalFinalState(status: TransactionStatus): boolean {\n return [\n TransactionStatus.cancelled,\n TransactionStatus.confirmed,\n TransactionStatus.failed,\n TransactionStatus.rejected,\n TransactionStatus.submitted,\n ].includes(status);\n }\n\n /**\n * Method to verify the state of a transaction using the Blockchain as a source of truth.\n *\n * @param meta - The local transaction to verify on the blockchain.\n * @returns A tuple containing the updated transaction, and whether or not an update was required.\n */\n private async blockchainTransactionStateReconciler(\n meta: TransactionMeta,\n ): Promise<[TransactionMeta, boolean]> {\n const { status, hash } = meta;\n switch (status) {\n case TransactionStatus.confirmed:\n const txReceipt = await query(this.ethQuery, 'getTransactionReceipt', [\n hash,\n ]);\n\n if (!txReceipt) {\n return [meta, false];\n }\n\n const txBlock = await query(this.ethQuery, 'getBlockByHash', [\n txReceipt.blockHash,\n ]);\n\n meta.verifiedOnBlockchain = true;\n meta.txParams.gasUsed = txReceipt.gasUsed;\n meta.txReceipt = txReceipt;\n meta.baseFeePerGas = txBlock?.baseFeePerGas;\n meta.blockTimestamp = txBlock?.timestamp;\n\n // According to the Web3 docs:\n // TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.\n if (Number(txReceipt.status) === 0) {\n const error: Error = new Error(\n 'Transaction failed. The transaction was reversed',\n );\n this.failTransaction(meta, error);\n return [meta, false];\n }\n\n return [meta, true];\n case TransactionStatus.submitted:\n const txObj = await query(this.ethQuery, 'getTransactionByHash', [\n hash,\n ]);\n\n if (!txObj) {\n const receiptShowsFailedStatus =\n await this.checkTxReceiptStatusIsFailed(hash);\n\n // Case the txObj is evaluated as false, a second check will\n // determine if the tx failed or it is pending or confirmed\n if (receiptShowsFailedStatus) {\n const error: Error = new Error(\n 'Transaction failed. The transaction was dropped or replaced by a new one',\n );\n this.failTransaction(meta, error);\n }\n }\n\n /* istanbul ignore next */\n if (txObj?.blockNumber) {\n meta.status = TransactionStatus.confirmed;\n this.hub.emit(`${meta.id}:confirmed`, meta);\n return [meta, true];\n }\n\n return [meta, false];\n default:\n return [meta, false];\n }\n }\n\n /**\n * Method to check if a tx has failed according to their receipt\n * According to the Web3 docs:\n * TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.\n * The receipt is not available for pending transactions and returns null.\n *\n * @param txHash - The transaction hash.\n * @returns Whether the transaction has failed.\n */\n private async checkTxReceiptStatusIsFailed(\n txHash: string | undefined,\n ): Promise {\n const txReceipt = await query(this.ethQuery, 'getTransactionReceipt', [\n txHash,\n ]);\n if (!txReceipt) {\n // Transaction is pending\n return false;\n }\n return Number(txReceipt.status) === 0;\n }\n\n private async requestApproval(\n txMeta: TransactionMeta,\n { shouldShowRequest }: { shouldShowRequest: boolean },\n ): Promise {\n const id = this.getApprovalId(txMeta);\n const { origin } = txMeta;\n const type = ApprovalType.Transaction;\n const requestData = { txId: txMeta.id };\n\n return (await this.messagingSystem.call(\n 'ApprovalController:addRequest',\n {\n id,\n origin: origin || ORIGIN_METAMASK,\n type,\n requestData,\n expectsResult: true,\n },\n shouldShowRequest,\n )) as Promise;\n }\n\n private getTransaction(transactionId: string): TransactionMeta | undefined {\n const { transactions } = this.state;\n return transactions.find(({ id }) => id === transactionId);\n }\n\n private getApprovalId(txMeta: TransactionMeta) {\n return String(txMeta.id);\n }\n\n private isTransactionCompleted(transactionId: string): {\n meta?: TransactionMeta;\n isCompleted: boolean;\n } {\n const transaction = this.getTransaction(transactionId);\n\n if (!transaction) {\n return { meta: undefined, isCompleted: false };\n }\n\n const isCompleted = this.isLocalFinalState(transaction.status);\n\n return { meta: transaction, isCompleted };\n }\n\n private getChainId(): Hex {\n const { providerConfig } = this.getNetworkState();\n return providerConfig.chainId;\n }\n\n private prepareUnsignedEthTx(\n txParams: Record,\n ): TypedTransaction {\n return TransactionFactory.fromTxData(txParams, {\n common: this.getCommonConfiguration(),\n freeze: false,\n });\n }\n\n /**\n * `@ethereumjs/tx` uses `@ethereumjs/common` as a configuration tool for\n * specifying which chain, network, hardfork and EIPs to support for\n * a transaction. By referencing this configuration, and analyzing the fields\n * specified in txParams, @ethereumjs/tx is able to determine which EIP-2718\n * transaction type to use.\n *\n * @returns common configuration object\n */\n private getCommonConfiguration(): Common {\n const {\n providerConfig: { type: chain, chainId, nickname: name },\n } = this.getNetworkState();\n\n if (\n chain !== RPC &&\n chain !== NetworkType['linea-goerli'] &&\n chain !== NetworkType['linea-mainnet']\n ) {\n return new Common({ chain, hardfork: HARDFORK });\n }\n\n const customChainParams: Partial = {\n name,\n chainId: parseInt(chainId, 16),\n defaultHardfork: HARDFORK,\n };\n\n return Common.custom(customChainParams);\n }\n\n private onIncomingTransactions({\n added,\n updated,\n }: {\n added: TransactionMeta[];\n updated: TransactionMeta[];\n }) {\n const { transactions: currentTransactions } = this.state;\n\n const updatedTransactions = [\n ...added,\n ...currentTransactions.map((originalTransaction) => {\n const updatedTransaction = updated.find(\n ({ hash }) => hash === originalTransaction.hash,\n );\n\n return updatedTransaction ?? originalTransaction;\n }),\n ];\n\n this.update({\n transactions: this.trimTransactionsForState(updatedTransactions),\n });\n }\n\n private onUpdatedLastFetchedBlockNumbers({\n lastFetchedBlockNumbers,\n blockNumber,\n }: {\n lastFetchedBlockNumbers: {\n [key: string]: number;\n };\n blockNumber: number;\n }) {\n this.update({ lastFetchedBlockNumbers });\n this.hub.emit('incomingTransactionBlock', blockNumber);\n }\n\n private generateDappSuggestedGasFees(\n txParams: TransactionParams,\n origin?: string,\n ): DappSuggestedGasFees | undefined {\n if (!origin || origin === ORIGIN_METAMASK) {\n return undefined;\n }\n\n const { gasPrice, maxFeePerGas, maxPriorityFeePerGas, gas } = txParams;\n\n if (\n gasPrice === undefined &&\n maxFeePerGas === undefined &&\n maxPriorityFeePerGas === undefined &&\n gas === undefined\n ) {\n return undefined;\n }\n\n const dappSuggestedGasFees: DappSuggestedGasFees = {};\n\n if (gasPrice !== undefined) {\n dappSuggestedGasFees.gasPrice = gasPrice;\n } else if (\n maxFeePerGas !== undefined ||\n maxPriorityFeePerGas !== undefined\n ) {\n dappSuggestedGasFees.maxFeePerGas = maxFeePerGas;\n dappSuggestedGasFees.maxPriorityFeePerGas = maxPriorityFeePerGas;\n }\n\n if (gas !== undefined) {\n dappSuggestedGasFees.gas = gas;\n }\n\n return dappSuggestedGasFees;\n }\n\n /**\n * Validates and adds external provided transaction to state.\n *\n * @param transactionMeta - Nominated external transaction to be added to state.\n */\n private async addExternalTransaction(transactionMeta: TransactionMeta) {\n const chainId = this.getChainId();\n const { transactions } = this.state;\n const fromAddress = transactionMeta?.txParams?.from;\n const sameFromAndNetworkTransactions = transactions.filter(\n (transaction) =>\n transaction.txParams.from === fromAddress &&\n transaction.chainId === chainId,\n );\n const confirmedTxs = sameFromAndNetworkTransactions.filter(\n (transaction) => transaction.status === TransactionStatus.confirmed,\n );\n const pendingTxs = sameFromAndNetworkTransactions.filter(\n (transaction) => transaction.status === TransactionStatus.submitted,\n );\n\n validateConfirmedExternalTransaction(\n transactionMeta,\n confirmedTxs,\n pendingTxs,\n );\n\n // Make sure provided external transaction has non empty history array\n if (!(transactionMeta.history ?? []).length) {\n if (!this.isHistoryDisabled) {\n addInitialHistorySnapshot(transactionMeta);\n }\n }\n\n const updatedTransactions = [...transactions, transactionMeta];\n this.update({\n transactions: this.trimTransactionsForState(updatedTransactions),\n });\n }\n\n /**\n * Sets other txMeta statuses to dropped if the txMeta that has been confirmed has other transactions\n * in the transactions have the same nonce.\n *\n * @param transactionId - Used to identify original transaction.\n */\n private markNonceDuplicatesDropped(transactionId: string) {\n const chainId = this.getChainId();\n const transactionMeta = this.getTransaction(transactionId);\n const nonce = transactionMeta?.txParams?.nonce;\n const from = transactionMeta?.txParams?.from;\n const sameNonceTxs = this.state.transactions.filter(\n (transaction) =>\n transaction.txParams.from === from &&\n transaction.txParams.nonce === nonce &&\n transaction.chainId === chainId,\n );\n\n if (!sameNonceTxs.length) {\n return;\n }\n\n // Mark all same nonce transactions as dropped and give it a replacedBy hash\n for (const transaction of sameNonceTxs) {\n if (transaction.id === transactionId) {\n continue;\n }\n transaction.replacedBy = transactionMeta?.hash;\n transaction.replacedById = transactionMeta?.id;\n // Drop any transaction that wasn't previously failed (off chain failure)\n if (transaction.status !== TransactionStatus.failed) {\n this.setTransactionStatusDropped(transaction);\n }\n }\n }\n\n /**\n * Method to set transaction status to dropped.\n *\n * @param transactionMeta - TransactionMeta of transaction to be marked as dropped.\n */\n private setTransactionStatusDropped(transactionMeta: TransactionMeta) {\n transactionMeta.status = TransactionStatus.dropped;\n this.updateTransaction(\n transactionMeta,\n 'TransactionController#setTransactionStatusDropped - Transaction dropped',\n );\n }\n\n /**\n * Get transaction with provided actionId.\n *\n * @param actionId - Unique ID to prevent duplicate requests\n * @returns the filtered transaction\n */\n private getTransactionWithActionId(actionId?: string) {\n return this.state.transactions.find(\n (transaction) => actionId && transaction.actionId === actionId,\n );\n }\n\n private async waitForTransactionFinished(\n transactionId: string,\n ): Promise {\n return new Promise((resolve) => {\n this.hub.once(`${transactionId}:finished`, (txMeta) => {\n resolve(txMeta);\n });\n });\n }\n\n /**\n * Updates the r, s, and v properties of a TransactionMeta object\n * with values from a signed transaction.\n *\n * @param transactionMeta - The TransactionMeta object to update.\n * @param signedTx - The encompassing type for all transaction types containing r, s, and v values.\n */\n private async updateTransactionMetaRSV(\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ): Promise {\n if (signedTx.r) {\n transactionMeta.r = addHexPrefix(signedTx.r.toString(16));\n }\n\n if (signedTx.s) {\n transactionMeta.s = addHexPrefix(signedTx.s.toString(16));\n }\n\n if (signedTx.v) {\n transactionMeta.v = addHexPrefix(signedTx.v.toString(16));\n }\n }\n\n private async getEIP1559Compatibility() {\n const currentNetworkIsEIP1559Compatible =\n await this.getCurrentNetworkEIP1559Compatibility();\n const currentAccountIsEIP1559Compatible =\n this.getCurrentAccountEIP1559Compatibility?.() ?? true;\n\n return (\n currentNetworkIsEIP1559Compatible && currentAccountIsEIP1559Compatible\n );\n }\n}\n\nexport default TransactionController;\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/constants.d.ts b/node_modules/@metamask/transaction-controller/dist/constants.d.ts -index fff2c5c..72cf242 100644 ---- a/node_modules/@metamask/transaction-controller/dist/constants.d.ts -+++ b/node_modules/@metamask/transaction-controller/dist/constants.d.ts -@@ -5,7 +5,7 @@ export declare const CHAIN_IDS: { - readonly BSC: "0x38"; - readonly BSC_TESTNET: "0x61"; - readonly OPTIMISM: "0xa"; -- readonly OPTIMISM_TESTNET: "0x1a4"; -+ readonly OPTIMISM_SEPOLIA: "0xaa37dc"; - readonly POLYGON: "0x89"; - readonly POLYGON_TESTNET: "0x13881"; - readonly AVALANCHE: "0xa86a"; -@@ -14,11 +14,14 @@ export declare const CHAIN_IDS: { - readonly FANTOM_TESTNET: "0xfa2"; - readonly SEPOLIA: "0xaa36a7"; - readonly LINEA_GOERLI: "0xe704"; -+ readonly LINEA_SEPOLIA: "0xe705"; - readonly LINEA_MAINNET: "0xe708"; - readonly MOONBEAM: "0x504"; - readonly MOONBEAM_TESTNET: "0x507"; - readonly MOONRIVER: "0x505"; - readonly GNOSIS: "0x64"; -+ readonly ARBITRUM: "0xa4b1"; -+ readonly ZKSYNC_ERA: "0x144"; - }; - export declare const DEFAULT_ETHERSCAN_DOMAIN = "etherscan.io"; - export declare const DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = "api"; -@@ -39,6 +42,10 @@ export declare const ETHERSCAN_SUPPORTED_NETWORKS: { - domain: string; - subdomain: string; - }; -+ "0xe705": { -+ domain: string; -+ subdomain: string; -+ }; - "0xe708": { - domain: string; - subdomain: string; -@@ -55,7 +62,7 @@ export declare const ETHERSCAN_SUPPORTED_NETWORKS: { - domain: string; - subdomain: string; - }; -- "0x1a4": { -+ "0xaa37dc": { - domain: string; - subdomain: string; - }; -@@ -102,4 +109,26 @@ export declare const ETHERSCAN_SUPPORTED_NETWORKS: { - }; - export declare const SWAP_TRANSACTION_TYPES: TransactionType[]; - export declare const VALID_UNAPPROVED_TRANSACTION_TYPES: TransactionType[]; -+/** Extract of the Wrapped ERC-20 ABI required for simulation. */ -+export declare const ABI_SIMULATION_ERC20_WRAPPED: { -+ anonymous: boolean; -+ inputs: { -+ indexed: boolean; -+ name: string; -+ type: string; -+ }[]; -+ name: string; -+ type: string; -+}[]; -+/** Extract of the legacy ERC-721 ABI required for simulation. */ -+export declare const ABI_SIMULATION_ERC721_LEGACY: { -+ anonymous: boolean; -+ inputs: { -+ indexed: boolean; -+ name: string; -+ type: string; -+ }[]; -+ name: string; -+ type: string; -+}[]; - //# sourceMappingURL=constants.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/constants.d.ts.map b/node_modules/@metamask/transaction-controller/dist/constants.d.ts.map -deleted file mode 100644 -index 7fe8678..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/constants.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAoBZ,CAAC;AAEX,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AACvD,eAAO,MAAM,kCAAkC,QAAQ,CAAC;AAExD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ExC,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAGlC,CAAC;AAIF,eAAO,MAAM,kCAAkC,mBAM9C,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/constants.js b/node_modules/@metamask/transaction-controller/dist/constants.js -index 3a2ead9..ba5bfb7 100644 ---- a/node_modules/@metamask/transaction-controller/dist/constants.js -+++ b/node_modules/@metamask/transaction-controller/dist/constants.js -@@ -1,6 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.VALID_UNAPPROVED_TRANSACTION_TYPES = exports.SWAP_TRANSACTION_TYPES = exports.ETHERSCAN_SUPPORTED_NETWORKS = exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = exports.DEFAULT_ETHERSCAN_DOMAIN = exports.CHAIN_IDS = void 0; -+exports.ABI_SIMULATION_ERC721_LEGACY = exports.ABI_SIMULATION_ERC20_WRAPPED = exports.VALID_UNAPPROVED_TRANSACTION_TYPES = exports.SWAP_TRANSACTION_TYPES = exports.ETHERSCAN_SUPPORTED_NETWORKS = exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = exports.DEFAULT_ETHERSCAN_DOMAIN = exports.CHAIN_IDS = void 0; - const types_1 = require("./types"); - exports.CHAIN_IDS = { - MAINNET: '0x1', -@@ -8,7 +8,7 @@ exports.CHAIN_IDS = { - BSC: '0x38', - BSC_TESTNET: '0x61', - OPTIMISM: '0xa', -- OPTIMISM_TESTNET: '0x1a4', -+ OPTIMISM_SEPOLIA: '0xaa37dc', - POLYGON: '0x89', - POLYGON_TESTNET: '0x13881', - AVALANCHE: '0xa86a', -@@ -17,11 +17,14 @@ exports.CHAIN_IDS = { - FANTOM_TESTNET: '0xfa2', - SEPOLIA: '0xaa36a7', - LINEA_GOERLI: '0xe704', -+ LINEA_SEPOLIA: '0xe705', - LINEA_MAINNET: '0xe708', - MOONBEAM: '0x504', - MOONBEAM_TESTNET: '0x507', - MOONRIVER: '0x505', - GNOSIS: '0x64', -+ ARBITRUM: '0xa4b1', -+ ZKSYNC_ERA: '0x144', - }; - exports.DEFAULT_ETHERSCAN_DOMAIN = 'etherscan.io'; - exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = 'api'; -@@ -42,6 +45,10 @@ exports.ETHERSCAN_SUPPORTED_NETWORKS = { - domain: 'lineascan.build', - subdomain: 'goerli', - }, -+ [exports.CHAIN_IDS.LINEA_SEPOLIA]: { -+ domain: 'lineascan.build', -+ subdomain: 'sepolia', -+ }, - [exports.CHAIN_IDS.LINEA_MAINNET]: { - domain: 'lineascan.build', - subdomain: exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX, -@@ -58,9 +65,9 @@ exports.ETHERSCAN_SUPPORTED_NETWORKS = { - domain: exports.DEFAULT_ETHERSCAN_DOMAIN, - subdomain: `${exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-optimistic`, - }, -- [exports.CHAIN_IDS.OPTIMISM_TESTNET]: { -+ [exports.CHAIN_IDS.OPTIMISM_SEPOLIA]: { - domain: exports.DEFAULT_ETHERSCAN_DOMAIN, -- subdomain: `${exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli-optimistic`, -+ subdomain: `${exports.DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia-optimistic`, - }, - [exports.CHAIN_IDS.POLYGON]: { - domain: 'polygonscan.com', -@@ -116,4 +123,50 @@ exports.VALID_UNAPPROVED_TRANSACTION_TYPES = [ - types_1.TransactionType.tokenMethodTransferFrom, - types_1.TransactionType.contractInteraction, - ]; -+/** Extract of the Wrapped ERC-20 ABI required for simulation. */ -+exports.ABI_SIMULATION_ERC20_WRAPPED = [ -+ { -+ anonymous: false, -+ inputs: [ -+ { indexed: true, name: 'to', type: 'address' }, -+ { indexed: false, name: 'wad', type: 'uint256' }, -+ ], -+ name: 'Deposit', -+ type: 'event', -+ }, -+ { -+ anonymous: false, -+ inputs: [ -+ { indexed: true, name: 'from', type: 'address' }, -+ { indexed: false, name: 'wad', type: 'uint256' }, -+ ], -+ name: 'Withdrawal', -+ type: 'event', -+ }, -+]; -+/** Extract of the legacy ERC-721 ABI required for simulation. */ -+exports.ABI_SIMULATION_ERC721_LEGACY = [ -+ { -+ anonymous: false, -+ inputs: [ -+ { -+ indexed: false, -+ name: '_from', -+ type: 'address', -+ }, -+ { -+ indexed: false, -+ name: '_to', -+ type: 'address', -+ }, -+ { -+ indexed: false, -+ name: '_tokenId', -+ type: 'uint256', -+ }, -+ ], -+ name: 'Transfer', -+ type: 'event', -+ }, -+]; - //# sourceMappingURL=constants.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/constants.js.map b/node_modules/@metamask/transaction-controller/dist/constants.js.map -deleted file mode 100644 -index 8e7d444..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/constants.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,mCAA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5D;IACD,CAAC,iBAAS,CAAC,SAAS,CAAC,EAAE;QACrB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,GAAG,0CAAkC,YAAY;KAC7D;IACD,CAAC,iBAAS,CAAC,MAAM,CAAC,EAAE;QAClB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,GAAG,0CAAkC,SAAS;KAC1D;CACF,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,uBAAe,CAAC,IAAI;IACpB,uBAAe,CAAC,YAAY;CAC7B,CAAC;AAEF,4EAA4E;AAC5E,uCAAuC;AAC1B,QAAA,kCAAkC,GAAG;IAChD,GAAG,8BAAsB;IACzB,uBAAe,CAAC,UAAU;IAC1B,uBAAe,CAAC,mBAAmB;IACnC,uBAAe,CAAC,uBAAuB;IACvC,uBAAe,CAAC,mBAAmB;CACpC,CAAC","sourcesContent":["import { TransactionType } from './types';\n\nexport const CHAIN_IDS = {\n MAINNET: '0x1',\n GOERLI: '0x5',\n BSC: '0x38',\n BSC_TESTNET: '0x61',\n OPTIMISM: '0xa',\n OPTIMISM_TESTNET: '0x1a4',\n POLYGON: '0x89',\n POLYGON_TESTNET: '0x13881',\n AVALANCHE: '0xa86a',\n AVALANCHE_TESTNET: '0xa869',\n FANTOM: '0xfa',\n FANTOM_TESTNET: '0xfa2',\n SEPOLIA: '0xaa36a7',\n LINEA_GOERLI: '0xe704',\n LINEA_MAINNET: '0xe708',\n MOONBEAM: '0x504',\n MOONBEAM_TESTNET: '0x507',\n MOONRIVER: '0x505',\n GNOSIS: '0x64',\n} as const;\n\nexport const DEFAULT_ETHERSCAN_DOMAIN = 'etherscan.io';\nexport const DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = 'api';\n\nexport const ETHERSCAN_SUPPORTED_NETWORKS = {\n [CHAIN_IDS.GOERLI]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli`,\n },\n [CHAIN_IDS.MAINNET]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.SEPOLIA]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia`,\n },\n [CHAIN_IDS.LINEA_GOERLI]: {\n domain: 'lineascan.build',\n subdomain: 'goerli',\n },\n [CHAIN_IDS.LINEA_MAINNET]: {\n domain: 'lineascan.build',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.BSC]: {\n domain: 'bscscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.BSC_TESTNET]: {\n domain: 'bscscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.OPTIMISM]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-optimistic`,\n },\n [CHAIN_IDS.OPTIMISM_TESTNET]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli-optimistic`,\n },\n [CHAIN_IDS.POLYGON]: {\n domain: 'polygonscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.POLYGON_TESTNET]: {\n domain: 'polygonscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-mumbai`,\n },\n [CHAIN_IDS.AVALANCHE]: {\n domain: 'snowtrace.io',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.AVALANCHE_TESTNET]: {\n domain: 'snowtrace.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.FANTOM]: {\n domain: 'ftmscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.FANTOM_TESTNET]: {\n domain: 'ftmscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.MOONBEAM]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonbeam`,\n },\n [CHAIN_IDS.MOONBEAM_TESTNET]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonbase`,\n },\n [CHAIN_IDS.MOONRIVER]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonriver`,\n },\n [CHAIN_IDS.GNOSIS]: {\n domain: 'gnosisscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-gnosis`,\n },\n};\n\nexport const SWAP_TRANSACTION_TYPES = [\n TransactionType.swap,\n TransactionType.swapApproval,\n];\n\n// Only certain types of transactions should be allowed to be specified when\n// adding a new unapproved transaction.\nexport const VALID_UNAPPROVED_TRANSACTION_TYPES = [\n ...SWAP_TRANSACTION_TYPES,\n TransactionType.simpleSend,\n TransactionType.tokenMethodTransfer,\n TransactionType.tokenMethodTransferFrom,\n TransactionType.contractInteraction,\n];\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/errors.d.ts b/node_modules/@metamask/transaction-controller/dist/errors.d.ts -new file mode 100644 -index 0000000..a608a03 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/errors.d.ts -@@ -0,0 +1,15 @@ -+import type { Hex } from '@metamask/utils'; -+export declare class SimulationError extends Error { -+ code?: string | number; -+ constructor(message?: string, code?: string | number); -+} -+export declare class SimulationChainNotSupportedError extends SimulationError { -+ constructor(chainId: Hex); -+} -+export declare class SimulationInvalidResponseError extends SimulationError { -+ constructor(); -+} -+export declare class SimulationRevertedError extends SimulationError { -+ constructor(); -+} -+//# sourceMappingURL=errors.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/errors.js b/node_modules/@metamask/transaction-controller/dist/errors.js -new file mode 100644 -index 0000000..64f2399 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/errors.js -@@ -0,0 +1,30 @@ -+"use strict"; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.SimulationRevertedError = exports.SimulationInvalidResponseError = exports.SimulationChainNotSupportedError = exports.SimulationError = void 0; -+const types_1 = require("./types"); -+class SimulationError extends Error { -+ constructor(message, code) { -+ super(message !== null && message !== void 0 ? message : 'Simulation failed'); -+ this.code = code; -+ } -+} -+exports.SimulationError = SimulationError; -+class SimulationChainNotSupportedError extends SimulationError { -+ constructor(chainId) { -+ super(`Chain is not supported: ${chainId}`, types_1.SimulationErrorCode.ChainNotSupported); -+ } -+} -+exports.SimulationChainNotSupportedError = SimulationChainNotSupportedError; -+class SimulationInvalidResponseError extends SimulationError { -+ constructor() { -+ super('Invalid response from simulation API', types_1.SimulationErrorCode.InvalidResponse); -+ } -+} -+exports.SimulationInvalidResponseError = SimulationInvalidResponseError; -+class SimulationRevertedError extends SimulationError { -+ constructor() { -+ super('Transaction was reverted', types_1.SimulationErrorCode.Reverted); -+ } -+} -+exports.SimulationRevertedError = SimulationRevertedError; -+//# sourceMappingURL=errors.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/etherscan.d.ts.map b/node_modules/@metamask/transaction-controller/dist/etherscan.d.ts.map -deleted file mode 100644 -index 089ab8f..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/etherscan.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"etherscan.d.ts","sourceRoot":"","sources":["../src/etherscan.ts"],"names":[],"mappings":"AACA,OAAO,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;GASG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,2BAA2B,GAAG,OAAO,CACtC,4BAA4B,CAAC,wBAAwB,CAAC,CACvD,CAOA;AAED;;;;;;;;;GASG;AACH,wBAAsB,+BAA+B,CAAC,EACpD,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,2BAA2B,GAAG,OAAO,CACtC,4BAA4B,CAAC,6BAA6B,CAAC,CAC5D,CAOA"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/etherscan.js.map b/node_modules/@metamask/transaction-controller/dist/etherscan.js.map -deleted file mode 100644 -index 070ac33..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/etherscan.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"etherscan.js","sourceRoot":"","sources":["../src/etherscan.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAAyD;AAGzD,2CAA2D;AAC3D,qCAA6D;AAkD7D;;;;;;;;;GASG;AACH,SAAsB,0BAA0B,CAAC,EAC/C,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,GACuB;;QAG5B,OAAO,MAAM,iBAAiB,CAAC,QAAQ,EAAE;YACvC,OAAO;YACP,OAAO;YACP,SAAS;YACT,KAAK;SACN,CAAC,CAAC;IACL,CAAC;CAAA;AAdD,gEAcC;AAED;;;;;;;;;GASG;AACH,SAAsB,+BAA+B,CAAC,EACpD,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,GACuB;;QAG5B,OAAO,MAAM,iBAAiB,CAAC,SAAS,EAAE;YACxC,OAAO;YACP,OAAO;YACP,SAAS;YACT,KAAK;SACN,CAAC,CAAC;IACL,CAAC;CAAA;AAdD,0EAcC;AAED;;;;;;;;;;GAUG;AACH,SAAe,iBAAiB,CAC9B,MAAc,EACd,EACE,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,GAMN;;QAED,MAAM,SAAS,GAAG;YAChB,MAAM,EAAE,SAAS;YACjB,OAAO;YACP,UAAU,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,EAAE;YACjC,MAAM,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;YACzB,IAAI,EAAE,MAAM;SACb,CAAC;QAEF,MAAM,cAAc,GAAG,kBAAkB,CAAC,OAAO,kCAC5C,SAAS,KACZ,MAAM,IACN,CAAC;QAEH,IAAA,mCAAG,EAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC;QAEjD,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,8BAAW,EACjC,cAAc,CACf,CAAoC,CAAC;QAEtC,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAED;;;;;;GAMG;AACH,SAAS,kBAAkB,CACzB,OAAY,EACZ,SAA6C;IAI7C,MAAM,WAAW,GAAG,wCAA4B,CAAC,OAA2B,CAAC,CAAC;IAE9E,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,6CAA6C,OAAO,EAAE,CAAC,CAAC;KACzE;IAED,MAAM,MAAM,GAAG,WAAW,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;IACxE,IAAI,GAAG,GAAG,GAAG,MAAM,OAAO,CAAC;IAE3B,wCAAwC;IACxC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QAElC,IAAI,CAAC,KAAK,EAAE;YACV,SAAS;SACV;QAED,GAAG,IAAI,GAAG,QAAQ,IAAI,KAAK,GAAG,CAAC;KAChC;IAED,GAAG,IAAI,mBAAmB,CAAC;IAE3B,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { handleFetch } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport { ETHERSCAN_SUPPORTED_NETWORKS } from './constants';\nimport { incomingTransactionsLogger as log } from './logger';\n\nexport interface EtherscanTransactionMetaBase {\n blockNumber: string;\n blockHash: string;\n confirmations: string;\n contractAddress: string;\n cumulativeGasUsed: string;\n from: string;\n gas: string;\n gasPrice: string;\n gasUsed: string;\n hash: string;\n nonce: string;\n timeStamp: string;\n to: string;\n transactionIndex: string;\n value: string;\n}\n\nexport interface EtherscanTransactionMeta extends EtherscanTransactionMetaBase {\n functionName: string;\n input: string;\n isError: string;\n methodId: string;\n txreceipt_status: string;\n}\n\nexport interface EtherscanTokenTransactionMeta\n extends EtherscanTransactionMetaBase {\n tokenDecimal: string;\n tokenName: string;\n tokenSymbol: string;\n}\n\nexport interface EtherscanTransactionResponse<\n T extends EtherscanTransactionMetaBase,\n> {\n status: '0' | '1';\n message?: string;\n result: string | T[];\n}\n\nexport interface EtherscanTransactionRequest {\n address: string;\n chainId: Hex;\n fromBlock?: number;\n limit?: number;\n}\n\n/**\n * Retrieves transaction data from Etherscan.\n *\n * @param request - Configuration required to fetch transactions.\n * @param request.address - Address to retrieve transactions for.\n * @param request.chainId - Current chain ID used to determine subdomain and domain.\n * @param request.fromBlock - Block number to start fetching transactions from.\n * @param request.limit - Number of transactions to retrieve.\n * @returns An Etherscan response object containing the request status and an array of token transaction data.\n */\nexport async function fetchEtherscanTransactions({\n address,\n chainId,\n fromBlock,\n limit,\n}: EtherscanTransactionRequest): Promise<\n EtherscanTransactionResponse\n> {\n return await fetchTransactions('txlist', {\n address,\n chainId,\n fromBlock,\n limit,\n });\n}\n\n/**\n * Retrieves token transaction data from Etherscan.\n *\n * @param request - Configuration required to fetch token transactions.\n * @param request.address - Address to retrieve token transactions for.\n * @param request.chainId - Current chain ID used to determine subdomain and domain.\n * @param request.fromBlock - Block number to start fetching token transactions from.\n * @param request.limit - Number of token transactions to retrieve.\n * @returns An Etherscan response object containing the request status and an array of token transaction data.\n */\nexport async function fetchEtherscanTokenTransactions({\n address,\n chainId,\n fromBlock,\n limit,\n}: EtherscanTransactionRequest): Promise<\n EtherscanTransactionResponse\n> {\n return await fetchTransactions('tokentx', {\n address,\n chainId,\n fromBlock,\n limit,\n });\n}\n\n/**\n * Retrieves transaction data from Etherscan from a specific endpoint.\n *\n * @param action - The Etherscan endpoint to use.\n * @param options - Options bag.\n * @param options.address - Address to retrieve transactions for.\n * @param options.chainId - Current chain ID used to determine subdomain and domain.\n * @param options.fromBlock - Block number to start fetching transactions from.\n * @param options.limit - Number of transactions to retrieve.\n * @returns An object containing the request status and an array of transaction data.\n */\nasync function fetchTransactions(\n action: string,\n {\n address,\n chainId,\n fromBlock,\n limit,\n }: {\n address: string;\n chainId: Hex;\n fromBlock?: number;\n limit?: number;\n },\n): Promise> {\n const urlParams = {\n module: 'account',\n address,\n startBlock: fromBlock?.toString(),\n offset: limit?.toString(),\n sort: 'desc',\n };\n\n const etherscanTxUrl = getEtherscanApiUrl(chainId, {\n ...urlParams,\n action,\n });\n\n log('Sending Etherscan request', etherscanTxUrl);\n\n const response = (await handleFetch(\n etherscanTxUrl,\n )) as EtherscanTransactionResponse;\n\n return response;\n}\n\n/**\n * Return a URL that can be used to fetch data from Etherscan.\n *\n * @param chainId - Current chain ID used to determine subdomain and domain.\n * @param urlParams - The parameters used to construct the URL.\n * @returns URL to access Etherscan data.\n */\nfunction getEtherscanApiUrl(\n chainId: Hex,\n urlParams: Record,\n): string {\n type SupportedChainId = keyof typeof ETHERSCAN_SUPPORTED_NETWORKS;\n\n const networkInfo = ETHERSCAN_SUPPORTED_NETWORKS[chainId as SupportedChainId];\n\n if (!networkInfo) {\n throw new Error(`Etherscan does not support chain with ID: ${chainId}`);\n }\n\n const apiUrl = `https://${networkInfo.subdomain}.${networkInfo.domain}`;\n let url = `${apiUrl}/api?`;\n\n // eslint-disable-next-line guard-for-in\n for (const paramKey in urlParams) {\n const value = urlParams[paramKey];\n\n if (!value) {\n continue;\n }\n\n url += `${paramKey}=${value}&`;\n }\n\n url += 'tag=latest&page=1';\n\n return url;\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/external-transactions.d.ts.map b/node_modules/@metamask/transaction-controller/dist/external-transactions.d.ts.map -deleted file mode 100644 -index 4a72b53..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/external-transactions.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"external-transactions.d.ts","sourceRoot":"","sources":["../src/external-transactions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAClD,eAAe,CAAC,EAAE,eAAe,EACjC,YAAY,CAAC,EAAE,eAAe,EAAE,EAChC,UAAU,CAAC,EAAE,eAAe,EAAE,QAoC/B"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/external-transactions.js.map b/node_modules/@metamask/transaction-controller/dist/external-transactions.js.map -deleted file mode 100644 -index d92c9fc..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/external-transactions.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"external-transactions.js","sourceRoot":"","sources":["../src/external-transactions.ts"],"names":[],"mappings":";;;AAAA,oGAAoG;AACpG,qDAAiD;AAEjD,mCAA4C;AAG5C;;;;;;GAMG;AACH,SAAgB,oCAAoC,CAClD,eAAiC,EACjC,YAAgC,EAChC,UAA8B;IAE9B,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;QACjD,MAAM,sBAAS,CAAC,aAAa,CAC3B,4DAA4D,CAC7D,CAAC;KACH;IAED,IAAI,eAAe,CAAC,MAAM,KAAK,yBAAiB,CAAC,SAAS,EAAE;QAC1D,MAAM,sBAAS,CAAC,aAAa,CAC3B,mDAAmD,CACpD,CAAC;KACH;IAED,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC;IACvD,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACvC,MAAM,qBAAqB,GAAG,UAAU,CAAC,IAAI,CAC3C,CAAC,EAAE,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,EAAE,CAAC,QAAQ,0CAAE,KAAK,MAAK,eAAe,CAAA,EAAA,CAC/C,CAAC;QACF,IAAI,qBAAqB,EAAE;YACzB,MAAM,sBAAS,CAAC,aAAa,CAC3B,yDAAyD,CAC1D,CAAC;SACH;KACF;IAED,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3C,MAAM,uBAAuB,GAAG,YAAY,CAAC,IAAI,CAC/C,CAAC,EAAE,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,EAAE,CAAC,QAAQ,0CAAE,KAAK,MAAK,eAAe,CAAA,EAAA,CAC/C,CAAC;QACF,IAAI,uBAAuB,EAAE;YAC3B,MAAM,sBAAS,CAAC,aAAa,CAC3B,2DAA2D,CAC5D,CAAC;SACH;KACF;AACH,CAAC;AAvCD,oFAuCC","sourcesContent":["// These utility functions are exclusively used by `confirmExternalTransaction` method in controller\nimport { rpcErrors } from '@metamask/rpc-errors';\n\nimport { TransactionStatus } from './types';\nimport type { TransactionMeta } from './types';\n\n/**\n * Validates the external provided transaction meta.\n *\n * @param transactionMeta - The transaction meta to validate.\n * @param confirmedTxs - The confirmed transactions in controller state.\n * @param pendingTxs - The submitted transactions in controller state.\n */\nexport function validateConfirmedExternalTransaction(\n transactionMeta?: TransactionMeta,\n confirmedTxs?: TransactionMeta[],\n pendingTxs?: TransactionMeta[],\n) {\n if (!transactionMeta || !transactionMeta.txParams) {\n throw rpcErrors.invalidParams(\n '\"transactionMeta\" or \"transactionMeta.txParams\" is missing',\n );\n }\n\n if (transactionMeta.status !== TransactionStatus.confirmed) {\n throw rpcErrors.invalidParams(\n 'External transaction status should be \"confirmed\"',\n );\n }\n\n const externalTxNonce = transactionMeta.txParams.nonce;\n if (pendingTxs && pendingTxs.length > 0) {\n const foundPendingTxByNonce = pendingTxs.find(\n (tx) => tx.txParams?.nonce === externalTxNonce,\n );\n if (foundPendingTxByNonce) {\n throw rpcErrors.invalidParams(\n 'External transaction nonce should not be in pending txs',\n );\n }\n }\n\n if (confirmedTxs && confirmedTxs.length > 0) {\n const foundConfirmedTxByNonce = confirmedTxs.find(\n (tx) => tx.txParams?.nonce === externalTxNonce,\n );\n if (foundConfirmedTxByNonce) {\n throw rpcErrors.invalidParams(\n 'External transaction nonce should not be in confirmed txs',\n );\n }\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.d.ts b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.d.ts -new file mode 100644 -index 0000000..325802b ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.d.ts -@@ -0,0 +1,10 @@ -+import type { GasFeeFlow, GasFeeFlowRequest, GasFeeFlowResponse, TransactionMeta } from '../types'; -+/** -+ * The standard implementation of a gas fee flow that obtains gas fee estimates using only the GasFeeController. -+ */ -+export declare class DefaultGasFeeFlow implements GasFeeFlow { -+ #private; -+ matchesTransaction(_transactionMeta: TransactionMeta): boolean; -+ getGasFees(request: GasFeeFlowRequest): Promise; -+} -+//# sourceMappingURL=DefaultGasFeeFlow.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.d.ts.map b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.d.ts.map -new file mode 100644 -index 0000000..7ed6d78 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"DefaultGasFeeFlow.d.ts","sourceRoot":"","sources":["../../src/gas-flows/DefaultGasFeeFlow.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAChB,MAAM,UAAU,CAAC;AAiBlB;;GAEG;AACH,qBAAa,iBAAkB,YAAW,UAAU;;IAClD,kBAAkB,CAAC,gBAAgB,EAAE,eAAe,GAAG,OAAO;IAIxD,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA4E1E"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js -new file mode 100644 -index 0000000..24ecb29 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js -@@ -0,0 +1,79 @@ -+"use strict"; -+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -+ return new (P || (P = Promise))(function (resolve, reject) { -+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -+ step((generator = generator.apply(thisArg, _arguments || [])).next()); -+ }); -+}; -+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { -+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); -+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); -+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -+}; -+var _DefaultGasFeeFlow_instances, _DefaultGasFeeFlow_getEstimateLevel, _DefaultGasFeeFlow_getFeeMarketLevel, _DefaultGasFeeFlow_getLegacyLevel, _DefaultGasFeeFlow_gweiDecimalToWeiHex; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.DefaultGasFeeFlow = void 0; -+const controller_utils_1 = require("@metamask/controller-utils"); -+const gas_fee_controller_1 = require("@metamask/gas-fee-controller"); -+const utils_1 = require("@metamask/utils"); -+const logger_1 = require("../logger"); -+const types_1 = require("../types"); -+const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'default-gas-fee-flow'); -+/** -+ * The standard implementation of a gas fee flow that obtains gas fee estimates using only the GasFeeController. -+ */ -+class DefaultGasFeeFlow { -+ constructor() { -+ _DefaultGasFeeFlow_instances.add(this); -+ } -+ matchesTransaction(_transactionMeta) { -+ return true; -+ } -+ getGasFees(request) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const { getGasFeeControllerEstimates } = request; -+ const { gasEstimateType, gasFeeEstimates } = yield getGasFeeControllerEstimates(); -+ if (gasEstimateType === gas_fee_controller_1.GAS_ESTIMATE_TYPES.FEE_MARKET) { -+ log('Using fee market estimates', gasFeeEstimates); -+ } -+ else if (gasEstimateType === gas_fee_controller_1.GAS_ESTIMATE_TYPES.LEGACY) { -+ log('Using legacy estimates', gasFeeEstimates); -+ } -+ else { -+ throw new Error(`'No gas fee estimates available`); -+ } -+ const estimates = Object.values(types_1.GasFeeEstimateLevel).reduce((result, level) => (Object.assign(Object.assign({}, result), { [level]: __classPrivateFieldGet(this, _DefaultGasFeeFlow_instances, "m", _DefaultGasFeeFlow_getEstimateLevel).call(this, { -+ gasEstimateType, -+ gasFeeEstimates, -+ level, -+ }) })), {}); -+ return { estimates }; -+ }); -+ } -+} -+exports.DefaultGasFeeFlow = DefaultGasFeeFlow; -+_DefaultGasFeeFlow_instances = new WeakSet(), _DefaultGasFeeFlow_getEstimateLevel = function _DefaultGasFeeFlow_getEstimateLevel({ gasEstimateType, gasFeeEstimates, level, }) { -+ if (gasEstimateType === gas_fee_controller_1.GAS_ESTIMATE_TYPES.FEE_MARKET) { -+ return __classPrivateFieldGet(this, _DefaultGasFeeFlow_instances, "m", _DefaultGasFeeFlow_getFeeMarketLevel).call(this, gasFeeEstimates, level); -+ } -+ return __classPrivateFieldGet(this, _DefaultGasFeeFlow_instances, "m", _DefaultGasFeeFlow_getLegacyLevel).call(this, gasFeeEstimates, level); -+}, _DefaultGasFeeFlow_getFeeMarketLevel = function _DefaultGasFeeFlow_getFeeMarketLevel(gasFeeEstimates, level) { -+ const maxFeePerGas = __classPrivateFieldGet(this, _DefaultGasFeeFlow_instances, "m", _DefaultGasFeeFlow_gweiDecimalToWeiHex).call(this, gasFeeEstimates[level].suggestedMaxFeePerGas); -+ const maxPriorityFeePerGas = __classPrivateFieldGet(this, _DefaultGasFeeFlow_instances, "m", _DefaultGasFeeFlow_gweiDecimalToWeiHex).call(this, gasFeeEstimates[level].suggestedMaxPriorityFeePerGas); -+ return { -+ maxFeePerGas, -+ maxPriorityFeePerGas, -+ }; -+}, _DefaultGasFeeFlow_getLegacyLevel = function _DefaultGasFeeFlow_getLegacyLevel(gasFeeEstimates, level) { -+ const gasPrice = __classPrivateFieldGet(this, _DefaultGasFeeFlow_instances, "m", _DefaultGasFeeFlow_gweiDecimalToWeiHex).call(this, gasFeeEstimates[level]); -+ return { -+ maxFeePerGas: gasPrice, -+ maxPriorityFeePerGas: gasPrice, -+ }; -+}, _DefaultGasFeeFlow_gweiDecimalToWeiHex = function _DefaultGasFeeFlow_gweiDecimalToWeiHex(gweiDecimal) { -+ return (0, controller_utils_1.toHex)((0, controller_utils_1.gweiDecToWEIBN)(gweiDecimal)); -+}; -+//# sourceMappingURL=DefaultGasFeeFlow.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js.map b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js.map -new file mode 100644 -index 0000000..436f84f ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"DefaultGasFeeFlow.js","sourceRoot":"","sources":["../../src/gas-flows/DefaultGasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iE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KAAK,CAAC,CAAC;KACxD;IAED,OAAO,uBAAA,IAAI,uEAAgB,MAApB,IAAI,EAAiB,eAAe,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,uFAGC,eAA0C,EAC1C,KAA0B;IAE1B,MAAM,YAAY,GAAG,uBAAA,IAAI,4EAAqB,MAAzB,IAAI,EACvB,eAAe,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAC7C,CAAC;IAEF,MAAM,oBAAoB,GAAG,uBAAA,IAAI,4EAAqB,MAAzB,IAAI,EAC/B,eAAe,CAAC,KAAK,CAAC,CAAC,6BAA6B,CACrD,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,oBAAoB;KACrB,CAAC;AACJ,CAAC,iFAGC,eAAuC,EACvC,KAA0B;IAE1B,MAAM,QAAQ,GAAG,uBAAA,IAAI,4EAAqB,MAAzB,IAAI,EAAsB,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAEnE,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,oBAAoB,EAAE,QAAQ;KAC/B,CAAC;AACJ,CAAC,2FAEoB,WAAmB;IACtC,OAAO,IAAA,wBAAK,EAAC,IAAA,iCAAc,EAAC,WAAW,CAAC,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { gweiDecToWEIBN, toHex } from '@metamask/controller-utils';\nimport type {\n LegacyGasPriceEstimate,\n GasFeeEstimates as FeeMarketGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\nimport { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeEstimatesForLevel,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'default-gas-fee-flow');\n\ntype FeeMarketGetEstimateLevelRequest = {\n gasEstimateType: 'fee-market';\n gasFeeEstimates: FeeMarketGasPriceEstimate;\n level: GasFeeEstimateLevel;\n};\n\ntype LegacyGetEstimateLevelRequest = {\n gasEstimateType: 'legacy';\n gasFeeEstimates: LegacyGasPriceEstimate;\n level: GasFeeEstimateLevel;\n};\n\n/**\n * The standard implementation of a gas fee flow that obtains gas fee estimates using only the GasFeeController.\n */\nexport class DefaultGasFeeFlow implements GasFeeFlow {\n matchesTransaction(_transactionMeta: TransactionMeta): boolean {\n return true;\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n const { getGasFeeControllerEstimates } = request;\n\n const { gasEstimateType, gasFeeEstimates } =\n await getGasFeeControllerEstimates();\n\n if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) {\n log('Using fee market estimates', gasFeeEstimates);\n } else if (gasEstimateType === GAS_ESTIMATE_TYPES.LEGACY) {\n log('Using legacy estimates', gasFeeEstimates);\n } else {\n throw new Error(`'No gas fee estimates available`);\n }\n\n const estimates = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: this.#getEstimateLevel({\n gasEstimateType,\n gasFeeEstimates,\n level,\n } as FeeMarketGetEstimateLevelRequest | LegacyGetEstimateLevelRequest),\n }),\n {} as GasFeeEstimates,\n );\n\n return { estimates };\n }\n\n #getEstimateLevel({\n gasEstimateType,\n gasFeeEstimates,\n level,\n }:\n | FeeMarketGetEstimateLevelRequest\n | LegacyGetEstimateLevelRequest): GasFeeEstimatesForLevel {\n if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) {\n return this.#getFeeMarketLevel(gasFeeEstimates, level);\n }\n\n return this.#getLegacyLevel(gasFeeEstimates, level);\n }\n\n #getFeeMarketLevel(\n gasFeeEstimates: FeeMarketGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): GasFeeEstimatesForLevel {\n const maxFeePerGas = this.#gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxFeePerGas,\n );\n\n const maxPriorityFeePerGas = this.#gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxPriorityFeePerGas,\n );\n\n return {\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n }\n\n #getLegacyLevel(\n gasFeeEstimates: LegacyGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): GasFeeEstimatesForLevel {\n const gasPrice = this.#gweiDecimalToWeiHex(gasFeeEstimates[level]);\n\n return {\n maxFeePerGas: gasPrice,\n maxPriorityFeePerGas: gasPrice,\n };\n }\n\n #gweiDecimalToWeiHex(gweiDecimal: string): Hex {\n return toHex(gweiDecToWEIBN(gweiDecimal));\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.d.ts b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.d.ts -new file mode 100644 -index 0000000..ce728db ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.d.ts -@@ -0,0 +1,12 @@ -+import type { GasFeeFlow, GasFeeFlowRequest, GasFeeFlowResponse, TransactionMeta } from '../types'; -+/** -+ * Implementation of a gas fee flow specific to Linea networks that obtains gas fee estimates using: -+ * - The `linea_estimateGas` RPC method to obtain the base fee and lowest priority fee. -+ * - Static multipliers to increase the base and priority fees. -+ */ -+export declare class LineaGasFeeFlow implements GasFeeFlow { -+ #private; -+ matchesTransaction(transactionMeta: TransactionMeta): boolean; -+ getGasFees(request: GasFeeFlowRequest): Promise; -+} -+//# sourceMappingURL=LineaGasFeeFlow.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.d.ts.map b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.d.ts.map -new file mode 100644 -index 0000000..dec2fb5 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"LineaGasFeeFlow.d.ts","sourceRoot":"","sources":["../../src/gas-flows/LineaGasFeeFlow.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAChB,MAAM,UAAU,CAAC;AAgClB;;;;GAIG;AACH,qBAAa,eAAgB,YAAW,UAAU;;IAChD,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO;IAIvD,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAqG1E"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js -new file mode 100644 -index 0000000..0f7f764 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js -@@ -0,0 +1,112 @@ -+"use strict"; -+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -+ return new (P || (P = Promise))(function (resolve, reject) { -+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -+ step((generator = generator.apply(thisArg, _arguments || [])).next()); -+ }); -+}; -+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { -+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); -+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); -+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -+}; -+var _LineaGasFeeFlow_instances, _LineaGasFeeFlow_getLineaGasFees, _LineaGasFeeFlow_getLineaResponse, _LineaGasFeeFlow_getValuesFromMultipliers, _LineaGasFeeFlow_getMaxFees, _LineaGasFeeFlow_feesToString; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.LineaGasFeeFlow = void 0; -+const controller_utils_1 = require("@metamask/controller-utils"); -+const utils_1 = require("@metamask/utils"); -+const DefaultGasFeeFlow_1 = require("./DefaultGasFeeFlow"); -+const logger_1 = require("../logger"); -+const types_1 = require("../types"); -+const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'linea-gas-fee-flow'); -+const LINEA_CHAIN_IDS = [ -+ controller_utils_1.ChainId['linea-mainnet'], -+ controller_utils_1.ChainId['linea-goerli'], -+ controller_utils_1.ChainId['linea-sepolia'], -+]; -+const BASE_FEE_MULTIPLIERS = { -+ low: 1, -+ medium: 1.35, -+ high: 1.7, -+}; -+const PRIORITY_FEE_MULTIPLIERS = { -+ low: 1, -+ medium: 1.05, -+ high: 1.1, -+}; -+/** -+ * Implementation of a gas fee flow specific to Linea networks that obtains gas fee estimates using: -+ * - The `linea_estimateGas` RPC method to obtain the base fee and lowest priority fee. -+ * - Static multipliers to increase the base and priority fees. -+ */ -+class LineaGasFeeFlow { -+ constructor() { -+ _LineaGasFeeFlow_instances.add(this); -+ } -+ matchesTransaction(transactionMeta) { -+ return LINEA_CHAIN_IDS.includes(transactionMeta.chainId); -+ } -+ getGasFees(request) { -+ return __awaiter(this, void 0, void 0, function* () { -+ try { -+ return yield __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_getLineaGasFees).call(this, request); -+ } -+ catch (error) { -+ log('Using default flow as fallback due to error', error); -+ return new DefaultGasFeeFlow_1.DefaultGasFeeFlow().getGasFees(request); -+ } -+ }); -+ } -+} -+exports.LineaGasFeeFlow = LineaGasFeeFlow; -+_LineaGasFeeFlow_instances = new WeakSet(), _LineaGasFeeFlow_getLineaGasFees = function _LineaGasFeeFlow_getLineaGasFees(request) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const { ethQuery, transactionMeta } = request; -+ const lineaResponse = yield __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_getLineaResponse).call(this, transactionMeta, ethQuery); -+ log('Received Linea response', lineaResponse); -+ const baseFees = __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_getValuesFromMultipliers).call(this, lineaResponse.baseFeePerGas, BASE_FEE_MULTIPLIERS); -+ log('Generated base fees', __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_feesToString).call(this, baseFees)); -+ const priorityFees = __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_getValuesFromMultipliers).call(this, lineaResponse.priorityFeePerGas, PRIORITY_FEE_MULTIPLIERS); -+ log('Generated priority fees', __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_feesToString).call(this, priorityFees)); -+ const maxFees = __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_getMaxFees).call(this, baseFees, priorityFees); -+ log('Generated max fees', __classPrivateFieldGet(this, _LineaGasFeeFlow_instances, "m", _LineaGasFeeFlow_feesToString).call(this, maxFees)); -+ const estimates = Object.values(types_1.GasFeeEstimateLevel).reduce((result, level) => (Object.assign(Object.assign({}, result), { [level]: { -+ maxFeePerGas: (0, controller_utils_1.toHex)(maxFees[level]), -+ maxPriorityFeePerGas: (0, controller_utils_1.toHex)(priorityFees[level]), -+ } })), {}); -+ return { estimates }; -+ }); -+}, _LineaGasFeeFlow_getLineaResponse = function _LineaGasFeeFlow_getLineaResponse(transactionMeta, ethQuery) { -+ return (0, controller_utils_1.query)(ethQuery, 'linea_estimateGas', [ -+ { -+ from: transactionMeta.txParams.from, -+ to: transactionMeta.txParams.to, -+ value: transactionMeta.txParams.value, -+ input: transactionMeta.txParams.data, -+ // Required in request but no impact on response. -+ gasPrice: '0x100000000', -+ }, -+ ]); -+}, _LineaGasFeeFlow_getValuesFromMultipliers = function _LineaGasFeeFlow_getValuesFromMultipliers(value, multipliers) { -+ const base = (0, controller_utils_1.hexToBN)(value); -+ const low = base.muln(multipliers.low); -+ const medium = base.muln(multipliers.medium); -+ const high = base.muln(multipliers.high); -+ return { -+ low, -+ medium, -+ high, -+ }; -+}, _LineaGasFeeFlow_getMaxFees = function _LineaGasFeeFlow_getMaxFees(baseFees, priorityFees) { -+ return { -+ low: baseFees.low.add(priorityFees.low), -+ medium: baseFees.medium.add(priorityFees.medium), -+ high: baseFees.high.add(priorityFees.high), -+ }; -+}, _LineaGasFeeFlow_feesToString = function _LineaGasFeeFlow_feesToString(fees) { -+ return Object.values(types_1.GasFeeEstimateLevel).map((level) => fees[level].toString(10)); -+}; -+//# sourceMappingURL=LineaGasFeeFlow.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js.map b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js.map -new file mode 100644 -index 0000000..7efd818 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"LineaGasFeeFlow.js","sourceRoot":"","sources":["../../src/gas-flows/LineaGasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iEAA4E;AAC5E,2CAA+D;AAG/D,2DAAwD;AACxD,sCAA0C;AAQ1C,oCAA+C;AAW/C,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,oBAAoB,CAAC,CAAC;AAEpE,MAAM,eAAe,GAAU;IAC7B,0BAAO,CAAC,eAAe,CAAC;IACxB,0BAAO,CAAC,cAAc,CAAC;IACvB,0BAAO,CAAC,eAAe,CAAC;CACzB,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,GAAG;CAC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AI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO;QACL,GAAG;QACH,MAAM;QACN,IAAI;KACL,CAAC;AACJ,CAAC,qEAGC,QAAyC,EACzC,YAA6C;IAE7C,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC;QACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;QAChD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC;KAC3C,CAAC;AACJ,CAAC,yEAEa,IAAiB;IAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,2BAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACtD,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { ChainId, hexToBN, query, toHex } from '@metamask/controller-utils';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\nimport type { BN } from 'ethereumjs-util';\n\nimport { DefaultGasFeeFlow } from './DefaultGasFeeFlow';\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel } from '../types';\n\ntype LineaEstimateGasResponse = {\n baseFeePerGas: Hex;\n priorityFeePerGas: Hex;\n};\n\ntype FeesByLevel = {\n [key in GasFeeEstimateLevel]: BN;\n};\n\nconst log = createModuleLogger(projectLogger, 'linea-gas-fee-flow');\n\nconst LINEA_CHAIN_IDS: Hex[] = [\n ChainId['linea-mainnet'],\n ChainId['linea-goerli'],\n ChainId['linea-sepolia'],\n];\n\nconst BASE_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.35,\n high: 1.7,\n};\n\nconst PRIORITY_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.05,\n high: 1.1,\n};\n\n/**\n * Implementation of a gas fee flow specific to Linea networks that obtains gas fee estimates using:\n * - The `linea_estimateGas` RPC method to obtain the base fee and lowest priority fee.\n * - Static multipliers to increase the base and priority fees.\n */\nexport class LineaGasFeeFlow implements GasFeeFlow {\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return LINEA_CHAIN_IDS.includes(transactionMeta.chainId as Hex);\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n try {\n return await this.#getLineaGasFees(request);\n } catch (error) {\n log('Using default flow as fallback due to error', error);\n return new DefaultGasFeeFlow().getGasFees(request);\n }\n }\n\n async #getLineaGasFees(\n request: GasFeeFlowRequest,\n ): Promise {\n const { ethQuery, transactionMeta } = request;\n\n const lineaResponse = await this.#getLineaResponse(\n transactionMeta,\n ethQuery,\n );\n\n log('Received Linea response', lineaResponse);\n\n const baseFees = this.#getValuesFromMultipliers(\n lineaResponse.baseFeePerGas,\n BASE_FEE_MULTIPLIERS,\n );\n\n log('Generated base fees', this.#feesToString(baseFees));\n\n const priorityFees = this.#getValuesFromMultipliers(\n lineaResponse.priorityFeePerGas,\n PRIORITY_FEE_MULTIPLIERS,\n );\n\n log('Generated priority fees', this.#feesToString(priorityFees));\n\n const maxFees = this.#getMaxFees(baseFees, priorityFees);\n\n log('Generated max fees', this.#feesToString(maxFees));\n\n const estimates = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: {\n maxFeePerGas: toHex(maxFees[level]),\n maxPriorityFeePerGas: toHex(priorityFees[level]),\n },\n }),\n {} as GasFeeEstimates,\n );\n\n return { estimates };\n }\n\n #getLineaResponse(\n transactionMeta: TransactionMeta,\n ethQuery: any,\n ): Promise {\n return query(ethQuery, 'linea_estimateGas', [\n {\n from: transactionMeta.txParams.from,\n to: transactionMeta.txParams.to,\n value: transactionMeta.txParams.value,\n input: transactionMeta.txParams.data,\n // Required in request but no impact on response.\n gasPrice: '0x100000000',\n },\n ]);\n }\n\n #getValuesFromMultipliers(\n value: Hex,\n multipliers: { low: number; medium: number; high: number },\n ): FeesByLevel {\n const base = hexToBN(value);\n const low = base.muln(multipliers.low);\n const medium = base.muln(multipliers.medium);\n const high = base.muln(multipliers.high);\n\n return {\n low,\n medium,\n high,\n };\n }\n\n #getMaxFees(\n baseFees: Record,\n priorityFees: Record,\n ): FeesByLevel {\n return {\n low: baseFees.low.add(priorityFees.low),\n medium: baseFees.medium.add(priorityFees.medium),\n high: baseFees.high.add(priorityFees.high),\n };\n }\n\n #feesToString(fees: FeesByLevel) {\n return Object.values(GasFeeEstimateLevel).map((level) =>\n fees[level].toString(10),\n );\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.d.ts b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.d.ts -new file mode 100644 -index 0000000..e7eb32d ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.d.ts -@@ -0,0 +1,31 @@ -+/// -+import type { GasFeeState } from '@metamask/gas-fee-controller'; -+import EventEmitter from 'events'; -+import type { GasFeeFlow, TransactionMeta } from '../types'; -+/** -+ * Automatically polls and updates suggested gas fees on unapproved transactions. -+ */ -+export declare class GasFeePoller { -+ #private; -+ hub: EventEmitter; -+ /** -+ * Constructs a new instance of the GasFeePoller. -+ * -+ * @param options - The options for this instance. -+ * @param options.gasFeeFlows - The gas fee flows to use to obtain suitable gas fees. -+ * @param options.getChainIds - Callback to specify the chain IDs to monitor. -+ * @param options.getEthQuery - Callback to obtain an EthQuery instance. -+ * @param options.getGasFeeControllerEstimates - Callback to obtain the default fee estimates. -+ * @param options.getTransactions - Callback to obtain the transaction data. -+ * @param options.onStateChange - Callback to register a listener for controller state changes. -+ */ -+ constructor({ gasFeeFlows, getChainIds, getEthQuery, getGasFeeControllerEstimates, getTransactions, onStateChange, }: { -+ gasFeeFlows: GasFeeFlow[]; -+ getChainIds: () => string[]; -+ getEthQuery: () => any; -+ getGasFeeControllerEstimates: () => Promise; -+ getTransactions: () => TransactionMeta[]; -+ onStateChange: (listener: () => void) => void; -+ }); -+} -+//# sourceMappingURL=GasFeePoller.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.d.ts.map b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.d.ts.map -new file mode 100644 -index 0000000..f6a5ea5 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"GasFeePoller.d.ts","sourceRoot":"","sources":["../../src/helpers/GasFeePoller.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAIlC,OAAO,KAAK,EAAE,UAAU,EAAqB,eAAe,EAAE,MAAM,UAAU,CAAC;AAO/E;;GAEG;AACH,qBAAa,YAAY;;IACvB,GAAG,EAAE,YAAY,CAAsB;IAgBvC;;;;;;;;;;OAUG;gBACS,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,4BAA4B,EAC5B,eAAe,EACf,aAAa,GACd,EAAE;QACD,WAAW,EAAE,UAAU,EAAE,CAAC;QAC1B,WAAW,EAAE,MAAM,MAAM,EAAE,CAAC;QAC5B,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,4BAA4B,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;QACzD,eAAe,EAAE,MAAM,eAAe,EAAE,CAAC;QACzC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;KAC/C;CA+HF"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js -new file mode 100644 -index 0000000..6f287b5 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js -@@ -0,0 +1,147 @@ -+"use strict"; -+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -+ return new (P || (P = Promise))(function (resolve, reject) { -+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -+ step((generator = generator.apply(thisArg, _arguments || [])).next()); -+ }); -+}; -+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { -+ if (kind === "m") throw new TypeError("Private method is not writable"); -+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); -+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); -+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -+}; -+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { -+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); -+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); -+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -+}; -+var __importDefault = (this && this.__importDefault) || function (mod) { -+ return (mod && mod.__esModule) ? mod : { "default": mod }; -+}; -+var _GasFeePoller_instances, _GasFeePoller_gasFeeFlows, _GasFeePoller_getChainIds, _GasFeePoller_getEthQuery, _GasFeePoller_getGasFeeControllerEstimates, _GasFeePoller_getTransactions, _GasFeePoller_timeout, _GasFeePoller_running, _GasFeePoller_start, _GasFeePoller_stop, _GasFeePoller_onTimeout, _GasFeePoller_updateUnapprovedTransactions, _GasFeePoller_updateTransactionSuggestedFees, _GasFeePoller_getUnapprovedTransactions; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.GasFeePoller = void 0; -+const utils_1 = require("@metamask/utils"); -+const events_1 = __importDefault(require("events")); -+const logger_1 = require("../logger"); -+const types_1 = require("../types"); -+const gas_flow_1 = require("../utils/gas-flow"); -+const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'gas-fee-poller'); -+const INTERVAL_MILLISECONDS = 10000; -+/** -+ * Automatically polls and updates suggested gas fees on unapproved transactions. -+ */ -+class GasFeePoller { -+ /** -+ * Constructs a new instance of the GasFeePoller. -+ * -+ * @param options - The options for this instance. -+ * @param options.gasFeeFlows - The gas fee flows to use to obtain suitable gas fees. -+ * @param options.getChainIds - Callback to specify the chain IDs to monitor. -+ * @param options.getEthQuery - Callback to obtain an EthQuery instance. -+ * @param options.getGasFeeControllerEstimates - Callback to obtain the default fee estimates. -+ * @param options.getTransactions - Callback to obtain the transaction data. -+ * @param options.onStateChange - Callback to register a listener for controller state changes. -+ */ -+ constructor({ gasFeeFlows, getChainIds, getEthQuery, getGasFeeControllerEstimates, getTransactions, onStateChange, }) { -+ _GasFeePoller_instances.add(this); -+ this.hub = new events_1.default(); -+ _GasFeePoller_gasFeeFlows.set(this, void 0); -+ _GasFeePoller_getChainIds.set(this, void 0); -+ _GasFeePoller_getEthQuery.set(this, void 0); -+ _GasFeePoller_getGasFeeControllerEstimates.set(this, void 0); -+ _GasFeePoller_getTransactions.set(this, void 0); -+ _GasFeePoller_timeout.set(this, void 0); -+ _GasFeePoller_running.set(this, false); -+ __classPrivateFieldSet(this, _GasFeePoller_gasFeeFlows, gasFeeFlows, "f"); -+ __classPrivateFieldSet(this, _GasFeePoller_getChainIds, getChainIds, "f"); -+ __classPrivateFieldSet(this, _GasFeePoller_getEthQuery, getEthQuery, "f"); -+ __classPrivateFieldSet(this, _GasFeePoller_getGasFeeControllerEstimates, getGasFeeControllerEstimates, "f"); -+ __classPrivateFieldSet(this, _GasFeePoller_getTransactions, getTransactions, "f"); -+ onStateChange(() => { -+ const unapprovedTransactions = __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_getUnapprovedTransactions).call(this); -+ if (unapprovedTransactions.length) { -+ __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_start).call(this); -+ } -+ else { -+ __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_stop).call(this); -+ } -+ }); -+ } -+} -+exports.GasFeePoller = GasFeePoller; -+_GasFeePoller_gasFeeFlows = new WeakMap(), _GasFeePoller_getChainIds = new WeakMap(), _GasFeePoller_getEthQuery = new WeakMap(), _GasFeePoller_getGasFeeControllerEstimates = new WeakMap(), _GasFeePoller_getTransactions = new WeakMap(), _GasFeePoller_timeout = new WeakMap(), _GasFeePoller_running = new WeakMap(), _GasFeePoller_instances = new WeakSet(), _GasFeePoller_start = function _GasFeePoller_start() { -+ if (__classPrivateFieldGet(this, _GasFeePoller_running, "f")) { -+ return; -+ } -+ // Intentionally not awaiting since this starts the timeout chain. -+ // eslint-disable-next-line @typescript-eslint/no-floating-promises -+ __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_onTimeout).call(this); -+ __classPrivateFieldSet(this, _GasFeePoller_running, true, "f"); -+ log('Started polling'); -+}, _GasFeePoller_stop = function _GasFeePoller_stop() { -+ if (!__classPrivateFieldGet(this, _GasFeePoller_running, "f")) { -+ return; -+ } -+ clearTimeout(__classPrivateFieldGet(this, _GasFeePoller_timeout, "f")); -+ __classPrivateFieldSet(this, _GasFeePoller_timeout, undefined, "f"); -+ __classPrivateFieldSet(this, _GasFeePoller_running, false, "f"); -+ log('Stopped polling'); -+}, _GasFeePoller_onTimeout = function _GasFeePoller_onTimeout() { -+ return __awaiter(this, void 0, void 0, function* () { -+ yield __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_updateUnapprovedTransactions).call(this); -+ // eslint-disable-next-line @typescript-eslint/no-misused-promises -+ __classPrivateFieldSet(this, _GasFeePoller_timeout, setTimeout(() => __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_onTimeout).call(this), INTERVAL_MILLISECONDS), "f"); -+ }); -+}, _GasFeePoller_updateUnapprovedTransactions = function _GasFeePoller_updateUnapprovedTransactions() { -+ return __awaiter(this, void 0, void 0, function* () { -+ const unapprovedTransactions = __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_getUnapprovedTransactions).call(this); -+ log('Found unapproved transactions', { -+ count: unapprovedTransactions.length, -+ }); -+ const ethQuery = __classPrivateFieldGet(this, _GasFeePoller_getEthQuery, "f").call(this); -+ yield Promise.all(unapprovedTransactions.map((tx) => __classPrivateFieldGet(this, _GasFeePoller_instances, "m", _GasFeePoller_updateTransactionSuggestedFees).call(this, tx, ethQuery))); -+ }); -+}, _GasFeePoller_updateTransactionSuggestedFees = function _GasFeePoller_updateTransactionSuggestedFees(transactionMeta, ethQuery) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const gasFeeFlow = (0, gas_flow_1.getGasFeeFlow)(transactionMeta, __classPrivateFieldGet(this, _GasFeePoller_gasFeeFlows, "f")); -+ if (!gasFeeFlow) { -+ log('No gas fee flow found', transactionMeta.id); -+ } -+ else { -+ log('Found gas fee flow', gasFeeFlow.constructor.name, transactionMeta.id); -+ } -+ const request = { -+ ethQuery, -+ getGasFeeControllerEstimates: __classPrivateFieldGet(this, _GasFeePoller_getGasFeeControllerEstimates, "f"), -+ transactionMeta, -+ }; -+ if (gasFeeFlow) { -+ try { -+ const response = yield gasFeeFlow.getGasFees(request); -+ transactionMeta.gasFeeEstimates = response.estimates; -+ } -+ catch (error) { -+ log('Failed to get suggested gas fees', transactionMeta.id, error); -+ } -+ } -+ if (!gasFeeFlow && transactionMeta.gasFeeEstimatesLoaded) { -+ return; -+ } -+ transactionMeta.gasFeeEstimatesLoaded = true; -+ this.hub.emit('transaction-updated', transactionMeta, 'GasFeePoller - Suggested gas fees updated'); -+ log('Updated suggested gas fees', { -+ gasFeeEstimates: transactionMeta.gasFeeEstimates, -+ transaction: transactionMeta.id, -+ }); -+ }); -+}, _GasFeePoller_getUnapprovedTransactions = function _GasFeePoller_getUnapprovedTransactions() { -+ const chainIds = __classPrivateFieldGet(this, _GasFeePoller_getChainIds, "f").call(this); -+ return __classPrivateFieldGet(this, _GasFeePoller_getTransactions, "f").call(this).filter((tx) => chainIds.includes(tx.chainId) && -+ tx.status === types_1.TransactionStatus.unapproved); -+}; -+//# sourceMappingURL=GasFeePoller.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js.map b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js.map -new file mode 100644 -index 0000000..1b85190 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"GasFeePoller.js","sourceRoot":"","sources":["../../src/helpers/GasFeePoller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAAqD;AACrD,oDAAkC;AAElC,sCAA0C;AAC1C,oCAA6C;AAE7C,gDAAkD;AAElD,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,gBAAgB,CAAC,CAAC;AAEhE,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEpC;;GAEG;AACH,MAAa,YAAY;IAiBvB;;;;;;;;;;OAUG;IACH,YAAY,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,4BAA4B,EAC5B,eAAe,EACf,aAAa,GAQd;;QAzCD,QAAG,GAAiB,IAAI,gBAAY,EAAE,CAAC;QAEvC,4CAA2B;QAE3B,4CAA6B;QAE7B,4CAAwB;QAExB,6DAA0D;QAE1D,gDAA0C;QAE1C,wCAAc;QAEd,gCAAW,KAAK,EAAC;QA4Bf,uBAAA,IAAI,6BAAgB,WAAW,MAAA,CAAC;QAChC,uBAAA,IAAI,6BAAgB,WAAW,MAAA,CA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ACrB,eAAe,EACf,2CAA2C,CAC5C,CAAC;QAEF,GAAG,CAAC,4BAA4B,EAAE;YAChC,eAAe,EAAE,eAAe,CAAC,eAAe;YAChD,WAAW,EAAE,eAAe,CAAC,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;;IAGC,MAAM,QAAQ,GAAG,uBAAA,IAAI,iCAAa,MAAjB,IAAI,CAAe,CAAC;IAErC,OAAO,uBAAA,IAAI,qCAAiB,MAArB,IAAI,CAAmB,CAAC,MAAM,CACnC,CAAC,EAAE,EAAE,EAAE,CACL,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAiB,CAAC;QACvC,EAAE,CAAC,MAAM,KAAK,yBAAiB,CAAC,UAAU,CAC7C,CAAC;AACJ,CAAC","sourcesContent":["import type { GasFeeState } from '@metamask/gas-fee-controller';\nimport { createModuleLogger } from '@metamask/utils';\nimport EventEmitter from 'events';\n\nimport { projectLogger } from '../logger';\nimport { TransactionStatus } from '../types';\nimport type { GasFeeFlow, GasFeeFlowRequest, TransactionMeta } from '../types';\nimport { getGasFeeFlow } from '../utils/gas-flow';\n\nconst log = createModuleLogger(projectLogger, 'gas-fee-poller');\n\nconst INTERVAL_MILLISECONDS = 10000;\n\n/**\n * Automatically polls and updates suggested gas fees on unapproved transactions.\n */\nexport class GasFeePoller {\n hub: EventEmitter = new EventEmitter();\n\n #gasFeeFlows: GasFeeFlow[];\n\n #getChainIds: () => string[];\n\n #getEthQuery: () => any;\n\n #getGasFeeControllerEstimates: () => Promise;\n\n #getTransactions: () => TransactionMeta[];\n\n #timeout: any;\n\n #running = false;\n\n /**\n * Constructs a new instance of the GasFeePoller.\n *\n * @param options - The options for this instance.\n * @param options.gasFeeFlows - The gas fee flows to use to obtain suitable gas fees.\n * @param options.getChainIds - Callback to specify the chain IDs to monitor.\n * @param options.getEthQuery - Callback to obtain an EthQuery instance.\n * @param options.getGasFeeControllerEstimates - Callback to obtain the default fee estimates.\n * @param options.getTransactions - Callback to obtain the transaction data.\n * @param options.onStateChange - Callback to register a listener for controller state changes.\n */\n constructor({\n gasFeeFlows,\n getChainIds,\n getEthQuery,\n getGasFeeControllerEstimates,\n getTransactions,\n onStateChange,\n }: {\n gasFeeFlows: GasFeeFlow[];\n getChainIds: () => string[];\n getEthQuery: () => any;\n getGasFeeControllerEstimates: () => Promise;\n getTransactions: () => TransactionMeta[];\n onStateChange: (listener: () => void) => void;\n }) {\n this.#gasFeeFlows = gasFeeFlows;\n this.#getChainIds = getChainIds;\n this.#getEthQuery = getEthQuery;\n this.#getGasFeeControllerEstimates = getGasFeeControllerEstimates;\n this.#getTransactions = getTransactions;\n\n onStateChange(() => {\n const unapprovedTransactions = this.#getUnapprovedTransactions();\n\n if (unapprovedTransactions.length) {\n this.#start();\n } else {\n this.#stop();\n }\n });\n }\n\n #start() {\n if (this.#running) {\n return;\n }\n\n // Intentionally not awaiting since this starts the timeout chain.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#onTimeout();\n\n this.#running = true;\n\n log('Started polling');\n }\n\n #stop() {\n if (!this.#running) {\n return;\n }\n\n clearTimeout(this.#timeout);\n\n this.#timeout = undefined;\n this.#running = false;\n\n log('Stopped polling');\n }\n\n async #onTimeout() {\n await this.#updateUnapprovedTransactions();\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#timeout = setTimeout(() => this.#onTimeout(), INTERVAL_MILLISECONDS);\n }\n\n async #updateUnapprovedTransactions() {\n const unapprovedTransactions = this.#getUnapprovedTransactions();\n\n log('Found unapproved transactions', {\n count: unapprovedTransactions.length,\n });\n\n const ethQuery = this.#getEthQuery();\n\n await Promise.all(\n unapprovedTransactions.map((tx) =>\n this.#updateTransactionSuggestedFees(tx, ethQuery),\n ),\n );\n }\n\n async #updateTransactionSuggestedFees(\n transactionMeta: TransactionMeta,\n ethQuery: any,\n ) {\n const gasFeeFlow = getGasFeeFlow(transactionMeta, this.#gasFeeFlows);\n\n if (!gasFeeFlow) {\n log('No gas fee flow found', transactionMeta.id);\n } else {\n log(\n 'Found gas fee flow',\n gasFeeFlow.constructor.name,\n transactionMeta.id,\n );\n }\n\n const request: GasFeeFlowRequest = {\n ethQuery,\n getGasFeeControllerEstimates: this.#getGasFeeControllerEstimates,\n transactionMeta,\n };\n\n if (gasFeeFlow) {\n try {\n const response = await gasFeeFlow.getGasFees(request);\n\n transactionMeta.gasFeeEstimates = response.estimates;\n } catch (error) {\n log('Failed to get suggested gas fees', transactionMeta.id, error);\n }\n }\n\n if (!gasFeeFlow && transactionMeta.gasFeeEstimatesLoaded) {\n return;\n }\n\n transactionMeta.gasFeeEstimatesLoaded = true;\n\n this.hub.emit(\n 'transaction-updated',\n transactionMeta,\n 'GasFeePoller - Suggested gas fees updated',\n );\n\n log('Updated suggested gas fees', {\n gasFeeEstimates: transactionMeta.gasFeeEstimates,\n transaction: transactionMeta.id,\n });\n }\n\n #getUnapprovedTransactions() {\n const chainIds = this.#getChainIds();\n\n return this.#getTransactions().filter(\n (tx) =>\n chainIds.includes(tx.chainId as string) &&\n tx.status === TransactionStatus.unapproved,\n );\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/history.d.ts.map b/node_modules/@metamask/transaction-controller/dist/history.d.ts.map -deleted file mode 100644 -index 7a423a8..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/history.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,EAAE,eAAe,QAGzE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,MAAM,GACX,IAAI,CAWN"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/history.js.map b/node_modules/@metamask/transaction-controller/dist/history.js.map -deleted file mode 100644 -index 09322be..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/history.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAyC;AACzC,mCAAmC;AAQnC;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,eAAgC;IACxE,MAAM,QAAQ,GAAG,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC9D,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAHD,8DAGC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CACtC,eAAgC,EAChC,IAAY;;IAEZ,MAAM,YAAY,GAAG,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAClE,MAAM,aAAa,GAAG,aAAa,CACjC,eAAe,CAAC,OAA6B,CAC9C,CAAC;IAEF,MAAM,YAAY,GAAG,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAE7E,IAAI,YAAY,CAAC,MAAM,EAAE;QACvB,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,0CAAE,IAAI,CAAC,YAAY,CAAC,CAAC;KAC9C;AACH,CAAC;AAdD,4DAcC;AAED;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAC3B,aAAkB,EAClB,YAA6B,EAC7B,IAAY;IAEZ,MAAM,sBAAsB,GAAG,yBAAU,CAAC,OAAO,CAC/C,aAAa,EACb,YAAY,CACc,CAAC;IAC7B,kFAAkF;IAClF,IAAI,sBAAsB,CAAC,CAAC,CAAC,EAAE;QAC7B,IAAI,IAAI,EAAE;YACR,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;SACvC;QACD,sBAAsB,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;KAClD;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CACpB,kBAAsC;IAEtC,MAAM,YAAY,GAAG,IAAA,kBAAS,EAAC,kBAAkB,CAAC,CAAC;IACnD,OAAO,YAAY,CAAC,MAAM,CACxB,CAAC,GAAG,EAAE,KAAU,EAAE,EAAE,CAAC,yBAAU,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,WAAW,CAChD,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,SAAS,2BAA2B,CAClC,eAAgC;IAEhC,MAAM,QAAQ,qBAAQ,eAAe,CAAE,CAAC;IACxC,OAAO,QAAQ,CAAC,OAAO,CAAC;IACxB,OAAO,IAAA,kBAAS,EAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import jsonDiffer from 'fast-json-patch';\nimport { cloneDeep } from 'lodash';\n\nimport type {\n TransactionHistory,\n TransactionHistoryEntry,\n TransactionMeta,\n} from './types';\n\n/**\n * Add initial history snapshot to the provided transactionMeta history.\n *\n * @param transactionMeta - TransactionMeta to add initial history snapshot to.\n */\nexport function addInitialHistorySnapshot(transactionMeta: TransactionMeta) {\n const snapshot = snapshotFromTransactionMeta(transactionMeta);\n transactionMeta.history = [snapshot];\n}\n\n/**\n * Compares and adds history entry to the provided transactionMeta history.\n *\n * @param transactionMeta - TransactionMeta to add history entry to.\n * @param note - Note to add to history entry.\n */\nexport function updateTransactionHistory(\n transactionMeta: TransactionMeta,\n note: string,\n): void {\n const currentState = snapshotFromTransactionMeta(transactionMeta);\n const previousState = replayHistory(\n transactionMeta.history as TransactionHistory,\n );\n\n const historyEntry = generateHistoryEntry(previousState, currentState, note);\n\n if (historyEntry.length) {\n transactionMeta?.history?.push(historyEntry);\n }\n}\n\n/**\n * Generates a history entry from the previous and new transaction metadata.\n *\n * @param previousState - The previous transaction metadata.\n * @param currentState - The new transaction metadata.\n * @param note - A note for the transaction metada update.\n * @returns An array of history operation.\n */\nfunction generateHistoryEntry(\n previousState: any,\n currentState: TransactionMeta,\n note: string,\n): TransactionHistoryEntry {\n const historyOperationsEntry = jsonDiffer.compare(\n previousState,\n currentState,\n ) as TransactionHistoryEntry;\n // Add a note to the first operation, since it breaks if we append it to the entry\n if (historyOperationsEntry[0]) {\n if (note) {\n historyOperationsEntry[0].note = note;\n }\n historyOperationsEntry[0].timestamp = Date.now();\n }\n return historyOperationsEntry;\n}\n\n/**\n * Recovers previous transactionMeta from passed history array.\n *\n * @param transactionHistory - The transaction metadata to replay.\n * @returns The transaction metadata.\n */\nfunction replayHistory(\n transactionHistory: TransactionHistory,\n): TransactionMeta {\n const shortHistory = cloneDeep(transactionHistory);\n return shortHistory.reduce(\n (val, entry: any) => jsonDiffer.applyPatch(val, entry).newDocument,\n ) as TransactionMeta;\n}\n\n/**\n * Clone the transaction meta data without the history property.\n *\n * @param transactionMeta - The transaction metadata to snapshot.\n * @returns A deep clone of transaction metadata without history property.\n */\nfunction snapshotFromTransactionMeta(\n transactionMeta: TransactionMeta,\n): TransactionMeta {\n const snapshot = { ...transactionMeta };\n delete snapshot.history;\n return cloneDeep(snapshot);\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/index.d.ts b/node_modules/@metamask/transaction-controller/dist/index.d.ts -index 9998101..b7c9355 100644 ---- a/node_modules/@metamask/transaction-controller/dist/index.d.ts -+++ b/node_modules/@metamask/transaction-controller/dist/index.d.ts -@@ -1,5 +1,5 @@ - export * from './TransactionController'; --export type { EtherscanTransactionMeta } from './etherscan'; --export { isEIP1559Transaction } from './utils'; -+export { isEIP1559Transaction, normalizeTransactionParams } from './utils'; - export * from './types'; -+export { mergeGasFeeEstimates, getGasFeeFlow } from './utils/gas-flow'; - //# sourceMappingURL=index.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/index.d.ts.map b/node_modules/@metamask/transaction-controller/dist/index.d.ts.map -deleted file mode 100644 -index 6b85676..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/index.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,cAAc,SAAS,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/index.js b/node_modules/@metamask/transaction-controller/dist/index.js -index 602f51c..0818eb8 100644 ---- a/node_modules/@metamask/transaction-controller/dist/index.js -+++ b/node_modules/@metamask/transaction-controller/dist/index.js -@@ -14,9 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.isEIP1559Transaction = void 0; -+exports.getGasFeeFlow = exports.mergeGasFeeEstimates = exports.normalizeTransactionParams = exports.isEIP1559Transaction = void 0; - __exportStar(require("./TransactionController"), exports); - var utils_1 = require("./utils"); - Object.defineProperty(exports, "isEIP1559Transaction", { enumerable: true, get: function () { return utils_1.isEIP1559Transaction; } }); -+Object.defineProperty(exports, "normalizeTransactionParams", { enumerable: true, get: function () { return utils_1.normalizeTransactionParams; } }); - __exportStar(require("./types"), exports); -+var gas_flow_1 = require("./utils/gas-flow"); -+Object.defineProperty(exports, "mergeGasFeeEstimates", { enumerable: true, get: function () { return gas_flow_1.mergeGasFeeEstimates; } }); -+Object.defineProperty(exports, "getGasFeeFlow", { enumerable: true, get: function () { return gas_flow_1.getGasFeeFlow; } }); - //# sourceMappingURL=index.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/index.js.map b/node_modules/@metamask/transaction-controller/dist/index.js.map -deleted file mode 100644 -index c4fa911..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/index.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0DAAwC;AAExC,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAC7B,0CAAwB","sourcesContent":["export * from './TransactionController';\nexport type { EtherscanTransactionMeta } from './etherscan';\nexport { isEIP1559Transaction } from './utils';\nexport * from './types';\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/logger.d.ts.map b/node_modules/@metamask/transaction-controller/dist/logger.d.ts.map -deleted file mode 100644 -index bb648ef..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/logger.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,eAAO,MAAM,aAAa,0BAAgD,CAAC;AAE3E,eAAO,MAAM,0BAA0B,0BAGtC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/logger.js b/node_modules/@metamask/transaction-controller/dist/logger.js -index 69ce8ec..bb55b17 100644 ---- a/node_modules/@metamask/transaction-controller/dist/logger.js -+++ b/node_modules/@metamask/transaction-controller/dist/logger.js -@@ -1,4 +1,5 @@ - "use strict"; -+/* istanbul ignore file */ - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createModuleLogger = exports.incomingTransactionsLogger = exports.projectLogger = void 0; - const utils_1 = require("@metamask/utils"); -diff --git a/node_modules/@metamask/transaction-controller/dist/logger.js.map b/node_modules/@metamask/transaction-controller/dist/logger.js.map -deleted file mode 100644 -index 616e0cd..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/logger.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AASjE,mGATqB,0BAAkB,OASrB;AAPd,QAAA,aAAa,GAAG,IAAA,2BAAmB,EAAC,wBAAwB,CAAC,CAAC;AAE9D,QAAA,0BAA0B,GAAG,IAAA,0BAAkB,EAC1D,qBAAa,EACb,uBAAuB,CACxB,CAAC","sourcesContent":["import { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nexport const projectLogger = createProjectLogger('transaction-controller');\n\nexport const incomingTransactionsLogger = createModuleLogger(\n projectLogger,\n 'incoming-transactions',\n);\n\nexport { createModuleLogger };\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/transaction-type.d.ts.map b/node_modules/@metamask/transaction-controller/dist/transaction-type.d.ts.map -deleted file mode 100644 -index 0721a72..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/transaction-type.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"transaction-type.d.ts","sourceRoot":"","sources":["../src/transaction-type.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAGhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG7E,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAMrE;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,0BAA0B,CAAC,CAiCrC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/transaction-type.js b/node_modules/@metamask/transaction-controller/dist/transaction-type.js -index 6497fd0..147adc8 100644 ---- a/node_modules/@metamask/transaction-controller/dist/transaction-type.js -+++ b/node_modules/@metamask/transaction-controller/dist/transaction-type.js -@@ -18,6 +18,7 @@ exports.ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error'; - const ERC20Interface = new abi_1.Interface(metamask_eth_abis_1.abiERC20); - const ERC721Interface = new abi_1.Interface(metamask_eth_abis_1.abiERC721); - const ERC1155Interface = new abi_1.Interface(metamask_eth_abis_1.abiERC1155); -+const USDCInterface = new abi_1.Interface(metamask_eth_abis_1.abiFiatTokenV2); - /** - * Determines the type of the transaction by analyzing the txParams. - * It will never return TRANSACTION_TYPE_CANCEL or TRANSACTION_TYPE_RETRY as these -@@ -46,6 +47,7 @@ function determineTransactionType(txParams, ethQuery) { - types_1.TransactionType.tokenMethodTransfer, - types_1.TransactionType.tokenMethodTransferFrom, - types_1.TransactionType.tokenMethodSafeTransferFrom, -+ types_1.TransactionType.tokenMethodIncreaseAllowance, - ].find((methodName) => methodName.toLowerCase() === (name === null || name === void 0 ? void 0 : name.toLowerCase())); - if (data && tokenMethodName && !hasValue) { - return { type: tokenMethodName, getCodeResponse: resultCode }; -@@ -87,6 +89,12 @@ function parseStandardTokenTransactionData(data) { - catch (_c) { - // ignore and return undefined - } -+ try { -+ return USDCInterface.parseTransaction({ data }); -+ } -+ catch (_d) { -+ // ignore and return undefined -+ } - return undefined; - } - /** -diff --git a/node_modules/@metamask/transaction-controller/dist/transaction-type.js.map b/node_modules/@metamask/transaction-controller/dist/transaction-type.js.map -deleted file mode 100644 -index fc7d668..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/transaction-type.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"transaction-type.js","sourceRoot":"","sources":["../src/transaction-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4CAA+C;AAC/C,iEAAmD;AAEnD,mEAA8E;AAG9E,mCAA0C;AAE7B,QAAA,kBAAkB,GAAG,kCAAkC,CAAC;AAErE,MAAM,cAAc,GAAG,IAAI,eAAS,CAAC,4BAAQ,CAAC,CAAC;AAC/C,MAAM,eAAe,GAAG,IAAI,eAAS,CAAC,6BAAS,CAAC,CAAC;AACjD,MAAM,gBAAgB,GAAG,IAAI,eAAS,CAAC,8BAAU,CAAC,CAAC;AAEnD;;;;;;;;GA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CC;AAED;;;;;;;GAOG;AACH,SAAS,iCAAiC,CACxC,IAAa;IAEb,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,SAAS,CAAC;KAClB;IAED,IAAI;QACF,OAAO,cAAc,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;KAClD;IAAC,WAAM;QACN,+CAA+C;KAChD;IAED,IAAI;QACF,OAAO,eAAe,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;KACnD;IAAC,WAAM;QACN,gDAAgD;KACjD;IAED,IAAI;QACF,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;KACpD;IAAC,WAAM;QACN,8BAA8B;KAC/B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,SAAe,qBAAqB,CAClC,QAAkB,EAClB,OAAgB;;QAKhB,IAAI,YAAY,CAAC;QACjB,IAAI;YACF,YAAY,GAAG,MAAM,IAAA,wBAAK,EAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;SAC5D;QAAC,OAAO,CAAC,EAAE;YACV,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,MAAM,iBAAiB,GAAG,YAAY;YACpC,CAAC,CAAC,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,KAAK;YACjD,CAAC,CAAC,KAAK,CAAC;QACV,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAC7C,CAAC;CAAA","sourcesContent":["import type { TransactionDescription } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport { abiERC721, abiERC20, abiERC1155 } from '@metamask/metamask-eth-abis';\n\nimport type { InferTransactionTypeResult, TransactionParams } from './types';\nimport { TransactionType } from './types';\n\nexport const ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error';\n\nconst ERC20Interface = new Interface(abiERC20);\nconst ERC721Interface = new Interface(abiERC721);\nconst ERC1155Interface = new Interface(abiERC1155);\n\n/**\n * Determines the type of the transaction by analyzing the txParams.\n * It will never return TRANSACTION_TYPE_CANCEL or TRANSACTION_TYPE_RETRY as these\n * represent specific events that we specify manually at transaction creation.\n *\n * @param txParams - Parameters for the transaction.\n * @param ethQuery - EthQuery instance.\n * @returns A object with the transaction type and the contract code response in Hex.\n */\nexport async function determineTransactionType(\n txParams: TransactionParams,\n ethQuery: EthQuery,\n): Promise {\n const { data, to } = txParams;\n const name = parseStandardTokenTransactionData(data)?.name;\n\n if (data && !to) {\n return { type: TransactionType.deployContract, getCodeResponse: undefined };\n }\n\n const { contractCode: resultCode, isContractAddress } =\n await readAddressAsContract(ethQuery, to);\n\n if (!isContractAddress) {\n return { type: TransactionType.simpleSend, getCodeResponse: resultCode };\n }\n\n const hasValue = txParams.value && Number(txParams.value) !== 0;\n\n const tokenMethodName = [\n TransactionType.tokenMethodApprove,\n TransactionType.tokenMethodSetApprovalForAll,\n TransactionType.tokenMethodTransfer,\n TransactionType.tokenMethodTransferFrom,\n TransactionType.tokenMethodSafeTransferFrom,\n ].find((methodName) => methodName.toLowerCase() === name?.toLowerCase());\n\n if (data && tokenMethodName && !hasValue) {\n return { type: tokenMethodName, getCodeResponse: resultCode };\n }\n\n return {\n type: TransactionType.contractInteraction,\n getCodeResponse: resultCode,\n };\n}\n\n/**\n * Attempts to decode transaction data using ABIs for three different token standards: ERC20, ERC721, ERC1155.\n * The data will decode correctly if the transaction is an interaction with a contract that matches one of these\n * contract standards\n *\n * @param data - Encoded transaction data.\n * @returns A representation of an ethereum contract call.\n */\nfunction parseStandardTokenTransactionData(\n data?: string,\n): TransactionDescription | undefined {\n if (!data) {\n return undefined;\n }\n\n try {\n return ERC20Interface.parseTransaction({ data });\n } catch {\n // ignore and next try to parse with erc721 ABI\n }\n\n try {\n return ERC721Interface.parseTransaction({ data });\n } catch {\n // ignore and next try to parse with erc1155 ABI\n }\n\n try {\n return ERC1155Interface.parseTransaction({ data });\n } catch {\n // ignore and return undefined\n }\n\n return undefined;\n}\n\n/**\n * Reads an Ethereum address and determines if it is a contract address.\n *\n * @param ethQuery - The Ethereum query object used to interact with the Ethereum blockchain.\n * @param address - The Ethereum address.\n * @returns An object containing the contract code and a boolean indicating if it is a contract address.\n */\nasync function readAddressAsContract(\n ethQuery: EthQuery,\n address?: string,\n): Promise<{\n contractCode: string | null;\n isContractAddress: boolean;\n}> {\n let contractCode;\n try {\n contractCode = await query(ethQuery, 'getCode', [address]);\n } catch (e) {\n contractCode = null;\n }\n\n const isContractAddress = contractCode\n ? contractCode !== '0x' && contractCode !== '0x0'\n : false;\n return { contractCode, isContractAddress };\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/types.d.ts b/node_modules/@metamask/transaction-controller/dist/types.d.ts -index fb94e7b..80be883 100644 ---- a/node_modules/@metamask/transaction-controller/dist/types.d.ts -+++ b/node_modules/@metamask/transaction-controller/dist/types.d.ts -@@ -1,3 +1,4 @@ -+import type { GasFeeState } from '@metamask/gas-fee-controller'; - import type { Hex } from '@metamask/utils'; - import type { Operation } from 'fast-json-patch'; - /** -@@ -107,15 +108,23 @@ declare type TransactionMetaBase = { - * The transaction's 's' value as a hex string. - */ - s?: string; -+ /** Alternate EIP-1559 gas fee estimates for multiple priority levels. */ -+ gasFeeEstimates?: GasFeeEstimates; -+ /** Whether the gas fee estimates have been checked at least once. */ -+ gasFeeEstimatesLoaded?: boolean; - /** - * Response from security validator. - */ -- securityAlertResponse?: Record; -+ securityAlertResponse?: SecurityAlertResponse; - /** - * An array of entries that describe the user's journey through the send flow. - * This is purely attached to state logs for troubleshooting and support. - */ - sendFlowHistory?: SendFlowHistoryEntry[]; -+ /** -+ * Simulation data for the transaction used to predict its outcome. -+ */ -+ simulationData?: SimulationData; - /** - * The time the transaction was submitted to the network, in Unix epoch time (ms). - */ -@@ -164,6 +173,53 @@ declare type TransactionMetaBase = { - * Whether the transaction is verified on the blockchain. - */ - verifiedOnBlockchain?: boolean; -+ /** -+ * ID of the transaction that approved the swap token transfer. -+ */ -+ approvalTxId?: string; -+ /** -+ * Account transaction balance after swap. -+ */ -+ postTxBalance?: string; -+ /** -+ * Account transaction balance before swap. -+ */ -+ preTxBalance?: string; -+ /** -+ * The address of the token being received of swap transaction. -+ */ -+ destinationTokenAddress?: string; -+ /** -+ * If the gas estimation fails, an object containing error and block information. -+ */ -+ simulationFails?: { -+ reason?: string; -+ errorKey?: string; -+ debug: { -+ blockNumber?: string; -+ blockGasLimit?: string; -+ }; -+ }; -+ /** -+ * The symbol of the token being swapped. -+ */ -+ sourceTokenSymbol?: string; -+ /** -+ * The decimals of the token being received of swap transaction. -+ */ -+ destinationTokenDecimals?: number; -+ /** -+ * The symbol of the token being received with swap. -+ */ -+ destinationTokenSymbol?: string; -+ /** -+ * The metadata of the swap transaction. -+ */ -+ swapMetaData?: Record; -+ /** -+ * The value of the token being swapped. -+ */ -+ swapTokenValue?: string; - }; - export declare type SendFlowHistoryEntry = { - /** -@@ -294,7 +350,11 @@ export declare enum TransactionType { - * A token transaction requesting an allowance of all of a user's tokens to - * spend on behalf of the user. - */ -- tokenMethodSetApprovalForAll = "setapprovalforall" -+ tokenMethodSetApprovalForAll = "setapprovalforall", -+ /** -+ * Increase the allowance by a given increment -+ */ -+ tokenMethodIncreaseAllowance = "increaseAllowance" - } - /** - * Standard data concerning a transaction to be processed by the blockchain. -@@ -353,15 +413,15 @@ export interface TransactionParams { - * Address to send this transaction to. - */ - to?: string; -- /** -- * Value associated with this transaction. -- */ -- value?: string; - /** - * Type of transaction. - * 0x0 indicates a legacy transaction. - */ - type?: string; -+ /** -+ * Value associated with this transaction. -+ */ -+ value?: string; - } - /** - * Standard data concerning a transaction processed by the blockchain. -@@ -499,5 +559,167 @@ export declare type InferTransactionTypeResult = { - */ - type: TransactionType; - }; -+export declare type SecurityAlertResponse = { -+ reason: string; -+ features?: string[]; -+ result_type: string; -+ providerRequestsCount?: Record; -+}; -+/** -+ * Data concerning a successfully submitted transaction. -+ * Used for debugging purposes. -+ */ -+export declare type SubmitHistoryEntry = { -+ /** The chain ID of the transaction as a hexadecimal string. */ -+ chainId?: Hex; -+ /** The hash of the transaction returned from the RPC provider. */ -+ hash: string; -+ /** True if the entry was generated using the migration and existing transaction metadata. */ -+ migration?: boolean; -+ /** The type of the network where the transaction was submitted. */ -+ networkType?: string; -+ /** -+ * The URL of the network the transaction was submitted to. -+ * A single network URL if it was recorded when submitted. -+ * An array of potential network URLs if it cannot be confirmed since the migration was used. -+ */ -+ networkUrl?: string | string[]; -+ /** The origin of the transaction. */ -+ origin?: string; -+ /** The raw transaction data that was submitted. */ -+ rawTransaction: string; -+ /** When the transaction was submitted. */ -+ time: number; -+ /** The transaction parameters that were submitted. */ -+ transaction: Record; -+}; -+/** Gas fee estimates for a specific priority level. */ -+export declare type GasFeeEstimatesForLevel = { -+ /** Maximum amount to pay per gas. */ -+ maxFeePerGas: Hex; -+ /** Maximum amount per gas to give to the validator as an incentive. */ -+ maxPriorityFeePerGas: Hex; -+}; -+/** Alternate priority levels for which values are provided in gas fee estimates. */ -+export declare enum GasFeeEstimateLevel { -+ low = "low", -+ medium = "medium", -+ high = "high" -+} -+/** Gas fee estimates for a transaction. */ -+export declare type GasFeeEstimates = { -+ /** The gas fee estimate for a low priority transaction. */ -+ [GasFeeEstimateLevel.low]: GasFeeEstimatesForLevel; -+ /** The gas fee estimate for a medium priority transaction. */ -+ [GasFeeEstimateLevel.medium]: GasFeeEstimatesForLevel; -+ /** The gas fee estimate for a high priority transaction. */ -+ [GasFeeEstimateLevel.high]: GasFeeEstimatesForLevel; -+}; -+/** Request to a gas fee flow to obtain gas fee estimates. */ -+export declare type GasFeeFlowRequest = { -+ /** An EthQuery instance to enable queries to the associated RPC provider. */ -+ ethQuery: any; -+ /** Callback to get the GasFeeController estimates. */ -+ getGasFeeControllerEstimates: () => Promise; -+ /** The metadata of the transaction to obtain estimates for. */ -+ transactionMeta: TransactionMeta; -+}; -+/** Response from a gas fee flow containing gas fee estimates. */ -+export declare type GasFeeFlowResponse = { -+ /** The gas fee estimates for the transaction. */ -+ estimates: GasFeeEstimates; -+}; -+/** A method of obtaining gas fee estimates for a specific transaction. */ -+export declare type GasFeeFlow = { -+ /** -+ * Determine if the gas fee flow supports the specified transaction. -+ * -+ * @param transactionMeta - The transaction metadata. -+ * @returns Whether the gas fee flow supports the transaction. -+ */ -+ matchesTransaction(transactionMeta: TransactionMeta): boolean; -+ /** -+ * Get gas fee estimates for a specific transaction. -+ * -+ * @param request - The gas fee flow request. -+ * @returns The gas fee flow response containing the gas fee estimates. -+ */ -+ getGasFees: (request: GasFeeFlowRequest) => Promise; -+}; -+/** -+ * Specifies the shape of the base transaction parameters. -+ * Added in EIP-2718. -+ */ -+export declare enum TransactionEnvelopeType { -+ /** -+ * A legacy transaction, the very first type. -+ */ -+ legacy = "0x0", -+ /** -+ * EIP-2930 defined the access list transaction type that allowed for -+ * specifying the state that a transaction would act upon in advance and -+ * theoretically save on gas fees. -+ */ -+ accessList = "0x1", -+ /** -+ * The type introduced comes from EIP-1559, Fee Market describes the addition -+ * of a baseFee to blocks that will be burned instead of distributed to -+ * miners. Transactions of this type have both a maxFeePerGas (maximum total -+ * amount in gwei per gas to spend on the transaction) which is inclusive of -+ * the maxPriorityFeePerGas (maximum amount of gwei per gas from the -+ * transaction fee to distribute to miner). -+ */ -+ feeMarket = "0x2" -+} -+/** Simulation data concerning an update to a native or token balance. */ -+export declare type SimulationBalanceChange = { -+ /** The balance before the transaction. */ -+ previousBalance: Hex; -+ /** The balance after the transaction. */ -+ newBalance: Hex; -+ /** The difference in balance. */ -+ difference: Hex; -+ /** Whether the balance is increasing or decreasing. */ -+ isDecrease: boolean; -+}; -+/** Token standards supported by simulation. */ -+export declare enum SimulationTokenStandard { -+ erc20 = "erc20", -+ erc721 = "erc721", -+ erc1155 = "erc1155" -+} -+/** Simulation data concerning an updated token. */ -+export declare type SimulationToken = { -+ /** The token's contract address. */ -+ address: Hex; -+ /** The standard of the token. */ -+ standard: SimulationTokenStandard; -+ /** The ID of the token if supported by the standard. */ -+ id?: Hex; -+}; -+/** Simulation data concerning a change to the a token balance. */ -+export declare type SimulationTokenBalanceChange = SimulationToken & SimulationBalanceChange; -+export declare enum SimulationErrorCode { -+ ChainNotSupported = "chain-not-supported", -+ Disabled = "disabled", -+ InvalidResponse = "invalid-response", -+ Reverted = "reverted" -+} -+/** Error data for a failed simulation. */ -+export declare type SimulationError = { -+ /** Error code to identify the error type. */ -+ code?: string | number; -+ /** Error message to describe the error. */ -+ message?: string; -+}; -+/** Simulation data for a transaction. */ -+export declare type SimulationData = { -+ /** Error data if the simulation failed or the transaction reverted. */ -+ error?: SimulationError; -+ /** Data concerning a change to the user's native balance. */ -+ nativeBalanceChange?: SimulationBalanceChange; -+ /** Data concerning a change to the user's token balances. */ -+ tokenBalanceChanges: SimulationTokenBalanceChange[]; -+}; - export {}; - //# sourceMappingURL=types.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/types.d.ts.map b/node_modules/@metamask/transaction-controller/dist/types.d.ts.map -deleted file mode 100644 -index 2dc9ab6..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/types.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,oBAAY,eAAe,GACvB,CAAC;IACC,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAC9D,GAAG,mBAAmB,CAAC,GACxB,CAAC;IAAE,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAA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E,8BAA8B,KACpC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,aAAK,wBAAwB,GAAG,SAAS,GAAG;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,oBAAY,uBAAuB,GAAG;IACpC,wBAAwB;IACxB,GAAG,SAAS,EAAE;CACf,CAAC;AAEF;;;GAGG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,eAAe;IACf,GAAG,uBAAuB,EAAE;CAC7B,CAAC;AAEF;;GAEG;AACH,oBAAY,0BAA0B,GAAG;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/types.js b/node_modules/@metamask/transaction-controller/dist/types.js -index 6bbf145..5b9c775 100644 ---- a/node_modules/@metamask/transaction-controller/dist/types.js -+++ b/node_modules/@metamask/transaction-controller/dist/types.js -@@ -1,6 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.TransactionType = exports.WalletDevice = exports.TransactionStatus = void 0; -+exports.SimulationErrorCode = exports.SimulationTokenStandard = exports.TransactionEnvelopeType = exports.GasFeeEstimateLevel = exports.TransactionType = exports.WalletDevice = exports.TransactionStatus = void 0; - /** - * The status of the transaction. Each status represents the state of the transaction internally - * in the wallet. Some of these correspond with the state of the transaction on the network, but -@@ -124,5 +124,56 @@ var TransactionType; - * spend on behalf of the user. - */ - TransactionType["tokenMethodSetApprovalForAll"] = "setapprovalforall"; -+ /** -+ * Increase the allowance by a given increment -+ */ -+ TransactionType["tokenMethodIncreaseAllowance"] = "increaseAllowance"; - })(TransactionType = exports.TransactionType || (exports.TransactionType = {})); -+/** Alternate priority levels for which values are provided in gas fee estimates. */ -+var GasFeeEstimateLevel; -+(function (GasFeeEstimateLevel) { -+ GasFeeEstimateLevel["low"] = "low"; -+ GasFeeEstimateLevel["medium"] = "medium"; -+ GasFeeEstimateLevel["high"] = "high"; -+})(GasFeeEstimateLevel = exports.GasFeeEstimateLevel || (exports.GasFeeEstimateLevel = {})); -+/** -+ * Specifies the shape of the base transaction parameters. -+ * Added in EIP-2718. -+ */ -+var TransactionEnvelopeType; -+(function (TransactionEnvelopeType) { -+ /** -+ * A legacy transaction, the very first type. -+ */ -+ TransactionEnvelopeType["legacy"] = "0x0"; -+ /** -+ * EIP-2930 defined the access list transaction type that allowed for -+ * specifying the state that a transaction would act upon in advance and -+ * theoretically save on gas fees. -+ */ -+ TransactionEnvelopeType["accessList"] = "0x1"; -+ /** -+ * The type introduced comes from EIP-1559, Fee Market describes the addition -+ * of a baseFee to blocks that will be burned instead of distributed to -+ * miners. Transactions of this type have both a maxFeePerGas (maximum total -+ * amount in gwei per gas to spend on the transaction) which is inclusive of -+ * the maxPriorityFeePerGas (maximum amount of gwei per gas from the -+ * transaction fee to distribute to miner). -+ */ -+ TransactionEnvelopeType["feeMarket"] = "0x2"; -+})(TransactionEnvelopeType = exports.TransactionEnvelopeType || (exports.TransactionEnvelopeType = {})); -+/** Token standards supported by simulation. */ -+var SimulationTokenStandard; -+(function (SimulationTokenStandard) { -+ SimulationTokenStandard["erc20"] = "erc20"; -+ SimulationTokenStandard["erc721"] = "erc721"; -+ SimulationTokenStandard["erc1155"] = "erc1155"; -+})(SimulationTokenStandard = exports.SimulationTokenStandard || (exports.SimulationTokenStandard = {})); -+var SimulationErrorCode; -+(function (SimulationErrorCode) { -+ SimulationErrorCode["ChainNotSupported"] = "chain-not-supported"; -+ SimulationErrorCode["Disabled"] = "disabled"; -+ SimulationErrorCode["InvalidResponse"] = "invalid-response"; -+ SimulationErrorCode["Reverted"] = "reverted"; -+})(SimulationErrorCode = exports.SimulationErrorCode || (exports.SimulationErrorCode = {})); - //# sourceMappingURL=types.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/types.js.map b/node_modules/@metamask/transaction-controller/dist/types.js.map -deleted file mode 100644 -index 7bca630..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/types.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAwNA;;;;GAIG;AACH,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IAC3B,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;AAC3B,CAAC,EAVW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAU5B;AAED;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,6CAA6B,CAAA;IAC7B,mDAAmC,CAAA;IACnC,sCAAsB,CAAA;AACxB,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED;;GAEG;AACH,IAAY,eA+GX;AA/GD,WAAY,eAAe;IACzB;;OAEG;IACH,oCAAiB,CAAA;IAEjB;;;;OAIG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,wDAAqC,CAAA;IAErC;;OAEG;IACH,6CAA0B,CAAA;IAE1B;;OAEG;IACH,2EAAwD,CAAA;IAExD;;OAEG;IACH,wCAAqB,CAAA;IAErB;;OAEG;IACH,iDAA8B,CAAA;IAE9B;;;;;OAKG;IACH,kCAAe,CAAA;IAEf;;OAEG;IACH,4CAAyB,CAAA;IAEzB;;OAEG;IACH,oCAAiB,CAAA;IAEjB;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,kCAAe,CAAA;IAEf;;OAEG;IACH,gCAAa,CAAA;IAEb;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,iDAA8B,CAAA;IAE9B;;;;;OAKG;IACH,mEAAgD,CAAA;IAEhD;;;OAGG;IACH,mDAAgC,CAAA;IAEhC;;;;OAIG;IACH,2DAAwC,CAAA;IAExC;;;OAGG;IACH,qEAAkD,CAAA;AACpD,CAAC,EA/GW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QA+G1B","sourcesContent":["import type { Hex } from '@metamask/utils';\nimport type { Operation } from 'fast-json-patch';\n\n/**\n * Representation of transaction metadata.\n */\nexport type TransactionMeta =\n | ({\n status: Exclude;\n } & TransactionMetaBase)\n | ({ status: TransactionStatus.failed; error: Error } & TransactionMetaBase);\n\n/**\n * Information about a single transaction such as status and block number.\n */\ntype TransactionMetaBase = {\n /**\n * Unique ID to prevent duplicate requests.\n */\n actionId?: string;\n\n /**\n * Base fee of the block as a hex value, introduced in EIP-1559.\n */\n baseFeePerGas?: Hex;\n\n /**\n * Number of the block where the transaction has been included.\n */\n blockNumber?: string;\n\n /**\n * The timestamp for when the block was collated.\n */\n blockTimestamp?: string;\n\n /**\n * Network code as per EIP-155 for this transaction.\n */\n chainId: Hex;\n\n /**\n * Gas values provided by the dApp.\n */\n dappSuggestedGasFees?: DappSuggestedGasFees;\n\n /**\n * The default estimate for gas.\n */\n defaultGasEstimates?: string;\n\n /**\n * String to indicate what device the transaction was confirmed on.\n */\n deviceConfirmedOn?: WalletDevice;\n\n /**\n * The estimated base fee of the transaction.\n */\n estimatedBaseFee?: string;\n\n /**\n * Which estimate level that the API suggested.\n */\n estimateSuggested?: string;\n\n /**\n * Which estimate level was used\n */\n estimateUsed?: string;\n\n /**\n * A hex string of the transaction hash, used to identify the transaction on the network.\n */\n hash?: string;\n\n /**\n * A history of mutations to TransactionMeta.\n */\n history?: TransactionHistory;\n\n /**\n * Generated UUID associated with this transaction.\n */\n id: string;\n\n /**\n * Whether the transaction is a transfer.\n */\n isTransfer?: boolean;\n\n /**\n * Network code as per EIP-155 for this transaction\n *\n * @deprecated Use `chainId` instead.\n */\n readonly networkID?: string;\n\n /**\n * Origin this transaction was sent from.\n */\n origin?: string;\n\n /**\n * The original gas estimation of the transaction.\n */\n originalGasEstimate?: string;\n\n /**\n * The transaction's 'r' value as a hex string.\n */\n r?: string;\n\n /**\n * Hex representation of the underlying transaction.\n */\n rawTx?: string;\n\n /**\n * When the transaction is dropped, this is the replacement transaction hash.\n */\n replacedBy?: string;\n\n /**\n * When the transaction is dropped, this is the replacement transaction ID.\n */\n replacedById?: string;\n\n /**\n * The transaction's 's' value as a hex string.\n */\n s?: string;\n\n /**\n * Response from security validator.\n */\n securityAlertResponse?: Record;\n\n /**\n * An array of entries that describe the user's journey through the send flow.\n * This is purely attached to state logs for troubleshooting and support.\n */\n sendFlowHistory?: SendFlowHistoryEntry[];\n\n /**\n * The time the transaction was submitted to the network, in Unix epoch time (ms).\n */\n submittedTime?: number;\n\n /**\n * Timestamp associated with this transaction.\n */\n time: number;\n\n /**\n * Whether transaction recipient is a smart contract.\n */\n toSmartContract?: boolean;\n\n /**\n * Additional transfer information.\n */\n transferInformation?: {\n contractAddress: string;\n decimals: number;\n symbol: string;\n };\n\n /**\n * Underlying Transaction object.\n */\n txParams: TransactionParams;\n\n /**\n * Transaction receipt.\n */\n txReceipt?: TransactionReceipt;\n\n /**\n * The type of transaction such as `cancel` or `swap`.\n */\n type?: TransactionType;\n\n /**\n * The gas limit supplied by user.\n */\n userEditedGasLimit?: boolean;\n\n /**\n * Estimate level user selected.\n */\n userFeeLevel?: string;\n\n /**\n * The transaction's 'v' value as a hex string.\n */\n v?: string;\n\n /**\n * Whether the transaction is verified on the blockchain.\n */\n verifiedOnBlockchain?: boolean;\n};\n\nexport type SendFlowHistoryEntry = {\n /**\n * String to indicate user interaction information.\n */\n entry: string;\n\n /**\n * Timestamp associated with this entry.\n */\n timestamp: number;\n};\n\n/**\n * The status of the transaction. Each status represents the state of the transaction internally\n * in the wallet. Some of these correspond with the state of the transaction on the network, but\n * some are wallet-specific.\n */\nexport enum TransactionStatus {\n approved = 'approved',\n cancelled = 'cancelled',\n confirmed = 'confirmed',\n dropped = 'dropped',\n failed = 'failed',\n rejected = 'rejected',\n signed = 'signed',\n submitted = 'submitted',\n unapproved = 'unapproved',\n}\n\n/**\n * Options for wallet device.\n */\nexport enum WalletDevice {\n MM_MOBILE = 'metamask_mobile',\n MM_EXTENSION = 'metamask_extension',\n OTHER = 'other_device',\n}\n\n/**\n * The type of the transaction.\n */\nexport enum TransactionType {\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n cancel = 'cancel',\n\n /**\n * A transaction that is interacting with a smart contract's methods that we\n * have not treated as a special case, such as approve, transfer, and\n * transferfrom.\n */\n contractInteraction = 'contractInteraction',\n\n /**\n * A transaction that deployed a smart contract.\n */\n deployContract = 'contractDeployment',\n\n /**\n * A transaction for Ethereum decryption.\n */\n ethDecrypt = 'eth_decrypt',\n\n /**\n * A transaction for getting an encryption public key.\n */\n ethGetEncryptionPublicKey = 'eth_getEncryptionPublicKey',\n\n /**\n * An incoming (deposit) transaction.\n */\n incoming = 'incoming',\n\n /**\n * A transaction for personal sign.\n */\n personalSign = 'personal_sign',\n\n /**\n * When a transaction is failed it can be retried by\n * resubmitting the same transaction with a higher gas fee. This type is also used\n * to speed up pending transactions. This is accomplished by creating a new tx with\n * the same nonce and higher gas fees.\n */\n retry = 'retry',\n\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n simpleSend = 'simpleSend',\n\n /**\n * A transaction that is signing a message.\n */\n sign = 'eth_sign',\n\n /**\n * A transaction that is signing typed data.\n */\n signTypedData = 'eth_signTypedData',\n\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n smart = 'smart',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps.\n */\n swap = 'swap',\n\n /**\n * Similar to the approve type, a swap approval is a special case of ERC20\n * approve method that requests an allowance of the token to spend on behalf\n * of the user for the MetaMask Swaps contract. The first swap for any token\n * will have an accompanying swapApproval transaction.\n */\n swapApproval = 'swapApproval',\n\n /**\n * A token transaction requesting an allowance of the token to spend on\n * behalf of the user.\n */\n tokenMethodApprove = 'approve',\n\n /**\n * A token transaction transferring tokens from an account that the sender\n * has an allowance of. The method is prefixed with safe because when calling\n * this method the contract checks to ensure that the receiver is an address\n * capable of handling the token being sent.\n */\n tokenMethodSafeTransferFrom = 'safetransferfrom',\n\n /**\n * A token transaction where the user is sending tokens that they own to\n * another address.\n */\n tokenMethodTransfer = 'transfer',\n\n /**\n * A token transaction transferring tokens from an account that the sender\n * has an allowance of. For more information on allowances, see the approve\n * type.\n */\n tokenMethodTransferFrom = 'transferfrom',\n\n /**\n * A token transaction requesting an allowance of all of a user's tokens to\n * spend on behalf of the user.\n */\n tokenMethodSetApprovalForAll = 'setapprovalforall',\n}\n\n/**\n * Standard data concerning a transaction to be processed by the blockchain.\n */\nexport interface TransactionParams {\n /**\n * Network ID as per EIP-155.\n */\n chainId?: Hex;\n\n /**\n * Data to pass with this transaction.\n */\n data?: string;\n\n /**\n * Error message for gas estimation failure.\n */\n estimateGasError?: string;\n\n /**\n * Estimated base fee for this transaction.\n */\n estimatedBaseFee?: string;\n\n /**\n * Address to send this transaction from.\n */\n from: string;\n\n /**\n * same as gasLimit?\n */\n gas?: string;\n\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gasLimit?: string;\n\n /**\n * Price per gas for legacy txs\n */\n gasPrice?: string;\n\n /**\n * Gas used in the transaction.\n */\n gasUsed?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority\n * fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n\n /**\n * Unique number to prevent replay attacks.\n */\n nonce?: string;\n\n /**\n * Address to send this transaction to.\n */\n to?: string;\n\n /**\n * Value associated with this transaction.\n */\n value?: string;\n\n /**\n * Type of transaction.\n * 0x0 indicates a legacy transaction.\n */\n type?: string;\n}\n\n/**\n * Standard data concerning a transaction processed by the blockchain.\n */\nexport interface TransactionReceipt {\n /**\n * The block hash of the block that this transaction was included in.\n */\n blockHash?: string;\n\n /**\n * The block number of the block that this transaction was included in.\n */\n blockNumber?: string;\n\n /**\n * Effective gas price the transaction was charged at.\n */\n effectiveGasPrice?: string;\n\n /**\n * Gas used in the transaction.\n */\n gasUsed?: string;\n\n /**\n * Total used gas in hex.\n */\n l1Fee?: string;\n\n /**\n * All the logs emitted by this transaction.\n */\n logs?: Log[];\n\n /**\n * The status of the transaction.\n */\n status?: string;\n\n /**\n * The index of this transaction in the list of transactions included in the block this transaction was mined in.\n */\n transactionIndex?: number;\n}\n\n/**\n * Represents an event that has been included in a transaction using the EVM `LOG` opcode.\n */\nexport interface Log {\n /**\n * Address of the contract that generated log.\n */\n address?: string;\n /**\n * List of topics for log.\n */\n topics?: string;\n}\n\n/**\n * The configuration required to fetch transaction data from a RemoteTransactionSource.\n */\nexport interface RemoteTransactionSourceRequest {\n /**\n * The address of the account to fetch transactions for.\n */\n address: string;\n\n /**\n * The chainId of the current network.\n */\n currentChainId: Hex;\n\n /**\n * Block number to start fetching transactions from.\n */\n fromBlock?: number;\n\n /**\n * Maximum number of transactions to retrieve.\n */\n limit?: number;\n}\n\n/**\n * An object capable of fetching transaction data from a remote source.\n * Used by the IncomingTransactionHelper to retrieve remote transaction data.\n */\nexport interface RemoteTransactionSource {\n /**\n * @param chainId - The chainId of the current network.\n * @returns Whether the remote transaction source supports the specified network.\n */\n isSupportedNetwork: (chainId: Hex) => boolean;\n\n /**\n * @returns An array of additional keys to use when caching the last fetched block number.\n */\n getLastBlockVariations?: () => string[];\n\n /**\n * @param request - A request object containing data such as the address and chain ID.\n * @returns An array of transaction metadata for the retrieved transactions.\n */\n fetchTransactions: (\n request: RemoteTransactionSourceRequest,\n ) => Promise;\n}\n\n/**\n * Gas values initially suggested by the dApp.\n */\nexport interface DappSuggestedGasFees {\n gas?: string;\n gasPrice?: string;\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n}\n\n/**\n * A transaction history operation that includes a note and timestamp.\n */\ntype ExtendedHistoryOperation = Operation & {\n note?: string;\n timestamp?: number;\n};\n\n/**\n * A transaction history entry that includes the ExtendedHistoryOperation as the first element.\n */\nexport type TransactionHistoryEntry = [\n ExtendedHistoryOperation,\n ...Operation[],\n];\n\n/**\n * A transaction history that includes the transaction meta as the first element.\n * And the rest of the elements are the operation arrays that were applied to the transaction meta.\n */\nexport type TransactionHistory = [\n TransactionMeta,\n ...TransactionHistoryEntry[],\n];\n\n/**\n * Result of inferring the transaction type.\n */\nexport type InferTransactionTypeResult = {\n /**\n * The contract code, in hex format if it exists. '0x0' or\n * '0x' are also indicators of non-existent contract code.\n */\n getCodeResponse?: string | null;\n\n /**\n * The type of transaction\n */\n type: TransactionType;\n};\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils.d.ts b/node_modules/@metamask/transaction-controller/dist/utils.d.ts -index 1049d83..83b5ca9 100644 ---- a/node_modules/@metamask/transaction-controller/dist/utils.d.ts -+++ b/node_modules/@metamask/transaction-controller/dist/utils.d.ts -@@ -1,3 +1,4 @@ -+import type { Hex } from '@metamask/utils'; - import type { Transaction as NonceTrackerTransaction } from 'nonce-tracker/dist/NonceTracker'; - import type { GasPriceValue, FeeMarketEIP1559Values } from './TransactionController'; - import { TransactionStatus } from './types'; -@@ -9,7 +10,7 @@ export declare const ESTIMATE_GAS_ERROR = "eth_estimateGas rpc method error"; - * @param txParams - The transaction params to normalize. - * @returns Normalized transaction params. - */ --export declare function normalizeTxParams(txParams: TransactionParams): TransactionParams; -+export declare function normalizeTransactionParams(txParams: TransactionParams): TransactionParams; - /** - * Validates the transaction params for required properties and throws in - * the event of any validation error. -@@ -43,12 +44,13 @@ export declare function validateMinimumIncrease(proposed: string, min: string): - /** - * Helper function to filter and format transactions for the nonce tracker. - * -+ * @param currentChainId - Chain ID of the current network. - * @param fromAddress - Address of the account from which the transactions to filter from are sent. - * @param transactionStatus - Status of the transactions for which to filter. - * @param transactions - Array of transactionMeta objects that have been prefiltered. - * @returns Array of transactions formatted for the nonce tracker. - */ --export declare function getAndFormatTransactionsForNonceTracker(fromAddress: string, transactionStatus: TransactionStatus, transactions: TransactionMeta[]): NonceTrackerTransaction[]; -+export declare function getAndFormatTransactionsForNonceTracker(currentChainId: Hex, fromAddress: string, transactionStatus: TransactionStatus, transactions: TransactionMeta[]): NonceTrackerTransaction[]; - /** - * Validates that a transaction is unapproved. - * Throws if the transaction is not unapproved. -@@ -57,4 +59,12 @@ export declare function getAndFormatTransactionsForNonceTracker(fromAddress: str - * @param fnName - The name of the function calling this helper. - */ - export declare function validateIfTransactionUnapproved(transactionMeta: TransactionMeta | undefined, fnName: string): void; -+/** -+ * Ensure a hex string is of even length by adding a leading 0 if necessary. -+ * Any existing `0x` prefix is preserved but is not added if missing. -+ * -+ * @param hex - The hex string to ensure is even. -+ * @returns The hex string with an even length. -+ */ -+export declare function padHexToEvenLength(hex: string): string; - //# sourceMappingURL=utils.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils.d.ts.map b/node_modules/@metamask/transaction-controller/dist/utils.d.ts.map -deleted file mode 100644 -index 01c0c66..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/utils.d.ts.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,IAAI,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAmBrE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,qBAS5D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,mBAAmB,UAAO,QAyD3B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAOzE;AAED,eAAO,MAAM,iBAAiB,cACjB,aAAa,GAAG,sBAAsB,SAUlD,CAAC;AAEF,eAAO,MAAM,wBAAwB,eACvB,aAAa,GAAG,sBAAsB,wCAGuB,CAAC;AAE5E,eAAO,MAAM,eAAe,eACd,aAAa,GAAG,sBAAsB,+BAEE,CAAC;AAEvD,eAAO,MAAM,oBAAoB,UAAW,MAAM,QAAQ,MAAM,KAAG,MACF,CAAC;AAElE,eAAO,MAAM,6BAA6B,UACjC,MAAM,GAAG,SAAS,QACnB,MAAM,KACX,MAEF,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAQpE;AAED;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,eAAe,EAAE,GAC9B,uBAAuB,EAAE,CAsB3B;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,QAQf"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils.js b/node_modules/@metamask/transaction-controller/dist/utils.js -index 835d1e4..b59fc6a 100644 ---- a/node_modules/@metamask/transaction-controller/dist/utils.js -+++ b/node_modules/@metamask/transaction-controller/dist/utils.js -@@ -1,13 +1,13 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.validateIfTransactionUnapproved = exports.getAndFormatTransactionsForNonceTracker = exports.validateMinimumIncrease = exports.getIncreasedPriceFromExisting = exports.getIncreasedPriceHex = exports.isGasPriceValue = exports.isFeeMarketEIP1559Values = exports.validateGasValues = exports.isEIP1559Transaction = exports.validateTxParams = exports.normalizeTxParams = exports.ESTIMATE_GAS_ERROR = void 0; -+exports.padHexToEvenLength = exports.validateIfTransactionUnapproved = exports.getAndFormatTransactionsForNonceTracker = exports.validateMinimumIncrease = exports.getIncreasedPriceFromExisting = exports.getIncreasedPriceHex = exports.isGasPriceValue = exports.isFeeMarketEIP1559Values = exports.validateGasValues = exports.isEIP1559Transaction = exports.validateTxParams = exports.normalizeTransactionParams = exports.ESTIMATE_GAS_ERROR = void 0; - const controller_utils_1 = require("@metamask/controller-utils"); - const rpc_errors_1 = require("@metamask/rpc-errors"); - const ethereumjs_util_1 = require("ethereumjs-util"); - const types_1 = require("./types"); - exports.ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error'; - const NORMALIZERS = { -- data: (data) => (0, ethereumjs_util_1.addHexPrefix)(data), -+ data: (data) => (0, ethereumjs_util_1.addHexPrefix)(padHexToEvenLength(data)), - from: (from) => (0, ethereumjs_util_1.addHexPrefix)(from).toLowerCase(), - gas: (gas) => (0, ethereumjs_util_1.addHexPrefix)(gas), - gasLimit: (gas) => (0, ethereumjs_util_1.addHexPrefix)(gas), -@@ -19,6 +19,7 @@ const NORMALIZERS = { - maxPriorityFeePerGas: (maxPriorityFeePerGas) => (0, ethereumjs_util_1.addHexPrefix)(maxPriorityFeePerGas), - estimatedBaseFee: (maxPriorityFeePerGas) => (0, ethereumjs_util_1.addHexPrefix)(maxPriorityFeePerGas), - type: (type) => (type === '0x0' ? '0x0' : undefined), -+ estimateGasError: (estimateGasError) => estimateGasError, - }; - /** - * Normalizes properties on transaction params. -@@ -26,7 +27,7 @@ const NORMALIZERS = { - * @param txParams - The transaction params to normalize. - * @returns Normalized transaction params. - */ --function normalizeTxParams(txParams) { -+function normalizeTransactionParams(txParams) { - const normalizedTxParams = { from: '' }; - let key; - for (key in NORMALIZERS) { -@@ -36,7 +37,7 @@ function normalizeTxParams(txParams) { - } - return normalizedTxParams; - } --exports.normalizeTxParams = normalizeTxParams; -+exports.normalizeTransactionParams = normalizeTransactionParams; - /** - * Validates the transaction params for required properties and throws in - * the event of any validation error. -@@ -137,14 +138,17 @@ exports.validateMinimumIncrease = validateMinimumIncrease; - /** - * Helper function to filter and format transactions for the nonce tracker. - * -+ * @param currentChainId - Chain ID of the current network. - * @param fromAddress - Address of the account from which the transactions to filter from are sent. - * @param transactionStatus - Status of the transactions for which to filter. - * @param transactions - Array of transactionMeta objects that have been prefiltered. - * @returns Array of transactions formatted for the nonce tracker. - */ --function getAndFormatTransactionsForNonceTracker(fromAddress, transactionStatus, transactions) { -+function getAndFormatTransactionsForNonceTracker(currentChainId, fromAddress, transactionStatus, transactions) { - return transactions -- .filter(({ status, txParams: { from } }) => status === transactionStatus && -+ .filter(({ chainId, isTransfer, status, txParams: { from } }) => !isTransfer && -+ chainId === currentChainId && -+ status === transactionStatus && - from.toLowerCase() === fromAddress.toLowerCase()) - .map(({ status, txParams: { from, gas, value, nonce } }) => { - // the only value we care about is the nonce -@@ -177,4 +181,18 @@ function validateIfTransactionUnapproved(transactionMeta, fnName) { - } - } - exports.validateIfTransactionUnapproved = validateIfTransactionUnapproved; -+/** -+ * Ensure a hex string is of even length by adding a leading 0 if necessary. -+ * Any existing `0x` prefix is preserved but is not added if missing. -+ * -+ * @param hex - The hex string to ensure is even. -+ * @returns The hex string with an even length. -+ */ -+function padHexToEvenLength(hex) { -+ const prefix = hex.toLowerCase().startsWith('0x') ? hex.slice(0, 2) : ''; -+ const data = prefix ? hex.slice(2) : hex; -+ const evenData = data.length % 2 === 0 ? data : `0${data}`; -+ return prefix + evenData; -+} -+exports.padHexToEvenLength = padHexToEvenLength; - //# sourceMappingURL=utils.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils.js.map b/node_modules/@metamask/transaction-controller/dist/utils.js.map -deleted file mode 100644 -index 013009a..0000000 ---- a/node_modules/@metamask/transaction-controller/dist/utils.js.map -+++ /dev/null -@@ -1 +0,0 @@ --{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,iEAGoC;AACpC,qDAAiD;AACjD,qDAA4D;AAO5D,mCAA4C;AAG/B,QAAA,kBAAkB,GAAG,kCAAkC,CAAC;AAErE,MAAM,WAAW,GAAgD;IAC/D,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,IAAI,CAAC;IAC1C,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,IAAI,CAAC,CAAC,WAAW,EAAE;IACxD,GAAG,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,GAAG,CAAC;IACvC,QAAQ,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,GAAG,CAAC;IAC5C,QAAQ,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,QAAQ,CAAC;IACtD,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,KAAK,CAAC;IAC7C,EAAE,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,EAAE,CAAC,CAAC,WAAW,EAAE;IAClD,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,KAAK,CAAC;IAC7C,YAAY,EAAE,CAAC,YAAoB,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,YAAY,CAAC;IAClE,oBAAoB,EAAE,CAAC,oBAA4B,EAAE,EAAE,CACrD,IAAA,8BAAY,EAAC,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,GAAI,EAAE;gBAChB,GAAG,EAAE,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE;gBACd,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE;gBAClB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE;aACnB;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AA1BD,0FA0BC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAC7C,eAA4C,EAC5C,MAAc;IAEd,IAAI,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,MAAK,yBAAiB,CAAC,UAAU,EAAE;QAC5D,MAAM,IAAI,KAAK,CACb,iBAAiB,MAAM;2BACF,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE,CAC/C,CAAC;KACH;AACH,CAAC;AAVD,0EAUC","sourcesContent":["import {\n convertHexToDecimal,\n isValidHexAddress,\n} from '@metamask/controller-utils';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport { addHexPrefix, isHexString } from 'ethereumjs-util';\nimport type { Transaction as NonceTrackerTransaction } from 'nonce-tracker/dist/NonceTracker';\n\nimport type {\n GasPriceValue,\n FeeMarketEIP1559Values,\n} from './TransactionController';\nimport { TransactionStatus } from './types';\nimport type { TransactionParams, TransactionMeta } from './types';\n\nexport const ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error';\n\nconst NORMALIZERS: { [param in keyof TransactionParams]: any } = {\n data: (data: string) => addHexPrefix(data),\n from: (from: string) => addHexPrefix(from).toLowerCase(),\n gas: (gas: string) => addHexPrefix(gas),\n gasLimit: (gas: string) => addHexPrefix(gas),\n gasPrice: (gasPrice: string) => addHexPrefix(gasPrice),\n nonce: (nonce: string) => addHexPrefix(nonce),\n to: (to: string) => addHexPrefix(to).toLowerCase(),\n value: (value: string) => addHexPrefix(value),\n maxFeePerGas: (maxFeePerGas: string) => addHexPrefix(maxFeePerGas),\n maxPriorityFeePerGas: (maxPriorityFeePerGas: string) =>\n addHexPrefix(maxPriorityFeePerGas),\n estimatedBaseFee: (maxPriorityFeePerGas: string) =>\n addHexPrefix(maxPriorityFeePerGas),\n type: (type: string) => (type === '0x0' ? '0x0' : undefined),\n};\n\n/**\n * Normalizes properties on transaction params.\n *\n * @param txParams - The transaction params to normalize.\n * @returns Normalized transaction params.\n */\nexport function normalizeTxParams(txParams: TransactionParams) {\n const normalizedTxParams: TransactionParams = { from: '' };\n let key: keyof TransactionParams;\n for (key in NORMALIZERS) {\n if (txParams[key as keyof TransactionParams]) {\n normalizedTxParams[key] = NORMALIZERS[key](txParams[key]) as never;\n }\n }\n return normalizedTxParams;\n}\n\n/**\n * Validates the transaction params for required properties and throws in\n * the event of any validation error.\n *\n * @param txParams - Transaction params object to validate.\n * @param isEIP1559Compatible - whether or not the current network supports EIP-1559 transactions.\n */\nexport function validateTxParams(\n txParams: TransactionParams,\n isEIP1559Compatible = true,\n) {\n if (\n !txParams.from ||\n typeof txParams.from !== 'string' ||\n !isValidHexAddress(txParams.from)\n ) {\n throw rpcErrors.invalidParams(\n `Invalid \"from\" address: ${txParams.from} must be a valid string.`,\n );\n }\n\n if (isEIP1559Transaction(txParams) && !isEIP1559Compatible) {\n throw rpcErrors.invalidParams(\n 'Invalid transaction params: params specify an EIP-1559 transaction but the current network does not support EIP-1559',\n );\n }\n\n if (txParams.to === '0x' || txParams.to === undefined) {\n if (txParams.data) {\n delete txParams.to;\n } else {\n throw rpcErrors.invalidParams(\n `Invalid \"to\" address: ${txParams.to} must be a valid string.`,\n );\n }\n } else if (txParams.to !== undefined && !isValidHexAddress(txParams.to)) {\n throw rpcErrors.invalidParams(\n `Invalid \"to\" address: ${txParams.to} must be a valid string.`,\n );\n }\n\n if (txParams.value !== undefined) {\n const value = txParams.value.toString();\n if (value.includes('-')) {\n throw rpcErrors.invalidParams(\n `Invalid \"value\": ${value} is not a positive number.`,\n );\n }\n\n if (value.includes('.')) {\n throw rpcErrors.invalidParams(\n `Invalid \"value\": ${value} number must be denominated in wei.`,\n );\n }\n const intValue = parseInt(txParams.value, 10);\n const isValid =\n Number.isFinite(intValue) &&\n !Number.isNaN(intValue) &&\n !isNaN(Number(value)) &&\n Number.isSafeInteger(intValue);\n if (!isValid) {\n throw rpcErrors.invalidParams(\n `Invalid \"value\": ${value} number must be a valid number.`,\n );\n }\n }\n}\n\n/**\n * Checks if a transaction is EIP-1559 by checking for the existence of\n * maxFeePerGas and maxPriorityFeePerGas within its parameters.\n *\n * @param txParams - Transaction params object to add.\n * @returns Boolean that is true if the transaction is EIP-1559 (has maxFeePerGas and maxPriorityFeePerGas), otherwise returns false.\n */\nexport function isEIP1559Transaction(txParams: TransactionParams): boolean {\n const hasOwnProp = (obj: TransactionParams, key: string) =>\n Object.prototype.hasOwnProperty.call(obj, key);\n return (\n hasOwnProp(txParams, 'maxFeePerGas') &&\n hasOwnProp(txParams, 'maxPriorityFeePerGas')\n );\n}\n\nexport const validateGasValues = (\n gasValues: GasPriceValue | FeeMarketEIP1559Values,\n) => {\n Object.keys(gasValues).forEach((key) => {\n const value = (gasValues as any)[key];\n if (typeof value !== 'string' || !isHexString(value)) {\n throw new TypeError(\n `expected hex string for ${key} but received: ${value}`,\n );\n }\n });\n};\n\nexport const isFeeMarketEIP1559Values = (\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n): gasValues is FeeMarketEIP1559Values =>\n (gasValues as FeeMarketEIP1559Values)?.maxFeePerGas !== undefined ||\n (gasValues as FeeMarketEIP1559Values)?.maxPriorityFeePerGas !== undefined;\n\nexport const isGasPriceValue = (\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n): gasValues is GasPriceValue =>\n (gasValues as GasPriceValue)?.gasPrice !== undefined;\n\nexport const getIncreasedPriceHex = (value: number, rate: number): string =>\n addHexPrefix(`${parseInt(`${value * rate}`, 10).toString(16)}`);\n\nexport const getIncreasedPriceFromExisting = (\n value: string | undefined,\n rate: number,\n): string => {\n return getIncreasedPriceHex(convertHexToDecimal(value), rate);\n};\n\n/**\n * Validates that the proposed value is greater than or equal to the minimum value.\n *\n * @param proposed - The proposed value.\n * @param min - The minimum value.\n * @returns The proposed value.\n * @throws Will throw if the proposed value is too low.\n */\nexport function validateMinimumIncrease(proposed: string, min: string) {\n const proposedDecimal = convertHexToDecimal(proposed);\n const minDecimal = convertHexToDecimal(min);\n if (proposedDecimal >= minDecimal) {\n return proposed;\n }\n const errorMsg = `The proposed value: ${proposedDecimal} should meet or exceed the minimum value: ${minDecimal}`;\n throw new Error(errorMsg);\n}\n\n/**\n * Helper function to filter and format transactions for the nonce tracker.\n *\n * @param fromAddress - Address of the account from which the transactions to filter from are sent.\n * @param transactionStatus - Status of the transactions for which to filter.\n * @param transactions - Array of transactionMeta objects that have been prefiltered.\n * @returns Array of transactions formatted for the nonce tracker.\n */\nexport function getAndFormatTransactionsForNonceTracker(\n fromAddress: string,\n transactionStatus: TransactionStatus,\n transactions: TransactionMeta[],\n): NonceTrackerTransaction[] {\n return transactions\n .filter(\n ({ status, txParams: { from } }) =>\n status === transactionStatus &&\n from.toLowerCase() === fromAddress.toLowerCase(),\n )\n .map(({ status, txParams: { from, gas, value, nonce } }) => {\n // the only value we care about is the nonce\n // but we need to return the other values to satisfy the type\n // TODO: refactor nonceTracker to not require this\n return {\n status,\n history: [{}],\n txParams: {\n from: from ?? '',\n gas: gas ?? '',\n value: value ?? '',\n nonce: nonce ?? '',\n },\n };\n });\n}\n\n/**\n * Validates that a transaction is unapproved.\n * Throws if the transaction is not unapproved.\n *\n * @param transactionMeta - The transaction metadata to check.\n * @param fnName - The name of the function calling this helper.\n */\nexport function validateIfTransactionUnapproved(\n transactionMeta: TransactionMeta | undefined,\n fnName: string,\n) {\n if (transactionMeta?.status !== TransactionStatus.unapproved) {\n throw new Error(\n `Can only call ${fnName} on an unapproved transaction.\n Current tx status: ${transactionMeta?.status}`,\n );\n }\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.d.ts b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.d.ts -new file mode 100644 -index 0000000..02539b9 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.d.ts -@@ -0,0 +1,32 @@ -+import { type GasFeeEstimates, type GasFeeState, type LegacyGasPriceEstimate } from '@metamask/gas-fee-controller'; -+import { type GasFeeEstimates as TransactionGasFeeEstimates, type GasFeeFlow, type TransactionMeta } from '../types'; -+/** -+ * Returns the first gas fee flow that matches the transaction. -+ * -+ * @param transactionMeta - The transaction metadata to find a gas fee flow for. -+ * @param gasFeeFlows - The gas fee flows to search. -+ * @returns The first gas fee flow that matches the transaction, or undefined if none match. -+ */ -+export declare function getGasFeeFlow(transactionMeta: TransactionMeta, gasFeeFlows: GasFeeFlow[]): GasFeeFlow | undefined; -+declare type FeeMarketMergeGasFeeEstimatesRequest = { -+ gasFeeControllerEstimateType: 'fee-market'; -+ gasFeeControllerEstimates: GasFeeEstimates; -+ transactionGasFeeEstimates: TransactionGasFeeEstimates; -+}; -+declare type LegacyMergeGasFeeEstimatesRequest = { -+ gasFeeControllerEstimateType: 'legacy'; -+ gasFeeControllerEstimates: LegacyGasPriceEstimate; -+ transactionGasFeeEstimates: TransactionGasFeeEstimates; -+}; -+/** -+ * Merge the gas fee estimates from the gas fee controller with the gas fee estimates from a transaction. -+ * -+ * @param request - Data required to merge gas fee estimates. -+ * @param request.gasFeeControllerEstimateType - Gas fee estimate type from the gas fee controller. -+ * @param request.gasFeeControllerEstimates - Gas fee estimates from the GasFeeController. -+ * @param request.transactionGasFeeEstimates - Gas fee estimates from the transaction. -+ * @returns The merged gas fee estimates. -+ */ -+export declare function mergeGasFeeEstimates({ gasFeeControllerEstimateType, gasFeeControllerEstimates, transactionGasFeeEstimates, }: FeeMarketMergeGasFeeEstimatesRequest | LegacyMergeGasFeeEstimatesRequest): GasFeeState['gasFeeEstimates']; -+export {}; -+//# sourceMappingURL=gas-flow.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.d.ts.map b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.d.ts.map -new file mode 100644 -index 0000000..1eee187 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"gas-flow.d.ts","sourceRoot":"","sources":["../../src/utils/gas-flow.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,KAAK,eAAe,IAAI,0BAA0B,EAClD,KAAK,UAAU,EACf,KAAK,eAAe,EAGrB,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,UAAU,EAAE,GACxB,UAAU,GAAG,SAAS,CAIxB;AAED,aAAK,oCAAoC,GAAG;IAC1C,4BAA4B,EAAE,YAAY,CAAC;IAC3C,yBAAyB,EAAE,eAAe,CAAC;IAC3C,0BAA0B,EAAE,0BAA0B,CAAC;CACxD,CAAC;AAEF,aAAK,iCAAiC,GAAG;IACvC,4BAA4B,EAAE,QAAQ,CAAC;IACvC,yBAAyB,EAAE,sBAAsB,CAAC;IAClD,0BAA0B,EAAE,0BAA0B,CAAC;CACxD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,GAC3B,EACG,oCAAoC,GACpC,iCAAiC,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAyBrE"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js -new file mode 100644 -index 0000000..7f4e8a9 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js -@@ -0,0 +1,56 @@ -+"use strict"; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.mergeGasFeeEstimates = exports.getGasFeeFlow = void 0; -+const controller_utils_1 = require("@metamask/controller-utils"); -+const gas_fee_controller_1 = require("@metamask/gas-fee-controller"); -+const types_1 = require("../types"); -+/** -+ * Returns the first gas fee flow that matches the transaction. -+ * -+ * @param transactionMeta - The transaction metadata to find a gas fee flow for. -+ * @param gasFeeFlows - The gas fee flows to search. -+ * @returns The first gas fee flow that matches the transaction, or undefined if none match. -+ */ -+function getGasFeeFlow(transactionMeta, gasFeeFlows) { -+ return gasFeeFlows.find((gasFeeFlow) => gasFeeFlow.matchesTransaction(transactionMeta)); -+} -+exports.getGasFeeFlow = getGasFeeFlow; -+/** -+ * Merge the gas fee estimates from the gas fee controller with the gas fee estimates from a transaction. -+ * -+ * @param request - Data required to merge gas fee estimates. -+ * @param request.gasFeeControllerEstimateType - Gas fee estimate type from the gas fee controller. -+ * @param request.gasFeeControllerEstimates - Gas fee estimates from the GasFeeController. -+ * @param request.transactionGasFeeEstimates - Gas fee estimates from the transaction. -+ * @returns The merged gas fee estimates. -+ */ -+function mergeGasFeeEstimates({ gasFeeControllerEstimateType, gasFeeControllerEstimates, transactionGasFeeEstimates, }) { -+ if (gasFeeControllerEstimateType === gas_fee_controller_1.GAS_ESTIMATE_TYPES.FEE_MARKET) { -+ return Object.values(types_1.GasFeeEstimateLevel).reduce((result, level) => (Object.assign(Object.assign({}, result), { [level]: mergeFeeMarketEstimate(gasFeeControllerEstimates[level], transactionGasFeeEstimates[level]) })), Object.assign({}, gasFeeControllerEstimates)); -+ } -+ if (gasFeeControllerEstimateType === gas_fee_controller_1.GAS_ESTIMATE_TYPES.LEGACY) { -+ return Object.values(types_1.GasFeeEstimateLevel).reduce((result, level) => (Object.assign(Object.assign({}, result), { [level]: getLegacyEstimate(transactionGasFeeEstimates[level]) })), {}); -+ } -+ return gasFeeControllerEstimates; -+} -+exports.mergeGasFeeEstimates = mergeGasFeeEstimates; -+/** -+ * Merge a specific priority level of EIP-1559 gas fee estimates. -+ * -+ * @param gasFeeControllerEstimate - The gas fee estimate from the gas fee controller. -+ * @param transactionGasFeeEstimate - The gas fee estimate from the transaction. -+ * @returns The merged gas fee estimate. -+ */ -+function mergeFeeMarketEstimate(gasFeeControllerEstimate, transactionGasFeeEstimate) { -+ return Object.assign(Object.assign({}, gasFeeControllerEstimate), { suggestedMaxFeePerGas: (0, controller_utils_1.weiHexToGweiDec)(transactionGasFeeEstimate.maxFeePerGas), suggestedMaxPriorityFeePerGas: (0, controller_utils_1.weiHexToGweiDec)(transactionGasFeeEstimate.maxPriorityFeePerGas) }); -+} -+/** -+ * Generate a specific priority level for a legacy gas fee estimate. -+ * -+ * @param transactionGasFeeEstimate - The gas fee estimate from the transaction. -+ * @returns The legacy gas fee estimate. -+ */ -+function getLegacyEstimate(transactionGasFeeEstimate) { -+ return (0, controller_utils_1.weiHexToGweiDec)(transactionGasFeeEstimate.maxFeePerGas); -+} -+//# sourceMappingURL=gas-flow.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js.map b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js.map -new file mode 100644 -index 0000000..461ba2c ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"gas-flow.js","sourceRoot":"","sources":["../../src/utils/gas-flow.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAC7D,qEAMsC;AAEtC,oCAMkB;AAElB;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,eAAgC,EAChC,WAAyB;IAEzB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CACrC,UAAU,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAC/C,CAAC;AACJ,CAAC;AAPD,sCAOC;AAcD;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,EACnC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,GAGS;IACnC,IAAI,4BAA4B,KAAK,uCAAkB,CAAC,UAAU,EAAE;QAClE,OAAO,MAAM,CAAC,MAAM,CAAC,2BAAmB,CAAC,CAAC,MAAM,CAC9C,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,iCACd,MAAM,KACT,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAC7B,yBAAyB,CAAC,KAAK,CAAC,EAChC,0BAA0B,CAAC,KAAK,CAAC,CAClC,IACD,EACF,kBAAK,yBAAyB,CAAqB,CACpD,CAAC;KACH;IAED,IAAI,4BAA4B,KAAK,uCAAkB,CAAC,MAAM,EAAE;QAC9D,OAAO,MAAM,CAAC,MAAM,CAAC,2BAAmB,CAAC,CAAC,MAAM,CAC9C,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,iCACd,MAAM,KACT,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,IAC7D,EACF,EAA4B,CAC7B,CAAC;KACH;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AA/BD,oDA+BC;AAED;;;;;;GAMG;AACH,SAAS,sBAAsB,CAC7B,wBAAuC,EACvC,yBAAkD;IAElD,uCACK,wBAAwB,KAC3B,qBAAqB,EAAE,IAAA,kCAAe,EACpC,yBAAyB,CAAC,YAAY,CACvC,EACD,6BAA6B,EAAE,IAAA,kCAAe,EAC5C,yBAAyB,CAAC,oBAAoB,CAC/C,IACD;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACxB,yBAAkD;IAElD,OAAO,IAAA,kCAAe,EAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import { weiHexToGweiDec } from '@metamask/controller-utils';\nimport {\n GAS_ESTIMATE_TYPES,\n type Eip1559GasFee,\n type GasFeeEstimates,\n type GasFeeState,\n type LegacyGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\n\nimport {\n type GasFeeEstimates as TransactionGasFeeEstimates,\n type GasFeeFlow,\n type TransactionMeta,\n type GasFeeEstimatesForLevel,\n GasFeeEstimateLevel,\n} from '../types';\n\n/**\n * Returns the first gas fee flow that matches the transaction.\n *\n * @param transactionMeta - The transaction metadata to find a gas fee flow for.\n * @param gasFeeFlows - The gas fee flows to search.\n * @returns The first gas fee flow that matches the transaction, or undefined if none match.\n */\nexport function getGasFeeFlow(\n transactionMeta: TransactionMeta,\n gasFeeFlows: GasFeeFlow[],\n): GasFeeFlow | undefined {\n return gasFeeFlows.find((gasFeeFlow) =>\n gasFeeFlow.matchesTransaction(transactionMeta),\n );\n}\n\ntype FeeMarketMergeGasFeeEstimatesRequest = {\n gasFeeControllerEstimateType: 'fee-market';\n gasFeeControllerEstimates: GasFeeEstimates;\n transactionGasFeeEstimates: TransactionGasFeeEstimates;\n};\n\ntype LegacyMergeGasFeeEstimatesRequest = {\n gasFeeControllerEstimateType: 'legacy';\n gasFeeControllerEstimates: LegacyGasPriceEstimate;\n transactionGasFeeEstimates: TransactionGasFeeEstimates;\n};\n\n/**\n * Merge the gas fee estimates from the gas fee controller with the gas fee estimates from a transaction.\n *\n * @param request - Data required to merge gas fee estimates.\n * @param request.gasFeeControllerEstimateType - Gas fee estimate type from the gas fee controller.\n * @param request.gasFeeControllerEstimates - Gas fee estimates from the GasFeeController.\n * @param request.transactionGasFeeEstimates - Gas fee estimates from the transaction.\n * @returns The merged gas fee estimates.\n */\nexport function mergeGasFeeEstimates({\n gasFeeControllerEstimateType,\n gasFeeControllerEstimates,\n transactionGasFeeEstimates,\n}:\n | FeeMarketMergeGasFeeEstimatesRequest\n | LegacyMergeGasFeeEstimatesRequest): GasFeeState['gasFeeEstimates'] {\n if (gasFeeControllerEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) {\n return Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: mergeFeeMarketEstimate(\n gasFeeControllerEstimates[level],\n transactionGasFeeEstimates[level],\n ),\n }),\n { ...gasFeeControllerEstimates } as GasFeeEstimates,\n );\n }\n\n if (gasFeeControllerEstimateType === GAS_ESTIMATE_TYPES.LEGACY) {\n return Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: getLegacyEstimate(transactionGasFeeEstimates[level]),\n }),\n {} as LegacyGasPriceEstimate,\n );\n }\n\n return gasFeeControllerEstimates;\n}\n\n/**\n * Merge a specific priority level of EIP-1559 gas fee estimates.\n *\n * @param gasFeeControllerEstimate - The gas fee estimate from the gas fee controller.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @returns The merged gas fee estimate.\n */\nfunction mergeFeeMarketEstimate(\n gasFeeControllerEstimate: Eip1559GasFee,\n transactionGasFeeEstimate: GasFeeEstimatesForLevel,\n): Eip1559GasFee {\n return {\n ...gasFeeControllerEstimate,\n suggestedMaxFeePerGas: weiHexToGweiDec(\n transactionGasFeeEstimate.maxFeePerGas,\n ),\n suggestedMaxPriorityFeePerGas: weiHexToGweiDec(\n transactionGasFeeEstimate.maxPriorityFeePerGas,\n ),\n };\n}\n\n/**\n * Generate a specific priority level for a legacy gas fee estimate.\n *\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @returns The legacy gas fee estimate.\n */\nfunction getLegacyEstimate(\n transactionGasFeeEstimate: GasFeeEstimatesForLevel,\n): string {\n return weiHexToGweiDec(transactionGasFeeEstimate.maxFeePerGas);\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.d.ts b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.d.ts -new file mode 100644 -index 0000000..69c78e7 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.d.ts -@@ -0,0 +1,107 @@ -+import { type Hex } from '@metamask/utils'; -+/** Single transaction to simulate in a simulation API request. */ -+export declare type SimulationRequestTransaction = { -+ /** Data to send with the transaction. */ -+ data?: Hex; -+ /** Sender of the transaction. */ -+ from: Hex; -+ /** Gas limit for the transaction. */ -+ gas?: Hex; -+ /** Maximum fee per gas for the transaction. */ -+ maxFeePerGas?: Hex; -+ /** Maximum priority fee per gas for the transaction. */ -+ maxPriorityFeePerGas?: Hex; -+ /** Recipient of the transaction. */ -+ to?: Hex; -+ /** Value to send with the transaction. */ -+ value?: Hex; -+}; -+/** Request to the simulation API to simulate transactions. */ -+export declare type SimulationRequest = { -+ /** -+ * Transactions to be sequentially simulated. -+ * State changes impact subsequent transactions in the list. -+ */ -+ transactions: SimulationRequestTransaction[]; -+ /** -+ * Overrides to the state of the blockchain, keyed by smart contract address. -+ */ -+ overrides?: { -+ [address: Hex]: { -+ /** Overrides to the storage slots for a smart contract account. */ -+ stateDiff: { -+ [slot: Hex]: Hex; -+ }; -+ }; -+ }; -+ /** -+ * Whether to include call traces in the response. -+ * Defaults to false. -+ */ -+ withCallTrace?: boolean; -+ /** -+ * Whether to include event logs in the response. -+ * Defaults to false. -+ */ -+ withLogs?: boolean; -+}; -+/** Raw event log emitted by a simulated transaction. */ -+export declare type SimulationResponseLog = { -+ /** Address of the account that created the event. */ -+ address: Hex; -+ /** Raw data in the event that is not indexed. */ -+ data: Hex; -+ /** Raw indexed data from the event. */ -+ topics: Hex[]; -+}; -+/** Call trace of a single simulated transaction. */ -+export declare type SimulationResponseCallTrace = { -+ /** Nested calls. */ -+ calls: SimulationResponseCallTrace[]; -+ /** Raw event logs created by the call. */ -+ logs: SimulationResponseLog[]; -+}; -+/** -+ * Changes to the blockchain state. -+ * Keyed by account address. -+ */ -+export declare type SimulationResponseStateDiff = { -+ [address: Hex]: { -+ /** Native balance of the account. */ -+ balance?: Hex; -+ /** Nonce of the account. */ -+ nonce?: Hex; -+ /** Storage values per slot. */ -+ storage?: { -+ [slot: Hex]: Hex; -+ }; -+ }; -+}; -+/** Response from the simulation API for a single transaction. */ -+export declare type SimulationResponseTransaction = { -+ /** An error message indicating the transaction could not be simulated. */ -+ error?: string; -+ /** Return value of the transaction, such as the balance if calling balanceOf. */ -+ return: Hex; -+ /** Hierarchy of call data including nested calls and logs. */ -+ callTrace?: SimulationResponseCallTrace; -+ /** Changes to the blockchain state. */ -+ stateDiff?: { -+ /** Initial blockchain state before the transaction. */ -+ pre?: SimulationResponseStateDiff; -+ /** Updated blockchain state after the transaction. */ -+ post?: SimulationResponseStateDiff; -+ }; -+}; -+/** Response from the simulation API. */ -+export declare type SimulationResponse = { -+ /** Simulation data for each transaction in the request. */ -+ transactions: SimulationResponseTransaction[]; -+}; -+/** -+ * Simulate transactions using the transaction simulation API. -+ * @param chainId - The chain ID to simulate transactions on. -+ * @param request - The request to simulate transactions. -+ */ -+export declare function simulateTransactions(chainId: Hex, request: SimulationRequest): Promise; -+//# sourceMappingURL=simulation-api.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.d.ts.map b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.d.ts.map -new file mode 100644 -index 0000000..5a4d361 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"simulation-api.d.ts","sourceRoot":"","sources":["../../src/utils/simulation-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAW/D,mEAAmE;AACnE,oBAAY,4BAA4B,GAAG;IACzC,yCAAyC;IACzC,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX,iCAAiC;IACjC,IAAI,EAAE,GAAG,CAAC;IAEV,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,+CAA+C;IAC/C,YAAY,CAAC,EAAE,GAAG,CAAC;IAEnB,wDAAwD;IACxD,oBAAoB,CAAC,EAAE,GAAG,CAAC;IAE3B,oCAAoC;IACpC,EAAE,CAAC,EAAE,GAAG,CAAC;IAET,0CAA0C;IAC1C,KAAK,CAAC,E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AC9D,SAAS,CAAC,EAAE,2BAA2B,CAAC;IAExC,uCAAuC;IACvC,SAAS,CAAC,EAAE;QACV,uDAAuD;QACvD,GAAG,CAAC,EAAE,2BAA2B,CAAC;QAElC,sDAAsD;QACtD,IAAI,CAAC,EAAE,2BAA2B,CAAC;KACpC,CAAC;CACH,CAAC;AAEF,wCAAwC;AACxC,oBAAY,kBAAkB,GAAG;IAC/B,2DAA2D;IAC3D,YAAY,EAAE,6BAA6B,EAAE,CAAC;CAC/C,CAAC;AAkBF;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CA4B7B"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js -new file mode 100644 -index 0000000..a8f5f02 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js -@@ -0,0 +1,87 @@ -+"use strict"; -+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -+ return new (P || (P = Promise))(function (resolve, reject) { -+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -+ step((generator = generator.apply(thisArg, _arguments || [])).next()); -+ }); -+}; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.simulateTransactions = void 0; -+const controller_utils_1 = require("@metamask/controller-utils"); -+const utils_1 = require("@metamask/utils"); -+const errors_1 = require("../errors"); -+const logger_1 = require("../logger"); -+const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'simulation-api'); -+const RPC_METHOD = 'infura_simulateTransactions'; -+const BASE_URL = 'https://tx-sentinel-{0}.api.cx.metamask.io/'; -+const ENDPOINT_NETWORKS = 'networks'; -+let requestIdCounter = 0; -+/** -+ * Simulate transactions using the transaction simulation API. -+ * @param chainId - The chain ID to simulate transactions on. -+ * @param request - The request to simulate transactions. -+ */ -+function simulateTransactions(chainId, request) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const url = yield getSimulationUrl(chainId); -+ log('Sending request', url, request); -+ const requestId = requestIdCounter; -+ requestIdCounter += 1; -+ const response = yield fetch(url, { -+ method: 'POST', -+ body: JSON.stringify({ -+ id: String(requestId), -+ jsonrpc: '2.0', -+ method: RPC_METHOD, -+ params: [request], -+ }), -+ }); -+ const responseJson = yield response.json(); -+ log('Received response', responseJson); -+ if (responseJson.error) { -+ const { code, message } = responseJson.error; -+ throw new errors_1.SimulationError(message, code); -+ } -+ return responseJson === null || responseJson === void 0 ? void 0 : responseJson.result; -+ }); -+} -+exports.simulateTransactions = simulateTransactions; -+/** -+ * Get the URL for the transaction simulation API. -+ * @param chainId - The chain ID to get the URL for. -+ * @returns The URL for the transaction simulation API. -+ */ -+function getSimulationUrl(chainId) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const networkData = yield getNetworkData(); -+ const chainIdDecimal = (0, controller_utils_1.convertHexToDecimal)(chainId); -+ const network = networkData[chainIdDecimal]; -+ if (!(network === null || network === void 0 ? void 0 : network.confirmations)) { -+ log('Chain is not supported', chainId); -+ throw new errors_1.SimulationChainNotSupportedError(chainId); -+ } -+ return getUrl(network.network); -+ }); -+} -+/** -+ * Retrieve the supported network data from the simulation API. -+ */ -+function getNetworkData() { -+ return __awaiter(this, void 0, void 0, function* () { -+ const url = `${getUrl('ethereum-mainnet')}${ENDPOINT_NETWORKS}`; -+ const response = yield fetch(url); -+ return response.json(); -+ }); -+} -+/** -+ * Generate the URL for the specified subdomain in the simulation API. -+ * @param subdomain - The subdomain to generate the URL for. -+ * @returns The URL for the transaction simulation API. -+ */ -+function getUrl(subdomain) { -+ return BASE_URL.replace('{0}', subdomain); -+} -+//# sourceMappingURL=simulation-api.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js.map b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js.map -new file mode 100644 -index 0000000..f04f122 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"simulation-api.js","sourceRoot":"","sources":["../../src/utils/simulation-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAAiE;AACjE,2CAA+D;AAE/D,sCAA8E;AAC9E,sCAA0C;AAE1C,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,gBAAgB,CAAC,CAAC;AAEhE,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACjD,MAAM,QAAQ,GAAG,6CAA6C,CAAC;AAC/D,MAAM,iBAAiB,GAAG,UAAU,CAAC;AA4IrC,IAAI,gBAAgB,GAAG,CAAC,CAAC;AAEzB;;;;GAIG;AACH,SAAsB,oBAAoB,CACxC,OAAY,EACZ,OAA0B;;QAE1B,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAE5C,GAAG,CAAC,iBAAiB,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAErC,MAAM,SAAS,GAAG,gBAAgB,CAAC;QACnC,gBAAgB,IAAI,CAAC,CAAC;QAEtB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,EAAE,EAAE,MAAM,CAAC,SAAS,CAAC;gBACrB,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,CAAC,OAAO,CAAC;aAClB,CAAC;SACH,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAE3C,GAAG,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;QAEvC,IAAI,YAAY,CAAC,KAAK,EAAE;YACtB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC;YAC7C,MAAM,IAAI,wBAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SAC1C;QAED,OAAO,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,CAAC;IAC9B,CAAC;CAAA;AA/BD,oDA+BC;AAED;;;;GAIG;AACH,SAAe,gBAAgB,CAAC,OAAY;;QAC1C,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;QAC3C,MAAM,cAAc,GAAG,IAAA,sCAAmB,EAAC,OAAO,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;QAE5C,IAAI,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAA,EAAE;YAC3B,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;YACvC,MAAM,IAAI,yCAAgC,CAAC,OAAO,CAAC,CAAC;SACrD;QAED,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;CAAA;AAED;;GAEG;AACH,SAAe,cAAc;;QAC3B,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,iBAAiB,EAAE,CAAC;QAChE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CAAA;AAED;;;;GAIG;AACH,SAAS,MAAM,CAAC,SAAiB;IAC/B,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { convertHexToDecimal } from '@metamask/controller-utils';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { SimulationChainNotSupportedError, SimulationError } from '../errors';\nimport { projectLogger } from '../logger';\n\nconst log = createModuleLogger(projectLogger, 'simulation-api');\n\nconst RPC_METHOD = 'infura_simulateTransactions';\nconst BASE_URL = 'https://tx-sentinel-{0}.api.cx.metamask.io/';\nconst ENDPOINT_NETWORKS = 'networks';\n\n/** Single transaction to simulate in a simulation API request. */\nexport type SimulationRequestTransaction = {\n /** Data to send with the transaction. */\n data?: Hex;\n\n /** Sender of the transaction. */\n from: Hex;\n\n /** Gas limit for the transaction. */\n gas?: Hex;\n\n /** Maximum fee per gas for the transaction. */\n maxFeePerGas?: Hex;\n\n /** Maximum priority fee per gas for the transaction. */\n maxPriorityFeePerGas?: Hex;\n\n /** Recipient of the transaction. */\n to?: Hex;\n\n /** Value to send with the transaction. */\n value?: Hex;\n};\n\n/** Request to the simulation API to simulate transactions. */\nexport type SimulationRequest = {\n /**\n * Transactions to be sequentially simulated.\n * State changes impact subsequent transactions in the list.\n */\n transactions: SimulationRequestTransaction[];\n\n /**\n * Overrides to the state of the blockchain, keyed by smart contract address.\n */\n overrides?: {\n [address: Hex]: {\n /** Overrides to the storage slots for a smart contract account. */\n stateDiff: {\n [slot: Hex]: Hex;\n };\n };\n };\n\n /**\n * Whether to include call traces in the response.\n * Defaults to false.\n */\n withCallTrace?: boolean;\n\n /**\n * Whether to include event logs in the response.\n * Defaults to false.\n */\n withLogs?: boolean;\n};\n\n/** Raw event log emitted by a simulated transaction. */\nexport type SimulationResponseLog = {\n /** Address of the account that created the event. */\n address: Hex;\n\n /** Raw data in the event that is not indexed. */\n data: Hex;\n\n /** Raw indexed data from the event. */\n topics: Hex[];\n};\n\n/** Call trace of a single simulated transaction. */\nexport type SimulationResponseCallTrace = {\n /** Nested calls. */\n calls: SimulationResponseCallTrace[];\n\n /** Raw event logs created by the call. */\n logs: SimulationResponseLog[];\n};\n\n/**\n * Changes to the blockchain state.\n * Keyed by account address.\n */\nexport type SimulationResponseStateDiff = {\n [address: Hex]: {\n /** Native balance of the account. */\n balance?: Hex;\n\n /** Nonce of the account. */\n nonce?: Hex;\n\n /** Storage values per slot. */\n storage?: {\n [slot: Hex]: Hex;\n };\n };\n};\n\n/** Response from the simulation API for a single transaction. */\nexport type SimulationResponseTransaction = {\n /** An error message indicating the transaction could not be simulated. */\n error?: string;\n\n /** Return value of the transaction, such as the balance if calling balanceOf. */\n return: Hex;\n\n /** Hierarchy of call data including nested calls and logs. */\n callTrace?: SimulationResponseCallTrace;\n\n /** Changes to the blockchain state. */\n stateDiff?: {\n /** Initial blockchain state before the transaction. */\n pre?: SimulationResponseStateDiff;\n\n /** Updated blockchain state after the transaction. */\n post?: SimulationResponseStateDiff;\n };\n};\n\n/** Response from the simulation API. */\nexport type SimulationResponse = {\n /** Simulation data for each transaction in the request. */\n transactions: SimulationResponseTransaction[];\n};\n\n/** Data for a network supported by the Simulation API. */\ntype SimulationNetwork = {\n /** Subdomain of the API for the network. */\n network: string;\n\n /** Whether the network supports confirmation simulations. */\n confirmations: boolean;\n};\n\n/** Response from the simulation API containing supported networks. */\ntype SimulationNetworkResponse = {\n [chainIdDecimal: string]: SimulationNetwork;\n};\n\nlet requestIdCounter = 0;\n\n/**\n * Simulate transactions using the transaction simulation API.\n * @param chainId - The chain ID to simulate transactions on.\n * @param request - The request to simulate transactions.\n */\nexport async function simulateTransactions(\n chainId: Hex,\n request: SimulationRequest,\n): Promise {\n const url = await getSimulationUrl(chainId);\n\n log('Sending request', url, request);\n\n const requestId = requestIdCounter;\n requestIdCounter += 1;\n\n const response = await fetch(url, {\n method: 'POST',\n body: JSON.stringify({\n id: String(requestId),\n jsonrpc: '2.0',\n method: RPC_METHOD,\n params: [request],\n }),\n });\n\n const responseJson = await response.json();\n\n log('Received response', responseJson);\n\n if (responseJson.error) {\n const { code, message } = responseJson.error;\n throw new SimulationError(message, code);\n }\n\n return responseJson?.result;\n}\n\n/**\n * Get the URL for the transaction simulation API.\n * @param chainId - The chain ID to get the URL for.\n * @returns The URL for the transaction simulation API.\n */\nasync function getSimulationUrl(chainId: Hex): Promise {\n const networkData = await getNetworkData();\n const chainIdDecimal = convertHexToDecimal(chainId);\n const network = networkData[chainIdDecimal];\n\n if (!network?.confirmations) {\n log('Chain is not supported', chainId);\n throw new SimulationChainNotSupportedError(chainId);\n }\n\n return getUrl(network.network);\n}\n\n/**\n * Retrieve the supported network data from the simulation API.\n */\nasync function getNetworkData(): Promise {\n const url = `${getUrl('ethereum-mainnet')}${ENDPOINT_NETWORKS}`;\n const response = await fetch(url);\n return response.json();\n}\n\n/**\n * Generate the URL for the specified subdomain in the simulation API.\n * @param subdomain - The subdomain to generate the URL for.\n * @returns The URL for the transaction simulation API.\n */\nfunction getUrl(subdomain: string): string {\n return BASE_URL.replace('{0}', subdomain);\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation.d.ts b/node_modules/@metamask/transaction-controller/dist/utils/simulation.d.ts -new file mode 100644 -index 0000000..c903a45 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation.d.ts -@@ -0,0 +1,46 @@ -+import type { Fragment } from '@ethersproject/abi'; -+import { type Hex } from '@metamask/utils'; -+import type { SimulationResponse } from './simulation-api'; -+import type { SimulationData } from '../types'; -+import { SimulationTokenStandard } from '../types'; -+export declare enum SupportedToken { -+ ERC20 = "erc20", -+ ERC721 = "erc721", -+ ERC1155 = "erc1155", -+ ERC20_WRAPPED = "erc20Wrapped", -+ ERC721_LEGACY = "erc721Legacy" -+} -+declare type ABI = Fragment[]; -+export declare type GetSimulationDataRequest = { -+ chainId: Hex; -+ from: Hex; -+ to?: Hex; -+ value?: Hex; -+ data?: Hex; -+}; -+declare type ParsedEvent = { -+ contractAddress: Hex; -+ tokenStandard: SimulationTokenStandard; -+ name: string; -+ args: Record; -+ abi: ABI; -+}; -+/** -+ * Generate simulation data for a transaction. -+ * @param request - The transaction to simulate. -+ * @param request.chainId - The chain ID of the transaction. -+ * @param request.from - The sender of the transaction. -+ * @param request.to - The recipient of the transaction. -+ * @param request.value - The value of the transaction. -+ * @param request.data - The data of the transaction. -+ * @returns The simulation data. -+ */ -+export declare function getSimulationData(request: GetSimulationDataRequest): Promise; -+/** -+ * Extract events from a simulation response. -+ * @param response - The simulation response. -+ * @returns The parsed events. -+ */ -+export declare function getEvents(response: SimulationResponse): ParsedEvent[]; -+export {}; -+//# sourceMappingURL=simulation.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation.d.ts.map b/node_modules/@metamask/transaction-controller/dist/utils/simulation.d.ts.map -new file mode 100644 -index 0000000..5197d63 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../../src/utils/simulation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA0B,MAAM,oBAAoB,CAAC;AAI3E,OAAO,EAAsB,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAG/D,OAAO,KAAK,EAGV,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAW1B,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,aAAa,iBAAiB;IAC9B,aAAa,iBAAiB;CAC/B;AAED,aAAK,GAAG,GAAG,QAAQ,EAAE,CAAC;AAEtB,oBAAY,wBAAwB,GAAG;IACrC,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,GAAG,CAAC;IACV,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,aAAK,WAAW,GAAG;IACjB,eAAe,EAAE,GAAG,CAAC;IACrB,aAAa,EAAE,uBAAuB,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;IAClC,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAuCF;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,cAAc,CAAC,CA6DzB;AA8BD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,WAAW,EAAE,CAuCrE"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation.js b/node_modules/@metamask/transaction-controller/dist/utils/simulation.js -new file mode 100644 -index 0000000..80c7256 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation.js -@@ -0,0 +1,445 @@ -+"use strict"; -+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -+ return new (P || (P = Promise))(function (resolve, reject) { -+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -+ step((generator = generator.apply(thisArg, _arguments || [])).next()); -+ }); -+}; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.getEvents = exports.getSimulationData = exports.SupportedToken = void 0; -+const abi_1 = require("@ethersproject/abi"); -+const controller_utils_1 = require("@metamask/controller-utils"); -+const metamask_eth_abis_1 = require("@metamask/metamask-eth-abis"); -+const utils_1 = require("@metamask/utils"); -+const simulation_api_1 = require("./simulation-api"); -+const constants_1 = require("../constants"); -+const errors_1 = require("../errors"); -+const logger_1 = require("../logger"); -+const types_1 = require("../types"); -+var SupportedToken; -+(function (SupportedToken) { -+ SupportedToken["ERC20"] = "erc20"; -+ SupportedToken["ERC721"] = "erc721"; -+ SupportedToken["ERC1155"] = "erc1155"; -+ SupportedToken["ERC20_WRAPPED"] = "erc20Wrapped"; -+ SupportedToken["ERC721_LEGACY"] = "erc721Legacy"; -+})(SupportedToken = exports.SupportedToken || (exports.SupportedToken = {})); -+const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'simulation'); -+const SUPPORTED_EVENTS = [ -+ 'Transfer', -+ 'TransferSingle', -+ 'TransferBatch', -+ 'Deposit', -+ 'Withdrawal', -+]; -+const SUPPORTED_TOKEN_ABIS = { -+ [SupportedToken.ERC20]: { -+ abi: metamask_eth_abis_1.abiERC20, -+ standard: types_1.SimulationTokenStandard.erc20, -+ }, -+ [SupportedToken.ERC721]: { -+ abi: metamask_eth_abis_1.abiERC721, -+ standard: types_1.SimulationTokenStandard.erc721, -+ }, -+ [SupportedToken.ERC1155]: { -+ abi: metamask_eth_abis_1.abiERC1155, -+ standard: types_1.SimulationTokenStandard.erc1155, -+ }, -+ [SupportedToken.ERC20_WRAPPED]: { -+ abi: constants_1.ABI_SIMULATION_ERC20_WRAPPED, -+ standard: types_1.SimulationTokenStandard.erc20, -+ }, -+ [SupportedToken.ERC721_LEGACY]: { -+ abi: constants_1.ABI_SIMULATION_ERC721_LEGACY, -+ standard: types_1.SimulationTokenStandard.erc721, -+ }, -+}; -+const REVERTED_ERRORS = ['execution reverted', 'insufficient funds for gas']; -+/** -+ * Generate simulation data for a transaction. -+ * @param request - The transaction to simulate. -+ * @param request.chainId - The chain ID of the transaction. -+ * @param request.from - The sender of the transaction. -+ * @param request.to - The recipient of the transaction. -+ * @param request.value - The value of the transaction. -+ * @param request.data - The data of the transaction. -+ * @returns The simulation data. -+ */ -+function getSimulationData(request) { -+ var _a, _b; -+ return __awaiter(this, void 0, void 0, function* () { -+ const { chainId, from, to, value, data } = request; -+ log('Getting simulation data', request); -+ try { -+ const response = yield (0, simulation_api_1.simulateTransactions)(chainId, { -+ transactions: [ -+ { -+ data, -+ from, -+ maxFeePerGas: '0x0', -+ maxPriorityFeePerGas: '0x0', -+ to, -+ value, -+ }, -+ ], -+ withCallTrace: true, -+ withLogs: true, -+ }); -+ const transactionError = (_b = (_a = response.transactions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.error; -+ if (transactionError) { -+ throw new errors_1.SimulationError(transactionError); -+ } -+ const nativeBalanceChange = getNativeBalanceChange(request.from, response); -+ const events = getEvents(response); -+ log('Parsed events', events); -+ const tokenBalanceChanges = yield getTokenBalanceChanges(request, events); -+ return { -+ nativeBalanceChange, -+ tokenBalanceChanges, -+ }; -+ } -+ catch (error) { -+ log('Failed to get simulation data', error, request); -+ let simulationError = error; -+ if (REVERTED_ERRORS.some((revertErrorMessage) => { var _a; return (_a = simulationError.message) === null || _a === void 0 ? void 0 : _a.includes(revertErrorMessage); })) { -+ simulationError = new errors_1.SimulationRevertedError(); -+ } -+ const { code, message } = simulationError; -+ return { -+ tokenBalanceChanges: [], -+ error: { -+ code, -+ message, -+ }, -+ }; -+ } -+ }); -+} -+exports.getSimulationData = getSimulationData; -+/** -+ * Extract the native balance change from a simulation response. -+ * @param userAddress - The user's account address. -+ * @param response - The simulation response. -+ * @returns The native balance change or undefined if unchanged. -+ */ -+function getNativeBalanceChange(userAddress, response) { -+ var _a, _b, _c, _d; -+ const transactionResponse = response.transactions[0]; -+ /* istanbul ignore next */ -+ if (!transactionResponse) { -+ return undefined; -+ } -+ const { stateDiff } = transactionResponse; -+ const previousBalance = (_b = (_a = stateDiff === null || stateDiff === void 0 ? void 0 : stateDiff.pre) === null || _a === void 0 ? void 0 : _a[userAddress]) === null || _b === void 0 ? void 0 : _b.balance; -+ const newBalance = (_d = (_c = stateDiff === null || stateDiff === void 0 ? void 0 : stateDiff.post) === null || _c === void 0 ? void 0 : _c[userAddress]) === null || _d === void 0 ? void 0 : _d.balance; -+ if (!previousBalance || !newBalance) { -+ return undefined; -+ } -+ return getSimulationBalanceChange(previousBalance, newBalance); -+} -+/** -+ * Extract events from a simulation response. -+ * @param response - The simulation response. -+ * @returns The parsed events. -+ */ -+function getEvents(response) { -+ var _a, _b; -+ /* istanbul ignore next */ -+ const logs = extractLogs((_b = (_a = response.transactions[0]) === null || _a === void 0 ? void 0 : _a.callTrace) !== null && _b !== void 0 ? _b : {}); -+ log('Extracted logs', logs); -+ const interfaces = getContractInterfaces(); -+ return logs -+ .map((currentLog) => { -+ var _a; -+ const event = parseLog(currentLog, interfaces); -+ if (!event) { -+ log('Failed to parse log', currentLog); -+ return undefined; -+ } -+ /* istanbul ignore next */ -+ const inputs = (_a = event.abi.find((e) => e.name === event.name)) === null || _a === void 0 ? void 0 : _a.inputs; -+ /* istanbul ignore if */ -+ if (!inputs) { -+ log('Failed to find inputs for event', event); -+ return undefined; -+ } -+ const args = parseEventArgs(event.args, inputs); -+ return { -+ contractAddress: currentLog.address, -+ tokenStandard: event.standard, -+ name: event.name, -+ args, -+ abi: event.abi, -+ }; -+ }) -+ .filter((e) => e !== undefined); -+} -+exports.getEvents = getEvents; -+/** -+ * Parse event arguments using ABI input definitions. -+ * @param args - The raw event arguments. -+ * @param abiInputs - The ABI input definitions. -+ * @returns The parsed event arguments. -+ */ -+function parseEventArgs(args, abiInputs) { -+ return args.reduce((result, arg, index) => { -+ const name = abiInputs[index].name.replace('_', ''); -+ const value = parseEventArgValue(arg); -+ result[name] = value; -+ return result; -+ }, {}); -+} -+/** -+ * Parse an event argument value. -+ * @param value - The event argument value. -+ * @returns The parsed event argument value. -+ */ -+// eslint-disable-next-line @typescript-eslint/no-explicit-any -+function parseEventArgValue(value) { -+ var _a, _b; -+ if (Array.isArray(value)) { -+ return value.map(parseEventArgValue); -+ } -+ return ((_b = (_a = value.toHexString) === null || _a === void 0 ? void 0 : _a.call(value)) !== null && _b !== void 0 ? _b : value).toLowerCase(); -+} -+/** -+ * Generate token balance changes from parsed events. -+ * @param request - The transaction that was simulated. -+ * @param events - The parsed events. -+ * @returns An array of token balance changes. -+ */ -+function getTokenBalanceChanges(request, events) { -+ return __awaiter(this, void 0, void 0, function* () { -+ const balanceTxs = getTokenBalanceTransactions(request, events); -+ log('Generated balance transactions', [...balanceTxs.after.values()]); -+ const transactions = [ -+ ...balanceTxs.before.values(), -+ request, -+ ...balanceTxs.after.values(), -+ ]; -+ if (transactions.length === 1) { -+ return []; -+ } -+ const response = yield (0, simulation_api_1.simulateTransactions)(request.chainId, { -+ transactions, -+ }); -+ log('Balance simulation response', response); -+ if (response.transactions.length !== transactions.length) { -+ throw new errors_1.SimulationInvalidResponseError(); -+ } -+ let prevBalanceTxIndex = 0; -+ return [...balanceTxs.after.keys()] -+ .map((token, index) => { -+ const previousBalanceCheckSkipped = !balanceTxs.before.get(token); -+ const previousBalance = previousBalanceCheckSkipped -+ ? '0x0' -+ : getValueFromBalanceTransaction(request.from, token, -+ // eslint-disable-next-line no-plusplus -+ response.transactions[prevBalanceTxIndex++]); -+ const newBalance = getValueFromBalanceTransaction(request.from, token, response.transactions[index + balanceTxs.before.size + 1]); -+ const balanceChange = getSimulationBalanceChange(previousBalance, newBalance); -+ if (!balanceChange) { -+ return undefined; -+ } -+ return Object.assign(Object.assign({}, token), balanceChange); -+ }) -+ .filter((change) => change !== undefined); -+ }); -+} -+/** -+ * Generate transactions to check token balances. -+ * @param request - The transaction that was simulated. -+ * @param events - The parsed events. -+ * @returns A map of token balance transactions keyed by token. -+ */ -+function getTokenBalanceTransactions(request, events) { -+ const tokenKeys = new Set(); -+ const before = new Map(); -+ const after = new Map(); -+ const userEvents = events.filter((event) => SUPPORTED_EVENTS.includes(event.name) && -+ [event.args.from, event.args.to].includes(request.from)); -+ log('Filtered user events', userEvents); -+ for (const event of userEvents) { -+ const tokenIds = getEventTokenIds(event); -+ log('Extracted token ids', tokenIds); -+ for (const tokenId of tokenIds) { -+ const simulationToken = { -+ address: event.contractAddress, -+ standard: event.tokenStandard, -+ id: tokenId, -+ }; -+ const tokenKey = JSON.stringify(simulationToken); -+ if (tokenKeys.has(tokenKey)) { -+ log('Ignoring additional event with same contract and token ID', simulationToken); -+ continue; -+ } -+ tokenKeys.add(tokenKey); -+ const data = getBalanceTransactionData(event.tokenStandard, request.from, tokenId); -+ const transaction = { -+ from: request.from, -+ to: event.contractAddress, -+ data, -+ }; -+ if (skipPriorBalanceCheck(event)) { -+ after.set(simulationToken, transaction); -+ } -+ else { -+ before.set(simulationToken, transaction); -+ after.set(simulationToken, transaction); -+ } -+ } -+ } -+ return { before, after }; -+} -+/** -+ * Check if an event needs to check the previous balance. -+ * @param event - The parsed event. -+ * @returns True if the prior balance check should be skipped. -+ */ -+function skipPriorBalanceCheck(event) { -+ // In the case of an NFT mint, we cannot check the NFT owner before the mint -+ // as the balance check transaction would revert. -+ return (event.name === 'Transfer' && -+ event.tokenStandard === types_1.SimulationTokenStandard.erc721 && -+ parseInt(event.args.from, 16) === 0); -+} -+/** -+ * Extract token IDs from a parsed event. -+ * @param event - The parsed event. -+ * @returns An array of token IDs. -+ */ -+function getEventTokenIds(event) { -+ if (event.tokenStandard === types_1.SimulationTokenStandard.erc721) { -+ return [event.args.tokenId]; -+ } -+ if (event.tokenStandard === types_1.SimulationTokenStandard.erc1155 && -+ event.name === 'TransferSingle') { -+ return [event.args.id]; -+ } -+ if (event.tokenStandard === types_1.SimulationTokenStandard.erc1155 && -+ event.name === 'TransferBatch') { -+ return event.args.ids; -+ } -+ // ERC-20 does not have a token ID so default to undefined. -+ return [undefined]; -+} -+/** -+ * Extract the value from a balance transaction response. -+ * @param from - The address to check the balance of. -+ * @param token - The token to check the balance of. -+ * @param response - The balance transaction response. -+ * @returns The value of the balance transaction. -+ */ -+function getValueFromBalanceTransaction(from, token, response) { -+ const normalizedReturn = normalizeReturnValue(response.return); -+ if (token.standard === types_1.SimulationTokenStandard.erc721) { -+ return normalizedReturn === from ? '0x1' : '0x0'; -+ } -+ return normalizedReturn; -+} -+/** -+ * Generate the balance transaction data for a token. -+ * @param tokenStandard - The token standard. -+ * @param from - The address to check the balance of. -+ * @param tokenId - The token ID to check the balance of. -+ * @returns The balance transaction data. -+ */ -+function getBalanceTransactionData(tokenStandard, from, tokenId) { -+ switch (tokenStandard) { -+ case types_1.SimulationTokenStandard.erc721: -+ return new abi_1.Interface(metamask_eth_abis_1.abiERC721).encodeFunctionData('ownerOf', [ -+ tokenId, -+ ]); -+ case types_1.SimulationTokenStandard.erc1155: -+ return new abi_1.Interface(metamask_eth_abis_1.abiERC1155).encodeFunctionData('balanceOf', [ -+ from, -+ tokenId, -+ ]); -+ default: -+ return new abi_1.Interface(metamask_eth_abis_1.abiERC20).encodeFunctionData('balanceOf', [ -+ from, -+ ]); -+ } -+} -+/** -+ * Parse a raw event log using known ABIs. -+ * @param eventLog - The raw event log. -+ * @param interfaces - The contract interfaces. -+ * @returns The parsed event log or undefined if it could not be parsed. -+ */ -+function parseLog(eventLog, interfaces) { -+ const supportedTokens = Object.values(SupportedToken); -+ for (const token of supportedTokens) { -+ try { -+ const contractInterface = interfaces.get(token); -+ const { abi, standard } = SUPPORTED_TOKEN_ABIS[token]; -+ return Object.assign(Object.assign({}, contractInterface.parseLog(eventLog)), { abi, -+ standard }); -+ } -+ catch (e) { -+ continue; -+ } -+ } -+ return undefined; -+} -+/** -+ * Extract all logs from a call trace tree. -+ * @param call - The root call trace. -+ * @returns An array of logs. -+ */ -+function extractLogs(call) { -+ var _a, _b; -+ /* istanbul ignore next */ -+ const logs = (_a = call.logs) !== null && _a !== void 0 ? _a : []; -+ /* istanbul ignore next */ -+ const nestedCalls = (_b = call.calls) !== null && _b !== void 0 ? _b : []; -+ return [ -+ ...logs, -+ ...nestedCalls.map((nestedCall) => extractLogs(nestedCall)).flat(), -+ ]; -+} -+/** -+ * Generate balance change data from previous and new balances. -+ * @param previousBalance - The previous balance. -+ * @param newBalance - The new balance. -+ * @returns The balance change data or undefined if unchanged. -+ */ -+function getSimulationBalanceChange(previousBalance, newBalance) { -+ const differenceBN = (0, controller_utils_1.hexToBN)(newBalance).sub((0, controller_utils_1.hexToBN)(previousBalance)); -+ const isDecrease = differenceBN.isNeg(); -+ const difference = (0, controller_utils_1.toHex)(differenceBN.abs()); -+ if (differenceBN.isZero()) { -+ log('Balance change is zero'); -+ return undefined; -+ } -+ return { -+ previousBalance, -+ newBalance, -+ difference, -+ isDecrease, -+ }; -+} -+/** -+ * Normalize a return value. -+ * @param value - The return value to normalize. -+ * @returns The normalized return value. -+ */ -+function normalizeReturnValue(value) { -+ return (0, controller_utils_1.toHex)((0, controller_utils_1.hexToBN)(value)); -+} -+/** -+ * Get the contract interfaces for all supported tokens. -+ * @returns A map of supported tokens to their contract interfaces. -+ */ -+function getContractInterfaces() { -+ const supportedTokens = Object.values(SupportedToken); -+ return new Map(supportedTokens.map((tokenType) => { -+ const { abi } = SUPPORTED_TOKEN_ABIS[tokenType]; -+ const contractInterface = new abi_1.Interface(abi); -+ return [tokenType, contractInterface]; -+ })); -+} -+//# sourceMappingURL=simulation.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation.js.map b/node_modules/@metamask/transaction-controller/dist/utils/simulation.js.map -new file mode 100644 -index 0000000..b992bb4 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"simulation.js","sourceRoot":"","sources":["../../src/utils/simulation.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4CAA+C;AAC/C,iEAA4D;AAC5D,mEAA8E;AAC9E,2CAA+D;AAE/D,qDAAwD;AAQxD,4CAGsB;AACtB,sCAImB;AACnB,sCAA0C;AAO1C,oCAAmD;AAEnD,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,gDAA8B,CAAA;IAC9B,gDAA8B,CAAA;AAChC,CAAC,EANW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAMzB;AAoBD,MAAM,GAAG,GAAG,IAAA,0BAAkB,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IAAI,YAAY,CAAC,MAAM,EAAE,EAAE;QACzB,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAC9B,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,eAAe;QACf,UAAU;QACV,UAAU;QACV,UAAU;KACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,KAAU;IACtC,OAAO,IAAA,wBAAK,EAAC,IAAA,0BAAO,EAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtD,OAAO,IAAI,GAAG,CACZ,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAChC,MAAM,EAAE,GAAG,EAAE,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChD,MAAM,iBAAiB,GAAG,IAAI,eAAS,CAAC,GAAG,CAAC,CAAC;QAC7C,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IACxC,CAAC,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { Fragment, LogDescription, Result } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { hexToBN, toHex } from '@metamask/controller-utils';\nimport { abiERC20, abiERC721, abiERC1155 } from '@metamask/metamask-eth-abis';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { simulateTransactions } from './simulation-api';\nimport type {\n SimulationResponseLog,\n SimulationRequestTransaction,\n SimulationResponse,\n SimulationResponseCallTrace,\n SimulationResponseTransaction,\n} from './simulation-api';\nimport {\n ABI_SIMULATION_ERC20_WRAPPED,\n ABI_SIMULATION_ERC721_LEGACY,\n} from '../constants';\nimport {\n SimulationError,\n SimulationInvalidResponseError,\n SimulationRevertedError,\n} from '../errors';\nimport { projectLogger } from '../logger';\nimport type {\n SimulationBalanceChange,\n SimulationData,\n SimulationTokenBalanceChange,\n SimulationToken,\n} from '../types';\nimport { SimulationTokenStandard } from '../types';\n\nexport enum SupportedToken {\n ERC20 = 'erc20',\n ERC721 = 'erc721',\n ERC1155 = 'erc1155',\n ERC20_WRAPPED = 'erc20Wrapped',\n ERC721_LEGACY = 'erc721Legacy',\n}\n\ntype ABI = Fragment[];\n\nexport type GetSimulationDataRequest = {\n chainId: Hex;\n from: Hex;\n to?: Hex;\n value?: Hex;\n data?: Hex;\n};\n\ntype ParsedEvent = {\n contractAddress: Hex;\n tokenStandard: SimulationTokenStandard;\n name: string;\n args: Record;\n abi: ABI;\n};\n\nconst log = createModuleLogger(projectLogger, 'simulation');\n\nconst SUPPORTED_EVENTS = [\n 'Transfer',\n 'TransferSingle',\n 'TransferBatch',\n 'Deposit',\n 'Withdrawal',\n];\n\nconst SUPPORTED_TOKEN_ABIS = {\n [SupportedToken.ERC20]: {\n abi: abiERC20,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721]: {\n abi: abiERC721,\n standard: SimulationTokenStandard.erc721,\n },\n [SupportedToken.ERC1155]: {\n abi: abiERC1155,\n standard: SimulationTokenStandard.erc1155,\n },\n [SupportedToken.ERC20_WRAPPED]: {\n abi: ABI_SIMULATION_ERC20_WRAPPED,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721_LEGACY]: {\n abi: ABI_SIMULATION_ERC721_LEGACY,\n standard: SimulationTokenStandard.erc721,\n },\n};\n\nconst REVERTED_ERRORS = ['execution reverted', 'insufficient funds for gas'];\n\ntype BalanceTransactionMap = Map;\n\n/**\n * Generate simulation data for a transaction.\n * @param request - The transaction to simulate.\n * @param request.chainId - The chain ID of the transaction.\n * @param request.from - The sender of the transaction.\n * @param request.to - The recipient of the transaction.\n * @param request.value - The value of the transaction.\n * @param request.data - The data of the transaction.\n * @returns The simulation data.\n */\nexport async function getSimulationData(\n request: GetSimulationDataRequest,\n): Promise {\n const { chainId, from, to, value, data } = request;\n\n log('Getting simulation data', request);\n\n try {\n const response = await simulateTransactions(chainId, {\n transactions: [\n {\n data,\n from,\n maxFeePerGas: '0x0',\n maxPriorityFeePerGas: '0x0',\n to,\n value,\n },\n ],\n withCallTrace: true,\n withLogs: true,\n });\n\n const transactionError = response.transactions?.[0]?.error;\n\n if (transactionError) {\n throw new SimulationError(transactionError);\n }\n\n const nativeBalanceChange = getNativeBalanceChange(request.from, response);\n const events = getEvents(response);\n\n log('Parsed events', events);\n\n const tokenBalanceChanges = await getTokenBalanceChanges(request, events);\n\n return {\n nativeBalanceChange,\n tokenBalanceChanges,\n };\n } catch (error) {\n log('Failed to get simulation data', error, request);\n\n let simulationError = error as SimulationError;\n\n if (\n REVERTED_ERRORS.some((revertErrorMessage) =>\n simulationError.message?.includes(revertErrorMessage),\n )\n ) {\n simulationError = new SimulationRevertedError();\n }\n\n const { code, message } = simulationError;\n\n return {\n tokenBalanceChanges: [],\n error: {\n code,\n message,\n },\n };\n }\n}\n\n/**\n * Extract the native balance change from a simulation response.\n * @param userAddress - The user's account address.\n * @param response - The simulation response.\n * @returns The native balance change or undefined if unchanged.\n */\nfunction getNativeBalanceChange(\n userAddress: Hex,\n response: SimulationResponse,\n): SimulationBalanceChange | undefined {\n const transactionResponse = response.transactions[0];\n\n /* istanbul ignore next */\n if (!transactionResponse) {\n return undefined;\n }\n\n const { stateDiff } = transactionResponse;\n const previousBalance = stateDiff?.pre?.[userAddress]?.balance;\n const newBalance = stateDiff?.post?.[userAddress]?.balance;\n\n if (!previousBalance || !newBalance) {\n return undefined;\n }\n\n return getSimulationBalanceChange(previousBalance, newBalance);\n}\n\n/**\n * Extract events from a simulation response.\n * @param response - The simulation response.\n * @returns The parsed events.\n */\nexport function getEvents(response: SimulationResponse): ParsedEvent[] {\n /* istanbul ignore next */\n const logs = extractLogs(\n response.transactions[0]?.callTrace ?? ({} as SimulationResponseCallTrace),\n );\n\n log('Extracted logs', logs);\n\n const interfaces = getContractInterfaces();\n\n return logs\n .map((currentLog) => {\n const event = parseLog(currentLog, interfaces);\n\n if (!event) {\n log('Failed to parse log', currentLog);\n return undefined;\n }\n\n /* istanbul ignore next */\n const inputs = event.abi.find((e) => e.name === event.name)?.inputs;\n\n /* istanbul ignore if */\n if (!inputs) {\n log('Failed to find inputs for event', event);\n return undefined;\n }\n\n const args = parseEventArgs(event.args, inputs);\n\n return {\n contractAddress: currentLog.address,\n tokenStandard: event.standard,\n name: event.name,\n args,\n abi: event.abi,\n };\n })\n .filter((e) => e !== undefined) as ParsedEvent[];\n}\n\n/**\n * Parse event arguments using ABI input definitions.\n * @param args - The raw event arguments.\n * @param abiInputs - The ABI input definitions.\n * @returns The parsed event arguments.\n */\nfunction parseEventArgs(\n args: Result,\n abiInputs: { name: string }[],\n): Record {\n return args.reduce((result, arg, index) => {\n const name = abiInputs[index].name.replace('_', '');\n const value = parseEventArgValue(arg);\n\n result[name] = value;\n\n return result;\n }, {});\n}\n\n/**\n * Parse an event argument value.\n * @param value - The event argument value.\n * @returns The parsed event argument value.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction parseEventArgValue(value: any): Hex | Hex[] {\n if (Array.isArray(value)) {\n return value.map(parseEventArgValue) as Hex[];\n }\n\n return (value.toHexString?.() ?? value).toLowerCase();\n}\n\n/**\n * Generate token balance changes from parsed events.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns An array of token balance changes.\n */\nasync function getTokenBalanceChanges(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): Promise {\n const balanceTxs = getTokenBalanceTransactions(request, events);\n\n log('Generated balance transactions', [...balanceTxs.after.values()]);\n\n const transactions = [\n ...balanceTxs.before.values(),\n request,\n ...balanceTxs.after.values(),\n ];\n\n if (transactions.length === 1) {\n return [];\n }\n\n const response = await simulateTransactions(request.chainId as Hex, {\n transactions,\n });\n\n log('Balance simulation response', response);\n\n if (response.transactions.length !== transactions.length) {\n throw new SimulationInvalidResponseError();\n }\n\n let prevBalanceTxIndex = 0;\n return [...balanceTxs.after.keys()]\n .map((token, index) => {\n const previousBalanceCheckSkipped = !balanceTxs.before.get(token);\n const previousBalance = previousBalanceCheckSkipped\n ? '0x0'\n : getValueFromBalanceTransaction(\n request.from,\n token,\n // eslint-disable-next-line no-plusplus\n response.transactions[prevBalanceTxIndex++],\n );\n\n const newBalance = getValueFromBalanceTransaction(\n request.from,\n token,\n response.transactions[index + balanceTxs.before.size + 1],\n );\n\n const balanceChange = getSimulationBalanceChange(\n previousBalance,\n newBalance,\n );\n\n if (!balanceChange) {\n return undefined;\n }\n\n return {\n ...token,\n ...balanceChange,\n };\n })\n .filter((change) => change !== undefined) as SimulationTokenBalanceChange[];\n}\n\n/**\n * Generate transactions to check token balances.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns A map of token balance transactions keyed by token.\n */\nfunction getTokenBalanceTransactions(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): {\n before: BalanceTransactionMap;\n after: BalanceTransactionMap;\n} {\n const tokenKeys = new Set();\n const before = new Map();\n const after = new Map();\n\n const userEvents = events.filter(\n (event) =>\n SUPPORTED_EVENTS.includes(event.name) &&\n [event.args.from, event.args.to].includes(request.from),\n );\n\n log('Filtered user events', userEvents);\n\n for (const event of userEvents) {\n const tokenIds = getEventTokenIds(event);\n\n log('Extracted token ids', tokenIds);\n\n for (const tokenId of tokenIds) {\n const simulationToken: SimulationToken = {\n address: event.contractAddress,\n standard: event.tokenStandard,\n id: tokenId,\n };\n\n const tokenKey = JSON.stringify(simulationToken);\n\n if (tokenKeys.has(tokenKey)) {\n log(\n 'Ignoring additional event with same contract and token ID',\n simulationToken,\n );\n continue;\n }\n\n tokenKeys.add(tokenKey);\n\n const data = getBalanceTransactionData(\n event.tokenStandard,\n request.from,\n tokenId,\n );\n\n const transaction: SimulationRequestTransaction = {\n from: request.from,\n to: event.contractAddress,\n data,\n };\n\n if (skipPriorBalanceCheck(event)) {\n after.set(simulationToken, transaction);\n } else {\n before.set(simulationToken, transaction);\n after.set(simulationToken, transaction);\n }\n }\n }\n\n return { before, after };\n}\n\n/**\n * Check if an event needs to check the previous balance.\n * @param event - The parsed event.\n * @returns True if the prior balance check should be skipped.\n */\nfunction skipPriorBalanceCheck(event: ParsedEvent): boolean {\n // In the case of an NFT mint, we cannot check the NFT owner before the mint\n // as the balance check transaction would revert.\n return (\n event.name === 'Transfer' &&\n event.tokenStandard === SimulationTokenStandard.erc721 &&\n parseInt(event.args.from as string, 16) === 0\n );\n}\n\n/**\n * Extract token IDs from a parsed event.\n * @param event - The parsed event.\n * @returns An array of token IDs.\n */\nfunction getEventTokenIds(event: ParsedEvent): (Hex | undefined)[] {\n if (event.tokenStandard === SimulationTokenStandard.erc721) {\n return [event.args.tokenId as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferSingle'\n ) {\n return [event.args.id as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferBatch'\n ) {\n return event.args.ids as Hex[];\n }\n\n // ERC-20 does not have a token ID so default to undefined.\n return [undefined];\n}\n\n/**\n * Extract the value from a balance transaction response.\n * @param from - The address to check the balance of.\n * @param token - The token to check the balance of.\n * @param response - The balance transaction response.\n * @returns The value of the balance transaction.\n */\nfunction getValueFromBalanceTransaction(\n from: Hex,\n token: SimulationToken,\n response: SimulationResponseTransaction,\n): Hex {\n const normalizedReturn = normalizeReturnValue(response.return);\n\n if (token.standard === SimulationTokenStandard.erc721) {\n return normalizedReturn === from ? '0x1' : '0x0';\n }\n\n return normalizedReturn;\n}\n\n/**\n * Generate the balance transaction data for a token.\n * @param tokenStandard - The token standard.\n * @param from - The address to check the balance of.\n * @param tokenId - The token ID to check the balance of.\n * @returns The balance transaction data.\n */\nfunction getBalanceTransactionData(\n tokenStandard: SimulationTokenStandard,\n from: Hex,\n tokenId?: Hex,\n): Hex {\n switch (tokenStandard) {\n case SimulationTokenStandard.erc721:\n return new Interface(abiERC721).encodeFunctionData('ownerOf', [\n tokenId,\n ]) as Hex;\n\n case SimulationTokenStandard.erc1155:\n return new Interface(abiERC1155).encodeFunctionData('balanceOf', [\n from,\n tokenId,\n ]) as Hex;\n\n default:\n return new Interface(abiERC20).encodeFunctionData('balanceOf', [\n from,\n ]) as Hex;\n }\n}\n\n/**\n * Parse a raw event log using known ABIs.\n * @param eventLog - The raw event log.\n * @param interfaces - The contract interfaces.\n * @returns The parsed event log or undefined if it could not be parsed.\n */\nfunction parseLog(\n eventLog: SimulationResponseLog,\n interfaces: Map,\n):\n | (LogDescription & { abi: ABI; standard: SimulationTokenStandard })\n | undefined {\n const supportedTokens = Object.values(SupportedToken);\n\n for (const token of supportedTokens) {\n try {\n const contractInterface = interfaces.get(token) as Interface;\n const { abi, standard } = SUPPORTED_TOKEN_ABIS[token];\n\n return {\n ...contractInterface.parseLog(eventLog),\n abi,\n standard,\n };\n } catch (e) {\n continue;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extract all logs from a call trace tree.\n * @param call - The root call trace.\n * @returns An array of logs.\n */\nfunction extractLogs(\n call: SimulationResponseCallTrace,\n): SimulationResponseLog[] {\n /* istanbul ignore next */\n const logs = call.logs ?? [];\n\n /* istanbul ignore next */\n const nestedCalls = call.calls ?? [];\n\n return [\n ...logs,\n ...nestedCalls.map((nestedCall) => extractLogs(nestedCall)).flat(),\n ];\n}\n\n/**\n * Generate balance change data from previous and new balances.\n * @param previousBalance - The previous balance.\n * @param newBalance - The new balance.\n * @returns The balance change data or undefined if unchanged.\n */\nfunction getSimulationBalanceChange(\n previousBalance: Hex,\n newBalance: Hex,\n): SimulationBalanceChange | undefined {\n const differenceBN = hexToBN(newBalance).sub(hexToBN(previousBalance));\n const isDecrease = differenceBN.isNeg();\n const difference = toHex(differenceBN.abs());\n\n if (differenceBN.isZero()) {\n log('Balance change is zero');\n return undefined;\n }\n\n return {\n previousBalance,\n newBalance,\n difference,\n isDecrease,\n };\n}\n\n/**\n * Normalize a return value.\n * @param value - The return value to normalize.\n * @returns The normalized return value.\n */\nfunction normalizeReturnValue(value: Hex): Hex {\n return toHex(hexToBN(value));\n}\n\n/**\n * Get the contract interfaces for all supported tokens.\n * @returns A map of supported tokens to their contract interfaces.\n */\nfunction getContractInterfaces(): Map {\n const supportedTokens = Object.values(SupportedToken);\n\n return new Map(\n supportedTokens.map((tokenType) => {\n const { abi } = SUPPORTED_TOKEN_ABIS[tokenType];\n const contractInterface = new Interface(abi);\n return [tokenType, contractInterface];\n }),\n );\n}\n"]} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/swaps.d.ts b/node_modules/@metamask/transaction-controller/dist/utils/swaps.d.ts -new file mode 100644 -index 0000000..311b20f ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/swaps.d.ts -@@ -0,0 +1,60 @@ -+import type EthQuery from '@metamask/eth-query'; -+import type { TransactionMeta } from '../types'; -+import { TransactionType } from '../types'; -+/** -+ * Interval in milliseconds between checks of post transaction balance -+ */ -+export declare const UPDATE_POST_TX_BALANCE_TIMEOUT = 5000; -+/** -+ * Retry attempts for checking post transaction balance -+ */ -+export declare const UPDATE_POST_TX_BALANCE_ATTEMPTS = 6; -+/** -+ * An address that the metaswap-api recognizes as the default token for the current network, in place of the token address that ERC-20 tokens have -+ */ -+export declare const DEFAULT_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000"; -+interface SwapsTokenObject { -+ /** -+ * The name for the network -+ */ -+ name: string; -+ /** -+ * An address that the metaswap-api recognizes as the default token -+ */ -+ address: string; -+ /** -+ * Number of digits after decimal point -+ */ -+ decimals: number; -+} -+export declare const SWAPS_CHAINID_DEFAULT_TOKEN_MAP: { -+ readonly "0x1": SwapsTokenObject; -+ readonly "0x539": SwapsTokenObject; -+ readonly "0x38": SwapsTokenObject; -+ readonly "0x89": SwapsTokenObject; -+ readonly "0x5": SwapsTokenObject; -+ readonly "0xa86a": SwapsTokenObject; -+ readonly "0xa": SwapsTokenObject; -+ readonly "0xa4b1": SwapsTokenObject; -+ readonly "0x144": SwapsTokenObject; -+}; -+export declare const SWAP_TRANSACTION_TYPES: TransactionType[]; -+/** -+ * Attempts to update the post transaction balance of the provided transaction -+ * -+ * @param transactionMeta - Transaction meta object to update -+ * @param updatePostTransactionBalanceRequest - Dependency bag -+ * @param updatePostTransactionBalanceRequest.ethQuery - EthQuery object -+ * @param updatePostTransactionBalanceRequest.getTransaction - Reading function for the latest transaction state -+ * @param updatePostTransactionBalanceRequest.updateTransaction - Updating transaction function -+ */ -+export declare function updatePostTransactionBalance(transactionMeta: TransactionMeta, { ethQuery, getTransaction, updateTransaction, }: { -+ ethQuery: EthQuery; -+ getTransaction: (transactionId: string) => TransactionMeta | undefined; -+ updateTransaction: (transactionMeta: TransactionMeta, note: string) => void; -+}): Promise<{ -+ updatedTransactionMeta: TransactionMeta; -+ approvalTransactionMeta?: TransactionMeta; -+}>; -+export {}; -+//# sourceMappingURL=swaps.d.ts.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/swaps.d.ts.map b/node_modules/@metamask/transaction-controller/dist/utils/swaps.d.ts.map -new file mode 100644 -index 0000000..5afe2f3 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/swaps.d.ts.map -@@ -0,0 +1 @@ -+{"version":3,"file":"swaps.d.ts","sourceRoot":"","sources":["../../src/utils/swaps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAIhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI3C;;GAEG;AACH,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAIjD;;GAEG;AACH,eAAO,MAAM,qBAAqB,+CACY,CAAC;AAI/C,UAAU,gBAAgB;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkDD,eAAO,MAAM,+BAA+B;;;;;;;;;;CAUlC,CAAC;AAEX,eAAO,MAAM,sBAAsB,mBAGlC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,eAAe,EAAE,eAAe,EAChC,EACE,QAAQ,EACR,cAAc,EACd,iBAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IACvE,iBAAiB,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7E,GACA,OAAO,CAAC;IACT,sBAAsB,EAAE,eAAe,CAAC;IACxC,uBAAuB,CAAC,EAAE,eAAe,CAAC;CAC3C,CAAC,CA4DD"} -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/swaps.js b/node_modules/@metamask/transaction-controller/dist/utils/swaps.js -new file mode 100644 -index 0000000..628e99c ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/swaps.js -@@ -0,0 +1,154 @@ -+"use strict"; -+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -+ return new (P || (P = Promise))(function (resolve, reject) { -+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -+ step((generator = generator.apply(thisArg, _arguments || [])).next()); -+ }); -+}; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.updatePostTransactionBalance = exports.SWAP_TRANSACTION_TYPES = exports.SWAPS_CHAINID_DEFAULT_TOKEN_MAP = exports.DEFAULT_TOKEN_ADDRESS = exports.UPDATE_POST_TX_BALANCE_ATTEMPTS = exports.UPDATE_POST_TX_BALANCE_TIMEOUT = void 0; -+const controller_utils_1 = require("@metamask/controller-utils"); -+const constants_1 = require("../constants"); -+const logger_1 = require("../logger"); -+const types_1 = require("../types"); -+const log = (0, logger_1.createModuleLogger)(logger_1.projectLogger, 'swaps'); -+/** -+ * Interval in milliseconds between checks of post transaction balance -+ */ -+exports.UPDATE_POST_TX_BALANCE_TIMEOUT = 5000; -+/** -+ * Retry attempts for checking post transaction balance -+ */ -+exports.UPDATE_POST_TX_BALANCE_ATTEMPTS = 6; -+const SWAPS_TESTNET_CHAIN_ID = '0x539'; -+/** -+ * An address that the metaswap-api recognizes as the default token for the current network, in place of the token address that ERC-20 tokens have -+ */ -+exports.DEFAULT_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000000'; -+const ETH_SWAPS_TOKEN_OBJECT = { -+ name: 'Ether', -+ address: exports.DEFAULT_TOKEN_ADDRESS, -+ decimals: 18, -+}; -+const BNB_SWAPS_TOKEN_OBJECT = { -+ name: 'Binance Coin', -+ address: exports.DEFAULT_TOKEN_ADDRESS, -+ decimals: 18, -+}; -+const MATIC_SWAPS_TOKEN_OBJECT = { -+ name: 'Matic', -+ address: exports.DEFAULT_TOKEN_ADDRESS, -+ decimals: 18, -+}; -+const AVAX_SWAPS_TOKEN_OBJECT = { -+ name: 'Avalanche', -+ address: exports.DEFAULT_TOKEN_ADDRESS, -+ decimals: 18, -+}; -+const TEST_ETH_SWAPS_TOKEN_OBJECT = { -+ name: 'Test Ether', -+ address: exports.DEFAULT_TOKEN_ADDRESS, -+ decimals: 18, -+}; -+const GOERLI_SWAPS_TOKEN_OBJECT = { -+ name: 'Ether', -+ address: exports.DEFAULT_TOKEN_ADDRESS, -+ decimals: 18, -+}; -+const ARBITRUM_SWAPS_TOKEN_OBJECT = Object.assign({}, ETH_SWAPS_TOKEN_OBJECT); -+const OPTIMISM_SWAPS_TOKEN_OBJECT = Object.assign({}, ETH_SWAPS_TOKEN_OBJECT); -+const ZKSYNC_ERA_SWAPS_TOKEN_OBJECT = Object.assign({}, ETH_SWAPS_TOKEN_OBJECT); -+exports.SWAPS_CHAINID_DEFAULT_TOKEN_MAP = { -+ [constants_1.CHAIN_IDS.MAINNET]: ETH_SWAPS_TOKEN_OBJECT, -+ [SWAPS_TESTNET_CHAIN_ID]: TEST_ETH_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.BSC]: BNB_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.POLYGON]: MATIC_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.GOERLI]: GOERLI_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.AVALANCHE]: AVAX_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.OPTIMISM]: OPTIMISM_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.ARBITRUM]: ARBITRUM_SWAPS_TOKEN_OBJECT, -+ [constants_1.CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_ERA_SWAPS_TOKEN_OBJECT, -+}; -+exports.SWAP_TRANSACTION_TYPES = [ -+ types_1.TransactionType.swap, -+ types_1.TransactionType.swapApproval, -+]; -+/** -+ * Attempts to update the post transaction balance of the provided transaction -+ * -+ * @param transactionMeta - Transaction meta object to update -+ * @param updatePostTransactionBalanceRequest - Dependency bag -+ * @param updatePostTransactionBalanceRequest.ethQuery - EthQuery object -+ * @param updatePostTransactionBalanceRequest.getTransaction - Reading function for the latest transaction state -+ * @param updatePostTransactionBalanceRequest.updateTransaction - Updating transaction function -+ */ -+function updatePostTransactionBalance(transactionMeta, { ethQuery, getTransaction, updateTransaction, }) { -+ var _a; -+ return __awaiter(this, void 0, void 0, function* () { -+ log('Updating post transaction balance', transactionMeta.id); -+ const transactionId = transactionMeta.id; -+ let latestTransactionMeta; -+ let approvalTransactionMeta; -+ for (let i = 0; i < exports.UPDATE_POST_TX_BALANCE_ATTEMPTS; i++) { -+ log('Querying balance', { attempt: i }); -+ const postTransactionBalance = yield (0, controller_utils_1.query)(ethQuery, 'getBalance', [ -+ transactionMeta.txParams.from, -+ ]); -+ latestTransactionMeta = Object.assign({}, ((_a = getTransaction(transactionId)) !== null && _a !== void 0 ? _a : {})); -+ approvalTransactionMeta = latestTransactionMeta.approvalTxId -+ ? getTransaction(latestTransactionMeta.approvalTxId) -+ : undefined; -+ latestTransactionMeta.postTxBalance = postTransactionBalance.toString(16); -+ const isDefaultTokenAddress = isSwapsDefaultTokenAddress(transactionMeta.destinationTokenAddress, transactionMeta.chainId); -+ if (!isDefaultTokenAddress || -+ transactionMeta.preTxBalance !== latestTransactionMeta.postTxBalance) { -+ log('Finishing post balance update', { -+ isDefaultTokenAddress, -+ preTxBalance: transactionMeta.preTxBalance, -+ postTxBalance: latestTransactionMeta.postTxBalance, -+ }); -+ break; -+ } -+ log('Waiting for balance to update', { -+ delay: exports.UPDATE_POST_TX_BALANCE_TIMEOUT, -+ }); -+ yield sleep(exports.UPDATE_POST_TX_BALANCE_TIMEOUT); -+ } -+ updateTransaction(latestTransactionMeta, 'TransactionController#updatePostTransactionBalance - Add post transaction balance'); -+ log('Completed post balance update', latestTransactionMeta === null || latestTransactionMeta === void 0 ? void 0 : latestTransactionMeta.postTxBalance); -+ return { -+ updatedTransactionMeta: latestTransactionMeta, -+ approvalTransactionMeta, -+ }; -+ }); -+} -+exports.updatePostTransactionBalance = updatePostTransactionBalance; -+/** -+ * Checks whether the provided address is strictly equal to the address for -+ * the default swaps token of the provided chain. -+ * -+ * @param address - The string to compare to the default token address -+ * @param chainId - The hex encoded chain ID of the default swaps token to check -+ * @returns Whether the address is the provided chain's default token address -+ */ -+function isSwapsDefaultTokenAddress(address, chainId) { -+ var _a; -+ if (!address || !chainId) { -+ return false; -+ } -+ return (address === -+ ((_a = exports.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[chainId]) === null || _a === void 0 ? void 0 : _a.address)); -+} -+/** -+ * Sleeps for the provided number of milliseconds -+ * -+ * @param ms - Number of milliseconds to sleep -+ * @returns Promise that resolves after the provided number of milliseconds -+ */ -+function sleep(ms) { -+ return new Promise((resolve) => setTimeout(resolve, ms)); -+} -+//# sourceMappingURL=swaps.js.map -\ No newline at end of file -diff --git a/node_modules/@metamask/transaction-controller/dist/utils/swaps.js.map b/node_modules/@metamask/transaction-controller/dist/utils/swaps.js.map -new file mode 100644 -index 0000000..3459623 ---- /dev/null -+++ b/node_modules/@metamask/transaction-controller/dist/utils/swaps.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"swaps.js","sourceRoot":"","sources":["../../src/utils/swaps.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAAmD;AAGnD,4CAAyC;AACzC,sCAA8D;AAE9D,oCAA2C;AAE3C,MAAM,GAAG,GAAG,IAAA,2BAAkB,EAAC,sBAAa,EAAE,OAAO,CAAC,CAAC;AAEvD;;GAEG;AACU,QAAA,8BAA8B,GAAG,IAAI,CAAC;AAEnD;;GAEG;AACU,QAAA,+BAA+B,GAAG,CAAC,CAAC;AAEjD,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC;;GAEG;AACU,QAAA,qBAAqB,GAChC,4CAA4C,CAAC;AAmB/C,MAAM,sBAAsB,GAAqB;IAC/C,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,6BAAqB;IAC9B,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,sBAAsB,GAAqB;IAC/C,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,6BAAqB;IAC9B,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,wBAAwB,GAAqB;IACjD,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,6BAAqB;IAC9B,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,uBAAuB,GAAqB;IAChD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,6BAAqB;IAC9B,QAAQ,EAA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BAArB,qBAAqB,CAAE,aAAa,CAAC,CAAC;QAE3E,OAAO;YACL,sBAAsB,EAAE,qBAAwC;YAChE,uBAAuB;SACxB,CAAC;;CACH;AA1ED,oEA0EC;AAED;;;;;;;GAOG;AACH,SAAS,0BAA0B,CAAC,OAAe,EAAE,OAAe;;IAClE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,CACL,OAAO;SACP,MAAA,uCAA+B,CAC7B,OAAuD,CACxD,0CAAE,OAAO,CAAA,CACX,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\n\nimport { CHAIN_IDS } from '../constants';\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionMeta } from '../types';\nimport { TransactionType } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'swaps');\n\n/**\n * Interval in milliseconds between checks of post transaction balance\n */\nexport const UPDATE_POST_TX_BALANCE_TIMEOUT = 5000;\n\n/**\n * Retry attempts for checking post transaction balance\n */\nexport const UPDATE_POST_TX_BALANCE_ATTEMPTS = 6;\n\nconst SWAPS_TESTNET_CHAIN_ID = '0x539';\n\n/**\n * An address that the metaswap-api recognizes as the default token for the current network, in place of the token address that ERC-20 tokens have\n */\nexport const DEFAULT_TOKEN_ADDRESS =\n '0x0000000000000000000000000000000000000000';\n\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\ninterface SwapsTokenObject {\n /**\n * The name for the network\n */\n name: string;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n}\n\nconst ETH_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n};\n\nconst BNB_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Binance Coin',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst MATIC_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Matic',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst AVAX_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Avalanche',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst TEST_ETH_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Test Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst GOERLI_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst ARBITRUM_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nconst OPTIMISM_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nconst ZKSYNC_ERA_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nexport const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {\n [CHAIN_IDS.MAINNET]: ETH_SWAPS_TOKEN_OBJECT,\n [SWAPS_TESTNET_CHAIN_ID]: TEST_ETH_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.BSC]: BNB_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.POLYGON]: MATIC_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.GOERLI]: GOERLI_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.AVALANCHE]: AVAX_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.OPTIMISM]: OPTIMISM_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.ARBITRUM]: ARBITRUM_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_ERA_SWAPS_TOKEN_OBJECT,\n} as const;\n\nexport const SWAP_TRANSACTION_TYPES = [\n TransactionType.swap,\n TransactionType.swapApproval,\n];\n\n/**\n * Attempts to update the post transaction balance of the provided transaction\n *\n * @param transactionMeta - Transaction meta object to update\n * @param updatePostTransactionBalanceRequest - Dependency bag\n * @param updatePostTransactionBalanceRequest.ethQuery - EthQuery object\n * @param updatePostTransactionBalanceRequest.getTransaction - Reading function for the latest transaction state\n * @param updatePostTransactionBalanceRequest.updateTransaction - Updating transaction function\n */\nexport async function updatePostTransactionBalance(\n transactionMeta: TransactionMeta,\n {\n ethQuery,\n getTransaction,\n updateTransaction,\n }: {\n ethQuery: EthQuery;\n getTransaction: (transactionId: string) => TransactionMeta | undefined;\n updateTransaction: (transactionMeta: TransactionMeta, note: string) => void;\n },\n): Promise<{\n updatedTransactionMeta: TransactionMeta;\n approvalTransactionMeta?: TransactionMeta;\n}> {\n log('Updating post transaction balance', transactionMeta.id);\n\n const transactionId = transactionMeta.id;\n let latestTransactionMeta: TransactionMeta | undefined;\n let approvalTransactionMeta;\n\n for (let i = 0; i < UPDATE_POST_TX_BALANCE_ATTEMPTS; i++) {\n log('Querying balance', { attempt: i });\n\n const postTransactionBalance = await query(ethQuery, 'getBalance', [\n transactionMeta.txParams.from,\n ]);\n\n latestTransactionMeta = {\n ...(getTransaction(transactionId) ?? ({} as TransactionMeta)),\n };\n\n approvalTransactionMeta = latestTransactionMeta.approvalTxId\n ? getTransaction(latestTransactionMeta.approvalTxId)\n : undefined;\n\n latestTransactionMeta.postTxBalance = postTransactionBalance.toString(16);\n\n const isDefaultTokenAddress = isSwapsDefaultTokenAddress(\n transactionMeta.destinationTokenAddress as string,\n transactionMeta.chainId,\n );\n\n if (\n !isDefaultTokenAddress ||\n transactionMeta.preTxBalance !== latestTransactionMeta.postTxBalance\n ) {\n log('Finishing post balance update', {\n isDefaultTokenAddress,\n preTxBalance: transactionMeta.preTxBalance,\n postTxBalance: latestTransactionMeta.postTxBalance,\n });\n\n break;\n }\n\n log('Waiting for balance to update', {\n delay: UPDATE_POST_TX_BALANCE_TIMEOUT,\n });\n\n await sleep(UPDATE_POST_TX_BALANCE_TIMEOUT);\n }\n\n updateTransaction(\n latestTransactionMeta as TransactionMeta,\n 'TransactionController#updatePostTransactionBalance - Add post transaction balance',\n );\n\n log('Completed post balance update', latestTransactionMeta?.postTxBalance);\n\n return {\n updatedTransactionMeta: latestTransactionMeta as TransactionMeta,\n approvalTransactionMeta,\n };\n}\n\n/**\n * Checks whether the provided address is strictly equal to the address for\n * the default swaps token of the provided chain.\n *\n * @param address - The string to compare to the default token address\n * @param chainId - The hex encoded chain ID of the default swaps token to check\n * @returns Whether the address is the provided chain's default token address\n */\nfunction isSwapsDefaultTokenAddress(address: string, chainId: string) {\n if (!address || !chainId) {\n return false;\n }\n\n return (\n address ===\n SWAPS_CHAINID_DEFAULT_TOKEN_MAP[\n chainId as keyof typeof SWAPS_CHAINID_DEFAULT_TOKEN_MAP\n ]?.address\n );\n}\n\n/**\n * Sleeps for the provided number of milliseconds\n *\n * @param ms - Number of milliseconds to sleep\n * @returns Promise that resolves after the provided number of milliseconds\n */\nfunction sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"]} -\ No newline at end of file diff --git a/patches/@metamask+transaction-controller+35.0.0.patch b/patches/@metamask+transaction-controller+35.0.0.patch new file mode 100644 index 00000000000..e8ac10077ed --- /dev/null +++ b/patches/@metamask+transaction-controller+35.0.0.patch @@ -0,0 +1,2366 @@ +diff --git a/node_modules/@metamask/transaction-controller/dist/.patch.txt b/node_modules/@metamask/transaction-controller/dist/.patch.txt +new file mode 100644 +index 0000000..550de56 +--- /dev/null ++++ b/node_modules/@metamask/transaction-controller/dist/.patch.txt +@@ -0,0 +1,7 @@ ++PATCH GENERATED FROM MetaMask/core branch: patch/mobile-transaction-controller-33-0-1 ++This patch backports various transaction controller features from the main branch of MetaMask/core ++Steps to update patch: ++* Create a new core branch from: patch/mobile-transaction-controller-33-0-1 ++* Run "yarn build" in the core monorepo ++* Run "yarn patch:tx " in the mobile repo ++* Once the new patch is merged, add your changes to: patch/mobile-transaction-controller-33-0-1 +diff --git a/node_modules/@metamask/transaction-controller/dist/TransactionController.js b/node_modules/@metamask/transaction-controller/dist/TransactionController.js +index bdb836a..4bc4e3d 100644 +--- a/node_modules/@metamask/transaction-controller/dist/TransactionController.js ++++ b/node_modules/@metamask/transaction-controller/dist/TransactionController.js +@@ -4,7 +4,7 @@ + + + +-var _chunkS7Q622ISjs = require('./chunk-S7Q622IS.js'); ++var _chunk4M5OIUIUjs = require('./chunk-4M5OIUIU.js'); + require('./chunk-PRUNMTRD.js'); + require('./chunk-74W7X6BE.js'); + require('./chunk-KT6UAKBB.js'); +@@ -18,22 +18,22 @@ require('./chunk-NYKRCWBG.js'); + require('./chunk-WR5F34OW.js'); + require('./chunk-YVCX6Z75.js'); + require('./chunk-TJMQEH57.js'); +-require('./chunk-2EU6346V.js'); ++require('./chunk-5ITD3JI5.js'); + require('./chunk-2XKEAKQG.js'); + require('./chunk-RHDPOIS4.js'); + require('./chunk-6OLJWLKK.js'); + require('./chunk-7NMV2NPM.js'); + require('./chunk-XVYXRCRL.js'); + require('./chunk-HMOSP33F.js'); +-require('./chunk-ARZHJFVG.js'); +-require('./chunk-QTKXIDGE.js'); +-require('./chunk-C3WC4OJ3.js'); ++require('./chunk-4SXPHQZR.js'); ++require('./chunk-5G4OGDYP.js'); ++require('./chunk-XGCT4DDW.js'); + require('./chunk-QH2H4W3N.js'); + require('./chunk-OZ6UB42C.js'); +-require('./chunk-76FONEDA.js'); ++require('./chunk-OEMCU4FY.js'); + require('./chunk-UGN7PBON.js'); + require('./chunk-S6VGOPUY.js'); +-require('./chunk-AYTU4HU5.js'); ++require('./chunk-VWDGWDFV.js'); + require('./chunk-Z4BLTVTB.js'); + + +@@ -41,5 +41,5 @@ require('./chunk-Z4BLTVTB.js'); + + + +-exports.ApprovalState = _chunkS7Q622ISjs.ApprovalState; exports.CANCEL_RATE = _chunkS7Q622ISjs.CANCEL_RATE; exports.HARDFORK = _chunkS7Q622ISjs.HARDFORK; exports.SPEED_UP_RATE = _chunkS7Q622ISjs.SPEED_UP_RATE; exports.TransactionController = _chunkS7Q622ISjs.TransactionController; ++exports.ApprovalState = _chunk4M5OIUIUjs.ApprovalState; exports.CANCEL_RATE = _chunk4M5OIUIUjs.CANCEL_RATE; exports.HARDFORK = _chunk4M5OIUIUjs.HARDFORK; exports.SPEED_UP_RATE = _chunk4M5OIUIUjs.SPEED_UP_RATE; exports.TransactionController = _chunk4M5OIUIUjs.TransactionController; + //# sourceMappingURL=TransactionController.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/TransactionController.js.map b/node_modules/@metamask/transaction-controller/dist/TransactionController.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/TransactionController.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs b/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs +index ac7d4c2..bc3c9ac 100644 +--- a/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs +@@ -4,7 +4,7 @@ import { + HARDFORK, + SPEED_UP_RATE, + TransactionController +-} from "./chunk-UKV5HIMT.mjs"; ++} from "./chunk-XVQU7RNY.mjs"; + import "./chunk-6DDVVUJC.mjs"; + import "./chunk-EVL6KODQ.mjs"; + import "./chunk-K4KOSAGM.mjs"; +@@ -18,22 +18,22 @@ import "./chunk-VEVVBHP3.mjs"; + import "./chunk-Z4GV3YQQ.mjs"; + import "./chunk-FG74Z3F5.mjs"; + import "./chunk-FMRLPVFZ.mjs"; +-import "./chunk-SFFTNB2X.mjs"; ++import "./chunk-TKS27C32.mjs"; + import "./chunk-NOHEXQ7Y.mjs"; + import "./chunk-3ZV5YEUV.mjs"; + import "./chunk-4V4XIPCI.mjs"; + import "./chunk-EKJXGERC.mjs"; + import "./chunk-EGQCE3FK.mjs"; + import "./chunk-HQSNKCXI.mjs"; +-import "./chunk-UHG2LLVV.mjs"; +-import "./chunk-H2KZOK3J.mjs"; +-import "./chunk-VXNPVIYL.mjs"; ++import "./chunk-XW5Y6OXZ.mjs"; ++import "./chunk-JQDBXSCG.mjs"; ++import "./chunk-UUBV6ROF.mjs"; + import "./chunk-GNAL5HC2.mjs"; + import "./chunk-Q56I5ONX.mjs"; +-import "./chunk-JXXTNVU4.mjs"; ++import "./chunk-GRMANXAN.mjs"; + import "./chunk-O6ZZVIFH.mjs"; + import "./chunk-UQQWZT6C.mjs"; +-import "./chunk-6SJYXSF3.mjs"; ++import "./chunk-UF4IMTUO.mjs"; + import "./chunk-XUI43LEZ.mjs"; + export { + ApprovalState, +diff --git a/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs.map b/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/TransactionController.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-2EU6346V.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-2EU6346V.js.map +deleted file mode 100644 +index 2fcdf92..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-2EU6346V.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/GasFeePoller.ts"],"names":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,QAAQ,CAAC,EAAE;AAAA,IACpE,OAAO,CAAC,SAAS,eAAe,MAAM;AACpC,aAAO;AAAA,QACL;AAAA,QACA,MAAM,mBAAK,+BAAL,WAAmC,EAAE,gBAAgB;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAEA,SAAO,IAAI,IAAI,MAAM,QAAQ,IAAI,aAAa,CAAC;AACjD","sourcesContent":["import EthQuery from '@metamask/eth-query';\nimport type {\n FetchGasFeeEstimateOptions,\n GasFeeState,\n} from '@metamask/gas-fee-controller';\nimport type { NetworkClientId, Provider } from '@metamask/network-controller';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\nimport EventEmitter from 'events';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n Layer1GasFeeFlow,\n} from '../types';\nimport { TransactionStatus, type TransactionMeta } from '../types';\nimport { getGasFeeFlow } from '../utils/gas-flow';\nimport { getTransactionLayer1GasFee } from '../utils/layer1-gas-fee-flow';\n\nconst log = createModuleLogger(projectLogger, 'gas-fee-poller');\n\nconst INTERVAL_MILLISECONDS = 10000;\n\n/**\n * Automatically polls and updates suggested gas fees on unapproved transactions.\n */\nexport class GasFeePoller {\n hub: EventEmitter = new EventEmitter();\n\n #findNetworkClientIdByChainId: (chainId: Hex) => NetworkClientId | undefined;\n\n #gasFeeFlows: GasFeeFlow[];\n\n #getGasFeeControllerEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n\n #getProvider: (chainId: Hex, networkClientId?: NetworkClientId) => Provider;\n\n #getTransactions: () => TransactionMeta[];\n\n #layer1GasFeeFlows: Layer1GasFeeFlow[];\n\n #timeout: ReturnType | undefined;\n\n #running = false;\n\n /**\n * Constructs a new instance of the GasFeePoller.\n * @param options - The options for this instance.\n * @param options.findNetworkClientIdByChainId - Callback to find the network client ID by chain ID.\n * @param options.gasFeeFlows - The gas fee flows to use to obtain suitable gas fees.\n * @param options.getGasFeeControllerEstimates - Callback to obtain the default fee estimates.\n * @param options.getProvider - Callback to obtain a provider instance.\n * @param options.getTransactions - Callback to obtain the transaction data.\n * @param options.layer1GasFeeFlows - The layer 1 gas fee flows to use to obtain suitable layer 1 gas fees.\n * @param options.onStateChange - Callback to register a listener for controller state changes.\n */\n constructor({\n findNetworkClientIdByChainId,\n gasFeeFlows,\n getGasFeeControllerEstimates,\n getProvider,\n getTransactions,\n layer1GasFeeFlows,\n onStateChange,\n }: {\n findNetworkClientIdByChainId: (chainId: Hex) => NetworkClientId | undefined;\n gasFeeFlows: GasFeeFlow[];\n getGasFeeControllerEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n getProvider: (chainId: Hex, networkClientId?: NetworkClientId) => Provider;\n getTransactions: () => TransactionMeta[];\n layer1GasFeeFlows: Layer1GasFeeFlow[];\n onStateChange: (listener: () => void) => void;\n }) {\n this.#findNetworkClientIdByChainId = findNetworkClientIdByChainId;\n this.#gasFeeFlows = gasFeeFlows;\n this.#layer1GasFeeFlows = layer1GasFeeFlows;\n this.#getGasFeeControllerEstimates = getGasFeeControllerEstimates;\n this.#getProvider = getProvider;\n this.#getTransactions = getTransactions;\n\n onStateChange(() => {\n const unapprovedTransactions = this.#getUnapprovedTransactions();\n\n if (unapprovedTransactions.length) {\n this.#start();\n } else {\n this.#stop();\n }\n });\n }\n\n #start() {\n if (this.#running) {\n return;\n }\n\n // Intentionally not awaiting since this starts the timeout chain.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#onTimeout();\n\n this.#running = true;\n\n log('Started polling');\n }\n\n #stop() {\n if (!this.#running) {\n return;\n }\n\n clearTimeout(this.#timeout);\n\n this.#timeout = undefined;\n this.#running = false;\n\n log('Stopped polling');\n }\n\n async #onTimeout() {\n await this.#updateUnapprovedTransactions();\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#timeout = setTimeout(() => this.#onTimeout(), INTERVAL_MILLISECONDS);\n }\n\n async #updateUnapprovedTransactions() {\n const unapprovedTransactions = this.#getUnapprovedTransactions();\n\n if (!unapprovedTransactions.length) {\n return;\n }\n\n log('Found unapproved transactions', unapprovedTransactions.length);\n\n const gasFeeControllerDataByChainId = await this.#getGasFeeControllerData(\n unapprovedTransactions,\n );\n\n log('Retrieved gas fee controller data', gasFeeControllerDataByChainId);\n\n await Promise.all(\n unapprovedTransactions.flatMap((tx) => {\n const { chainId } = tx;\n\n const gasFeeControllerData = gasFeeControllerDataByChainId.get(\n chainId,\n ) as GasFeeState;\n\n return this.#updateUnapprovedTransaction(tx, gasFeeControllerData);\n }),\n );\n }\n\n async #updateUnapprovedTransaction(\n transactionMeta: TransactionMeta,\n gasFeeControllerData: GasFeeState,\n ) {\n const { id } = transactionMeta;\n\n const [gasFeeEstimatesResponse, layer1GasFee] = await Promise.all([\n this.#updateTransactionGasFeeEstimates(\n transactionMeta,\n gasFeeControllerData,\n ),\n this.#updateTransactionLayer1GasFee(transactionMeta),\n ]);\n\n if (!gasFeeEstimatesResponse && !layer1GasFee) {\n return;\n }\n\n this.hub.emit('transaction-updated', {\n transactionId: id,\n gasFeeEstimates: gasFeeEstimatesResponse?.gasFeeEstimates,\n gasFeeEstimatesLoaded: gasFeeEstimatesResponse?.gasFeeEstimatesLoaded,\n layer1GasFee,\n });\n }\n\n async #updateTransactionGasFeeEstimates(\n transactionMeta: TransactionMeta,\n gasFeeControllerData: GasFeeState,\n ): Promise<\n | { gasFeeEstimates?: GasFeeEstimates; gasFeeEstimatesLoaded: boolean }\n | undefined\n > {\n const { chainId, networkClientId } = transactionMeta;\n\n const ethQuery = new EthQuery(this.#getProvider(chainId, networkClientId));\n const gasFeeFlow = getGasFeeFlow(transactionMeta, this.#gasFeeFlows);\n\n if (gasFeeFlow) {\n log(\n 'Found gas fee flow',\n gasFeeFlow.constructor.name,\n transactionMeta.id,\n );\n }\n\n const request: GasFeeFlowRequest = {\n ethQuery,\n gasFeeControllerData,\n transactionMeta,\n };\n\n let gasFeeEstimates: GasFeeEstimates | undefined;\n\n if (gasFeeFlow) {\n try {\n const response = await gasFeeFlow.getGasFees(request);\n gasFeeEstimates = response.estimates;\n } catch (error) {\n log('Failed to get suggested gas fees', transactionMeta.id, error);\n }\n }\n\n if (!gasFeeEstimates && transactionMeta.gasFeeEstimatesLoaded) {\n return undefined;\n }\n\n log('Updated gas fee estimates', {\n gasFeeEstimates,\n transaction: transactionMeta.id,\n });\n\n return { gasFeeEstimates, gasFeeEstimatesLoaded: true };\n }\n\n async #updateTransactionLayer1GasFee(\n transactionMeta: TransactionMeta,\n ): Promise {\n const { chainId, networkClientId } = transactionMeta;\n const provider = this.#getProvider(chainId, networkClientId);\n\n const layer1GasFee = await getTransactionLayer1GasFee({\n layer1GasFeeFlows: this.#layer1GasFeeFlows,\n provider,\n transactionMeta,\n });\n\n if (layer1GasFee) {\n log('Updated layer 1 gas fee', layer1GasFee, transactionMeta.id);\n }\n\n return layer1GasFee;\n }\n\n #getUnapprovedTransactions() {\n return this.#getTransactions().filter(\n (tx) => tx.status === TransactionStatus.unapproved,\n );\n }\n\n async #getGasFeeControllerData(\n transactions: TransactionMeta[],\n ): Promise> {\n const networkClientIdsByChainId = new Map();\n\n for (const transaction of transactions) {\n const { chainId, networkClientId: transactionNetworkClientId } =\n transaction;\n\n if (networkClientIdsByChainId.has(chainId)) {\n continue;\n }\n\n const networkClientId =\n transactionNetworkClientId ??\n (this.#findNetworkClientIdByChainId(chainId) as string);\n\n networkClientIdsByChainId.set(chainId, networkClientId);\n }\n\n log('Extracted network client IDs by chain ID', networkClientIdsByChainId);\n\n const entryPromises = Array.from(networkClientIdsByChainId.entries()).map(\n async ([chainId, networkClientId]) => {\n return [\n chainId,\n await this.#getGasFeeControllerEstimates({ networkClientId }),\n ] as const;\n },\n );\n\n return new Map(await Promise.all(entryPromises));\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-2XKEAKQG.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-2XKEAKQG.js.map +deleted file mode 100644 +index 9af28b8..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-2XKEAKQG.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/layer1-gas-fee-flow.ts"],"names":[],"mappings":";;;;;AACA,SAAS,0BAAoC;AAK7C,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAepE,eAAsB,8BACpB,SACA;AACA,QAAM,eAAe,MAAM,2BAA2B,OAAO;AAE7D,MAAI,CAAC,cAAc;AACjB;AAAA,EACF;AAEA,QAAM,EAAE,gBAAgB,IAAI;AAE5B,kBAAgB,eAAe;AAE/B,MAAI,2BAA2B,cAAc,gBAAgB,EAAE;AACjE;AAQA,SAAS,oBACP,iBACA,mBAC8B;AAC9B,SAAO,kBAAkB;AAAA,IAAK,CAAC,qBAC7B,iBAAiB,mBAAmB,eAAe;AAAA,EACrD;AACF;AASA,eAAsB,2BAA2B;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AACF,GAAwD;AACtD,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,MAAI,CAAC,kBAAkB;AACrB,WAAO;AAAA,EACT;AAEA;AAAA,IACE;AAAA,IACA,iBAAiB,YAAY;AAAA,IAC7B,gBAAgB;AAAA,EAClB;AAEA,MAAI;AACF,UAAM,EAAE,UAAU,IAAI,MAAM,iBAAiB,aAAa;AAAA,MACxD;AAAA,MACA;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT,SAAS,OAAO;AACd,QAAI,iCAAiC,gBAAgB,IAAI,KAAK;AAC9D,WAAO;AAAA,EACT;AACF","sourcesContent":["import type { Provider } from '@metamask/network-controller';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type { Layer1GasFeeFlow, TransactionMeta } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'layer-1-gas-fee-flow');\n\nexport type UpdateLayer1GasFeeRequest = {\n layer1GasFeeFlows: Layer1GasFeeFlow[];\n provider: Provider;\n transactionMeta: TransactionMeta;\n};\n\n/**\n * Updates the given transactionMeta with the layer 1 gas fee.\n * @param request - The request to use when getting the layer 1 gas fee.\n * @param request.provider - Provider used to create a new underlying EthQuery instance\n * @param request.transactionMeta - The transaction to get the layer 1 gas fee for.\n * @param request.layer1GasFeeFlows - The layer 1 gas fee flows to search.\n */\nexport async function updateTransactionLayer1GasFee(\n request: UpdateLayer1GasFeeRequest,\n) {\n const layer1GasFee = await getTransactionLayer1GasFee(request);\n\n if (!layer1GasFee) {\n return;\n }\n\n const { transactionMeta } = request;\n\n transactionMeta.layer1GasFee = layer1GasFee;\n\n log('Updated layer 1 gas fee', layer1GasFee, transactionMeta.id);\n}\n\n/**\n * Get the layer 1 gas fee flow for a transaction.\n * @param transactionMeta - The transaction to get the layer 1 gas fee flow for.\n * @param layer1GasFeeFlows - The layer 1 gas fee flows to search.\n * @returns The layer 1 gas fee flow for the transaction, or undefined if none match.\n */\nfunction getLayer1GasFeeFlow(\n transactionMeta: TransactionMeta,\n layer1GasFeeFlows: Layer1GasFeeFlow[],\n): Layer1GasFeeFlow | undefined {\n return layer1GasFeeFlows.find((layer1GasFeeFlow) =>\n layer1GasFeeFlow.matchesTransaction(transactionMeta),\n );\n}\n\n/**\n * Get the layer 1 gas fee for a transaction and return the layer1Fee.\n * @param request - The request to use when getting the layer 1 gas fee.\n * @param request.layer1GasFeeFlows - The layer 1 gas fee flows to search.\n * @param request.provider - The provider to use to get the layer 1 gas fee.\n * @param request.transactionMeta - The transaction to get the layer 1 gas fee for.\n */\nexport async function getTransactionLayer1GasFee({\n layer1GasFeeFlows,\n provider,\n transactionMeta,\n}: UpdateLayer1GasFeeRequest): Promise {\n const layer1GasFeeFlow = getLayer1GasFeeFlow(\n transactionMeta,\n layer1GasFeeFlows,\n );\n\n if (!layer1GasFeeFlow) {\n return undefined;\n }\n\n log(\n 'Found layer 1 gas fee flow',\n layer1GasFeeFlow.constructor.name,\n transactionMeta.id,\n );\n\n try {\n const { layer1Fee } = await layer1GasFeeFlow.getLayer1Fee({\n provider,\n transactionMeta,\n });\n return layer1Fee;\n } catch (error) {\n log('Failed to get layer 1 gas fee', transactionMeta.id, error);\n return undefined;\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-3ZV5YEUV.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-3ZV5YEUV.mjs.map +deleted file mode 100644 +index 70a90d4..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-3ZV5YEUV.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/IncomingTransactionHelper.ts"],"sourcesContent":["import type { AccountsController } from '@metamask/accounts-controller';\nimport type { BlockTracker } from '@metamask/network-controller';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport EventEmitter from 'events';\n\nimport { incomingTransactionsLogger as log } from '../logger';\nimport type { RemoteTransactionSource, TransactionMeta } from '../types';\n\nconst RECENT_HISTORY_BLOCK_RANGE = 10;\n\n// TODO: Replace `any` with type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst UPDATE_CHECKS: ((txMeta: TransactionMeta) => any)[] = [\n (txMeta) => txMeta.status,\n (txMeta) => txMeta.txParams.gasUsed,\n];\n\n/**\n * Configuration options for the IncomingTransactionHelper\n *\n * @property includeTokenTransfers - Whether or not to include ERC20 token transfers.\n * @property isEnabled - Whether or not incoming transaction retrieval is enabled.\n * @property queryEntireHistory - Whether to initially query the entire transaction history or only recent blocks.\n * @property updateTransactions - Whether to update local transactions using remote transaction data.\n */\nexport type IncomingTransactionOptions = {\n includeTokenTransfers?: boolean;\n isEnabled?: () => boolean;\n queryEntireHistory?: boolean;\n updateTransactions?: boolean;\n};\n\nexport class IncomingTransactionHelper {\n hub: EventEmitter;\n\n #blockTracker: BlockTracker;\n\n #getCurrentAccount: () => ReturnType<\n AccountsController['getSelectedAccount']\n >;\n\n #getLastFetchedBlockNumbers: () => Record;\n\n #getLocalTransactions: () => TransactionMeta[];\n\n #getChainId: () => Hex;\n\n #isEnabled: () => boolean;\n\n #isRunning: boolean;\n\n #mutex = new Mutex();\n\n #onLatestBlock: (blockNumberHex: Hex) => Promise;\n\n #queryEntireHistory: boolean;\n\n #remoteTransactionSource: RemoteTransactionSource;\n\n #transactionLimit?: number;\n\n #updateTransactions: boolean;\n\n constructor({\n blockTracker,\n getCurrentAccount,\n getLastFetchedBlockNumbers,\n getLocalTransactions,\n getChainId,\n isEnabled,\n queryEntireHistory,\n remoteTransactionSource,\n transactionLimit,\n updateTransactions,\n }: {\n blockTracker: BlockTracker;\n getCurrentAccount: () => ReturnType<\n AccountsController['getSelectedAccount']\n >;\n getLastFetchedBlockNumbers: () => Record;\n getLocalTransactions?: () => TransactionMeta[];\n getChainId: () => Hex;\n isEnabled?: () => boolean;\n queryEntireHistory?: boolean;\n remoteTransactionSource: RemoteTransactionSource;\n transactionLimit?: number;\n updateTransactions?: boolean;\n }) {\n this.hub = new EventEmitter();\n\n this.#blockTracker = blockTracker;\n this.#getCurrentAccount = getCurrentAccount;\n this.#getLastFetchedBlockNumbers = getLastFetchedBlockNumbers;\n this.#getLocalTransactions = getLocalTransactions || (() => []);\n this.#getChainId = getChainId;\n this.#isEnabled = isEnabled ?? (() => true);\n this.#isRunning = false;\n this.#queryEntireHistory = queryEntireHistory ?? true;\n this.#remoteTransactionSource = remoteTransactionSource;\n this.#transactionLimit = transactionLimit;\n this.#updateTransactions = updateTransactions ?? false;\n\n // Using a property instead of a method to provide a listener reference\n // with the correct scope that we can remove later if stopped.\n this.#onLatestBlock = async (blockNumberHex: Hex) => {\n try {\n await this.update(blockNumberHex);\n } catch (error) {\n console.error('Error while checking incoming transactions', error);\n }\n };\n }\n\n start() {\n if (this.#isRunning) {\n return;\n }\n\n if (!this.#canStart()) {\n return;\n }\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#blockTracker.addListener('latest', this.#onLatestBlock);\n this.#isRunning = true;\n }\n\n stop() {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#blockTracker.removeListener('latest', this.#onLatestBlock);\n this.#isRunning = false;\n }\n\n async update(latestBlockNumberHex?: Hex): Promise {\n const releaseLock = await this.#mutex.acquire();\n\n log('Checking for incoming transactions');\n\n try {\n if (!this.#canStart()) {\n return;\n }\n\n const latestBlockNumber = parseInt(\n latestBlockNumberHex || (await this.#blockTracker.getLatestBlock()),\n 16,\n );\n\n const additionalLastFetchedKeys =\n this.#remoteTransactionSource.getLastBlockVariations?.() ?? [];\n\n const fromBlock = this.#getFromBlock(latestBlockNumber);\n const account = this.#getCurrentAccount();\n const currentChainId = this.#getChainId();\n\n let remoteTransactions = [];\n\n try {\n remoteTransactions =\n await this.#remoteTransactionSource.fetchTransactions({\n address: account.address,\n currentChainId,\n fromBlock,\n limit: this.#transactionLimit,\n });\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n log('Error while fetching remote transactions', error);\n return;\n }\n if (!this.#updateTransactions) {\n const address = account.address.toLowerCase();\n remoteTransactions = remoteTransactions.filter(\n (tx) => tx.txParams.to?.toLowerCase() === address,\n );\n }\n\n const localTransactions = !this.#updateTransactions\n ? []\n : this.#getLocalTransactions();\n\n const newTransactions = this.#getNewTransactions(\n remoteTransactions,\n localTransactions,\n );\n\n const updatedTransactions = this.#getUpdatedTransactions(\n remoteTransactions,\n localTransactions,\n );\n\n if (newTransactions.length > 0 || updatedTransactions.length > 0) {\n this.#sortTransactionsByTime(newTransactions);\n this.#sortTransactionsByTime(updatedTransactions);\n\n log('Found incoming transactions', {\n new: newTransactions,\n updated: updatedTransactions,\n });\n\n this.hub.emit('transactions', {\n added: newTransactions,\n updated: updatedTransactions,\n });\n }\n this.#updateLastFetchedBlockNumber(\n remoteTransactions,\n additionalLastFetchedKeys,\n );\n } finally {\n releaseLock();\n }\n }\n\n #sortTransactionsByTime(transactions: TransactionMeta[]) {\n transactions.sort((a, b) => (a.time < b.time ? -1 : 1));\n }\n\n #getNewTransactions(\n remoteTxs: TransactionMeta[],\n localTxs: TransactionMeta[],\n ): TransactionMeta[] {\n return remoteTxs.filter(\n (tx) => !localTxs.some(({ hash }) => hash === tx.hash),\n );\n }\n\n #getUpdatedTransactions(\n remoteTxs: TransactionMeta[],\n localTxs: TransactionMeta[],\n ): TransactionMeta[] {\n return remoteTxs.filter((remoteTx) =>\n localTxs.some(\n (localTx) =>\n remoteTx.hash === localTx.hash &&\n this.#isTransactionOutdated(remoteTx, localTx),\n ),\n );\n }\n\n #isTransactionOutdated(\n remoteTx: TransactionMeta,\n localTx: TransactionMeta,\n ): boolean {\n return UPDATE_CHECKS.some(\n (getValue) => getValue(remoteTx) !== getValue(localTx),\n );\n }\n\n #getLastFetchedBlockNumberDec(): number {\n const additionalLastFetchedKeys =\n this.#remoteTransactionSource.getLastBlockVariations?.() ?? [];\n const lastFetchedKey = this.#getBlockNumberKey(additionalLastFetchedKeys);\n const lastFetchedBlockNumbers = this.#getLastFetchedBlockNumbers();\n return lastFetchedBlockNumbers[lastFetchedKey];\n }\n\n #getFromBlock(latestBlockNumber: number): number | undefined {\n const lastFetchedBlockNumber = this.#getLastFetchedBlockNumberDec();\n\n if (lastFetchedBlockNumber) {\n return lastFetchedBlockNumber + 1;\n }\n\n return this.#queryEntireHistory\n ? undefined\n : latestBlockNumber - RECENT_HISTORY_BLOCK_RANGE;\n }\n\n #updateLastFetchedBlockNumber(\n remoteTxs: TransactionMeta[],\n additionalKeys: string[],\n ) {\n let lastFetchedBlockNumber = -1;\n\n for (const tx of remoteTxs) {\n const currentBlockNumberValue = tx.blockNumber\n ? parseInt(tx.blockNumber, 10)\n : -1;\n\n lastFetchedBlockNumber = Math.max(\n lastFetchedBlockNumber,\n currentBlockNumberValue,\n );\n }\n\n if (lastFetchedBlockNumber === -1) {\n return;\n }\n\n const lastFetchedKey = this.#getBlockNumberKey(additionalKeys);\n const lastFetchedBlockNumbers = this.#getLastFetchedBlockNumbers();\n const previousValue = lastFetchedBlockNumbers[lastFetchedKey];\n\n if (previousValue >= lastFetchedBlockNumber) {\n return;\n }\n\n this.hub.emit('updatedLastFetchedBlockNumbers', {\n lastFetchedBlockNumbers: {\n ...lastFetchedBlockNumbers,\n [lastFetchedKey]: lastFetchedBlockNumber,\n },\n blockNumber: lastFetchedBlockNumber,\n });\n }\n\n #getBlockNumberKey(additionalKeys: string[]): string {\n const currentChainId = this.#getChainId();\n const currentAccount = this.#getCurrentAccount()?.address.toLowerCase();\n\n return [currentChainId, currentAccount, ...additionalKeys].join('#');\n }\n\n #canStart(): boolean {\n const isEnabled = this.#isEnabled();\n const currentChainId = this.#getChainId();\n\n const isSupportedNetwork =\n this.#remoteTransactionSource.isSupportedNetwork(currentChainId);\n\n return isEnabled && isSupportedNetwork;\n }\n}\n"],"mappings":";;;;;;;;;;;AAGA,SAAS,aAAa;AACtB,OAAO,kBAAkB;AAKzB,IAAM,6BAA6B;AAInC,IAAM,gBAAsD;AAAA,EAC1D,CAAC,WAAW,OAAO;AAAA,EACnB,CAAC,WAAW,OAAO,SAAS;AAC9B;AAhBA;AAiCO,IAAM,4BAAN,MAAgC;AAAA,EA+BrC,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAaG;AAkIH;AAIA;AASA;AAaA;AASA;AAQA;AAYA;AAsCA;AAOA;AA1RA;AAEA;AAIA;AAEA;AAEA;AAEA;AAEA;AAEA,+BAAS,IAAI,MAAM;AAEnB;AAEA;AAEA;AAEA;AAEA;AA2BE,SAAK,MAAM,IAAI,aAAa;AAE5B,uBAAK,eAAgB;AACrB,uBAAK,oBAAqB;AAC1B,uBAAK,6BAA8B;AACnC,uBAAK,uBA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vB,QAAM,iBAAiB,mBAAK,oBAAL,YAA2B,QAAQ,YAAY;AAEtE,SAAO,CAAC,gBAAgB,gBAAgB,GAAG,cAAc,EAAE,KAAK,GAAG;AACrE;AAEA;AAAA,cAAS,WAAY;AACnB,QAAM,YAAY,mBAAK,YAAL;AAClB,QAAM,iBAAiB,mBAAK,aAAL;AAEvB,QAAM,qBACJ,mBAAK,0BAAyB,mBAAmB,cAAc;AAEjE,SAAO,aAAa;AACtB;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-S7Q622IS.js b/node_modules/@metamask/transaction-controller/dist/chunk-4M5OIUIU.js +similarity index 97% +rename from node_modules/@metamask/transaction-controller/dist/chunk-S7Q622IS.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-4M5OIUIU.js +index 295d59e..05d18a9 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-S7Q622IS.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-4M5OIUIU.js +@@ -38,7 +38,7 @@ var _chunkWR5F34OWjs = require('./chunk-WR5F34OW.js'); + var _chunkTJMQEH57js = require('./chunk-TJMQEH57.js'); + + +-var _chunk2EU6346Vjs = require('./chunk-2EU6346V.js'); ++var _chunk5ITD3JI5js = require('./chunk-5ITD3JI5.js'); + + + +@@ -54,13 +54,13 @@ var _chunk6OLJWLKKjs = require('./chunk-6OLJWLKK.js'); + var _chunk7NMV2NPMjs = require('./chunk-7NMV2NPM.js'); + + +-var _chunkARZHJFVGjs = require('./chunk-ARZHJFVG.js'); ++var _chunk4SXPHQZRjs = require('./chunk-4SXPHQZR.js'); + + +-var _chunkQTKXIDGEjs = require('./chunk-QTKXIDGE.js'); ++var _chunk5G4OGDYPjs = require('./chunk-5G4OGDYP.js'); + + +-var _chunkC3WC4OJ3js = require('./chunk-C3WC4OJ3.js'); ++var _chunkXGCT4DDWjs = require('./chunk-XGCT4DDW.js'); + + + +@@ -79,7 +79,7 @@ var _chunkQH2H4W3Njs = require('./chunk-QH2H4W3N.js'); + var _chunkOZ6UB42Cjs = require('./chunk-OZ6UB42C.js'); + + +-var _chunk76FONEDAjs = require('./chunk-76FONEDA.js'); ++var _chunkOEMCU4FYjs = require('./chunk-OEMCU4FY.js'); + + + var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js'); +@@ -124,9 +124,14 @@ var metadata = { + lastFetchedBlockNumbers: { + persist: true, + anonymous: false ++ }, ++ submitHistory: { ++ persist: true, ++ anonymous: false + } + }; + var HARDFORK = _common.Hardfork.London; ++var SUBMIT_HISTORY_LIMIT = 100; + var CANCEL_RATE = 1.1; + var SPEED_UP_RATE = 1.1; + var controllerName = "TransactionController"; +@@ -140,10 +145,11 @@ function getDefaultTransactionControllerState() { + return { + methodData: {}, + transactions: [], +- lastFetchedBlockNumbers: {} ++ lastFetchedBlockNumbers: {}, ++ submitHistory: [] + }; + } +-var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _testGasFeeFlows, _multichainTrackingHelper, _createNonceTracker, createNonceTracker_fn, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn, _createPendingTransactionTracker, createPendingTransactionTracker_fn, _checkForPendingTransactionAndStartPolling, _stopAllTracking, stopAllTracking_fn, _removeIncomingTransactionHelperListeners, removeIncomingTransactionHelperListeners_fn, _addIncomingTransactionHelperListeners, addIncomingTransactionHelperListeners_fn, _removePendingTransactionTrackerListeners, removePendingTransactionTrackerListeners_fn, _addPendingTransactionTrackerListeners, addPendingTransactionTrackerListeners_fn, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn, _getGasFeeFlows, getGasFeeFlows_fn, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn, _updateTransactionInternal, updateTransactionInternal_fn, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn, _updateSimulationData, updateSimulationData_fn, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn, _getNetworkClientId, getNetworkClientId_fn, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn, _getGlobalChainId, getGlobalChainId_fn, _isCustomNetwork, isCustomNetwork_fn, _getSelectedAccount, getSelectedAccount_fn; ++var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _testGasFeeFlows, _multichainTrackingHelper, _createNonceTracker, createNonceTracker_fn, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn, _createPendingTransactionTracker, createPendingTransactionTracker_fn, _checkForPendingTransactionAndStartPolling, _stopAllTracking, stopAllTracking_fn, _removeIncomingTransactionHelperListeners, removeIncomingTransactionHelperListeners_fn, _addIncomingTransactionHelperListeners, addIncomingTransactionHelperListeners_fn, _removePendingTransactionTrackerListeners, removePendingTransactionTrackerListeners_fn, _addPendingTransactionTrackerListeners, addPendingTransactionTrackerListeners_fn, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn, _getGasFeeFlows, getGasFeeFlows_fn, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn, _updateTransactionInternal, updateTransactionInternal_fn, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn, _updateSimulationData, updateSimulationData_fn, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn, _getNetworkClientId, getNetworkClientId_fn, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn, _getGlobalChainId, getGlobalChainId_fn, _isCustomNetwork, isCustomNetwork_fn, _getSelectedAccount, getSelectedAccount_fn, _updateSubmitHistory, updateSubmitHistory_fn; + var TransactionController = class extends _basecontroller.BaseController { + /** + * Constructs a TransactionController. +@@ -232,6 +238,7 @@ var TransactionController = class extends _basecontroller.BaseController { + _chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getGlobalChainId); + _chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _isCustomNetwork); + _chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getSelectedAccount); ++ _chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _updateSubmitHistory); + _chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _internalEvents, new (0, _events.EventEmitter)()); + this.approvingTransactionIds = /* @__PURE__ */ new Set(); + this.mutex = new (0, _asyncmutex.Mutex)(); +@@ -321,7 +328,7 @@ var TransactionController = class extends _basecontroller.BaseController { + }); + this.gasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGasFeeFlows, getGasFeeFlows_fn).call(this); + this.layer1GasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn).call(this); +- const gasFeePoller = new (0, _chunk2EU6346Vjs.GasFeePoller)({ ++ const gasFeePoller = new (0, _chunk5ITD3JI5js.GasFeePoller)({ + findNetworkClientIdByChainId, + gasFeeFlows: this.gasFeeFlows, + getGasFeeControllerEstimates: this.getGasFeeEstimates, +@@ -669,7 +676,9 @@ var TransactionController = class extends _basecontroller.BaseController { + const hash = await this.publishTransactionForRetry( + ethQuery, + rawTx, +- transactionMeta ++ newTxParams, ++ transactionMeta, ++ "cancel" + ); + const cancelTransactionMeta = { + actionId, +@@ -787,7 +796,9 @@ var TransactionController = class extends _basecontroller.BaseController { + const hash = await this.publishTransactionForRetry( + ethQuery, + rawTx, +- transactionMeta ++ txParams, ++ transactionMeta, ++ _controllerutils.ORIGIN_METAMASK + ); + const baseTransactionMeta = { + ...transactionMetaWithRsv, +@@ -1396,7 +1407,7 @@ var TransactionController = class extends _basecontroller.BaseController { + chainId, + networkClientId + }; +- const gasFeeFlow = _chunk76FONEDAjs.getGasFeeFlow.call(void 0, ++ const gasFeeFlow = _chunkOEMCU4FYjs.getGasFeeFlow.call(void 0, + transactionMeta, + this.gasFeeFlows + ); +@@ -1517,7 +1528,7 @@ var TransactionController = class extends _basecontroller.BaseController { + isCustomNetwork, + txMeta: transactionMeta + }); +- await _chunkC3WC4OJ3js.updateGasFees.call(void 0, { ++ await _chunkXGCT4DDWjs.updateGasFees.call(void 0, { + eip1559: isEIP1559Compatible, + ethQuery, + gasFeeFlows: this.gasFeeFlows, +@@ -1717,7 +1728,13 @@ var TransactionController = class extends _basecontroller.BaseController { + rawTx + ); + if (hash === void 0) { +- hash = await this.publishTransaction(ethQuery, rawTx); ++ hash = await this.publishTransaction( ++ ethQuery, ++ rawTx, ++ transactionMeta.txParams, ++ transactionMeta.chainId, ++ transactionMeta.origin ++ ); + } + _chunkS6VGOPUYjs.projectLogger.call(void 0, "Publish successful", hash); + transactionMeta = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { +@@ -1749,8 +1766,12 @@ var TransactionController = class extends _basecontroller.BaseController { + cleanupTasks.forEach((task) => task()); + } + } +- async publishTransaction(ethQuery, rawTransaction) { +- return await _controllerutils.query.call(void 0, ethQuery, "sendRawTransaction", [rawTransaction]); ++ async publishTransaction(ethQuery, rawTransaction, transaction, chainId, origin) { ++ const transactionHash = await _controllerutils.query.call(void 0, ethQuery, "sendRawTransaction", [ ++ rawTransaction ++ ]); ++ _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateSubmitHistory, updateSubmitHistory_fn).call(this, rawTransaction, transactionHash, transaction, chainId, origin); ++ return transactionHash; + } + /** + * Cancels a transaction based on its ID by setting its status to "rejected" +@@ -2204,10 +2225,15 @@ var TransactionController = class extends _basecontroller.BaseController { + _chunkS6VGOPUYjs.projectLogger.call(void 0, "Error while updating post transaction balance", error); + } + } +- async publishTransactionForRetry(ethQuery, rawTx, transactionMeta) { ++ async publishTransactionForRetry(ethQuery, rawTx, params, transactionMeta, origin) { + try { +- const hash = await this.publishTransaction(ethQuery, rawTx); +- return hash; ++ return await this.publishTransaction( ++ ethQuery, ++ rawTx, ++ params, ++ transactionMeta.chainId, ++ origin ++ ); + } catch (error) { + if (this.isTransactionAlreadyConfirmedError(error)) { + await this.pendingTransactionTracker.forceCheckTransaction( +@@ -2270,6 +2296,7 @@ createIncomingTransactionHelper_fn = function({ + blockTracker, + getCurrentAccount: () => _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getSelectedAccount, getSelectedAccount_fn).call(this), + getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers, ++ getLocalTransactions: () => this.state.transactions, + getChainId: chainId ? () => chainId : this.getChainId.bind(this), + isEnabled: _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _incomingTransactionOptions).isEnabled, + queryEntireHistory: _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _incomingTransactionOptions).queryEntireHistory, +@@ -2300,7 +2327,7 @@ createPendingTransactionTracker_fn = function({ + getGlobalLock: () => _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).acquireNonceLockForChainIdKey({ + chainId: getChainId() + }), +- publishTransaction: this.publishTransaction.bind(this), ++ publishTransaction: (_ethQuery, rawTx) => _controllerutils.query.call(void 0, _ethQuery, "sendRawTransaction", [rawTx]), + hooks: { + beforeCheckPendingTransaction: this.beforeCheckPendingTransaction.bind(this), + beforePublish: this.beforePublish.bind(this) +@@ -2380,7 +2407,7 @@ getGasFeeFlows_fn = function() { + if (_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _testGasFeeFlows)) { + return [new (0, _chunkTJMQEH57js.TestGasFeeFlow)()]; + } +- return [new (0, _chunkARZHJFVGjs.LineaGasFeeFlow)(), new (0, _chunkQTKXIDGEjs.DefaultGasFeeFlow)()]; ++ return [new (0, _chunk4SXPHQZRjs.LineaGasFeeFlow)(), new (0, _chunk5G4OGDYPjs.DefaultGasFeeFlow)()]; + }; + _getLayer1GasFeeFlows = new WeakSet(); + getLayer1GasFeeFlows_fn = function() { +@@ -2555,6 +2582,32 @@ _getSelectedAccount = new WeakSet(); + getSelectedAccount_fn = function() { + return this.messagingSystem.call("AccountsController:getSelectedAccount"); + }; ++_updateSubmitHistory = new WeakSet(); ++updateSubmitHistory_fn = function(rawTransaction, hash, transaction, chainId, origin) { ++ const { networkConfigurations, selectedNetworkClientId } = this.getNetworkState(); ++ const networkConfiguration = networkConfigurations[selectedNetworkClientId]; ++ const networkUrl = networkConfiguration?.rpcUrl; ++ const networkType = networkConfiguration?.nickname || selectedNetworkClientId; ++ const submitHistoryEntry = { ++ chainId, ++ hash, ++ networkType, ++ networkUrl, ++ origin, ++ time: Date.now(), ++ transaction, ++ rawTransaction ++ }; ++ _chunkS6VGOPUYjs.projectLogger.call(void 0, "Updating submit history", submitHistoryEntry); ++ this.update((state) => { ++ const { submitHistory: currentSubmitHistory } = state; ++ const newSubmitHistory = [submitHistoryEntry, ...currentSubmitHistory]; ++ if (newSubmitHistory.length > SUBMIT_HISTORY_LIMIT) { ++ newSubmitHistory.pop(); ++ } ++ state.submitHistory = newSubmitHistory; ++ }); ++}; + + + +@@ -2563,4 +2616,4 @@ getSelectedAccount_fn = function() { + + + exports.HARDFORK = HARDFORK; exports.CANCEL_RATE = CANCEL_RATE; exports.SPEED_UP_RATE = SPEED_UP_RATE; exports.ApprovalState = ApprovalState; exports.TransactionController = TransactionController; +-//# sourceMappingURL=chunk-S7Q622IS.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-4M5OIUIU.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-ARZHJFVG.js b/node_modules/@metamask/transaction-controller/dist/chunk-4SXPHQZR.js +similarity index 92% +rename from node_modules/@metamask/transaction-controller/dist/chunk-ARZHJFVG.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-4SXPHQZR.js +index 17e99dc..f3d437f 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-ARZHJFVG.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-4SXPHQZR.js +@@ -1,12 +1,12 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +-var _chunkQTKXIDGEjs = require('./chunk-QTKXIDGE.js'); ++var _chunk5G4OGDYPjs = require('./chunk-5G4OGDYP.js'); + + + var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js'); + + +-var _chunkAYTU4HU5js = require('./chunk-AYTU4HU5.js'); ++var _chunkVWDGWDFVjs = require('./chunk-VWDGWDFV.js'); + + + +@@ -48,7 +48,7 @@ var LineaGasFeeFlow = class { + return await _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLineaGasFees, getLineaGasFees_fn).call(this, request); + } catch (error) { + log("Using default flow as fallback due to error", error); +- return new (0, _chunkQTKXIDGEjs.DefaultGasFeeFlow)().getGasFees(request); ++ return new (0, _chunk5G4OGDYPjs.DefaultGasFeeFlow)().getGasFees(request); + } + } + }; +@@ -63,7 +63,7 @@ getLineaGasFees_fn = async function(request) { + log("Generated priority fees", _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _feesToString, feesToString_fn).call(this, priorityFees)); + const maxFees = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getMaxFees, getMaxFees_fn).call(this, baseFees, priorityFees); + log("Generated max fees", _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _feesToString, feesToString_fn).call(this, maxFees)); +- const estimates = Object.values(_chunkAYTU4HU5js.GasFeeEstimateLevel).reduce( ++ const estimates = Object.values(_chunkVWDGWDFVjs.GasFeeEstimateLevel).reduce( + (result, level) => ({ + ...result, + [level]: { +@@ -110,7 +110,7 @@ getMaxFees_fn = function(baseFees, priorityFees) { + }; + _feesToString = new WeakSet(); + feesToString_fn = function(fees) { +- return Object.values(_chunkAYTU4HU5js.GasFeeEstimateLevel).map( ++ return Object.values(_chunkVWDGWDFVjs.GasFeeEstimateLevel).map( + (level) => fees[level].toString(10) + ); + }; +@@ -118,4 +118,4 @@ feesToString_fn = function(fees) { + + + exports.LineaGasFeeFlow = LineaGasFeeFlow; +-//# sourceMappingURL=chunk-ARZHJFVG.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-4SXPHQZR.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-4V4XIPCI.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-4V4XIPCI.mjs.map +deleted file mode 100644 +index 4f02dc7..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-4V4XIPCI.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/MultichainTrackingHelper.ts"],"sourcesContent":["import EthQuery from '@metamask/eth-query';\nimport type {\n NetworkClientId,\n NetworkController,\n NetworkClient,\n BlockTracker,\n Provider,\n NetworkControllerStateChangeEvent,\n} from '@metamask/network-controller';\nimport type { NonceLock, NonceTracker } from '@metamask/nonce-tracker';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\n\nimport { incomingTransactionsLogger as log } from '../logger';\nimport { EtherscanRemoteTransactionSource } from './EtherscanRemoteTransactionSource';\nimport type {\n IncomingTransactionHelper,\n IncomingTransactionOptions,\n} from './IncomingTransactionHelper';\nimport type { PendingTransactionTracker } from './PendingTransactionTracker';\n\n/**\n * Registry of network clients provided by the NetworkController\n */\ntype NetworkClientRegistry = ReturnType<\n NetworkController['getNetworkClientRegistry']\n>;\n\nexport type MultichainTrackingHelperOptions = {\n isMultichainEnabled: boolean;\n provider: Provider;\n nonceTracker: NonceTracker;\n incomingTransactionOptions: IncomingTransactionOptions;\n\n findNetworkClientIdByChainId: NetworkController['findNetworkClientIdByChainId'];\n getNetworkClientById: NetworkController['getNetworkClientById'];\n getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];\n\n removeIncomingTransactionHelperListeners: (\n IncomingTransactionHelper: IncomingTransactionHelper,\n ) => void;\n removePendingTransactionTrackerListeners: (\n pendingTransactionTracker: PendingTransactionTracker,\n ) => void;\n createNonceTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => NonceTracker;\n createIncomingTransactionHelper: (opts: {\n blockTracker: BlockTracker;\n etherscanRemoteTransactionSource: EtherscanRemoteTransactionSource;\n chainId?: Hex;\n }) => IncomingTransactionHelper;\n createPendingTransactionTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => PendingTransactionTracker;\n onNetworkStateChange: (\n listener: (\n ...payload: NetworkControllerStateChangeEvent['payload']\n ) => void,\n ) => void;\n};\n\nexport class MultichainTrackingHelper {\n #isMultichainEnabled: boolean;\n\n readonly #provider: Provider;\n\n readonly #nonceTracker: NonceTracker;\n\n readonly #incomingTransactionOptions: IncomingTransactionOptions;\n\n readonly #findNetworkClientIdByChainId: NetworkController['findNetworkClientIdByChainId'];\n\n readonly #getNetworkClientById: NetworkController['getNetworkClientById'];\n\n readonly #getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];\n\n readonly #removeIncomingTransactionHelperListeners: (\n IncomingTransactionHelper: IncomingTransactionHelper,\n ) => void;\n\n readonly #removePendingTransactionTrackerListeners: (\n pendingTransactionTracker: PendingTransactionTracker,\n ) => void;\n\n readonly #createNonceTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => NonceTracker;\n\n readonly #createIncomingTransactionHelper: (opts: {\n blockTracker: BlockTracker;\n chainId?: Hex;\n etherscanRemoteTransactionSource: EtherscanRemoteTransactionSource;\n }) => IncomingTransactionHelper;\n\n readonly #createPendingTransactionTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => PendingTransactionTracker;\n\n readonly #nonceMutexesByChainId = new Map>();\n\n readonly #trackingMap: Map<\n NetworkClientId,\n {\n nonceTracker: NonceTracker;\n pendingTransactionTracker: PendingTransactionTracker;\n incomingTransactionHelper: IncomingTransactionHelper;\n }\n > = new Map();\n\n readonly #etherscanRemoteTransactionSourcesMap: Map<\n Hex,\n EtherscanRemoteTransactionSource\n > = new Map();\n\n constructor({\n isMultichainEnabled,\n provider,\n nonceTracker,\n incomingTransactionOptions,\n findNetworkClientIdByChainId,\n getNetworkClientById,\n getNetworkClientRegistry,\n removeIncomingTransactionHelperListeners,\n removePendingTransactionTrackerListeners,\n createNonceTracker,\n createIncomingTransactionHelper,\n createPendingTransactionTracker,\n onNetworkStateChange,\n }: MultichainTrackingHelperOptions) {\n this.#isMultichainEnabled = isMultichainEnabled;\n this.#provider = provider;\n this.#nonceTracker = nonceTracker;\n this.#incomingTransactionOptions = incomingTransactionOptions;\n\n this.#findNetworkClientIdByChainId = findNetworkClientIdByChainId;\n this.#getNetworkClientById = getNetworkClientById;\n this.#getNetworkClientRegistry = getNetworkClientRegistry;\n\n this.#removeIncomingTransactionHelperListeners =\n removeIncomingTransactionHelperListeners;\n this.#removePendingTransactionTrackerListeners =\n removePendingTransactionTrackerListeners;\n this.#createNonceTracker = createNonceTracker;\n this.#createIncomingTransactionHelper = createIncomingTransactionHelper;\n this.#createPendingTransactionTracker = createPendingTransactionTracker;\n\n onNetworkStateChange((_, patches) => {\n if (this.#isMultichainEnabled) {\n const networkClients = this.#getNetworkClientRegistry();\n patches.forEach(({ op, path }) => {\n if (op === 'remove' && path[0] === 'networkConfigurations') {\n const networkClientId = path[1] as NetworkClientId;\n delete networkClients[networkClientId];\n }\n });\n\n this.#refreshTrackingMap(networkClients);\n }\n });\n }\n\n initialize() {\n if (!this.#isMultichainEnabled) {\n return;\n }\n const networkClients = this.#getNetworkClientRegistry();\n this.#refreshTrackingMap(networkClients);\n }\n\n has(networkClientId: NetworkClientId) {\n return this.#trackingMap.has(networkClientId);\n }\n\n getEthQuery({\n networkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): EthQuery {\n if (!this.#isMultichainEnabled) {\n return new EthQuery(this.getProvider());\n }\n return new EthQuery(this.getProvider({ networkClientId, chainId }));\n }\n\n getProvider({\n networkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): Provider {\n if (!this.#isMultichainEnabled) {\n return this.#provider;\n }\n\n const networkClient = this.#getNetworkClient({\n networkClientId,\n chainId,\n });\n\n return networkClient?.provider || this.#provider;\n }\n\n /**\n * Gets the mutex intended to guard the nonceTracker for a particular chainId and key .\n *\n * @param opts - The options object.\n * @param opts.chainId - The hex chainId.\n * @param opts.key - The hex address (or constant) pertaining to the chainId\n * @returns Mutex instance for the given chainId and key pair\n */\n async acquireNonceLockForChainIdKey({\n chainId,\n key = 'global',\n }: {\n chainId: Hex;\n key?: string;\n }): Promise<() => void> {\n let nonceMutexesForChainId = this.#nonceMutexesByChainId.get(chainId);\n if (!nonceMutexesForChainId) {\n nonceMutexesForChainId = new Map();\n this.#nonceMutexesByChainId.set(chainId, nonceMutexesForChainId);\n }\n let nonceMutexForKey = nonceMutexesForChainId.get(key);\n if (!nonceMutexForKey) {\n nonceMutexForKey = new Mutex();\n nonceMutexesForChainId.set(key, nonceMutexForKey);\n }\n\n return await nonceMutexForKey.acquire();\n }\n\n /**\n * Gets the next nonce according to the nonce-tracker.\n * Ensure `releaseLock` is called once processing of the `nonce` value is complete.\n *\n * @param address - The hex string address for the transaction.\n * @param networkClientId - The network client ID for the transaction, used to fetch the correct nonce tracker.\n * @returns object with the `nextNonce` `nonceDetails`, and the releaseLock.\n */\n async getNonceLock(\n address: string,\n networkClientId?: NetworkClientId,\n ): Promise {\n let releaseLockForChainIdKey: (() => void) | undefined;\n let nonceTracker = this.#nonceTracker;\n if (networkClientId && this.#isMultichainEnabled) {\n const networkClient = this.#getNetworkClientById(networkClientId);\n releaseLockForChainIdKey = await this.acquireNonceLockForChainIdKey({\n chainId: networkClient.configuration.chainId,\n key: address,\n });\n const trackers = this.#trackingMap.get(networkClientId);\n if (!trackers) {\n throw new Error('missing nonceTracker for networkClientId');\n }\n nonceTracker = trackers.nonceTracker;\n }\n\n // Acquires the lock for the chainId + address and the nonceLock from the nonceTracker, then\n // couples them together by replacing the nonceLock's releaseLock method with\n // an anonymous function that calls releases both the original nonceLock and the\n // lock for the chainId.\n try {\n const nonceLock = await nonceTracker.getNonceLock(address);\n return {\n ...nonceLock,\n releaseLock: () => {\n nonceLock.releaseLock();\n releaseLockForChainIdKey?.();\n },\n };\n } catch (err) {\n releaseLockForChainIdKey?.();\n throw err;\n }\n }\n\n startIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n networkClientIds.forEach((networkClientId) => {\n this.#trackingMap.get(networkClientId)?.incomingTransactionHelper.start();\n });\n }\n\n stopIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n networkClientIds.forEach((networkClientId) => {\n this.#trackingMap.get(networkClientId)?.incomingTransactionHelper.stop();\n });\n }\n\n stopAllIncomingTransactionPolling() {\n for (const [, trackers] of this.#trackingMap) {\n trackers.incomingTransactionHelper.stop();\n }\n }\n\n async updateIncomingTransactions(networkClientIds: NetworkClientId[] = []) {\n const promises = await Promise.allSettled(\n networkClientIds.map(async (networkClientId) => {\n return await this.#trackingMap\n .get(networkClientId)\n ?.incomingTransactionHelper.update();\n }),\n );\n\n promises\n .filter((result) => result.status === 'rejected')\n .forEach((result) => {\n log(\n 'failed to update incoming transactions',\n (result as PromiseRejectedResult).reason,\n );\n });\n }\n\n checkForPendingTransactionAndStartPolling = () => {\n for (const [, trackers] of this.#trackingMap) {\n trackers.pendingTransactionTracker.startIfPendingTransactions();\n }\n };\n\n stopAllTracking() {\n for (const [networkClientId] of this.#trackingMap) {\n this.#stopTrackingByNetworkClientId(networkClientId);\n }\n }\n\n #refreshTrackingMap = (networkClients: NetworkClientRegistry) => {\n this.#refreshEtherscanRemoteTransactionSources(networkClients);\n\n const networkClientIds = Object.keys(networkClients);\n const existingNetworkClientIds = Array.from(this.#trackingMap.keys());\n\n // Remove tracking for NetworkClientIds that no longer exist\n const networkClientIdsToRemove = existingNetworkClientIds.filter(\n (id) => !networkClientIds.includes(id),\n );\n networkClientIdsToRemove.forEach((id) => {\n this.#stopTrackingByNetworkClientId(id);\n });\n\n // Start tracking new NetworkClientIds from the registry\n const networkClientIdsToAdd = networkClientIds.filter(\n (id) => !existingNetworkClientIds.includes(id),\n );\n networkClientIdsToAdd.forEach((id) => {\n this.#startTrackingByNetworkClientId(id);\n });\n };\n\n #stopTrackingByNetworkClientId(networkClientId: NetworkClientId) {\n const trackers = this.#trackingMap.get(networkClientId);\n if (trackers) {\n trackers.pendingTransactionTracker.stop();\n this.#removePendingTransactionTrackerListeners(\n trackers.pendingTransactionTracker,\n );\n trackers.incomingTransactionHelper.stop();\n this.#removeIncomingTransactionHelperListeners(\n trackers.incomingTransactionHelper,\n );\n this.#trackingMap.delete(networkClientId);\n }\n }\n\n #startTrackingByNetworkClientId(networkClientId: NetworkClientId) {\n const trackers = this.#trackingMap.get(networkClientId);\n if (trackers) {\n return;\n }\n\n const {\n provider,\n blockTracker,\n configuration: { chainId },\n } = this.#getNetworkClientById(networkClientId);\n\n let etherscanRemoteTransactionSource =\n this.#etherscanRemoteTransactionSourcesMap.get(chainId);\n if (!etherscanRemoteTransactionSource) {\n etherscanRemoteTransactionSource = new EtherscanRemoteTransactionSource({\n includeTokenTransfers:\n this.#incomingTransactionOptions.includeTokenTransfers,\n });\n this.#etherscanRemoteTransactionSourcesMap.set(\n chainId,\n etherscanRemoteTransactionSource,\n );\n }\n\n const nonceTracker = this.#createNonceTracker({\n provider,\n blockTracker,\n chainId,\n });\n\n const incomingTransactionHelper = this.#createIncomingTransactionHelper({\n blockTracker,\n etherscanRemoteTransactionSource,\n chainId,\n });\n\n const pendingTransactionTracker = this.#createPendingTransactionTracker({\n provider,\n blockTracker,\n chainId,\n });\n\n this.#trackingMap.set(networkClientId, {\n nonceTracker,\n incomingTransactionHelper,\n pendingTransactionTracker,\n });\n }\n\n #refreshEtherscanRemoteTransactionSources = (\n networkClients: NetworkClientRegistry,\n ) => {\n // this will be prettier when we have consolidated network clients with a single chainId:\n // check if there are still other network clients using the same chainId\n // if not remove the etherscanRemoteTransaction source from the map\n const chainIdsInRegistry = new Set();\n Object.values(networkClients).forEach((networkClient) =>\n chainIdsInRegistry.add(networkClient.configuration.chainId),\n );\n const existingChainIds = Array.from(\n this.#etherscanRemoteTransactionSourcesMap.keys(),\n );\n const chainIdsToRemove = existingChainIds.filter(\n (chainId) => !chainIdsInRegistry.has(chainId),\n );\n\n chainIdsToRemove.forEach((chainId) => {\n this.#etherscanRemoteTransactionSourcesMap.delete(chainId);\n });\n };\n\n #getNetworkClient({\n networkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): NetworkClient | undefined {\n let networkClient: NetworkClient | undefined;\n\n if (networkClientId) {\n try {\n networkClient = this.#getNetworkClientById(networkClientId);\n } catch (err) {\n log('failed to get network client by networkClientId');\n }\n }\n if (!networkClient && chainId) {\n try {\n const networkClientIdForChainId =\n this.#findNetworkClientIdByChainId(chainId);\n networkClient = this.#getNetworkClientById(networkClientIdForChainId);\n } catch (err) {\n log('failed to get network client by chainId');\n }\n }\n return networkClient;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAO,cAAc;AAWrB,SAAS,aAAa;AAXtB;AAkEO,IAAM,2BAAN,MAA+B;AAAA,EAyDpC,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAAoC;AAgOpC;AAeA;AAwEA;AA7XA;AAEA,uBAAS,WAAT;AAEA,uBAAS,eAAT;AAEA,uBAAS,6BAAT;AAEA,uBAAS,+BAAT;AAEA,uBAAS,uBAAT;AAEA,uBAAS,2BAAT;AAEA,uBAAS,2CAAT;AAIA,uBAAS,2CAAT;AAIA,uBAAS,qBAAT;AAMA,uBAAS,kCAAT;AAMA,uBAAS,kCAAT;AAMA,uBAAS,wBAAyB,oBAAI,IAA6B;AAEnE,uBAAS,cAOL,oBAAI,IAAI;AAEZ,uBAAS,uCAGL,oBAAI,IAAI;AA6MZ,qDAA4C,MAAM;AAChD,iBAAW,CAAC,EAAE,QAAQ,KAAK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Q;AAAA,EAC3B,IAAI,mBAAK,uBAAL,WAA2B;AAE/B,MAAI,mCACF,mBAAK,uCAAsC,IAAI,OAAO;AACxD,MAAI,CAAC,kCAAkC;AACrC,uCAAmC,IAAI,iCAAiC;AAAA,MACtE,uBACE,mBAAK,6BAA4B;AAAA,IACrC,CAAC;AACD,uBAAK,uCAAsC;AAAA,MACzC;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe,mBAAK,qBAAL,WAAyB;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,4BAA4B,mBAAK,kCAAL,WAAsC;AAAA,IACtE;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,4BAA4B,mBAAK,kCAAL,WAAsC;AAAA,IACtE;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,qBAAK,cAAa,IAAI,iBAAiB;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEA;AAsBA;AAAA,sBAAiB,SAAC;AAAA,EAChB;AAAA,EACA;AACF,IAGI,CAAC,GAA8B;AACjC,MAAI;AAEJ,MAAI,iBAAiB;AACnB,QAAI;AACF,sBAAgB,mBAAK,uBAAL,WAA2B;AAAA,IAC7C,SAAS,KAAK;AACZ,iCAAI,iDAAiD;AAAA,IACvD;AAAA,EACF;AACA,MAAI,CAAC,iBAAiB,SAAS;AAC7B,QAAI;AACF,YAAM,4BACJ,mBAAK,+BAAL,WAAmC;AACrC,sBAAgB,mBAAK,uBAAL,WAA2B;AAAA,IAC7C,SAAS,KAAK;AACZ,iCAAI,yCAAyC;AAAA,IAC/C;AAAA,EACF;AACA,SAAO;AACT;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-QTKXIDGE.js b/node_modules/@metamask/transaction-controller/dist/chunk-5G4OGDYP.js +similarity index 87% +rename from node_modules/@metamask/transaction-controller/dist/chunk-QTKXIDGE.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-5G4OGDYP.js +index 7d80744..71d68d2 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-QTKXIDGE.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-5G4OGDYP.js +@@ -1,12 +1,12 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +-var _chunkC3WC4OJ3js = require('./chunk-C3WC4OJ3.js'); ++var _chunkXGCT4DDWjs = require('./chunk-XGCT4DDW.js'); + + + var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js'); + + +-var _chunkAYTU4HU5js = require('./chunk-AYTU4HU5.js'); ++var _chunkVWDGWDFVjs = require('./chunk-VWDGWDFV.js'); + + + +@@ -55,7 +55,7 @@ var DefaultGasFeeFlow = class { + }; + _getFeeMarkEstimates = new WeakSet(); + getFeeMarkEstimates_fn = function(gasFeeEstimates) { +- const levels = Object.values(_chunkAYTU4HU5js.GasFeeEstimateLevel).reduce( ++ const levels = Object.values(_chunkVWDGWDFVjs.GasFeeEstimateLevel).reduce( + (result, level) => ({ + ...result, + [level]: _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getFeeMarketLevel, getFeeMarketLevel_fn).call(this, gasFeeEstimates, level) +@@ -69,7 +69,7 @@ getFeeMarkEstimates_fn = function(gasFeeEstimates) { + }; + _getLegacyEstimates = new WeakSet(); + getLegacyEstimates_fn = function(gasFeeEstimates) { +- const levels = Object.values(_chunkAYTU4HU5js.GasFeeEstimateLevel).reduce( ++ const levels = Object.values(_chunkVWDGWDFVjs.GasFeeEstimateLevel).reduce( + (result, level) => ({ + ...result, + [level]: _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLegacyLevel, getLegacyLevel_fn).call(this, gasFeeEstimates, level) +@@ -85,15 +85,15 @@ _getGasPriceEstimates = new WeakSet(); + getGasPriceEstimates_fn = function(gasFeeEstimates) { + return { + type: "eth_gasPrice" /* GasPrice */, +- gasPrice: _chunkC3WC4OJ3js.gweiDecimalToWeiHex.call(void 0, gasFeeEstimates.gasPrice) ++ gasPrice: _chunkXGCT4DDWjs.gweiDecimalToWeiHex.call(void 0, gasFeeEstimates.gasPrice) + }; + }; + _getFeeMarketLevel = new WeakSet(); + getFeeMarketLevel_fn = function(gasFeeEstimates, level) { +- const maxFeePerGas = _chunkC3WC4OJ3js.gweiDecimalToWeiHex.call(void 0, ++ const maxFeePerGas = _chunkXGCT4DDWjs.gweiDecimalToWeiHex.call(void 0, + gasFeeEstimates[level].suggestedMaxFeePerGas + ); +- const maxPriorityFeePerGas = _chunkC3WC4OJ3js.gweiDecimalToWeiHex.call(void 0, ++ const maxPriorityFeePerGas = _chunkXGCT4DDWjs.gweiDecimalToWeiHex.call(void 0, + gasFeeEstimates[level].suggestedMaxPriorityFeePerGas + ); + return { +@@ -103,10 +103,10 @@ getFeeMarketLevel_fn = function(gasFeeEstimates, level) { + }; + _getLegacyLevel = new WeakSet(); + getLegacyLevel_fn = function(gasFeeEstimates, level) { +- return _chunkC3WC4OJ3js.gweiDecimalToWeiHex.call(void 0, gasFeeEstimates[level]); ++ return _chunkXGCT4DDWjs.gweiDecimalToWeiHex.call(void 0, gasFeeEstimates[level]); + }; + + + + exports.DefaultGasFeeFlow = DefaultGasFeeFlow; +-//# sourceMappingURL=chunk-QTKXIDGE.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-5G4OGDYP.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-5G6OHAXI.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-5G6OHAXI.mjs.map +deleted file mode 100644 +index bf0922d..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-5G6OHAXI.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/gas.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n\nimport {\n BNToHex,\n fractionBN,\n hexToBN,\n query,\n} from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type { Hex } from '@metamask/utils';\nimport { add0x, createModuleLogger } from '@metamask/utils';\n\nimport { GAS_BUFFER_CHAIN_OVERRIDES } from '../constants';\nimport { projectLogger } from '../logger';\nimport type { TransactionMeta, TransactionParams } from '../types';\n\nexport type UpdateGasRequest = {\n ethQuery: EthQuery;\n isCustomNetwork: boolean;\n chainId: Hex;\n txMeta: TransactionMeta;\n};\n\nexport const log = createModuleLogger(projectLogger, 'gas');\n\nexport const FIXED_GAS = '0x5208';\nexport const DEFAULT_GAS_MULTIPLIER = 1.5;\n\nexport async function updateGas(request: UpdateGasRequest) {\n const { txMeta } = request;\n const initialParams = { ...txMeta.txParams };\n\n const [gas, simulationFails] = await getGas(request);\n\n txMeta.txParams.gas = gas;\n txMeta.simulationFails = simulationFails;\n\n if (!initialParams.gas) {\n txMeta.originalGasEstimate = txMeta.txParams.gas;\n }\n\n if (!txMeta.defaultGasEstimates) {\n txMeta.defaultGasEstimates = {};\n }\n\n txMeta.defaultGasEstimates.gas = txMeta.txParams.gas;\n}\n\nexport async function estimateGas(\n txParams: TransactionParams,\n ethQuery: EthQuery,\n) {\n const request = { ...txParams };\n const { data, value } = request;\n\n const { gasLimit: gasLimitHex, number: blockNumber } = await getLatestBlock(\n ethQuery,\n );\n\n const gasLimitBN = hexToBN(gasLimitHex);\n\n request.data = data ? add0x(data) : data;\n request.gas = BNToHex(fractionBN(gasLimitBN, 19, 20));\n request.value = value || '0x0';\n\n let estimatedGas = request.gas;\n let simulationFails;\n\n try {\n estimatedGas = await query(ethQuery, 'estimateGas', [request]);\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n simulationFails = {\n reason: error.message,\n errorKey: error.errorKey,\n debug: {\n blockNumber,\n blockGasLimit: gasLimitHex,\n },\n };\n\n log('Estimation failed', { ...simulationFails, fallback: estimateGas });\n }\n\n return {\n blockGasLimit: gasLimitHex,\n estimatedGas,\n simulationFails,\n };\n}\n\nexport function addGasBuffer(\n estimatedGas: string,\n blockGasLimit: string,\n multiplier: number,\n) {\n const estimatedGasBN = hexToBN(estimatedGas);\n const maxGasBN = hexToBN(blockGasLimit).muln(0.9);\n const paddedGasBN = estimatedGasBN.muln(multiplier);\n\n if (estimatedGasBN.gt(maxGasBN)) {\n const estimatedGasHex = add0x(estimatedGas);\n log('Using estimated value', estimatedGasHex);\n return estimatedGasHex;\n }\n\n if (paddedGasBN.lt(maxGasBN)) {\n const paddedHex = add0x(BNToHex(paddedGasBN));\n log('Using padded estimate', paddedHex, multiplier);\n return paddedHex;\n }\n\n const maxHex = add0x(BNToHex(maxGasBN));\n log('Using 90% of block gas limit', maxHex);\n return maxHex;\n}\n\nasync function getGas(\n request: UpdateGasRequest,\n): Promise<[string, TransactionMeta['simulationFails']?]> {\n const { isCustomNetwork, chainId, txMeta } = request;\n\n if (txMeta.txParams.gas) {\n log('Using value from request', txMeta.txParams.gas);\n return [txMeta.txParams.gas];\n }\n\n if (await requiresFixedGas(request)) {\n log('Using fixed value', FIXED_GAS);\n return [FIXED_GAS];\n }\n\n const { blockGasLimit, estimatedGas, simulationFails } = await estimateGas(\n txMeta.txParams,\n request.ethQuery,\n );\n\n if (isCustomNetwork) {\n log('Using original estimate as custom network');\n return [estimatedGas, simulationFails];\n }\n\n const bufferMultiplier =\n GAS_BUFFER_CHAIN_OVERRIDES[\n chainId as keyof typeof GAS_BUFFER_CHAIN_OVERRIDES\n ] ?? DEFAULT_GAS_MULTIPLIER;\n\n const bufferedGas = addGasBuffer(\n estimatedGas,\n blockGasLimit,\n bufferMultiplier,\n );\n\n return [bufferedGas, simulationFails];\n}\n\nasync function requiresFixedGas({\n ethQuery,\n txMeta,\n isCustomNetwork,\n}: UpdateGasRequest): Promise {\n const {\n txParams: { to, data },\n } = txMeta;\n\n if (isCustomNetwork || !to || data) {\n return false;\n }\n\n const code = await getCode(ethQuery, to);\n\n return !code || code === '0x';\n}\n\nasync function getCode(\n ethQuery: EthQuery,\n address: string,\n): Promise {\n return await query(ethQuery, 'getCode', [address]);\n}\n\nasync function getLatestBlock(\n ethQuery: EthQuery,\n): Promise<{ gasLimit: string; number: string }> {\n return await query(ethQuery, 'getBlockByNumber', ['latest', false]);\n}\n"],"mappings":";;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,OAAO,0BAA0B;AAanC,IAAM,MAAM,mBAAmB,eAAe,KAAK;AAEnD,IAAM,YAAY;AAClB,IAAM,yBAAyB;AAEtC,eAAsB,UAAU,SAA2B;AACzD,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,gBAAgB,EAAE,GAAG,OAAO,SAAS;AAE3C,QAAM,CAAC,KAAK,eAAe,IAAI,MAAM,OAAO,OAAO;AAEnD,SAAO,SAAS,MAAM;AACtB,SAAO,kBAAkB;AAEzB,MAAI,CAAC,cAAc,KAAK;AACtB,WAAO,sBAAsB,OAAO,SAAS;AAAA,EAC/C;AAEA,MAAI,CAAC,OAAO,qBAAqB;AAC/B,WAAO,sBAAsB,CAAC;AAAA,EAChC;AAEA,SAAO,oBAAoB,MAAM,OAAO,SAAS;AACnD;AAEA,eAAsB,YACpB,UACA,UACA;AACA,QAAM,UAAU,EAAE,GAAG,SAAS;AAC9B,QAAM,EAAE,MAAM,MAAM,IAAI;AAExB,QAAM,EAAE,UAAU,aAAa,QAAQ,YAAY,IAAI,MAAM;AAAA,IAC3D;AAAA,EACF;AAEA,QAAM,aAAa,QAAQ,WAAW;AAEtC,UAAQ,OAAO,OAAO,MAAM,IAAI,IAAI;AACpC,UAAQ,MAAM,QAAQ,WAAW,YAAY,IAAI,EAAE,CAAC;AACpD,UAAQ,QAAQ,SAAS;AAEzB,MAAI,eAAe,QAAQ;AAC3B,MAAI;AAEJ,MAAI;AACF,mBAAe,MAAM,MAAM,UAAU,eAAe,CAAC,OAAO,CAAC;AAAA,EAG/D,SAAS,OAAY;AACnB,sBAAkB;AAAA,MAChB,QAAQ,MAAM;AAAA,MACd,UAA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,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,CAAC,aAAa,eAAe;AACtC;AAEA,eAAe,iBAAiB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAAuC;AACrC,QAAM;AAAA,IACJ,UAAU,EAAE,IAAI,KAAK;AAAA,EACvB,IAAI;AAEJ,MAAI,mBAAmB,CAAC,MAAM,MAAM;AAClC,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,MAAM,QAAQ,UAAU,EAAE;AAEvC,SAAO,CAAC,QAAQ,SAAS;AAC3B;AAEA,eAAe,QACb,UACA,SAC6B;AAC7B,SAAO,MAAM,MAAM,UAAU,WAAW,CAAC,OAAO,CAAC;AACnD;AAEA,eAAe,eACb,UAC+C;AAC/C,SAAO,MAAM,MAAM,UAAU,oBAAoB,CAAC,UAAU,KAAK,CAAC;AACpE;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-2EU6346V.js b/node_modules/@metamask/transaction-controller/dist/chunk-5ITD3JI5.js +similarity index 98% +rename from node_modules/@metamask/transaction-controller/dist/chunk-2EU6346V.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-5ITD3JI5.js +index 6e53a30..5d0b099 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-2EU6346V.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-5ITD3JI5.js +@@ -3,7 +3,7 @@ + var _chunk2XKEAKQGjs = require('./chunk-2XKEAKQG.js'); + + +-var _chunk76FONEDAjs = require('./chunk-76FONEDA.js'); ++var _chunkOEMCU4FYjs = require('./chunk-OEMCU4FY.js'); + + + var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js'); +@@ -148,7 +148,7 @@ _updateTransactionGasFeeEstimates = new WeakSet(); + updateTransactionGasFeeEstimates_fn = async function(transactionMeta, gasFeeControllerData) { + const { chainId, networkClientId } = transactionMeta; + const ethQuery = new (0, _ethquery2.default)(_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _getProvider).call(this, chainId, networkClientId)); +- const gasFeeFlow = _chunk76FONEDAjs.getGasFeeFlow.call(void 0, transactionMeta, _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _gasFeeFlows)); ++ const gasFeeFlow = _chunkOEMCU4FYjs.getGasFeeFlow.call(void 0, transactionMeta, _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _gasFeeFlows)); + if (gasFeeFlow) { + log( + "Found gas fee flow", +@@ -225,4 +225,4 @@ getGasFeeControllerData_fn = async function(transactions) { + + + exports.GasFeePoller = GasFeePoller; +-//# sourceMappingURL=chunk-2EU6346V.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-5ITD3JI5.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-5ZEJT5SN.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-5ZEJT5SN.mjs.map +deleted file mode 100644 +index 1eb61ac..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-5ZEJT5SN.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/validation.ts"],"sourcesContent":["import { Interface } from '@ethersproject/abi';\nimport { ORIGIN_METAMASK, isValidHexAddress } from '@metamask/controller-utils';\nimport { abiERC20 } from '@metamask/metamask-eth-abis';\nimport { providerErrors, rpcErrors } from '@metamask/rpc-errors';\n\nimport { TransactionEnvelopeType, type TransactionParams } from '../types';\nimport { isEIP1559Transaction } from './utils';\n\ntype GasFieldsToValidate = 'gasPrice' | 'maxFeePerGas' | 'maxPriorityFeePerGas';\n\n/**\n * Validates whether a transaction initiated by a specific 'from' address is permitted by the origin.\n *\n * @param permittedAddresses - The permitted accounts for the given origin.\n * @param selectedAddress - The currently selected Ethereum address in the wallet.\n * @param from - The address from which the transaction is initiated.\n * @param origin - The origin or source of the transaction.\n * @throws Throws an error if the transaction is not permitted.\n */\nexport async function validateTransactionOrigin(\n permittedAddresses: string[],\n selectedAddress: string,\n from: string,\n origin: string,\n) {\n if (origin === ORIGIN_METAMASK) {\n // Ensure the 'from' address matches the currently selected address\n if (from !== selectedAddress) {\n throw rpcErrors.internal({\n message: `Internally initiated transaction is using invalid account.`,\n data: {\n origin,\n fromAddress: from,\n selectedAddress,\n },\n });\n }\n return;\n }\n\n // Check if the origin has permissions to initiate transactions from the specified address\n if (!permittedAddresses.includes(from)) {\n throw providerErrors.unauthorized({ data: { origin } });\n }\n}\n\n/**\n * Validates the transaction params for required properties and throws in\n * the event of any validation error.\n *\n * @param txParams - Transaction params object to validate.\n * @param isEIP1559Compatible - whether or not the current network supports EIP-1559 transactions.\n */\nexport function validateTxParams(\n txParams: TransactionParams,\n isEIP1559Compatible = true,\n) {\n validateEIP1559Compatibility(txParams, isEIP1559Compatible);\n validateParamFrom(txParams.from);\n validateParamRecipient(txParams);\n validateParamValue(txParams.value);\n validateParamData(txParams.data);\n validateParamChainId(txParams.chainId);\n validateGasFeeParams(txParams);\n}\n\n/**\n * Validates EIP-1559 compatibility for transaction creation.\n *\n * @param txParams - The transaction parameters to validate.\n * @param isEIP1559Compatible - Indicates if the current network supports EIP-1559.\n * @throws Throws invalid params if the transaction specifies EIP-1559 but the network does not support it.\n */\nfunction validateEIP1559Compatibility(\n txParams: TransactionParams,\n isEIP1559Compatible: boolean,\n) {\n if (isEIP1559Transaction(txParams) && !isEIP1559Compatible) {\n throw rpcErrors.invalidParams(\n 'Invalid transaction params: params specify an EIP-1559 transaction but the current network does not support EIP-1559',\n );\n }\n}\n\n/**\n * Validates value property, ensuring it is a valid positive integer number\n * denominated in wei.\n *\n * @param value - The value to validate, expressed as a string.\n * @throws Throws an error if the value is not a valid positive integer\n * number denominated in wei.\n * - If the value contains a hyphen (-), it is considered invalid.\n * - If the value contains a decimal point (.), it is considered invalid.\n * - If the value is not a finite number, is NaN, or is not a safe integer, it is considered invalid.\n */\nfunction validateParamValue(value?: string) {\n if (value !== undefined) {\n if (value.includes('-')) {\n throw rpcErrors.invalidParams(\n `Invalid transaction value \"${value}\": not a positive number.`,\n );\n }\n\n if (value.includes('.')) {\n throw rpcErrors.invalidParams(\n `Invalid transaction value \"${value}\": number must be in wei.`,\n );\n }\n const intValue = parseInt(value, 10);\n const isValid =\n Number.isFinite(intValue) &&\n !Number.isNaN(intValue) &&\n !isNaN(Number(value)) &&\n Number.isSafeInteger(intValue);\n if (!isValid) {\n throw rpcErrors.invalidParams(\n `Invalid transaction value ${value}: number must be a valid number.`,\n );\n }\n }\n}\n\n/**\n * Validates the recipient address in a transaction's parameters.\n *\n * @param txParams - The transaction parameters object to validate.\n * @throws Throws an error if the recipient address is invalid:\n * - If the recipient address is an empty string ('0x') or undefined and the transaction contains data,\n * the \"to\" field is removed from the transaction parameters.\n * - If the recipient address is not a valid hexadecimal Ethereum address, an error is thrown.\n */\nfunction validateParamRecipient(txParams: TransactionParams) {\n if (txParams.to === '0x' || txParams.to === undefined) {\n if (txParams.data) {\n delete txParams.to;\n } else {\n throw rpcErrors.invalidParams(`Invalid \"to\" address.`);\n }\n } else if (txParams.to !== undefined && !isValidHexAddress(txParams.to)) {\n throw rpcErrors.invalidParams(`Invalid \"to\" address.`);\n }\n}\n\n/**\n * Validates the recipient address in a transaction's parameters.\n *\n * @param from - The from property to validate.\n * @throws Throws an error if the recipient address is invalid:\n * - If the recipient address is an empty string ('0x') or undefined and the transaction contains data,\n * the \"to\" field is removed from the transaction parameters.\n * - If the recipient address is not a valid hexadecimal Ethereum address, an error is thrown.\n */\nfunction validateParamFrom(from: string) {\n if (!from || typeof from !== 'string') {\n throw rpcErrors.invalidParams(\n `Invalid \"from\" address ${from}: not a string.`,\n );\n }\n if (!isValidHexAddress(from)) {\n throw rpcErrors.invalidParams('Invalid \"from\" address.');\n }\n}\n\n/**\n * Validates input data for transactions.\n *\n * @param value - The input data to validate.\n * @throws Throws invalid params if the input data is invalid.\n */\nfunction validateParamData(value?: string) {\n if (value) {\n const ERC20Interface = new Interface(abiERC20);\n try {\n ERC20Interface.parseTransaction({ data: value });\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n if (error.message.match(/BUFFER_OVERRUN/u)) {\n throw rpcErrors.invalidParams(\n 'Invalid transaction params: data out-of-bounds, BUFFER_OVERRUN.',\n );\n }\n }\n }\n}\n\n/**\n * Validates chainId type.\n *\n * @param chainId - The chainId to validate.\n */\nfunction validateParamChainId(chainId: number | string | undefined) {\n if (\n chainId !== undefined &&\n typeof chainId !== 'number' &&\n typeof chainId !== 'string'\n ) {\n throw rpcErrors.invalidParams(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Invalid transaction params: chainId is not a Number or hex string. got: (${chainId})`,\n );\n }\n}\n\n/**\n * Validates gas values.\n *\n * @param txParams - The transaction parameters to validate.\n */\nfunction validateGasFeeParams(txParams: TransactionParams) {\n if (txParams.gasPrice) {\n ensureProperTransactionEnvelopeTypeProvided(txParams, 'gasPrice');\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'gasPrice',\n 'maxFeePerGas',\n );\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'gasPrice',\n 'maxPriorityFeePerGas',\n );\n ensureFieldIsString(txParams, 'gasPrice');\n }\n\n if (txParams.maxFeePerGas) {\n ensureProperTransactionEnvelopeTypeProvided(txParams, 'maxFeePerGas');\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'maxFeePerGas',\n 'gasPrice',\n );\n ensureFieldIsString(txParams, 'maxFeePerGas');\n }\n\n if (txParams.maxPriorityFeePerGas) {\n ensureProperTransactionEnvelopeTypeProvided(\n txParams,\n 'maxPriorityFeePerGas',\n );\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'maxPriorityFeePerGas',\n 'gasPrice',\n );\n ensureFieldIsString(txParams, 'maxPriorityFeePerGas');\n }\n}\n\n/**\n * Ensures that the provided txParams has the proper 'type' specified for the\n * given field, if it is provided. If types do not match throws an\n * invalidParams error.\n *\n * @param txParams - The transaction parameters object\n * @param field - The current field being validated\n * @throws {ethErrors.rpc.invalidParams} Throws if type does not match the\n * expectations for provided field.\n */\nfunction ensureProperTransactionEnvelopeTypeProvided(\n txParams: TransactionParams,\n field: GasFieldsToValidate,\n) {\n switch (field) {\n case 'maxFeePerGas':\n case 'maxPriorityFeePerGas':\n if (\n txParams.type &&\n txParams.type !== TransactionEnvelopeType.feeMarket\n ) {\n throw rpcErrors.invalidParams(\n `Invalid transaction envelope type: specified type \"${txParams.type}\" but including maxFeePerGas and maxPriorityFeePerGas requires type: \"${TransactionEnvelopeType.feeMarket}\"`,\n );\n }\n break;\n case 'gasPrice':\n default:\n if (\n txParams.type &&\n txParams.type === TransactionEnvelopeType.feeMarket\n ) {\n throw rpcErrors.invalidParams(\n `Invalid transaction envelope type: specified type \"${txParams.type}\" but included a gasPrice instead of maxFeePerGas and maxPriorityFeePerGas`,\n );\n }\n }\n}\n\n/**\n * Given two fields, ensure that the second field is not included in txParams,\n * and if it is throw an invalidParams error.\n *\n * @param txParams - The transaction parameters object\n * @param fieldBeingValidated - The current field being validated\n * @param mutuallyExclusiveField - The field to ensure is not provided\n * @throws {ethErrors.rpc.invalidParams} Throws if mutuallyExclusiveField is\n * present in txParams.\n */\nfunction ensureMutuallyExclusiveFieldsNotProvided(\n txParams: TransactionParams,\n fieldBeingValidated: GasFieldsToValidate,\n mutuallyExclusiveField: GasFieldsToValidate,\n) {\n if (typeof txParams[mutuallyExclusiveField] !== 'undefined') {\n throw rpcErrors.invalidParams(\n `Invalid transaction params: specified ${fieldBeingValidated} but also included ${mutuallyExclusiveField}, these cannot be mixed`,\n );\n }\n}\n\n/**\n * Ensures that the provided value for field is a string, throws an\n * invalidParams error if field is not a string.\n *\n * @param txParams - The transaction parameters object\n * @param field - The current field being validated\n * @throws {rpcErrors.invalidParams} Throws if field is not a string\n */\nfunction ensureFieldIsString(\n txParams: TransactionParams,\n field: GasFieldsToValidate,\n) {\n if (typeof txParams[field] !== 'string') {\n throw rpcErrors.invalidParams(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Invalid transaction params: ${field} is not a string. got: (${txParams[field]})`,\n );\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB,yBAAyB;AACnD,SAAS,gBAAgB;AACzB,SAAS,gBAAgB,iBAAiB;AAgB1C,eAAsB,0BACpB,oBACA,iBACA,MACA,QACA;AACA,MAAI,WAAW,iBAAiB;AAE9B,QAAI,SAAS,iBAAiB;AAC5B,YAAM,UAAU,SAAS;AAAA,QACvB,SAAS;AAAA,QACT,MAAM;AAAA,UACJ;AAAA,UACA,aAAa;AAAA,UACb;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AACA;AAAA,EACF;AAGA,MAAI,CAAC,mBAAmB,SAAS,IAAI,GAAG;AACtC,UAAM,eAAe,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAAA,EACxD;AACF;AASO,SAAS,iBACd,UACA,sBAAsB,MACtB;AACA,+BAA6B,UAAU,mBAAmB;AAC1D,oBAAkB,SAAS,IAAI;AAC/B,yBAAuB,QAAQ;AAC/B,qBAAmB,SAAS,KAAK;AACjC,oBAAkB,SAAS,IAAI;AAC/B,uBAAqB,SAAS,OAAO;AACrC,uBAAqB,QAAQ;AAC/B;AASA,SAAS,6BACP,UACA,qBACA;AACA,MAAI,qBAAqB,QAAQ,KAAK,CAAC,qBAAqB;AAC1D,UAAM,UAAU;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;AAaA,SAAS,mBAAmB,OAAgB;AAC1C,MAAI,UAAU,QAAW;AACvB,QAAI,MAAM,SAAS,GAAG,GAAG;AACvB,YAAM,UAAU;AAAA,QACd,8BAA8B,KAAK;AAAA,MACrC;AAAA,IACF;AAEA,QAAI,MAAM,SAAS,GAAG,GAAG;AACvB,YAAM,UAAU;AAA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,KAAK,CAAC;AAAA,IAChF;AAAA,EACF;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-6B5BEO3R.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-6B5BEO3R.mjs.map +deleted file mode 100644 +index 662567a..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-6B5BEO3R.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/PendingTransactionTracker.ts"],"sourcesContent":["import { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type {\n BlockTracker,\n NetworkClientId,\n} from '@metamask/network-controller';\nimport EventEmitter from 'events';\nimport { cloneDeep, merge } from 'lodash';\n\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionMeta, TransactionReceipt } from '../types';\nimport { TransactionStatus, TransactionType } from '../types';\n\n/**\n * We wait this many blocks before emitting a 'transaction-dropped' event\n * This is because we could be talking to a node that is out of sync\n */\nconst DROPPED_BLOCK_COUNT = 3;\n\nconst RECEIPT_STATUS_SUCCESS = '0x1';\nconst RECEIPT_STATUS_FAILURE = '0x0';\nconst MAX_RETRY_BLOCK_DISTANCE = 50;\n\nconst KNOWN_TRANSACTION_ERRORS = [\n 'replacement transaction underpriced',\n 'known transaction',\n 'gas price too low to replace',\n 'transaction with the same hash was already imported',\n 'gateway timeout',\n 'nonce too low',\n];\n\nconst log = createModuleLogger(projectLogger, 'pending-transactions');\n\ntype SuccessfulTransactionReceipt = TransactionReceipt & {\n blockNumber: string;\n blockHash: string;\n};\n\ntype Events = {\n 'transaction-confirmed': [txMeta: TransactionMeta];\n 'transaction-dropped': [txMeta: TransactionMeta];\n 'transaction-failed': [txMeta: TransactionMeta, error: Error];\n 'transaction-updated': [txMeta: TransactionMeta, note: string];\n};\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface PendingTransactionTrackerEventEmitter extends EventEmitter {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n on(\n eventName: T,\n listener: (...args: Events[T]) => void,\n ): this;\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n emit(eventName: T, ...args: Events[T]): boolean;\n}\n\nexport class PendingTransactionTracker {\n hub: PendingTransactionTrackerEventEmitter;\n\n #approveTransaction: (transactionId: string) => Promise;\n\n #blockTracker: BlockTracker;\n\n #droppedBlockCountByHash: Map;\n\n #getChainId: () => string;\n\n #getEthQuery: (networkClientId?: NetworkClientId) => EthQuery;\n\n #getTransactions: () => TransactionMeta[];\n\n #isResubmitEnabled: () => boolean;\n\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #listener: any;\n\n #getGlobalLock: () => Promise<() => void>;\n\n #publishTransaction: (ethQuery: EthQuery, rawTx: string) => Promise;\n\n #running: boolean;\n\n #beforeCheckPendingTransaction: (transactionMeta: TransactionMeta) => boolean;\n\n #beforePublish: (transactionMeta: TransactionMeta) => boolean;\n\n constructor({\n approveTransaction,\n blockTracker,\n getChainId,\n getEthQuery,\n getTransactions,\n isResubmitEnabled,\n getGlobalLock,\n publishTransaction,\n hooks,\n }: {\n approveTransaction: (transactionId: string) => Promise;\n blockTracker: BlockTracker;\n getChainId: () => string;\n getEthQuery: (networkClientId?: NetworkClientId) => EthQuery;\n getTransactions: () => TransactionMeta[];\n isResubmitEnabled?: () => boolean;\n getGlobalLock: () => Promise<() => void>;\n publishTransaction: (ethQuery: EthQuery, rawTx: string) => Promise;\n hooks?: {\n beforeCheckPendingTransaction?: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n beforePublish?: (transactionMeta: TransactionMeta) => boolean;\n };\n }) {\n this.hub = new EventEmitter() as PendingTransactionTrackerEventEmitter;\n\n this.#approveTransaction = approveTransaction;\n this.#blockTracker = blockTracker;\n this.#droppedBlockCountByHash = new Map();\n this.#getChainId = getChainId;\n this.#getEthQuery = getEthQuery;\n this.#getTransactions = getTransactions;\n this.#isResubmitEnabled = isResubmitEnabled ?? (() => true);\n this.#listener = this.#onLatestBlock.bind(this);\n this.#getGlobalLock = getGlobalLock;\n this.#publishTransaction = publishTransaction;\n this.#running = false;\n this.#beforePublish = hooks?.beforePublish ?? (() => true);\n this.#beforeCheckPendingTransaction =\n hooks?.beforeCheckPendingTransaction ?? (() => true);\n }\n\n startIfPendingTransactions = () => {\n const pendingTransactions = this.#getPendingTransactions();\n\n if (pendingTransactions.length) {\n this.#start();\n } else {\n this.stop();\n }\n };\n\n /**\n * Force checks the network if the given transaction is confirmed and updates it's status.\n *\n * @param txMeta - The transaction to check\n */\n async forceCheckTransaction(txMeta: TransactionMeta) {\n const releaseLock = await this.#getGlobalLock();\n\n try {\n await this.#checkTransaction(txMeta);\n } catch (error) {\n /* istanbul ignore next */\n log('Failed to check transaction', error);\n } finally {\n releaseLock();\n }\n }\n\n #start() {\n if (this.#running) {\n return;\n }\n\n this.#blockTracker.on('latest', this.#listener);\n this.#running = true;\n\n log('Started polling');\n }\n\n stop() {\n if (!this.#running) {\n return;\n }\n\n this.#blockTracker.removeListener('latest', this.#listener);\n this.#running = false;\n\n log('Stopped polling');\n }\n\n async #onLatestBlock(latestBlockNumber: string) {\n const releaseLock = await this.#getGlobalLock();\n\n try {\n await this.#checkTransactions();\n } catch (error) {\n /* istanbul ignore next */\n log('Failed to check transactions', error);\n } finally {\n releaseLock();\n }\n\n try {\n await this.#resubmitTransactions(latestBlockNumber);\n } catch (error) {\n /* istanbul ignore next */\n log('Failed to resubmit transactions', error);\n }\n }\n\n async #checkTransactions() {\n log('Checking transactions');\n\n const pendingTransactions = this.#getPendingTransactions();\n\n if (!pendingTransactions.length) {\n log('No pending transactions to check');\n return;\n }\n\n log('Found pending transactions to check', {\n count: pendingTransactions.length,\n ids: pendingTransactions.map((tx) => tx.id),\n });\n\n await Promise.all(\n pendingTransactions.map((tx) => this.#checkTransaction(tx)),\n );\n }\n\n async #resubmitTransactions(latestBlockNumber: string) {\n if (!this.#isResubmitEnabled() || !this.#running) {\n return;\n }\n\n log('Resubmitting transactions');\n\n const pendingTransactions = this.#getPendingTransactions();\n\n if (!pendingTransactions.length) {\n log('No pending transactions to resubmit');\n return;\n }\n\n log('Found pending transactions to resubmit', {\n count: pendingTransactions.length,\n ids: pendingTransactions.map((tx) => tx.id),\n });\n\n for (const txMeta of pendingTransactions) {\n try {\n await this.#resubmitTransaction(txMeta, latestBlockNumber);\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n /* istanbul ignore next */\n const errorMessage =\n error.value?.message?.toLowerCase() || error.message.toLowerCase();\n\n if (this.#isKnownTransactionError(errorMessage)) {\n log('Ignoring known transaction error', errorMessage);\n return;\n }\n\n this.#warnTransaction(\n txMeta,\n error.message,\n 'There was an error when resubmitting this transaction.',\n );\n }\n }\n }\n\n #isKnownTransactionError(errorMessage: string) {\n return KNOWN_TRANSACTION_ERRORS.some((knownError) =>\n errorMessage.includes(knownError),\n );\n }\n\n async #resubmitTransaction(\n txMeta: TransactionMeta,\n latestBlockNumber: string,\n ) {\n if (!this.#isResubmitDue(txMeta, latestBlockNumber)) {\n return;\n }\n\n const { rawTx } = txMeta;\n\n if (!this.#beforePublish(txMeta)) {\n return;\n }\n\n if (!rawTx?.length) {\n log('Approving transaction as no raw value');\n await this.#approveTransaction(txMeta.id);\n return;\n }\n\n const ethQuery = this.#getEthQuery(txMeta.networkClientId);\n await this.#publishTransaction(ethQuery, rawTx);\n\n const retryCount = (txMeta.retryCount ?? 0) + 1;\n\n this.#updateTransaction(\n merge({}, txMeta, { retryCount }),\n 'PendingTransactionTracker:transaction-retry - Retry count increased',\n );\n }\n\n #isResubmitDue(txMeta: TransactionMeta, latestBlockNumber: string): boolean {\n const txMetaWithFirstRetryBlockNumber = cloneDeep(txMeta);\n\n if (!txMetaWithFirstRetryBlockNumber.firstRetryBlockNumber) {\n txMetaWithFirstRetryBlockNumber.firstRetryBlockNumber = latestBlockNumber;\n\n this.#updateTransaction(\n txMetaWithFirstRetryBlockNumber,\n 'PendingTransactionTracker:#isResubmitDue - First retry block number set',\n );\n }\n\n const { firstRetryBlockNumber } = txMetaWithFirstRetryBlockNumber;\n\n const blocksSinceFirstRetry =\n Number.parseInt(latestBlockNumber, 16) -\n Number.parseInt(firstRetryBlockNumber, 16);\n\n const retryCount = txMeta.retryCount || 0;\n\n // Exponential backoff to limit retries at publishing\n // Capped at ~15 minutes between retries\n const requiredBlocksSinceFirstRetry = Math.min(\n MAX_RETRY_BLOCK_DISTANCE,\n Math.pow(2, retryCount),\n );\n\n return blocksSinceFirstRetry >= requiredBlocksSinceFirstRetry;\n }\n\n async #checkTransaction(txMeta: TransactionMeta) {\n const { hash, id } = txMeta;\n\n if (!hash && this.#beforeCheckPendingTransaction(txMeta)) {\n const error = new Error(\n 'We had an error while submitting this transaction, please try again.',\n );\n\n error.name = 'NoTxHashError';\n\n this.#failTransaction(txMeta, error);\n\n return;\n }\n\n if (this.#isNonceTaken(txMeta)) {\n log('Nonce already taken', id);\n this.#dropTransaction(txMeta);\n return;\n }\n\n try {\n const receipt = await this.#getTransactionReceipt(hash);\n const isSuccess = receipt?.status === RECEIPT_STATUS_SUCCESS;\n const isFailure = receipt?.status === RECEIPT_STATUS_FAILURE;\n\n if (isFailure) {\n log('Transaction receipt has failed status');\n\n this.#failTransaction(\n txMeta,\n new Error('Transaction dropped or replaced'),\n );\n\n return;\n }\n\n const { blockNumber, blockHash } = receipt || {};\n\n if (isSuccess && blockNumber && blockHash) {\n await this.#onTransactionConfirmed(txMeta, {\n ...receipt,\n blockNumber,\n blockHash,\n });\n\n return;\n }\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n log('Failed to check transaction', id, error);\n\n this.#warnTransaction(\n txMeta,\n error.message,\n 'There was a problem loading this transaction.',\n );\n\n return;\n }\n\n if (await this.#isTransactionDropped(txMeta)) {\n this.#dropTransaction(txMeta);\n }\n }\n\n async #onTransactionConfirmed(\n txMeta: TransactionMeta,\n receipt: SuccessfulTransactionReceipt,\n ) {\n const { id } = txMeta;\n const { blockHash } = receipt;\n\n log('Transaction confirmed', id);\n\n const { baseFeePerGas, timestamp: blockTimestamp } =\n await this.#getBlockByHash(blockHash, false);\n\n const updatedTxMeta = cloneDeep(txMeta);\n updatedTxMeta.baseFeePerGas = baseFeePerGas;\n updatedTxMeta.blockTimestamp = blockTimestamp;\n updatedTxMeta.status = TransactionStatus.confirmed;\n updatedTxMeta.txParams = {\n ...updatedTxMeta.txParams,\n gasUsed: receipt.gasUsed,\n };\n updatedTxMeta.txReceipt = receipt;\n updatedTxMeta.verifiedOnBlockchain = true;\n\n this.#updateTransaction(\n updatedTxMeta,\n 'PendingTransactionTracker:#onTransactionConfirmed - Transaction confirmed',\n );\n\n this.hub.emit('transaction-confirmed', updatedTxMeta);\n }\n\n async #isTransactionDropped(txMeta: TransactionMeta) {\n const {\n hash,\n id,\n txParams: { nonce, from },\n } = txMeta;\n\n /* istanbul ignore next */\n if (!nonce || !hash) {\n return false;\n }\n\n const networkNextNonceHex = await this.#getNetworkTransactionCount(from);\n const networkNextNonceNumber = parseInt(networkNextNonceHex, 16);\n const nonceNumber = parseInt(nonce, 16);\n\n if (nonceNumber >= networkNextNonceNumber) {\n return false;\n }\n\n let droppedBlockCount = this.#droppedBlockCountByHash.get(hash);\n\n if (droppedBlockCount === undefined) {\n droppedBlockCount = 0;\n this.#droppedBlockCountByHash.set(hash, droppedBlockCount);\n }\n\n if (droppedBlockCount < DROPPED_BLOCK_COUNT) {\n log('Incrementing dropped block count', { id, droppedBlockCount });\n this.#droppedBlockCountByHash.set(hash, droppedBlockCount + 1);\n return false;\n }\n\n log('Hit dropped block count', id);\n\n this.#droppedBlockCountByHash.delete(hash);\n return true;\n }\n\n #isNonceTaken(txMeta: TransactionMeta): boolean {\n const { id, txParams } = txMeta;\n\n return this.#getCurrentChainTransactions().some(\n (tx) =>\n tx.id !== id &&\n tx.txParams.from === txParams.from &&\n tx.status === TransactionStatus.confirmed &&\n tx.txParams.nonce === txParams.nonce &&\n tx.type !== TransactionType.incoming,\n );\n }\n\n #getPendingTransactions(): TransactionMeta[] {\n return this.#getCurrentChainTransactions().filter(\n (tx) =>\n tx.status === TransactionStatus.submitted &&\n !tx.verifiedOnBlockchain &&\n !tx.isUserOperation,\n );\n }\n\n #warnTransaction(txMeta: TransactionMeta, error: string, message: string) {\n this.#updateTransaction(\n {\n ...txMeta,\n warning: { error, message },\n },\n 'PendingTransactionTracker:#warnTransaction - Warning added',\n );\n }\n\n #failTransaction(txMeta: TransactionMeta, error: Error) {\n log('Transaction failed', txMeta.id, error);\n this.hub.emit('transaction-failed', txMeta, error);\n }\n\n #dropTransaction(txMeta: TransactionMeta) {\n log('Transaction dropped', txMeta.id);\n this.hub.emit('transaction-dropped', txMeta);\n }\n\n #updateTransaction(txMeta: TransactionMeta, note: string) {\n this.hub.emit('transaction-updated', txMeta, note);\n }\n\n async #getTransactionReceipt(\n txHash?: string,\n ): Promise {\n return await query(this.#getEthQuery(), 'getTransactionReceipt', [txHash]);\n }\n\n async #getBlockByHash(\n blockHash: string,\n includeTransactionDetails: boolean,\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Promise {\n return await query(this.#getEthQuery(), 'getBlockByHash', [\n blockHash,\n includeTransactionDetails,\n ]);\n }\n\n async #getNetworkTransactionCount(address: string): Promise {\n return await query(this.#getEthQuery(), 'getTransactionCount', [address]);\n }\n\n #getCurrentChainTransactions(): TransactionMeta[] {\n const currentChainId = this.#getChainId();\n\n return this.#getTransactions().filter(\n (tx) => tx.chainId === currentChainId,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,aAAa;AAMtB,OAAO,kBAAkB;AACzB,SAAS,WAAW,aAAa;AAUjC,IAAM,sBAAs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KAAK,uBAAuB,QAAQ,IAAI;AACnD;AAEM;AAAA,2BAAsB,eAC1B,QACyC;AACzC,SAAO,MAAM,MAAM,mBAAK,cAAL,YAAqB,yBAAyB,CAAC,MAAM,CAAC;AAC3E;AAEM;AAAA,oBAAe,eACnB,WACA,2BAGc;AACd,SAAO,MAAM,MAAM,mBAAK,cAAL,YAAqB,kBAAkB;AAAA,IACxD;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEM;AAAA,gCAA2B,eAAC,SAAkC;AAClE,SAAO,MAAM,MAAM,mBAAK,cAAL,YAAqB,uBAAuB,CAAC,OAAO,CAAC;AAC1E;AAEA;AAAA,iCAA4B,WAAsB;AAChD,QAAM,iBAAiB,mBAAK,aAAL;AAEvB,SAAO,mBAAK,kBAAL,WAAwB;AAAA,IAC7B,CAAC,OAAO,GAAG,YAAY;AAAA,EACzB;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-6DDVVUJC.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-6DDVVUJC.mjs.map +deleted file mode 100644 +index 0bbef05..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-6DDVVUJC.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/nonce.ts"],"sourcesContent":["import { toHex } from '@metamask/controller-utils';\nimport type {\n NonceLock,\n Transaction as NonceTrackerTransaction,\n} from '@metamask/nonce-tracker';\n\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionMeta, TransactionStatus } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'nonce');\n\n/**\n * Determine the next nonce to be used for a transaction.\n *\n * @param txMeta - The transaction metadata.\n * @param getNonceLock - An anonymous function that acquires the nonce lock for an address\n * @returns The next hexadecimal nonce to be used for the given transaction, and optionally a function to release the nonce lock.\n */\nexport async function getNextNonce(\n txMeta: TransactionMeta,\n getNonceLock: (address: string) => Promise,\n): Promise<[string, (() => void) | undefined]> {\n const {\n customNonceValue,\n txParams: { from, nonce: existingNonce },\n } = txMeta;\n\n const customNonce = customNonceValue ? toHex(customNonceValue) : undefined;\n\n if (customNonce) {\n log('Using custom nonce', customNonce);\n return [customNonce, undefined];\n }\n\n if (existingNonce) {\n log('Using existing nonce', existingNonce);\n return [existingNonce, undefined];\n }\n\n const nonceLock = await getNonceLock(from);\n const nonce = toHex(nonceLock.nextNonce);\n const releaseLock = nonceLock.releaseLock.bind(nonceLock);\n\n log('Using nonce from nonce tracker', nonce, nonceLock.nonceDetails);\n\n return [nonce, releaseLock];\n}\n\n/**\n * Filter and format transactions for the nonce tracker.\n *\n * @param currentChainId - Chain ID of the current network.\n * @param fromAddress - Address of the account from which the transactions to filter from are sent.\n * @param transactionStatus - Status of the transactions for which to filter.\n * @param transactions - Array of transactionMeta objects that have been prefiltered.\n * @returns Array of transactions formatted for the nonce tracker.\n */\nexport function getAndFormatTransactionsForNonceTracker(\n currentChainId: string,\n fromAddress: string,\n transactionStatus: TransactionStatus,\n transactions: TransactionMeta[],\n): NonceTrackerTransaction[] {\n return transactions\n .filter(\n ({ chainId, isTransfer, isUserOperation, status, txParams: { from } }) =>\n !isTransfer &&\n !isUserOperation &&\n chainId === currentChainId &&\n status === transactionStatus &&\n from.toLowerCase() === fromAddress.toLowerCase(),\n )\n .map(({ status, txParams: { from, gas, value, nonce } }) => {\n // the only value we care about is the nonce\n // but we need to return the other values to satisfy the type\n // TODO: refactor nonceTracker to not require this\n /* istanbul ignore next */\n return {\n status,\n history: [{}],\n txParams: {\n from: from ?? '',\n gas: gas ?? '',\n value: value ?? '',\n nonce: nonce ?? '',\n },\n };\n });\n}\n"],"mappings":";;;;;;AAAA,SAAS,aAAa;AAStB,IAAM,MAAM,mBAAmB,eAAe,OAAO;AASrD,eAAsB,aACpB,QACA,cAC6C;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA,UAAU,EAAE,MAAM,OAAO,cAAc;AAAA,EACzC,IAAI;AAEJ,QAAM,cAAc,mBAAmB,MAAM,gBAAgB,IAAI;AAEjE,MAAI,aAAa;AACf,QAAI,sBAAsB,WAAW;AACrC,WAAO,CAAC,aAAa,MAAS;AAAA,EAChC;AAEA,MAAI,eAAe;AACjB,QAAI,wBAAwB,aAAa;AACzC,WAAO,CAAC,eAAe,MAAS;AAAA,EAClC;AAEA,QAAM,YAAY,MAAM,aAAa,IAAI;AACzC,QAAM,QAAQ,MAAM,UAAU,SAAS;AACvC,QAAM,cAAc,UAAU,YAAY,KAAK,SAAS;AAExD,MAAI,kCAAkC,OAAO,UAAU,YAAY;AAEnE,SAAO,CAAC,OAAO,WAAW;AAC5B;AAWO,SAAS,wCACd,gBACA,aACA,mBACA,cAC2B;AAC3B,SAAO,aACJ;AAAA,IACC,CAAC,EAAE,SAAS,YAAY,iBAAiB,QAAQ,UAAU,EAAE,KAAK,EAAE,MAClE,CAAC,cACD,CAAC,mBACD,YAAY,kBACZ,WAAW,qBACX,KAAK,YAAY,MAAM,YAAY,YAAY;AAAA,EACnD,EACC,IAAI,CAAC,EAAE,QAAQ,UAAU,EAAE,MAAM,KAAK,OAAO,MAAM,EAAE,MAAM;AAK1D,WAAO;AAAA,MACL;AAAA,MACA,SAAS,CAAC,CAAC,CAAC;AAAA,MACZ,UAAU;AAAA,QACR,MAAM,QAAQ;AAAA,QACd,KAAK,OAAO;AAAA,QACZ,OAAO,SAAS;AAAA,QAChB,OAAO,SAAS;AAAA,MAClB;AAAA,IACF;AAAA,EACF,CAAC;AACL;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-6OLJWLKK.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-6OLJWLKK.js.map +deleted file mode 100644 +index d4d48cb..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-6OLJWLKK.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/MultichainTrackingHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,OAAO,cAAc;A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,IACA;AAAA,EACF,CAAC;AACH;AAEA;AAsBA;AAAA,sBAAiB,SAAC;AAAA,EAChB;AAAA,EACA;AACF,IAGI,CAAC,GAA8B;AACjC,MAAI;AAEJ,MAAI,iBAAiB;AACnB,QAAI;AACF,sBAAgB,mBAAK,uBAAL,WAA2B;AAAA,IAC7C,SAAS,KAAK;AACZ,iCAAI,iDAAiD;AAAA,IACvD;AAAA,EACF;AACA,MAAI,CAAC,iBAAiB,SAAS;AAC7B,QAAI;AACF,YAAM,4BACJ,mBAAK,+BAAL,WAAmC;AACrC,sBAAgB,mBAAK,uBAAL,WAA2B;AAAA,IAC7C,SAAS,KAAK;AACZ,iCAAI,yCAAyC;AAAA,IAC/C;AAAA,EACF;AACA,SAAO;AACT","sourcesContent":["import EthQuery from '@metamask/eth-query';\nimport type {\n NetworkClientId,\n NetworkController,\n NetworkClient,\n BlockTracker,\n Provider,\n NetworkControllerStateChangeEvent,\n} from '@metamask/network-controller';\nimport type { NonceLock, NonceTracker } from '@metamask/nonce-tracker';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\n\nimport { incomingTransactionsLogger as log } from '../logger';\nimport { EtherscanRemoteTransactionSource } from './EtherscanRemoteTransactionSource';\nimport type {\n IncomingTransactionHelper,\n IncomingTransactionOptions,\n} from './IncomingTransactionHelper';\nimport type { PendingTransactionTracker } from './PendingTransactionTracker';\n\n/**\n * Registry of network clients provided by the NetworkController\n */\ntype NetworkClientRegistry = ReturnType<\n NetworkController['getNetworkClientRegistry']\n>;\n\nexport type MultichainTrackingHelperOptions = {\n isMultichainEnabled: boolean;\n provider: Provider;\n nonceTracker: NonceTracker;\n incomingTransactionOptions: IncomingTransactionOptions;\n\n findNetworkClientIdByChainId: NetworkController['findNetworkClientIdByChainId'];\n getNetworkClientById: NetworkController['getNetworkClientById'];\n getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];\n\n removeIncomingTransactionHelperListeners: (\n IncomingTransactionHelper: IncomingTransactionHelper,\n ) => void;\n removePendingTransactionTrackerListeners: (\n pendingTransactionTracker: PendingTransactionTracker,\n ) => void;\n createNonceTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => NonceTracker;\n createIncomingTransactionHelper: (opts: {\n blockTracker: BlockTracker;\n etherscanRemoteTransactionSource: EtherscanRemoteTransactionSource;\n chainId?: Hex;\n }) => IncomingTransactionHelper;\n createPendingTransactionTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => PendingTransactionTracker;\n onNetworkStateChange: (\n listener: (\n ...payload: NetworkControllerStateChangeEvent['payload']\n ) => void,\n ) => void;\n};\n\nexport class MultichainTrackingHelper {\n #isMultichainEnabled: boolean;\n\n readonly #provider: Provider;\n\n readonly #nonceTracker: NonceTracker;\n\n readonly #incomingTransactionOptions: IncomingTransactionOptions;\n\n readonly #findNetworkClientIdByChainId: NetworkController['findNetworkClientIdByChainId'];\n\n readonly #getNetworkClientById: NetworkController['getNetworkClientById'];\n\n readonly #getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];\n\n readonly #removeIncomingTransactionHelperListeners: (\n IncomingTransactionHelper: IncomingTransactionHelper,\n ) => void;\n\n readonly #removePendingTransactionTrackerListeners: (\n pendingTransactionTracker: PendingTransactionTracker,\n ) => void;\n\n readonly #createNonceTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => NonceTracker;\n\n readonly #createIncomingTransactionHelper: (opts: {\n blockTracker: BlockTracker;\n chainId?: Hex;\n etherscanRemoteTransactionSource: EtherscanRemoteTransactionSource;\n }) => IncomingTransactionHelper;\n\n readonly #createPendingTransactionTracker: (opts: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }) => PendingTransactionTracker;\n\n readonly #nonceMutexesByChainId = new Map>();\n\n readonly #trackingMap: Map<\n NetworkClientId,\n {\n nonceTracker: NonceTracker;\n pendingTransactionTracker: PendingTransactionTracker;\n incomingTransactionHelper: IncomingTransactionHelper;\n }\n > = new Map();\n\n readonly #etherscanRemoteTransactionSourcesMap: Map<\n Hex,\n EtherscanRemoteTransactionSource\n > = new Map();\n\n constructor({\n isMultichainEnabled,\n provider,\n nonceTracker,\n incomingTransactionOptions,\n findNetworkClientIdByChainId,\n getNetworkClientById,\n getNetworkClientRegistry,\n removeIncomingTransactionHelperListeners,\n removePendingTransactionTrackerListeners,\n createNonceTracker,\n createIncomingTransactionHelper,\n createPendingTransactionTracker,\n onNetworkStateChange,\n }: MultichainTrackingHelperOptions) {\n this.#isMultichainEnabled = isMultichainEnabled;\n this.#provider = provider;\n this.#nonceTracker = nonceTracker;\n this.#incomingTransactionOptions = incomingTransactionOptions;\n\n this.#findNetworkClientIdByChainId = findNetworkClientIdByChainId;\n this.#getNetworkClientById = getNetworkClientById;\n this.#getNetworkClientRegistry = getNetworkClientRegistry;\n\n this.#removeIncomingTransactionHelperListeners =\n removeIncomingTransactionHelperListeners;\n this.#removePendingTransactionTrackerListeners =\n removePendingTransactionTrackerListeners;\n this.#createNonceTracker = createNonceTracker;\n this.#createIncomingTransactionHelper = createIncomingTransactionHelper;\n this.#createPendingTransactionTracker = createPendingTransactionTracker;\n\n onNetworkStateChange((_, patches) => {\n if (this.#isMultichainEnabled) {\n const networkClients = this.#getNetworkClientRegistry();\n patches.forEach(({ op, path }) => {\n if (op === 'remove' && path[0] === 'networkConfigurations') {\n const networkClientId = path[1] as NetworkClientId;\n delete networkClients[networkClientId];\n }\n });\n\n this.#refreshTrackingMap(networkClients);\n }\n });\n }\n\n initialize() {\n if (!this.#isMultichainEnabled) {\n return;\n }\n const networkClients = this.#getNetworkClientRegistry();\n this.#refreshTrackingMap(networkClients);\n }\n\n has(networkClientId: NetworkClientId) {\n return this.#trackingMap.has(networkClientId);\n }\n\n getEthQuery({\n networkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): EthQuery {\n if (!this.#isMultichainEnabled) {\n return new EthQuery(this.getProvider());\n }\n return new EthQuery(this.getProvider({ networkClientId, chainId }));\n }\n\n getProvider({\n networkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): Provider {\n if (!this.#isMultichainEnabled) {\n return this.#provider;\n }\n\n const networkClient = this.#getNetworkClient({\n networkClientId,\n chainId,\n });\n\n return networkClient?.provider || this.#provider;\n }\n\n /**\n * Gets the mutex intended to guard the nonceTracker for a particular chainId and key .\n *\n * @param opts - The options object.\n * @param opts.chainId - The hex chainId.\n * @param opts.key - The hex address (or constant) pertaining to the chainId\n * @returns Mutex instance for the given chainId and key pair\n */\n async acquireNonceLockForChainIdKey({\n chainId,\n key = 'global',\n }: {\n chainId: Hex;\n key?: string;\n }): Promise<() => void> {\n let nonceMutexesForChainId = this.#nonceMutexesByChainId.get(chainId);\n if (!nonceMutexesForChainId) {\n nonceMutexesForChainId = new Map();\n this.#nonceMutexesByChainId.set(chainId, nonceMutexesForChainId);\n }\n let nonceMutexForKey = nonceMutexesForChainId.get(key);\n if (!nonceMutexForKey) {\n nonceMutexForKey = new Mutex();\n nonceMutexesForChainId.set(key, nonceMutexForKey);\n }\n\n return await nonceMutexForKey.acquire();\n }\n\n /**\n * Gets the next nonce according to the nonce-tracker.\n * Ensure `releaseLock` is called once processing of the `nonce` value is complete.\n *\n * @param address - The hex string address for the transaction.\n * @param networkClientId - The network client ID for the transaction, used to fetch the correct nonce tracker.\n * @returns object with the `nextNonce` `nonceDetails`, and the releaseLock.\n */\n async getNonceLock(\n address: string,\n networkClientId?: NetworkClientId,\n ): Promise {\n let releaseLockForChainIdKey: (() => void) | undefined;\n let nonceTracker = this.#nonceTracker;\n if (networkClientId && this.#isMultichainEnabled) {\n const networkClient = this.#getNetworkClientById(networkClientId);\n releaseLockForChainIdKey = await this.acquireNonceLockForChainIdKey({\n chainId: networkClient.configuration.chainId,\n key: address,\n });\n const trackers = this.#trackingMap.get(networkClientId);\n if (!trackers) {\n throw new Error('missing nonceTracker for networkClientId');\n }\n nonceTracker = trackers.nonceTracker;\n }\n\n // Acquires the lock for the chainId + address and the nonceLock from the nonceTracker, then\n // couples them together by replacing the nonceLock's releaseLock method with\n // an anonymous function that calls releases both the original nonceLock and the\n // lock for the chainId.\n try {\n const nonceLock = await nonceTracker.getNonceLock(address);\n return {\n ...nonceLock,\n releaseLock: () => {\n nonceLock.releaseLock();\n releaseLockForChainIdKey?.();\n },\n };\n } catch (err) {\n releaseLockForChainIdKey?.();\n throw err;\n }\n }\n\n startIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n networkClientIds.forEach((networkClientId) => {\n this.#trackingMap.get(networkClientId)?.incomingTransactionHelper.start();\n });\n }\n\n stopIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n networkClientIds.forEach((networkClientId) => {\n this.#trackingMap.get(networkClientId)?.incomingTransactionHelper.stop();\n });\n }\n\n stopAllIncomingTransactionPolling() {\n for (const [, trackers] of this.#trackingMap) {\n trackers.incomingTransactionHelper.stop();\n }\n }\n\n async updateIncomingTransactions(networkClientIds: NetworkClientId[] = []) {\n const promises = await Promise.allSettled(\n networkClientIds.map(async (networkClientId) => {\n return await this.#trackingMap\n .get(networkClientId)\n ?.incomingTransactionHelper.update();\n }),\n );\n\n promises\n .filter((result) => result.status === 'rejected')\n .forEach((result) => {\n log(\n 'failed to update incoming transactions',\n (result as PromiseRejectedResult).reason,\n );\n });\n }\n\n checkForPendingTransactionAndStartPolling = () => {\n for (const [, trackers] of this.#trackingMap) {\n trackers.pendingTransactionTracker.startIfPendingTransactions();\n }\n };\n\n stopAllTracking() {\n for (const [networkClientId] of this.#trackingMap) {\n this.#stopTrackingByNetworkClientId(networkClientId);\n }\n }\n\n #refreshTrackingMap = (networkClients: NetworkClientRegistry) => {\n this.#refreshEtherscanRemoteTransactionSources(networkClients);\n\n const networkClientIds = Object.keys(networkClients);\n const existingNetworkClientIds = Array.from(this.#trackingMap.keys());\n\n // Remove tracking for NetworkClientIds that no longer exist\n const networkClientIdsToRemove = existingNetworkClientIds.filter(\n (id) => !networkClientIds.includes(id),\n );\n networkClientIdsToRemove.forEach((id) => {\n this.#stopTrackingByNetworkClientId(id);\n });\n\n // Start tracking new NetworkClientIds from the registry\n const networkClientIdsToAdd = networkClientIds.filter(\n (id) => !existingNetworkClientIds.includes(id),\n );\n networkClientIdsToAdd.forEach((id) => {\n this.#startTrackingByNetworkClientId(id);\n });\n };\n\n #stopTrackingByNetworkClientId(networkClientId: NetworkClientId) {\n const trackers = this.#trackingMap.get(networkClientId);\n if (trackers) {\n trackers.pendingTransactionTracker.stop();\n this.#removePendingTransactionTrackerListeners(\n trackers.pendingTransactionTracker,\n );\n trackers.incomingTransactionHelper.stop();\n this.#removeIncomingTransactionHelperListeners(\n trackers.incomingTransactionHelper,\n );\n this.#trackingMap.delete(networkClientId);\n }\n }\n\n #startTrackingByNetworkClientId(networkClientId: NetworkClientId) {\n const trackers = this.#trackingMap.get(networkClientId);\n if (trackers) {\n return;\n }\n\n const {\n provider,\n blockTracker,\n configuration: { chainId },\n } = this.#getNetworkClientById(networkClientId);\n\n let etherscanRemoteTransactionSource =\n this.#etherscanRemoteTransactionSourcesMap.get(chainId);\n if (!etherscanRemoteTransactionSource) {\n etherscanRemoteTransactionSource = new EtherscanRemoteTransactionSource({\n includeTokenTransfers:\n this.#incomingTransactionOptions.includeTokenTransfers,\n });\n this.#etherscanRemoteTransactionSourcesMap.set(\n chainId,\n etherscanRemoteTransactionSource,\n );\n }\n\n const nonceTracker = this.#createNonceTracker({\n provider,\n blockTracker,\n chainId,\n });\n\n const incomingTransactionHelper = this.#createIncomingTransactionHelper({\n blockTracker,\n etherscanRemoteTransactionSource,\n chainId,\n });\n\n const pendingTransactionTracker = this.#createPendingTransactionTracker({\n provider,\n blockTracker,\n chainId,\n });\n\n this.#trackingMap.set(networkClientId, {\n nonceTracker,\n incomingTransactionHelper,\n pendingTransactionTracker,\n });\n }\n\n #refreshEtherscanRemoteTransactionSources = (\n networkClients: NetworkClientRegistry,\n ) => {\n // this will be prettier when we have consolidated network clients with a single chainId:\n // check if there are still other network clients using the same chainId\n // if not remove the etherscanRemoteTransaction source from the map\n const chainIdsInRegistry = new Set();\n Object.values(networkClients).forEach((networkClient) =>\n chainIdsInRegistry.add(networkClient.configuration.chainId),\n );\n const existingChainIds = Array.from(\n this.#etherscanRemoteTransactionSourcesMap.keys(),\n );\n const chainIdsToRemove = existingChainIds.filter(\n (chainId) => !chainIdsInRegistry.has(chainId),\n );\n\n chainIdsToRemove.forEach((chainId) => {\n this.#etherscanRemoteTransactionSourcesMap.delete(chainId);\n });\n };\n\n #getNetworkClient({\n networkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): NetworkClient | undefined {\n let networkClient: NetworkClient | undefined;\n\n if (networkClientId) {\n try {\n networkClient = this.#getNetworkClientById(networkClientId);\n } catch (err) {\n log('failed to get network client by networkClientId');\n }\n }\n if (!networkClient && chainId) {\n try {\n const networkClientIdForChainId =\n this.#findNetworkClientIdByChainId(chainId);\n networkClient = this.#getNetworkClientById(networkClientIdForChainId);\n } catch (err) {\n log('failed to get network client by chainId');\n }\n }\n return networkClient;\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-6SJYXSF3.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-6SJYXSF3.mjs.map +deleted file mode 100644 +index 82d5415..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-6SJYXSF3.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { AccessList } from '@ethereumjs/tx';\nimport type EthQuery from '@metamask/eth-query';\nimport type { GasFeeState } from '@metamask/gas-fee-controller';\nimport type { NetworkClientId, Provider } from '@metamask/network-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Operation } from 'fast-json-patch';\n\n/**\n * Given a record, ensures that each property matches the `Json` type.\n */\n// TODO: Either fix this lint violation or explain why it's necessary to ignore.\n// eslint-disable-next-line @typescript-eslint/naming-convention\ntype MakeJsonCompatible = T extends Json\n ? T\n : {\n [K in keyof T]: T[K] extends Json ? T[K] : never;\n };\n\n/**\n * `Json` from `@metamask/utils` is defined as a recursive type alias, but\n * `Operation` is defined as an interface, and the two are not compatible with\n * each other. Therefore, this is a variant of Operation from `fast-json-patch`\n * which is guaranteed to be type-compatible with `Json`.\n */\ntype JsonCompatibleOperation = MakeJsonCompatible;\n\n/**\n * Representation of transaction metadata.\n */\nexport type TransactionMeta = TransactionMetaBase &\n (\n | {\n status: Exclude;\n }\n | {\n status: TransactionStatus.failed;\n error: TransactionError;\n }\n );\n\n/**\n * Information about a single transaction such as status and block number.\n */\ntype TransactionMetaBase = {\n /**\n * ID of the transaction that approved the swap token transfer.\n */\n approvalTxId?: string;\n\n /**\n * Unique ID to prevent duplicate requests.\n */\n actionId?: string;\n\n /**\n * Base fee of the block as a hex value, introduced in EIP-1559.\n */\n baseFeePerGas?: Hex;\n\n /**\n * Number of the block where the transaction has been included.\n */\n blockNumber?: string;\n\n /**\n * The timestamp for when the block was collated.\n */\n blockTimestamp?: string;\n\n /**\n * Network code as per EIP-155 for this transaction.\n */\n chainId: Hex;\n\n /**\n * A string representing a name of transaction contract method.\n */\n contractMethodName?: string;\n\n /**\n * The balance of the token that is being sent.\n */\n currentTokenBalance?: string;\n\n /**\n * Unique ID for custodian transaction.\n */\n custodyId?: string;\n\n /**\n * Custodian transaction status.\n */\n custodyStatus?: string;\n\n /** The optional custom nonce override as a decimal string. */\n customNonceValue?: string;\n\n /**\n * The custom token amount is the amount set by the user.\n */\n customTokenAmount?: string;\n\n /**\n * The dapp proposed token amount.\n */\n dappProposedTokenAmount?: string;\n\n /**\n * Gas values provided by the dApp.\n */\n dappSuggestedGasFees?: DappSuggestedGasFees;\n\n /**\n * The initial gas values set when the transaction was first created.\n */\n defaultGasEstimates?: DefaultGasEstimates;\n\n /**\n * String to indicate what device the transaction was confirmed on.\n */\n deviceConfirmedOn?: WalletDevice;\n\n /**\n * The address of the token being received of swap transaction.\n */\n destinationTokenAddress?: string;\n\n /**\n * The raw amount of the destination token\n */\n destinationTokenAmount?: string;\n\n /**\n * The decimals of the token being received of swap transaction.\n */\n destinationTokenDecimals?: number;\n\n /**\n * The symbol of the token being received with swap.\n */\n destinationTokenSymbol?: string;\n\n /**\n * The estimated base fee of the transaction.\n */\n estimatedBaseFee?: string;\n\n /**\n * Which estimate level that the API suggested.\n */\n estimateSuggested?: string;\n\n /**\n * Which estimate level was used\n */\n estimateUsed?: string;\n\n /**\n * The chosen amount which will be the same as the originally proposed token\n * amount if the user does not edit the amount or will be a custom token\n * amount set by the user.\n */\n finalApprovalAmount?: string;\n\n /**\n * The number of the latest block when the transaction submit was first retried.\n */\n firstRetryBlockNumber?: string;\n\n /** Alternate EIP-1559 gas fee estimates for multiple priority levels. */\n gasFeeEstimates?: GasFeeEstimates;\n\n /** Whether the gas fee estimates have been checked at least once. */\n gasFeeEstimatesLoaded?: boolean;\n\n /**\n * A hex string of the transaction hash, used to identify the transaction on the network.\n */\n hash?: string;\n\n /**\n * A history of mutations to TransactionMeta.\n */\n history?: TransactionHistory;\n\n /**\n * Generated UUID associated with this transaction.\n */\n id: string;\n\n /**\n * Whether the transaction is a transfer.\n */\n isTransfer?: boolean;\n\n /**\n * Whether the transaction entry is generated from a user operation.\n */\n isUserOperation?: boolean;\n\n /**\n * Additional gas fees to cover the cost of persisting data on layer 1 for layer 2 networks.\n */\n layer1GasFee?: Hex;\n\n /**\n * The ID of the network client used by the transaction.\n */\n networkClientId?: NetworkClientId;\n\n /**\n * Network code as per EIP-155 for this transaction\n *\n * @deprecated Use `chainId` instead.\n */\n readonly networkID?: string;\n\n /**\n * Origin this transaction was sent from.\n */\n origin?: string;\n\n /**\n * The original dapp proposed token approval amount before edit by user.\n */\n originalApprovalAmount?: string;\n\n /**\n * The original gas estimation of the transaction.\n */\n originalGasEstimate?: string;\n\n /**\n * When we speed up a transaction, we set the type as Retry and we lose\n * information about type of transaction that is being set up, so we use\n * original type to track that information.\n */\n originalType?: TransactionType;\n\n /**\n * Account transaction balance after swap.\n */\n postTxBalance?: string;\n\n /**\n * Account transaction balance before swap.\n */\n preTxBalance?: string;\n\n /**\n * The previous gas properties before they were updated.\n */\n previousGas?: {\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gasLimit?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n };\n\n /**\n * The transaction's 'r' value as a hex string.\n */\n r?: string;\n\n /**\n * Hex representation of the underlying transaction.\n */\n rawTx?: string;\n\n /**\n * When the transaction is dropped, this is the replacement transaction hash.\n */\n replacedBy?: string;\n\n /**\n * When the transaction is dropped, this is the replacement transaction ID.\n */\n replacedById?: string;\n\n /**\n * The number of times that the transaction submit has been retried.\n */\n retryCount?: number;\n\n /**\n * The transaction's 's' value as a hex string.\n */\n s?: string;\n\n /**\n * Response from security validator.\n */\n securityAlertResponse?: SecurityAlertResponse;\n\n /**\n * Response from security provider.\n */\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n securityProviderResponse?: Record;\n\n /**\n * An array of entries that describe the user's journey through the send flow.\n * This is purely attached to state logs for troubleshooting and support.\n */\n sendFlowHistory?: SendFlowHistoryEntry[];\n\n /**\n * Simulation data for the transaction used to predict its outcome.\n */\n simulationData?: SimulationData;\n\n /**\n * If the gas estimation fails, an object containing error and block information.\n */\n simulationFails?: {\n reason?: string;\n errorKey?: string;\n debug: {\n blockNumber?: string;\n blockGasLimit?: string;\n };\n };\n\n /**\n * The time the transaction was submitted to the network, in Unix epoch time (ms).\n */\n submittedTime?: number;\n\n /**\n * The address of the token being swapped\n */\n sourceTokenAddress?: string;\n\n /**\n * The raw amount of the source swap token\n */\n sourceTokenAmount?: string;\n\n /**\n * The decimals of the token being swapped.\n */\n sourceTokenDecimals?: number;\n\n /**\n * The symbol of the token being swapped.\n */\n sourceTokenSymbol?: string;\n\n /**\n * The address of the swap recipient.\n */\n swapAndSendRecipient?: string;\n\n /**\n * The metadata of the swap transaction.\n */\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n swapMetaData?: Record;\n\n /**\n * The value of the token being swapped.\n */\n swapTokenValue?: string;\n\n /**\n * Timestamp associated with this transaction.\n */\n time: number;\n\n /**\n * Whether transaction recipient is a smart contract.\n */\n toSmartContract?: boolean;\n\n /**\n * Additional transfer information.\n */\n transferInformation?: {\n contractAddress: string;\n decimals: number;\n symbol: string;\n };\n\n /**\n * Underlying Transaction object.\n */\n txParams: TransactionParams;\n\n /**\n * Transaction receipt.\n */\n txReceipt?: TransactionReceipt;\n\n /**\n * The type of transaction such as `cancel` or `swap`.\n */\n type?: TransactionType;\n\n /**\n * The gas limit supplied by user.\n */\n userEditedGasLimit?: boolean;\n\n /**\n * Estimate level user selected.\n */\n userFeeLevel?: string;\n\n /**\n * The transaction's 'v' value as a hex string.\n */\n v?: string;\n\n /**\n * Whether the transaction is verified on the blockchain.\n */\n verifiedOnBlockchain?: boolean;\n\n /**\n * Warning information for the transaction.\n */\n warning?: {\n error: string;\n message: string;\n };\n};\n\nexport type SendFlowHistoryEntry = {\n /**\n * String to indicate user interaction information.\n */\n entry: string;\n\n /**\n * Timestamp associated with this entry.\n */\n timestamp: number;\n};\n\n/**\n * Represents the status of a transaction within the wallet.\n * Each status reflects the state of the transaction internally,\n * with some statuses corresponding to the transaction's state on the network.\n *\n * The typical transaction lifecycle follows this state machine:\n * unapproved -> approved -> signed -> submitted -> FINAL_STATE\n * where FINAL_STATE is one of: confirmed, failed, dropped, or rejected.\n */\nexport enum TransactionStatus {\n /**\n * The initial state of a transaction before user approval.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unapproved = 'unapproved',\n\n /**\n * The transaction has been approved by the user but is not yet signed.\n * This status is usually brief but may be longer for scenarios like hardware wallet usage.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n approved = 'approved',\n\n /**\n * The transaction is signed and in the process of being submitted to the network.\n * This status is typically short-lived but can be longer for certain cases, such as smart transactions.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n signed = 'signed',\n\n /**\n * The transaction has been submitted to the network and is awaiting confirmation.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n submitted = 'submitted',\n\n /**\n * The transaction has been successfully executed and confirmed on the blockchain.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n confirmed = 'confirmed',\n\n /**\n * The transaction encountered an error during execution on the blockchain and failed.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n failed = 'failed',\n\n /**\n * The transaction was superseded by another transaction, resulting in its dismissal.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n dropped = 'dropped',\n\n /**\n * The transaction was rejected by the user and not processed further.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n rejected = 'rejected',\n\n /**\n * @deprecated This status is no longer used.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n cancelled = 'cancelled',\n}\n\n/**\n * Options for wallet device.\n */\nexport enum WalletDevice {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MM_MOBILE = 'metamask_mobile',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MM_EXTENSION = 'metamask_extension',\n OTHER = 'other_device',\n}\n\n/**\n * The type of the transaction.\n */\nexport enum TransactionType {\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n cancel = 'cancel',\n\n /**\n * A transaction that is interacting with a smart contract's methods that we\n * have not treated as a special case, such as approve, transfer, and\n * transferfrom.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n contractInteraction = 'contractInteraction',\n\n /**\n * A transaction that deployed a smart contract.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n deployContract = 'contractDeployment',\n\n /**\n * A transaction for Ethereum decryption.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ethDecrypt = 'eth_decrypt',\n\n /**\n * A transaction for getting an encryption public key.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ethGetEncryptionPublicKey = 'eth_getEncryptionPublicKey',\n\n /**\n * An incoming (deposit) transaction.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n incoming = 'incoming',\n\n /**\n * A transaction for personal sign.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n personalSign = 'personal_sign',\n\n /**\n * When a transaction is failed it can be retried by\n * resubmitting the same transaction with a higher gas fee. This type is also used\n * to speed up pending transactions. This is accomplished by creating a new tx with\n * the same nonce and higher gas fees.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n retry = 'retry',\n\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n simpleSend = 'simpleSend',\n\n /**\n * A transaction that is signing typed data.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n signTypedData = 'eth_signTypedData',\n\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n smart = 'smart',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n swap = 'swap',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps, then sending the swapped token to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n swapAndSend = 'swapAndSend',\n\n /**\n * Similar to the approve type, a swap approval is a special case of ERC20\n * approve method that requests an allowance of the token to spend on behalf\n * of the user for the MetaMask Swaps contract. The first swap for any token\n * will have an accompanying swapApproval transaction.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n swapApproval = 'swapApproval',\n\n /**\n * A token transaction requesting an allowance of the token to spend on\n * behalf of the user.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodApprove = 'approve',\n\n /**\n * A token transaction transferring tokens from an account that the sender\n * has an allowance of. The method is prefixed with safe because when calling\n * this method the contract checks to ensure that the receiver is an address\n * capable of handling the token being sent.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodSafeTransferFrom = 'safetransferfrom',\n\n /**\n * A token transaction where the user is sending tokens that they own to\n * another address.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodTransfer = 'transfer',\n\n /**\n * A token transaction transferring tokens from an account that the sender\n * has an allowance of. For more information on allowances, see the approve\n * type.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodTransferFrom = 'transferfrom',\n\n /**\n * A token transaction requesting an allowance of all of a user's tokens to\n * spend on behalf of the user.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodSetApprovalForAll = 'setapprovalforall',\n\n /**\n * Increase the allowance by a given increment\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodIncreaseAllowance = 'increaseAllowance',\n}\n\n/**\n * Standard data concerning a transaction to be processed by the blockchain.\n */\nexport type TransactionParams = {\n /**\n * A list of addresses and storage keys that the transaction plans to access.\n */\n accessList?: AccessList;\n\n /**\n * Network ID as per EIP-155.\n */\n chainId?: Hex;\n\n /**\n * Data to pass with this transaction.\n */\n data?: string;\n\n /**\n * Error message for gas estimation failure.\n */\n estimateGasError?: string;\n\n /**\n * Estimated base fee for this transaction.\n */\n estimatedBaseFee?: string;\n\n /**\n * Which estimate level that the API suggested.\n */\n estimateSuggested?: string;\n\n /**\n * Which estimate level was used\n */\n estimateUsed?: string;\n\n /**\n * Address to send this transaction from.\n */\n from: string;\n\n /**\n * same as gasLimit?\n */\n gas?: string;\n\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gasLimit?: string;\n\n /**\n * Price per gas for legacy txs\n */\n gasPrice?: string;\n\n /**\n * Gas used in the transaction.\n */\n gasUsed?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority\n * fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n\n /**\n * Unique number to prevent replay attacks.\n */\n nonce?: string;\n\n /**\n * Address to send this transaction to.\n */\n to?: string;\n\n /**\n * Value associated with this transaction.\n */\n value?: string;\n\n /**\n * Type of transaction.\n * 0x0 indicates a legacy transaction.\n */\n type?: string;\n};\n\n/**\n * Standard data concerning a transaction processed by the blockchain.\n */\nexport type TransactionReceipt = {\n /**\n * The block hash of the block that this transaction was included in.\n */\n blockHash?: string;\n\n /**\n * The block number of the block that this transaction was included in.\n */\n blockNumber?: string;\n\n /**\n * Effective gas price the transaction was charged at.\n */\n effectiveGasPrice?: string;\n\n /**\n * Gas used in the transaction.\n */\n gasUsed?: string;\n\n /**\n * Total used gas in hex.\n */\n l1Fee?: string;\n\n /**\n * All the logs emitted by this transaction.\n */\n logs?: Log[];\n\n /**\n * The status of the transaction.\n */\n status?: string;\n\n /**\n * The hexadecimal index of this transaction in the list of transactions included in the block this transaction was mined in.\n */\n transactionIndex?: string;\n};\n\n/**\n * Represents an event that has been included in a transaction using the EVM `LOG` opcode.\n */\nexport type Log = {\n /**\n * Address of the contract that generated log.\n */\n address?: string;\n /**\n * List of topics for log.\n */\n topics?: string;\n};\n\n/**\n * The configuration required to fetch transaction data from a RemoteTransactionSource.\n */\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface RemoteTransactionSourceRequest {\n /**\n * The address of the account to fetch transactions for.\n */\n address: string;\n\n /**\n * The chainId of the current network.\n */\n currentChainId: Hex;\n\n /**\n * Block number to start fetching transactions from.\n */\n fromBlock?: number;\n\n /**\n * Maximum number of transactions to retrieve.\n */\n limit?: number;\n}\n\n/**\n * An object capable of fetching transaction data from a remote source.\n * Used by the IncomingTransactionHelper to retrieve remote transaction data.\n */\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface RemoteTransactionSource {\n /**\n * @param chainId - The chainId of the current network.\n * @returns Whether the remote transaction source supports the specified network.\n */\n isSupportedNetwork: (chainId: Hex) => boolean;\n\n /**\n * @returns An array of additional keys to use when caching the last fetched block number.\n */\n getLastBlockVariations?: () => string[];\n\n /**\n * @param request - A request object containing data such as the address and chain ID.\n * @returns An array of transaction metadata for the retrieved transactions.\n */\n fetchTransactions: (\n request: RemoteTransactionSourceRequest,\n ) => Promise;\n}\n\n/**\n * Gas values initially suggested by the dApp.\n */\nexport type DappSuggestedGasFees = {\n gas?: string;\n gasPrice?: string;\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n};\n\n/**\n * Gas values saved by the user for a specific chain.\n */\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface SavedGasFees {\n maxBaseFee: string;\n priorityFee: string;\n}\n\n/**\n * A transaction history operation that includes a note and timestamp.\n */\ntype ExtendedHistoryOperation = JsonCompatibleOperation & {\n note?: string;\n timestamp?: number;\n};\n\n/**\n * A transaction history entry that includes the ExtendedHistoryOperation as the first element.\n */\nexport type TransactionHistoryEntry = [\n ExtendedHistoryOperation,\n ...JsonCompatibleOperation[],\n];\n\n/**\n * A transaction history that includes the transaction meta as the first element.\n * And the rest of the elements are the operation arrays that were applied to the transaction meta.\n */\nexport type TransactionHistory = [\n TransactionMeta,\n ...TransactionHistoryEntry[],\n];\n\n/**\n * Result of inferring the transaction type.\n */\nexport type InferTransactionTypeResult = {\n /**\n * The contract code, in hex format if it exists. '0x0' or\n * '0x' are also indicators of non-existent contract code.\n */\n getCodeResponse?: string | null;\n\n /**\n * The type of transaction\n */\n type: TransactionType;\n};\n\n/**\n * A function for verifying a transaction, whether it is malicious or not.\n */\nexport type SecurityProviderRequest = (\n requestData: TransactionMeta,\n messageType: string,\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise;\n\n/**\n * Specifies the shape of the base transaction parameters.\n * Added in EIP-2718.\n */\nexport enum TransactionEnvelopeType {\n /**\n * A legacy transaction, the very first type.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n legacy = '0x0',\n\n /**\n * EIP-2930 defined the access list transaction type that allowed for\n * specifying the state that a transaction would act upon in advance and\n * theoretically save on gas fees.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n accessList = '0x1',\n\n /**\n * The type introduced comes from EIP-1559, Fee Market describes the addition\n * of a baseFee to blocks that will be burned instead of distributed to\n * miners. Transactions of this type have both a maxFeePerGas (maximum total\n * amount in gwei per gas to spend on the transaction) which is inclusive of\n * the maxPriorityFeePerGas (maximum amount of gwei per gas from the\n * transaction fee to distribute to miner).\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n feeMarket = '0x2',\n}\n\n/**\n * The source of the gas fee parameters on a transaction.\n */\nexport enum UserFeeLevel {\n CUSTOM = 'custom',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n DAPP_SUGGESTED = 'dappSuggested',\n MEDIUM = 'medium',\n}\n\n/**\n * Initial gas values set when the transaction was first created.\n */\nexport type DefaultGasEstimates = {\n /**\n * Source of the gas fee values, such as `dappSuggested` or `medium`.\n */\n estimateType?: string;\n\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gas?: string;\n\n /**\n * Price per gas for legacy transactions.\n */\n gasPrice?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n};\n\n/**\n * Data concerning an error while processing a transaction.\n */\nexport type TransactionError = {\n /**\n * A descriptive error name.\n */\n name: string;\n\n /**\n * A descriptive error message providing details about the encountered error.\n */\n message: string;\n\n /**\n * The stack trace associated with the error, if available.\n */\n stack?: string;\n\n /**\n * An optional error code associated with the error.\n */\n code?: string;\n\n /**\n * The rpc property holds additional information related to the error.\n */\n // We are intentionally using `any` here instead of `Json` because it causes\n // `WritableDraft` from Immer to cause TypeScript to error\n // with \"Type instantiation is excessively deep and possibly infinite\". See:\n // \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rpc?: any;\n};\n\n/**\n * Type for security alert response from transaction validator.\n */\nexport type SecurityAlertResponse = {\n reason: string;\n features?: string[];\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n result_type: string;\n providerRequestsCount?: Record;\n};\n\n/** Alternate priority levels for which values are provided in gas fee estimates. */\nexport enum GasFeeEstimateLevel {\n Low = 'low',\n Medium = 'medium',\n High = 'high',\n}\n\n/** Type of gas fee estimate generated by a GasFeeFlow. */\nexport enum GasFeeEstimateType {\n FeeMarket = 'fee-market',\n Legacy = 'legacy',\n GasPrice = 'eth_gasPrice',\n}\n\n/** Gas fee estimates for a specific priority level. */\nexport type FeeMarketGasFeeEstimateForLevel = {\n /** Maximum amount to pay per gas. */\n maxFeePerGas: Hex;\n\n /** Maximum amount per gas to give to the validator as an incentive. */\n maxPriorityFeePerGas: Hex;\n};\n\n/** Gas fee estimates for a EIP-1559 transaction. */\nexport type FeeMarketGasFeeEstimates = {\n type: GasFeeEstimateType.FeeMarket;\n [GasFeeEstimateLevel.Low]: FeeMarketGasFeeEstimateForLevel;\n [GasFeeEstimateLevel.Medium]: FeeMarketGasFeeEstimateForLevel;\n [GasFeeEstimateLevel.High]: FeeMarketGasFeeEstimateForLevel;\n};\n\n/** Gas fee estimates for a legacy transaction. */\nexport type LegacyGasFeeEstimates = {\n type: GasFeeEstimateType.Legacy;\n [GasFeeEstimateLevel.Low]: Hex;\n [GasFeeEstimateLevel.Medium]: Hex;\n [GasFeeEstimateLevel.High]: Hex;\n};\n\n/** Gas fee estimates for a transaction retrieved with the eth_gasPrice method. */\nexport type GasPriceGasFeeEstimates = {\n type: GasFeeEstimateType.GasPrice;\n gasPrice: Hex;\n};\n\n/** Gas fee estimates for a transaction. */\nexport type GasFeeEstimates =\n | FeeMarketGasFeeEstimates\n | LegacyGasFeeEstimates\n | GasPriceGasFeeEstimates;\n\n/** Request to a gas fee flow to obtain gas fee estimates. */\nexport type GasFeeFlowRequest = {\n /** An EthQuery instance to enable queries to the associated RPC provider. */\n ethQuery: EthQuery;\n\n /** Gas fee controller data matching the chain ID of the transaction. */\n gasFeeControllerData: GasFeeState;\n\n /** The metadata of the transaction to obtain estimates for. */\n transactionMeta: TransactionMeta;\n};\n\n/** Response from a gas fee flow containing gas fee estimates. */\nexport type GasFeeFlowResponse = {\n /** The gas fee estimates for the transaction. */\n estimates: GasFeeEstimates;\n};\n\n/** A method of obtaining gas fee estimates for a specific transaction. */\nexport type GasFeeFlow = {\n /**\n * Determine if the gas fee flow supports the specified transaction.\n * @param transactionMeta - The transaction metadata.\n * @returns Whether the gas fee flow supports the transaction.\n */\n matchesTransaction(transactionMeta: TransactionMeta): boolean;\n\n /**\n * Get gas fee estimates for a specific transaction.\n * @param request - The gas fee flow request.\n * @returns The gas fee flow response containing the gas fee estimates.\n */\n getGasFees: (request: GasFeeFlowRequest) => Promise;\n};\n\n/** Request to a layer 1 gas fee flow to obtain layer 1 fee estimate. */\nexport type Layer1GasFeeFlowRequest = {\n /** RPC Provider instance. */\n provider: Provider;\n\n /** The metadata of the transaction to obtain estimates for. */\n transactionMeta: TransactionMeta;\n};\n\n/** Response from a layer 1 gas fee flow containing layer 1 fee estimate. */\nexport type Layer1GasFeeFlowResponse = {\n /** The gas fee estimates for the transaction. */\n layer1Fee: Hex;\n};\n\n/** A method of obtaining layer 1 gas fee estimates for a specific transaction. */\nexport type Layer1GasFeeFlow = {\n /**\n * Determine if the gas fee flow supports the specified transaction.\n * @param transactionMeta - The transaction metadata.\n * @returns Whether the layer1 gas fee flow supports the transaction.\n */\n matchesTransaction(transactionMeta: TransactionMeta): boolean;\n\n /**\n * Get layer 1 gas fee estimates for a specific transaction.\n * @param request - The gas fee flow request.\n * @returns The gas fee flow response containing the layer 1 gas fee estimate.\n */\n getLayer1Fee: (\n request: Layer1GasFeeFlowRequest,\n ) => Promise;\n};\n\n/** Simulation data concerning an update to a native or token balance. */\nexport type SimulationBalanceChange = {\n /** The balance before the transaction. */\n previousBalance: Hex;\n\n /** The balance after the transaction. */\n newBalance: Hex;\n\n /** The difference in balance. */\n difference: Hex;\n\n /** Whether the balance is increasing or decreasing. */\n isDecrease: boolean;\n};\n\n/** Token standards supported by simulation. */\nexport enum SimulationTokenStandard {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n erc20 = 'erc20',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n erc721 = 'erc721',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n erc1155 = 'erc1155',\n}\n\n/** Simulation data concerning an updated token. */\nexport type SimulationToken = {\n /** The token's contract address. */\n address: Hex;\n\n /** The standard of the token. */\n standard: SimulationTokenStandard;\n\n /** The ID of the token if supported by the standard. */\n id?: Hex;\n};\n\n/** Simulation data concerning a change to the a token balance. */\nexport type SimulationTokenBalanceChange = SimulationToken &\n SimulationBalanceChange;\n\nexport enum SimulationErrorCode {\n ChainNotSupported = 'chain-not-supported',\n Disabled = 'disabled',\n InvalidResponse = 'invalid-response',\n Reverted = 'reverted',\n}\n\n/** Error data for a failed simulation. */\nexport type SimulationError = {\n /** Error code to identify the error type. */\n code?: string | number;\n\n /** Error message to describe the error. */\n message?: string;\n};\n\n/** Simulation data for a transaction. */\nexport type SimulationData = {\n /** Error data if the simulation failed or the transaction reverted. */\n error?: SimulationError;\n\n /** Data concerning a change to the user's native balance. */\n nativeBalanceChange?: SimulationBalanceChange;\n\n /** Data concerning a change to the user's token balances. */\n tokenBalanceChanges: SimulationTokenBalanceChange[];\n};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L,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,YAAS;AAGT,EAAAA,cAAA,oBAAiB;AACjB,EAAAA,cAAA,YAAS;AALC,SAAAA;AAAA,GAAA;AAsFL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,SAAM;AACN,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAOL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,oBAAA,eAAY;AACZ,EAAAA,oBAAA,YAAS;AACT,EAAAA,oBAAA,cAAW;AAHD,SAAAA;AAAA,GAAA;AAgIL,IAAK,0BAAL,kBAAKC,6BAAL;AAGL,EAAAA,yBAAA,WAAQ;AAGR,EAAAA,yBAAA,YAAS;AAGT,EAAAA,yBAAA,aAAU;AATA,SAAAA;AAAA,GAAA;AA4BL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,uBAAoB;AACpB,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,qBAAkB;AAClB,EAAAA,qBAAA,cAAW;AAJD,SAAAA;AAAA,GAAA;","names":["TransactionStatus","WalletDevice","TransactionType","TransactionEnvelopeType","UserFeeLevel","GasFeeEstimateLevel","GasFeeEstimateType","SimulationTokenStandard","SimulationErrorCode"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-74W7X6BE.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-74W7X6BE.js.map +deleted file mode 100644 +index 0473d04..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-74W7X6BE.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/simulation.ts"],"names":["SupportedToken"],"mappings":";;;;;;;;;;;;;;;;;AACA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,aAAa;AAC/B,SAAS,UAAU,WAAW,kBAAkB;AAChD,SAAS,0BAAoC;AA4BtC,IAAK,iBAAL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AI,UAAU,GAAG;AAC3C,aAAO,CAAC,WAAW,iBAAiB;AAAA,IACtC,CAAC;AAAA,EACH;AACF","sourcesContent":["import type { Fragment, LogDescription, Result } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { hexToBN, toHex } from '@metamask/controller-utils';\nimport { abiERC20, abiERC721, abiERC1155 } from '@metamask/metamask-eth-abis';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport {\n ABI_SIMULATION_ERC20_WRAPPED,\n ABI_SIMULATION_ERC721_LEGACY,\n} from '../constants';\nimport {\n SimulationError,\n SimulationInvalidResponseError,\n SimulationRevertedError,\n} from '../errors';\nimport { projectLogger } from '../logger';\nimport type {\n SimulationBalanceChange,\n SimulationData,\n SimulationTokenBalanceChange,\n SimulationToken,\n} from '../types';\nimport { SimulationTokenStandard } from '../types';\nimport { simulateTransactions } from './simulation-api';\nimport type {\n SimulationResponseLog,\n SimulationRequestTransaction,\n SimulationResponse,\n SimulationResponseCallTrace,\n SimulationResponseTransaction,\n} from './simulation-api';\n\nexport enum SupportedToken {\n ERC20 = 'erc20',\n ERC721 = 'erc721',\n ERC1155 = 'erc1155',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ERC20_WRAPPED = 'erc20Wrapped',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ERC721_LEGACY = 'erc721Legacy',\n}\n\ntype ABI = Fragment[];\n\nexport type GetSimulationDataRequest = {\n chainId: Hex;\n from: Hex;\n to?: Hex;\n value?: Hex;\n data?: Hex;\n};\n\ntype ParsedEvent = {\n contractAddress: Hex;\n tokenStandard: SimulationTokenStandard;\n name: string;\n args: Record;\n abi: ABI;\n};\n\nconst log = createModuleLogger(projectLogger, 'simulation');\n\nconst SUPPORTED_EVENTS = [\n 'Transfer',\n 'TransferSingle',\n 'TransferBatch',\n 'Deposit',\n 'Withdrawal',\n];\n\nconst SUPPORTED_TOKEN_ABIS = {\n [SupportedToken.ERC20]: {\n abi: abiERC20,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721]: {\n abi: abiERC721,\n standard: SimulationTokenStandard.erc721,\n },\n [SupportedToken.ERC1155]: {\n abi: abiERC1155,\n standard: SimulationTokenStandard.erc1155,\n },\n [SupportedToken.ERC20_WRAPPED]: {\n abi: ABI_SIMULATION_ERC20_WRAPPED,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721_LEGACY]: {\n abi: ABI_SIMULATION_ERC721_LEGACY,\n standard: SimulationTokenStandard.erc721,\n },\n};\n\nconst REVERTED_ERRORS = ['execution reverted', 'insufficient funds for gas'];\n\ntype BalanceTransactionMap = Map;\n\n/**\n * Generate simulation data for a transaction.\n * @param request - The transaction to simulate.\n * @param request.chainId - The chain ID of the transaction.\n * @param request.from - The sender of the transaction.\n * @param request.to - The recipient of the transaction.\n * @param request.value - The value of the transaction.\n * @param request.data - The data of the transaction.\n * @returns The simulation data.\n */\nexport async function getSimulationData(\n request: GetSimulationDataRequest,\n): Promise {\n const { chainId, from, to, value, data } = request;\n\n log('Getting simulation data', request);\n\n try {\n const response = await simulateTransactions(chainId, {\n transactions: [\n {\n data,\n from,\n maxFeePerGas: '0x0',\n maxPriorityFeePerGas: '0x0',\n to,\n value,\n },\n ],\n withCallTrace: true,\n withLogs: true,\n });\n\n const transactionError = response.transactions?.[0]?.error;\n\n if (transactionError) {\n throw new SimulationError(transactionError);\n }\n\n const nativeBalanceChange = getNativeBalanceChange(request.from, response);\n const events = getEvents(response);\n\n log('Parsed events', events);\n\n const tokenBalanceChanges = await getTokenBalanceChanges(request, events);\n\n return {\n nativeBalanceChange,\n tokenBalanceChanges,\n };\n } catch (error) {\n log('Failed to get simulation data', error, request);\n\n let simulationError = error as SimulationError;\n\n if (\n REVERTED_ERRORS.some((revertErrorMessage) =>\n simulationError.message?.includes(revertErrorMessage),\n )\n ) {\n simulationError = new SimulationRevertedError();\n }\n\n const { code, message } = simulationError;\n\n return {\n tokenBalanceChanges: [],\n error: {\n code,\n message,\n },\n };\n }\n}\n\n/**\n * Extract the native balance change from a simulation response.\n * @param userAddress - The user's account address.\n * @param response - The simulation response.\n * @returns The native balance change or undefined if unchanged.\n */\nfunction getNativeBalanceChange(\n userAddress: Hex,\n response: SimulationResponse,\n): SimulationBalanceChange | undefined {\n const transactionResponse = response.transactions[0];\n\n /* istanbul ignore next */\n if (!transactionResponse) {\n return undefined;\n }\n\n const { stateDiff } = transactionResponse;\n const previousBalance = stateDiff?.pre?.[userAddress]?.balance;\n const newBalance = stateDiff?.post?.[userAddress]?.balance;\n\n if (!previousBalance || !newBalance) {\n return undefined;\n }\n\n return getSimulationBalanceChange(previousBalance, newBalance);\n}\n\n/**\n * Extract events from a simulation response.\n * @param response - The simulation response.\n * @returns The parsed events.\n */\nexport function getEvents(response: SimulationResponse): ParsedEvent[] {\n /* istanbul ignore next */\n const logs = extractLogs(\n response.transactions[0]?.callTrace ?? ({} as SimulationResponseCallTrace),\n );\n\n log('Extracted logs', logs);\n\n const interfaces = getContractInterfaces();\n\n return logs\n .map((currentLog) => {\n const event = parseLog(currentLog, interfaces);\n\n if (!event) {\n log('Failed to parse log', currentLog);\n return undefined;\n }\n\n /* istanbul ignore next */\n const inputs = event.abi.find((e) => e.name === event.name)?.inputs;\n\n /* istanbul ignore if */\n if (!inputs) {\n log('Failed to find inputs for event', event);\n return undefined;\n }\n\n const args = parseEventArgs(event.args, inputs);\n\n return {\n contractAddress: currentLog.address,\n tokenStandard: event.standard,\n name: event.name,\n args,\n abi: event.abi,\n };\n })\n .filter((e) => e !== undefined) as ParsedEvent[];\n}\n\n/**\n * Parse event arguments using ABI input definitions.\n * @param args - The raw event arguments.\n * @param abiInputs - The ABI input definitions.\n * @returns The parsed event arguments.\n */\nfunction parseEventArgs(\n args: Result,\n abiInputs: { name: string }[],\n): Record {\n return args.reduce((result, arg, index) => {\n const name = abiInputs[index].name.replace('_', '');\n const value = parseEventArgValue(arg);\n\n result[name] = value;\n\n return result;\n }, {});\n}\n\n/**\n * Parse an event argument value.\n * @param value - The event argument value.\n * @returns The parsed event argument value.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction parseEventArgValue(value: any): Hex | Hex[] {\n if (Array.isArray(value)) {\n return value.map(parseEventArgValue) as Hex[];\n }\n\n return (value.toHexString?.() ?? value).toLowerCase();\n}\n\n/**\n * Generate token balance changes from parsed events.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns An array of token balance changes.\n */\nasync function getTokenBalanceChanges(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): Promise {\n const balanceTxs = getTokenBalanceTransactions(request, events);\n\n log('Generated balance transactions', [...balanceTxs.after.values()]);\n\n const transactions = [\n ...balanceTxs.before.values(),\n request,\n ...balanceTxs.after.values(),\n ];\n\n if (transactions.length === 1) {\n return [];\n }\n\n const response = await simulateTransactions(request.chainId as Hex, {\n transactions,\n });\n\n log('Balance simulation response', response);\n\n if (response.transactions.length !== transactions.length) {\n throw new SimulationInvalidResponseError();\n }\n\n let prevBalanceTxIndex = 0;\n return [...balanceTxs.after.keys()]\n .map((token, index) => {\n const previousBalanceCheckSkipped = !balanceTxs.before.get(token);\n const previousBalance = previousBalanceCheckSkipped\n ? '0x0'\n : getValueFromBalanceTransaction(\n request.from,\n token,\n // eslint-disable-next-line no-plusplus\n response.transactions[prevBalanceTxIndex++],\n );\n\n const newBalance = getValueFromBalanceTransaction(\n request.from,\n token,\n response.transactions[index + balanceTxs.before.size + 1],\n );\n\n const balanceChange = getSimulationBalanceChange(\n previousBalance,\n newBalance,\n );\n\n if (!balanceChange) {\n return undefined;\n }\n\n return {\n ...token,\n ...balanceChange,\n };\n })\n .filter((change) => change !== undefined) as SimulationTokenBalanceChange[];\n}\n\n/**\n * Generate transactions to check token balances.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns A map of token balance transactions keyed by token.\n */\nfunction getTokenBalanceTransactions(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): {\n before: BalanceTransactionMap;\n after: BalanceTransactionMap;\n} {\n const tokenKeys = new Set();\n const before = new Map();\n const after = new Map();\n\n const userEvents = events.filter(\n (event) =>\n SUPPORTED_EVENTS.includes(event.name) &&\n [event.args.from, event.args.to].includes(request.from),\n );\n\n log('Filtered user events', userEvents);\n\n for (const event of userEvents) {\n const tokenIds = getEventTokenIds(event);\n\n log('Extracted token ids', tokenIds);\n\n for (const tokenId of tokenIds) {\n const simulationToken: SimulationToken = {\n address: event.contractAddress,\n standard: event.tokenStandard,\n id: tokenId,\n };\n\n const tokenKey = JSON.stringify(simulationToken);\n\n if (tokenKeys.has(tokenKey)) {\n log(\n 'Ignoring additional event with same contract and token ID',\n simulationToken,\n );\n continue;\n }\n\n tokenKeys.add(tokenKey);\n\n const data = getBalanceTransactionData(\n event.tokenStandard,\n request.from,\n tokenId,\n );\n\n const transaction: SimulationRequestTransaction = {\n from: request.from,\n to: event.contractAddress,\n data,\n };\n\n if (skipPriorBalanceCheck(event)) {\n after.set(simulationToken, transaction);\n } else {\n before.set(simulationToken, transaction);\n after.set(simulationToken, transaction);\n }\n }\n }\n\n return { before, after };\n}\n\n/**\n * Check if an event needs to check the previous balance.\n * @param event - The parsed event.\n * @returns True if the prior balance check should be skipped.\n */\nfunction skipPriorBalanceCheck(event: ParsedEvent): boolean {\n // In the case of an NFT mint, we cannot check the NFT owner before the mint\n // as the balance check transaction would revert.\n return (\n event.name === 'Transfer' &&\n event.tokenStandard === SimulationTokenStandard.erc721 &&\n parseInt(event.args.from as string, 16) === 0\n );\n}\n\n/**\n * Extract token IDs from a parsed event.\n * @param event - The parsed event.\n * @returns An array of token IDs.\n */\nfunction getEventTokenIds(event: ParsedEvent): (Hex | undefined)[] {\n if (event.tokenStandard === SimulationTokenStandard.erc721) {\n return [event.args.tokenId as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferSingle'\n ) {\n return [event.args.id as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferBatch'\n ) {\n return event.args.ids as Hex[];\n }\n\n // ERC-20 does not have a token ID so default to undefined.\n return [undefined];\n}\n\n/**\n * Extract the value from a balance transaction response.\n * @param from - The address to check the balance of.\n * @param token - The token to check the balance of.\n * @param response - The balance transaction response.\n * @returns The value of the balance transaction.\n */\nfunction getValueFromBalanceTransaction(\n from: Hex,\n token: SimulationToken,\n response: SimulationResponseTransaction,\n): Hex {\n const normalizedReturn = normalizeReturnValue(response.return);\n\n if (token.standard === SimulationTokenStandard.erc721) {\n return normalizedReturn === from ? '0x1' : '0x0';\n }\n\n return normalizedReturn;\n}\n\n/**\n * Generate the balance transaction data for a token.\n * @param tokenStandard - The token standard.\n * @param from - The address to check the balance of.\n * @param tokenId - The token ID to check the balance of.\n * @returns The balance transaction data.\n */\nfunction getBalanceTransactionData(\n tokenStandard: SimulationTokenStandard,\n from: Hex,\n tokenId?: Hex,\n): Hex {\n switch (tokenStandard) {\n case SimulationTokenStandard.erc721:\n return new Interface(abiERC721).encodeFunctionData('ownerOf', [\n tokenId,\n ]) as Hex;\n\n case SimulationTokenStandard.erc1155:\n return new Interface(abiERC1155).encodeFunctionData('balanceOf', [\n from,\n tokenId,\n ]) as Hex;\n\n default:\n return new Interface(abiERC20).encodeFunctionData('balanceOf', [\n from,\n ]) as Hex;\n }\n}\n\n/**\n * Parse a raw event log using known ABIs.\n * @param eventLog - The raw event log.\n * @param interfaces - The contract interfaces.\n * @returns The parsed event log or undefined if it could not be parsed.\n */\nfunction parseLog(\n eventLog: SimulationResponseLog,\n interfaces: Map,\n):\n | (LogDescription & { abi: ABI; standard: SimulationTokenStandard })\n | undefined {\n const supportedTokens = Object.values(SupportedToken);\n\n for (const token of supportedTokens) {\n try {\n const contractInterface = interfaces.get(token) as Interface;\n const { abi, standard } = SUPPORTED_TOKEN_ABIS[token];\n\n return {\n ...contractInterface.parseLog(eventLog),\n abi,\n standard,\n };\n } catch (e) {\n continue;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extract all logs from a call trace tree.\n * @param call - The root call trace.\n * @returns An array of logs.\n */\nfunction extractLogs(\n call: SimulationResponseCallTrace,\n): SimulationResponseLog[] {\n /* istanbul ignore next */\n const logs = call.logs ?? [];\n\n /* istanbul ignore next */\n const nestedCalls = call.calls ?? [];\n\n return [\n ...logs,\n ...nestedCalls.map((nestedCall) => extractLogs(nestedCall)).flat(),\n ];\n}\n\n/**\n * Generate balance change data from previous and new balances.\n * @param previousBalance - The previous balance.\n * @param newBalance - The new balance.\n * @returns The balance change data or undefined if unchanged.\n */\nfunction getSimulationBalanceChange(\n previousBalance: Hex,\n newBalance: Hex,\n): SimulationBalanceChange | undefined {\n const differenceBN = hexToBN(newBalance).sub(hexToBN(previousBalance));\n const isDecrease = differenceBN.isNeg();\n const difference = toHex(differenceBN.abs());\n\n if (differenceBN.isZero()) {\n log('Balance change is zero');\n return undefined;\n }\n\n return {\n previousBalance,\n newBalance,\n difference,\n isDecrease,\n };\n}\n\n/**\n * Normalize a return value.\n * @param value - The return value to normalize.\n * @returns The normalized return value.\n */\nfunction normalizeReturnValue(value: Hex): Hex {\n return toHex(hexToBN(value));\n}\n\n/**\n * Get the contract interfaces for all supported tokens.\n * @returns A map of supported tokens to their contract interfaces.\n */\nfunction getContractInterfaces(): Map {\n const supportedTokens = Object.values(SupportedToken);\n\n return new Map(\n supportedTokens.map((tokenType) => {\n const { abi } = SUPPORTED_TOKEN_ABIS[tokenType];\n const contractInterface = new Interface(abi);\n return [tokenType, contractInterface];\n }),\n );\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-76FONEDA.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-76FONEDA.js.map +deleted file mode 100644 +index 9798470..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-76FONEDA.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/gas-flow.ts"],"names":[],"mappings":";;;;;AAAA,SAAS,uBAAuB;AAwCzB,SAAS,cACd,iBACA,aACwB;AACxB,SAAO,YAAY;AAAA,IAAK,CAAC,eACvB,WAAW,mBAAmB,eAAe;AAAA,EAC/C;AACF;AASO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AACF,GAAgE;AAC9D,QAAM,0BAA0B,2BAA2B;AAE3D,MAAI,0DAA0D;AAC5D,WAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,MACxC,CAAC,QAAQ,WAAW;AAAA,QAClB,GAAG;AAAA,QACH,CAAC,KAAK,GAAG;AAAA,UACN,4BAAgD,KAAK;AAAA,UACtD,2BAA2B,KAAK;AAAA,QAClC;AAAA,MACF;AAAA,MACA,EAAE,GAAG,0BAA0B;AAAA,IACjC;AAAA,EACF;AAEA,MAAI,mDAAuD;AACzD,WAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,MACxC,CAAC,QAAQ,WAAW;AAAA,QAClB,GAAG;AAAA,QACH,CAAC,KAAK,GAAG,kBAAkB,4BAA4B,KAAK;AAAA,MAC9D;AAAA,MACA,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,2DAAyD;AAC3D,WAAO;AAAA,MACL,UAAU,oBAAoB,0BAA0B;AAAA,IAC1D;AAAA,EACF;AAEA,SAAO;AACT;AAQA,SAAS,uBACP,0BACA,2BACe;AACf,SAAO;AAAA,IACL,GAAG;AAAA,IACH,uBAAuB;AAAA,MACrB,0BAA0B;AAAA,IAC5B;AAAA,IACA,+BAA+B;AAAA,MAC7B,0BAA0B;AAAA,IAC5B;AAAA,EACF;AACF;AAQA,SAAS,kBACP,2BACA,OACQ;AACR,SAAO,gBAAgB,0BAA0B,KAAK,CAAC;AACzD;AAOA,SAAS,oBACP,2BACQ;AACR,SAAO,gBAAgB,0BAA0B,QAAQ;AAC3D","sourcesContent":["import { weiHexToGweiDec } from '@metamask/controller-utils';\nimport type {\n Eip1559GasFee,\n EthGasPriceEstimate,\n GasFeeEstimates,\n LegacyGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\nimport { type GasFeeState } from '@metamask/gas-fee-controller';\n\nimport type {\n FeeMarketGasFeeEstimates,\n GasPriceGasFeeEstimates,\n LegacyGasFeeEstimates,\n} from '../types';\nimport {\n type GasFeeFlow,\n type TransactionMeta,\n type FeeMarketGasFeeEstimateForLevel,\n GasFeeEstimateLevel,\n GasFeeEstimateType,\n} from '../types';\n\ntype MergeGasFeeEstimatesRequest = {\n gasFeeControllerEstimates:\n | GasFeeEstimates\n | LegacyGasPriceEstimate\n | EthGasPriceEstimate;\n transactionGasFeeEstimates:\n | FeeMarketGasFeeEstimates\n | LegacyGasFeeEstimates\n | GasPriceGasFeeEstimates;\n};\n\n/**\n * Returns the first gas fee flow that matches the transaction.\n *\n * @param transactionMeta - The transaction metadata to find a gas fee flow for.\n * @param gasFeeFlows - The gas fee flows to search.\n * @returns The first gas fee flow that matches the transaction, or undefined if none match.\n */\nexport function getGasFeeFlow(\n transactionMeta: TransactionMeta,\n gasFeeFlows: GasFeeFlow[],\n): GasFeeFlow | undefined {\n return gasFeeFlows.find((gasFeeFlow) =>\n gasFeeFlow.matchesTransaction(transactionMeta),\n );\n}\n\n/**\n * Merge the gas fee estimates from the gas fee controller with the gas fee estimates from a transaction.\n * @param request - Data required to merge gas fee estimates.\n * @param request.gasFeeControllerEstimates - Gas fee estimates from the GasFeeController.\n * @param request.transactionGasFeeEstimates - Gas fee estimates from the transaction.\n * @returns The merged gas fee estimates.\n */\nexport function mergeGasFeeEstimates({\n gasFeeControllerEstimates,\n transactionGasFeeEstimates,\n}: MergeGasFeeEstimatesRequest): GasFeeState['gasFeeEstimates'] {\n const transactionEstimateType = transactionGasFeeEstimates.type;\n\n if (transactionEstimateType === GasFeeEstimateType.FeeMarket) {\n return Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: mergeFeeMarketEstimate(\n (gasFeeControllerEstimates as GasFeeEstimates)?.[level],\n transactionGasFeeEstimates[level],\n ),\n }),\n { ...gasFeeControllerEstimates } as GasFeeEstimates,\n );\n }\n\n if (transactionEstimateType === GasFeeEstimateType.Legacy) {\n return Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: getLegacyEstimate(transactionGasFeeEstimates, level),\n }),\n {} as LegacyGasPriceEstimate,\n );\n }\n\n if (transactionEstimateType === GasFeeEstimateType.GasPrice) {\n return {\n gasPrice: getGasPriceEstimate(transactionGasFeeEstimates),\n };\n }\n\n return gasFeeControllerEstimates;\n}\n\n/**\n * Merge a specific priority level of EIP-1559 gas fee estimates.\n * @param gasFeeControllerEstimate - The gas fee estimate from the gas fee controller.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @returns The merged gas fee estimate.\n */\nfunction mergeFeeMarketEstimate(\n gasFeeControllerEstimate: Eip1559GasFee | undefined,\n transactionGasFeeEstimate: FeeMarketGasFeeEstimateForLevel,\n): Eip1559GasFee {\n return {\n ...gasFeeControllerEstimate,\n suggestedMaxFeePerGas: weiHexToGweiDec(\n transactionGasFeeEstimate.maxFeePerGas,\n ),\n suggestedMaxPriorityFeePerGas: weiHexToGweiDec(\n transactionGasFeeEstimate.maxPriorityFeePerGas,\n ),\n } as Eip1559GasFee;\n}\n\n/**\n * Generate a specific priority level for a legacy gas fee estimate.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @param level - The gas fee estimate level.\n * @returns The legacy gas fee estimate.\n */\nfunction getLegacyEstimate(\n transactionGasFeeEstimate: LegacyGasFeeEstimates,\n level: GasFeeEstimateLevel,\n): string {\n return weiHexToGweiDec(transactionGasFeeEstimate[level]);\n}\n\n/**\n * Generate the value for a gas price gas fee estimate.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @returns The legacy gas fee estimate.\n */\nfunction getGasPriceEstimate(\n transactionGasFeeEstimate: GasPriceGasFeeEstimates,\n): string {\n return weiHexToGweiDec(transactionGasFeeEstimate.gasPrice);\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-7LXE4KHV.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-7LXE4KHV.js.map +deleted file mode 100644 +index 1c3d017..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-7LXE4KHV.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/external-transactions.ts"],"names":[],"mappings":";AACA,SAAS,iBAAiB;AAYnB,SAAS,qCACd,iBACA,cACA,YACA;AACA,MAAI,CAAC,mBAAmB,CAAC,gBAAgB,UAAU;AACjD,UAAM,UAAU;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAEA,MAAI,gBAAgB,wCAAwC;AAC1D,UAAM,UAAU;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAkB,gBAAgB,SAAS;AACjD,MAAI,cAAc,WAAW,SAAS,GAAG;AACvC,UAAM,wBAAwB,WAAW;AAAA,MACvC,CAAC,OAAO,GAAG,UAAU,UAAU;AAAA,IACjC;AACA,QAAI,uBAAuB;AACzB,YAAM,UAAU;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,gBAAgB,aAAa,SAAS,GAAG;AAC3C,UAAM,0BAA0B,aAAa;AAAA,MAC3C,CAAC,OAAO,GAAG,UAAU,UAAU;AAAA,IACjC;AACA,QAAI,yBAAyB;AAC3B,YAAM,UAAU;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["// These utility functions are exclusively used by `confirmExternalTransaction` method in controller\nimport { rpcErrors } from '@metamask/rpc-errors';\n\nimport { TransactionStatus } from '../types';\nimport type { TransactionMeta } from '../types';\n\n/**\n * Validates the external provided transaction meta.\n *\n * @param transactionMeta - The transaction meta to validate.\n * @param confirmedTxs - The confirmed transactions in controller state.\n * @param pendingTxs - The submitted transactions in controller state.\n */\nexport function validateConfirmedExternalTransaction(\n transactionMeta?: TransactionMeta,\n confirmedTxs?: TransactionMeta[],\n pendingTxs?: TransactionMeta[],\n) {\n if (!transactionMeta || !transactionMeta.txParams) {\n throw rpcErrors.invalidParams(\n '\"transactionMeta\" or \"transactionMeta.txParams\" is missing',\n );\n }\n\n if (transactionMeta.status !== TransactionStatus.confirmed) {\n throw rpcErrors.invalidParams(\n 'External transaction status should be \"confirmed\"',\n );\n }\n\n const externalTxNonce = transactionMeta.txParams.nonce;\n if (pendingTxs && pendingTxs.length > 0) {\n const foundPendingTxByNonce = pendingTxs.find(\n (tx) => tx.txParams?.nonce === externalTxNonce,\n );\n if (foundPendingTxByNonce) {\n throw rpcErrors.invalidParams(\n 'External transaction nonce should not be in pending txs',\n );\n }\n }\n\n if (confirmedTxs && confirmedTxs.length > 0) {\n const foundConfirmedTxByNonce = confirmedTxs.find(\n (tx) => tx.txParams?.nonce === externalTxNonce,\n );\n if (foundConfirmedTxByNonce) {\n throw rpcErrors.invalidParams(\n 'External transaction nonce should not be in confirmed txs',\n );\n }\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-7NMV2NPM.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-7NMV2NPM.js.map +deleted file mode 100644 +index c2b01c3..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-7NMV2NPM.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/EtherscanRemoteTransactionSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAExB,SAAS,aAAa;AACtB,OAAO,QAAQ;AACf,SAAS,MAAM,cAAc;AAsB7B,IAAM,gCAAgC;AA1BtC;AA8BO,IAAM,mCAAN,MAEP;AAAA,EAOE,YAAY;AAAA,IACV;AAAA,EACF,IAAyC,CAAC,GAAG;AAuC7C;AA8CA;AAAA;AAAA;AAmBA;AAqBA;AAiBA;AAtJA;AAEA;AAEA,+BAAS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AAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb,IAAI,OAAO,EAAE,OAAO,KAAK,CAAC;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM,OAAO;AAAA,MACb,KAAK,QAAQ,IAAI,GAAG,OAAO,GAAG,CAAC;AAAA,MAC/B,UAAU,QAAQ,IAAI,GAAG,OAAO,QAAQ,CAAC;AAAA,MACzC,SAAS,QAAQ,IAAI,GAAG,OAAO,OAAO,CAAC;AAAA,MACvC,OAAO,QAAQ,IAAI,GAAG,OAAO,KAAK,CAAC;AAAA,MACnC,IAAI,OAAO;AAAA,MACX,OAAO,QAAQ,IAAI,GAAG,OAAO,KAAK,CAAC;AAAA,IACrC;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,EACxB;AACF","sourcesContent":["import { BNToHex } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport BN from 'bn.js';\nimport { v1 as random } from 'uuid';\n\nimport { ETHERSCAN_SUPPORTED_NETWORKS } from '../constants';\nimport { incomingTransactionsLogger as log } from '../logger';\nimport type {\n RemoteTransactionSource,\n RemoteTransactionSourceRequest,\n TransactionMeta,\n} from '../types';\nimport { TransactionStatus, TransactionType } from '../types';\nimport {\n fetchEtherscanTokenTransactions,\n fetchEtherscanTransactions,\n} from '../utils/etherscan';\nimport type {\n EtherscanTokenTransactionMeta,\n EtherscanTransactionMeta,\n EtherscanTransactionMetaBase,\n EtherscanTransactionRequest,\n EtherscanTransactionResponse,\n} from '../utils/etherscan';\n\nconst ETHERSCAN_RATE_LIMIT_INTERVAL = 5000;\n/**\n * A RemoteTransactionSource that fetches transaction data from Etherscan.\n */\nexport class EtherscanRemoteTransactionSource\n implements RemoteTransactionSource\n{\n #includeTokenTransfers: boolean;\n\n #isTokenRequestPending: boolean;\n\n #mutex = new Mutex();\n\n constructor({\n includeTokenTransfers,\n }: { includeTokenTransfers?: boolean } = {}) {\n this.#includeTokenTransfers = includeTokenTransfers ?? true;\n this.#isTokenRequestPending = false;\n }\n\n isSupportedNetwork(chainId: Hex): boolean {\n return Object.keys(ETHERSCAN_SUPPORTED_NETWORKS).includes(chainId);\n }\n\n getLastBlockVariations(): string[] {\n return [this.#isTokenRequestPending ? 'token' : 'normal'];\n }\n\n async fetchTransactions(\n request: RemoteTransactionSourceRequest,\n ): Promise {\n const releaseLock = await this.#mutex.acquire();\n const acquiredTime = Date.now();\n\n const etherscanRequest: EtherscanTransactionRequest = {\n ...request,\n chainId: request.currentChainId,\n };\n\n try {\n const transactions = this.#isTokenRequestPending\n ? await this.#fetchTokenTransactions(request, etherscanRequest)\n : await this.#fetchNormalTransactions(request, etherscanRequest);\n\n if (this.#includeTokenTransfers) {\n this.#isTokenRequestPending = !this.#isTokenRequestPending;\n }\n\n return transactions;\n } finally {\n this.#releaseLockAfterInterval(acquiredTime, releaseLock);\n }\n }\n\n #releaseLockAfterInterval(acquireTime: number, releaseLock: () => void) {\n const elapsedTime = Date.now() - acquireTime;\n const remainingTime = Math.max(\n 0,\n ETHERSCAN_RATE_LIMIT_INTERVAL - elapsedTime,\n );\n // Wait for the remaining time if it hasn't been 5 seconds yet\n if (remainingTime > 0) {\n setTimeout(releaseLock, remainingTime);\n } else {\n releaseLock();\n }\n }\n\n #fetchNormalTransactions = async (\n request: RemoteTransactionSourceRequest,\n etherscanRequest: EtherscanTransactionRequest,\n ) => {\n const { currentChainId } = request;\n\n const etherscanTransactions = await fetchEtherscanTransactions(\n etherscanRequest,\n );\n\n return this.#getResponseTransactions(etherscanTransactions).map((tx) =>\n this.#normalizeTransaction(tx, currentChainId),\n );\n };\n\n #fetchTokenTransactions = async (\n request: RemoteTransactionSourceRequest,\n etherscanRequest: EtherscanTransactionRequest,\n ) => {\n const { currentChainId } = request;\n\n const etherscanTransactions = await fetchEtherscanTokenTransactions(\n etherscanRequest,\n );\n\n return this.#getResponseTransactions(etherscanTransactions).map((tx) =>\n this.#normalizeTokenTransaction(tx, currentChainId),\n );\n };\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n #getResponseTransactions(\n response: EtherscanTransactionResponse,\n ): T[] {\n let result = response.result as T[];\n\n if (response.status === '0') {\n result = [];\n\n if (response.result.length) {\n log('Ignored Etherscan request error', {\n message: response.result,\n type: this.#isTokenRequestPending ? 'token' : 'normal',\n });\n }\n }\n\n return result;\n }\n\n #normalizeTransaction(\n txMeta: EtherscanTransactionMeta,\n currentChainId: Hex,\n ): TransactionMeta {\n const base = this.#normalizeTransactionBase(txMeta, currentChainId);\n\n return {\n ...base,\n txParams: {\n ...base.txParams,\n data: txMeta.input,\n },\n ...(txMeta.isError === '0'\n ? { status: TransactionStatus.confirmed }\n : {\n error: new Error('Transaction failed'),\n status: TransactionStatus.failed,\n }),\n };\n }\n\n #normalizeTokenTransaction(\n txMeta: EtherscanTokenTransactionMeta,\n currentChainId: Hex,\n ): TransactionMeta {\n const base = this.#normalizeTransactionBase(txMeta, currentChainId);\n\n return {\n ...base,\n isTransfer: true,\n transferInformation: {\n contractAddress: txMeta.contractAddress,\n decimals: Number(txMeta.tokenDecimal),\n symbol: txMeta.tokenSymbol,\n },\n };\n }\n\n #normalizeTransactionBase(\n txMeta: EtherscanTransactionMetaBase,\n currentChainId: Hex,\n ): TransactionMeta {\n const time = parseInt(txMeta.timeStamp, 10) * 1000;\n\n return {\n blockNumber: txMeta.blockNumber,\n chainId: currentChainId,\n hash: txMeta.hash,\n id: random({ msecs: time }),\n status: TransactionStatus.confirmed,\n time,\n txParams: {\n chainId: currentChainId,\n from: txMeta.from,\n gas: BNToHex(new BN(txMeta.gas)),\n gasPrice: BNToHex(new BN(txMeta.gasPrice)),\n gasUsed: BNToHex(new BN(txMeta.gasUsed)),\n nonce: BNToHex(new BN(txMeta.nonce)),\n to: txMeta.to,\n value: BNToHex(new BN(txMeta.value)),\n },\n type: TransactionType.incoming,\n verifiedOnBlockchain: false,\n };\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-ARZHJFVG.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-ARZHJFVG.js.map +deleted file mode 100644 +index aec3c7d..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-ARZHJFVG.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/LineaGasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,SAAS,SAAS,OAAO,aAAa;AAE/C,SAAS,0BAAoC;AAuB7C,IAAM,MAAM,mBAAmB,eAAe,oBAAoB;AAElE,IAAM,kBAAyB;AAAA,EAC7B,QAAQ,eAAe;AAAA,EACvB,QAAQ,cAAc;AAAA,EACtB,QAAQ,eAAe;AACzB;AAEA,IAAM,uBAAuB;AAAA,EAC3B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,IAAM,2BAA2B;AAAA,EAC/B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AACR;AA3CA;AAkDO,IAAM,kBAAN,MAA4C;AAAA,EAA5C;AAcL,uBAAM;AA4CN;AAgBA;AAgBA;AAWA;AAAA;AAAA,EApGA,mBAAmB,iBAA2C;AAC5D,WAAO,gBAAgB,SAAS,gBAAgB,OAAO;AAAA,EACzD;AAAA,EAEA,MAAM,WAAW,SAAyD;AACxE,QAAI;AACF,aAAO,MAAM,sBAAK,sCAAL,WAAsB;AAAA,IACrC,SAAS,OAAO;AACd,UAAI,+CAA+C,KAAK;AACxD,aAAO,IAAI,kBAAkB,EAAE,WAAW,OAAO;AAAA,IACnD;AAAA,EACF;AA8FF;AA5FQ;AAAA,qBAAgB,eACpB,SAC6B;AAC7B,QAAM,EAAE,UAAU,gBAAgB,IAAI;AAEtC,QAAM,gBAAgB,MAAM,sBAAK,wCAAL,WAC1B,iBACA;AAGF,MAAI,2BAA2B,aAAa;AAE5C,QAAM,WAAW,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,aAAa,MAAM;AAAA,IAC/C,MAAM,SAAS,KAAK,IAAI,aAAa,IAAI;AAAA,EAC3C;AACF;AAEA;AAAA,kBAAa,SAAC,MAAmB;AAC/B,SAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAAI,CAAC,UAC7C,KAAK,KAAK,EAAE,SAAS,EAAE;AAAA,EACzB;AACF","sourcesContent":["import { ChainId, hexToBN, query, toHex } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\nimport type BN from 'bn.js';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel, GasFeeEstimateType } from '../types';\nimport { DefaultGasFeeFlow } from './DefaultGasFeeFlow';\n\ntype LineaEstimateGasResponse = {\n baseFeePerGas: Hex;\n priorityFeePerGas: Hex;\n};\n\ntype FeesByLevel = {\n [key in GasFeeEstimateLevel]: BN;\n};\n\nconst log = createModuleLogger(projectLogger, 'linea-gas-fee-flow');\n\nconst LINEA_CHAIN_IDS: Hex[] = [\n ChainId['linea-mainnet'],\n ChainId['linea-goerli'],\n ChainId['linea-sepolia'],\n];\n\nconst BASE_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.35,\n high: 1.7,\n};\n\nconst PRIORITY_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.05,\n high: 1.1,\n};\n\n/**\n * Implementation of a gas fee flow specific to Linea networks that obtains gas fee estimates using:\n * - The `linea_estimateGas` RPC method to obtain the base fee and lowest priority fee.\n * - Static multipliers to increase the base and priority fees.\n */\nexport class LineaGasFeeFlow implements GasFeeFlow {\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return LINEA_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n try {\n return await this.#getLineaGasFees(request);\n } catch (error) {\n log('Using default flow as fallback due to error', error);\n return new DefaultGasFeeFlow().getGasFees(request);\n }\n }\n\n async #getLineaGasFees(\n request: GasFeeFlowRequest,\n ): Promise {\n const { ethQuery, transactionMeta } = request;\n\n const lineaResponse = await this.#getLineaResponse(\n transactionMeta,\n ethQuery,\n );\n\n log('Received Linea response', lineaResponse);\n\n const baseFees = this.#getValuesFromMultipliers(\n lineaResponse.baseFeePerGas,\n BASE_FEE_MULTIPLIERS,\n );\n\n log('Generated base fees', this.#feesToString(baseFees));\n\n const priorityFees = this.#getValuesFromMultipliers(\n lineaResponse.priorityFeePerGas,\n PRIORITY_FEE_MULTIPLIERS,\n );\n\n log('Generated priority fees', this.#feesToString(priorityFees));\n\n const maxFees = this.#getMaxFees(baseFees, priorityFees);\n\n log('Generated max fees', this.#feesToString(maxFees));\n\n const estimates = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: {\n maxFeePerGas: toHex(maxFees[level]),\n maxPriorityFeePerGas: toHex(priorityFees[level]),\n },\n }),\n { type: GasFeeEstimateType.FeeMarket } as GasFeeEstimates,\n );\n\n return { estimates };\n }\n\n #getLineaResponse(\n transactionMeta: TransactionMeta,\n ethQuery: EthQuery,\n ): Promise {\n return query(ethQuery, 'linea_estimateGas', [\n {\n from: transactionMeta.txParams.from,\n to: transactionMeta.txParams.to,\n value: transactionMeta.txParams.value,\n input: transactionMeta.txParams.data,\n // Required in request but no impact on response.\n gasPrice: '0x100000000',\n },\n ]);\n }\n\n #getValuesFromMultipliers(\n value: Hex,\n multipliers: { low: number; medium: number; high: number },\n ): FeesByLevel {\n const base = hexToBN(value);\n const low = base.muln(multipliers.low);\n const medium = base.muln(multipliers.medium);\n const high = base.muln(multipliers.high);\n\n return {\n low,\n medium,\n high,\n };\n }\n\n #getMaxFees(\n baseFees: Record,\n priorityFees: Record,\n ): FeesByLevel {\n return {\n low: baseFees.low.add(priorityFees.low),\n medium: baseFees.medium.add(priorityFees.medium),\n high: baseFees.high.add(priorityFees.high),\n };\n }\n\n #feesToString(fees: FeesByLevel) {\n return Object.values(GasFeeEstimateLevel).map((level) =>\n fees[level].toString(10),\n );\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-AYTU4HU5.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-AYTU4HU5.js.map +deleted file mode 100644 +index 1157255..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-AYTU4HU5.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/types.ts"],"names":["TransactionStatus","WalletDevice","TransactionType","TransactionEnvelopeType","UserFeeLevel","GasFeeEstimateLevel","GasFeeEstimateType","SimulationTokenStandard","SimulationErrorCode"],"mappings":";AA4cO,IAAK,oBAAL,kBAAKA,uBAAL;AAML,EAAAA,mBAAA,gBAAa;AAQb,EAAAA,mBAAA,cAAW;AAQX,EAAAA,mBAAA,YAAS;AAOT,EAAAA,mBAAA,eAAY;AAQZ,EAAAA,mBAAA,eAAY;AAQZ,EAAAA,mBAAA,YAAS;AAQT,EAAAA,mBAAA,aAAU;AAQV,EAAAA,mBAAA,cAAW;AAOX,EAAAA,mBAAA,eAAY;AApEF,SAAAA;AAAA,GAAA;AA0EL,IAAK,eAAL,kBAAKC,kBAAL;AAGL,EAAAA,cAAA,eAAY;AAGZ,EAAAA,cAAA,kBAAe;AACf,EAAAA,cAAA,WAAQ;AAPE,SAAAA;AAAA,GAAA;AAaL,IAAK,kBAAL,kBAAKC,qBAAL;AAML,EAAAA,iBAAA,YAAS;AAST,EAAAA,iBAAA,yBAAsB;AAOtB,EAAAA,iBAAA,oBAAiB;AAOjB,EAAAA,iBAAA,gBAAa;AAOb,EAAAA,iBAAA,+BAA4B;AAO5B,EAAAA,iBAAA,cAAW;AAOX,EAAAA,iBAAA,kBAAe;AAUf,EAAAA,iBAAA,WAAQ;AAOR,EAAAA,iBAAA,gBAAa;AAOb,EAAAA,iBAAA,mBAAgB;AAOhB,E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';\nimport type { GasFeeState } from '@metamask/gas-fee-controller';\nimport type { NetworkClientId, Provider } from '@metamask/network-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Operation } from 'fast-json-patch';\n\n/**\n * Given a record, ensures that each property matches the `Json` type.\n */\n// TODO: Either fix this lint violation or explain why it's necessary to ignore.\n// eslint-disable-next-line @typescript-eslint/naming-convention\ntype MakeJsonCompatible = T extends Json\n ? T\n : {\n [K in keyof T]: T[K] extends Json ? T[K] : never;\n };\n\n/**\n * `Json` from `@metamask/utils` is defined as a recursive type alias, but\n * `Operation` is defined as an interface, and the two are not compatible with\n * each other. Therefore, this is a variant of Operation from `fast-json-patch`\n * which is guaranteed to be type-compatible with `Json`.\n */\ntype JsonCompatibleOperation = MakeJsonCompatible;\n\n/**\n * Representation of transaction metadata.\n */\nexport type TransactionMeta = TransactionMetaBase &\n (\n | {\n status: Exclude;\n }\n | {\n status: TransactionStatus.failed;\n error: TransactionError;\n }\n );\n\n/**\n * Information about a single transaction such as status and block number.\n */\ntype TransactionMetaBase = {\n /**\n * ID of the transaction that approved the swap token transfer.\n */\n approvalTxId?: string;\n\n /**\n * Unique ID to prevent duplicate requests.\n */\n actionId?: string;\n\n /**\n * Base fee of the block as a hex value, introduced in EIP-1559.\n */\n baseFeePerGas?: Hex;\n\n /**\n * Number of the block where the transaction has been included.\n */\n blockNumber?: string;\n\n /**\n * The timestamp for when the block was collated.\n */\n blockTimestamp?: string;\n\n /**\n * Network code as per EIP-155 for this transaction.\n */\n chainId: Hex;\n\n /**\n * A string representing a name of transaction contract method.\n */\n contractMethodName?: string;\n\n /**\n * The balance of the token that is being sent.\n */\n currentTokenBalance?: string;\n\n /**\n * Unique ID for custodian transaction.\n */\n custodyId?: string;\n\n /**\n * Custodian transaction status.\n */\n custodyStatus?: string;\n\n /** The optional custom nonce override as a decimal string. */\n customNonceValue?: string;\n\n /**\n * The custom token amount is the amount set by the user.\n */\n customTokenAmount?: string;\n\n /**\n * The dapp proposed token amount.\n */\n dappProposedTokenAmount?: string;\n\n /**\n * Gas values provided by the dApp.\n */\n dappSuggestedGasFees?: DappSuggestedGasFees;\n\n /**\n * The initial gas values set when the transaction was first created.\n */\n defaultGasEstimates?: DefaultGasEstimates;\n\n /**\n * String to indicate what device the transaction was confirmed on.\n */\n deviceConfirmedOn?: WalletDevice;\n\n /**\n * The address of the token being received of swap transaction.\n */\n destinationTokenAddress?: string;\n\n /**\n * The raw amount of the destination token\n */\n destinationTokenAmount?: string;\n\n /**\n * The decimals of the token being received of swap transaction.\n */\n destinationTokenDecimals?: number;\n\n /**\n * The symbol of the token being received with swap.\n */\n destinationTokenSymbol?: string;\n\n /**\n * The estimated base fee of the transaction.\n */\n estimatedBaseFee?: string;\n\n /**\n * Which estimate level that the API suggested.\n */\n estimateSuggested?: string;\n\n /**\n * Which estimate level was used\n */\n estimateUsed?: string;\n\n /**\n * The chosen amount which will be the same as the originally proposed token\n * amount if the user does not edit the amount or will be a custom token\n * amount set by the user.\n */\n finalApprovalAmount?: string;\n\n /**\n * The number of the latest block when the transaction submit was first retried.\n */\n firstRetryBlockNumber?: string;\n\n /** Alternate EIP-1559 gas fee estimates for multiple priority levels. */\n gasFeeEstimates?: GasFeeEstimates;\n\n /** Whether the gas fee estimates have been checked at least once. */\n gasFeeEstimatesLoaded?: boolean;\n\n /**\n * A hex string of the transaction hash, used to identify the transaction on the network.\n */\n hash?: string;\n\n /**\n * A history of mutations to TransactionMeta.\n */\n history?: TransactionHistory;\n\n /**\n * Generated UUID associated with this transaction.\n */\n id: string;\n\n /**\n * Whether the transaction is a transfer.\n */\n isTransfer?: boolean;\n\n /**\n * Whether the transaction entry is generated from a user operation.\n */\n isUserOperation?: boolean;\n\n /**\n * Additional gas fees to cover the cost of persisting data on layer 1 for layer 2 networks.\n */\n layer1GasFee?: Hex;\n\n /**\n * The ID of the network client used by the transaction.\n */\n networkClientId?: NetworkClientId;\n\n /**\n * Network code as per EIP-155 for this transaction\n *\n * @deprecated Use `chainId` instead.\n */\n readonly networkID?: string;\n\n /**\n * Origin this transaction was sent from.\n */\n origin?: string;\n\n /**\n * The original dapp proposed token approval amount before edit by user.\n */\n originalApprovalAmount?: string;\n\n /**\n * The original gas estimation of the transaction.\n */\n originalGasEstimate?: string;\n\n /**\n * When we speed up a transaction, we set the type as Retry and we lose\n * information about type of transaction that is being set up, so we use\n * original type to track that information.\n */\n originalType?: TransactionType;\n\n /**\n * Account transaction balance after swap.\n */\n postTxBalance?: string;\n\n /**\n * Account transaction balance before swap.\n */\n preTxBalance?: string;\n\n /**\n * The previous gas properties before they were updated.\n */\n previousGas?: {\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gasLimit?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n };\n\n /**\n * The transaction's 'r' value as a hex string.\n */\n r?: string;\n\n /**\n * Hex representation of the underlying transaction.\n */\n rawTx?: string;\n\n /**\n * When the transaction is dropped, this is the replacement transaction hash.\n */\n replacedBy?: string;\n\n /**\n * When the transaction is dropped, this is the replacement transaction ID.\n */\n replacedById?: string;\n\n /**\n * The number of times that the transaction submit has been retried.\n */\n retryCount?: number;\n\n /**\n * The transaction's 's' value as a hex string.\n */\n s?: string;\n\n /**\n * Response from security validator.\n */\n securityAlertResponse?: SecurityAlertResponse;\n\n /**\n * Response from security provider.\n */\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n securityProviderResponse?: Record;\n\n /**\n * An array of entries that describe the user's journey through the send flow.\n * This is purely attached to state logs for troubleshooting and support.\n */\n sendFlowHistory?: SendFlowHistoryEntry[];\n\n /**\n * Simulation data for the transaction used to predict its outcome.\n */\n simulationData?: SimulationData;\n\n /**\n * If the gas estimation fails, an object containing error and block information.\n */\n simulationFails?: {\n reason?: string;\n errorKey?: string;\n debug: {\n blockNumber?: string;\n blockGasLimit?: string;\n };\n };\n\n /**\n * The time the transaction was submitted to the network, in Unix epoch time (ms).\n */\n submittedTime?: number;\n\n /**\n * The address of the token being swapped\n */\n sourceTokenAddress?: string;\n\n /**\n * The raw amount of the source swap token\n */\n sourceTokenAmount?: string;\n\n /**\n * The decimals of the token being swapped.\n */\n sourceTokenDecimals?: number;\n\n /**\n * The symbol of the token being swapped.\n */\n sourceTokenSymbol?: string;\n\n /**\n * The address of the swap recipient.\n */\n swapAndSendRecipient?: string;\n\n /**\n * The metadata of the swap transaction.\n */\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n swapMetaData?: Record;\n\n /**\n * The value of the token being swapped.\n */\n swapTokenValue?: string;\n\n /**\n * Timestamp associated with this transaction.\n */\n time: number;\n\n /**\n * Whether transaction recipient is a smart contract.\n */\n toSmartContract?: boolean;\n\n /**\n * Additional transfer information.\n */\n transferInformation?: {\n contractAddress: string;\n decimals: number;\n symbol: string;\n };\n\n /**\n * Underlying Transaction object.\n */\n txParams: TransactionParams;\n\n /**\n * Transaction receipt.\n */\n txReceipt?: TransactionReceipt;\n\n /**\n * The type of transaction such as `cancel` or `swap`.\n */\n type?: TransactionType;\n\n /**\n * The gas limit supplied by user.\n */\n userEditedGasLimit?: boolean;\n\n /**\n * Estimate level user selected.\n */\n userFeeLevel?: string;\n\n /**\n * The transaction's 'v' value as a hex string.\n */\n v?: string;\n\n /**\n * Whether the transaction is verified on the blockchain.\n */\n verifiedOnBlockchain?: boolean;\n\n /**\n * Warning information for the transaction.\n */\n warning?: {\n error: string;\n message: string;\n };\n};\n\nexport type SendFlowHistoryEntry = {\n /**\n * String to indicate user interaction information.\n */\n entry: string;\n\n /**\n * Timestamp associated with this entry.\n */\n timestamp: number;\n};\n\n/**\n * Represents the status of a transaction within the wallet.\n * Each status reflects the state of the transaction internally,\n * with some statuses corresponding to the transaction's state on the network.\n *\n * The typical transaction lifecycle follows this state machine:\n * unapproved -> approved -> signed -> submitted -> FINAL_STATE\n * where FINAL_STATE is one of: confirmed, failed, dropped, or rejected.\n */\nexport enum TransactionStatus {\n /**\n * The initial state of a transaction before user approval.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unapproved = 'unapproved',\n\n /**\n * The transaction has been approved by the user but is not yet signed.\n * This status is usually brief but may be longer for scenarios like hardware wallet usage.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n approved = 'approved',\n\n /**\n * The transaction is signed and in the process of being submitted to the network.\n * This status is typically short-lived but can be longer for certain cases, such as smart transactions.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n signed = 'signed',\n\n /**\n * The transaction has been submitted to the network and is awaiting confirmation.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n submitted = 'submitted',\n\n /**\n * The transaction has been successfully executed and confirmed on the blockchain.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n confirmed = 'confirmed',\n\n /**\n * The transaction encountered an error during execution on the blockchain and failed.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n failed = 'failed',\n\n /**\n * The transaction was superseded by another transaction, resulting in its dismissal.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n dropped = 'dropped',\n\n /**\n * The transaction was rejected by the user and not processed further.\n * This is a final state.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n rejected = 'rejected',\n\n /**\n * @deprecated This status is no longer used.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n cancelled = 'cancelled',\n}\n\n/**\n * Options for wallet device.\n */\nexport enum WalletDevice {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MM_MOBILE = 'metamask_mobile',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MM_EXTENSION = 'metamask_extension',\n OTHER = 'other_device',\n}\n\n/**\n * The type of the transaction.\n */\nexport enum TransactionType {\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n cancel = 'cancel',\n\n /**\n * A transaction that is interacting with a smart contract's methods that we\n * have not treated as a special case, such as approve, transfer, and\n * transferfrom.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n contractInteraction = 'contractInteraction',\n\n /**\n * A transaction that deployed a smart contract.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n deployContract = 'contractDeployment',\n\n /**\n * A transaction for Ethereum decryption.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ethDecrypt = 'eth_decrypt',\n\n /**\n * A transaction for getting an encryption public key.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ethGetEncryptionPublicKey = 'eth_getEncryptionPublicKey',\n\n /**\n * An incoming (deposit) transaction.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n incoming = 'incoming',\n\n /**\n * A transaction for personal sign.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n personalSign = 'personal_sign',\n\n /**\n * When a transaction is failed it can be retried by\n * resubmitting the same transaction with a higher gas fee. This type is also used\n * to speed up pending transactions. This is accomplished by creating a new tx with\n * the same nonce and higher gas fees.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n retry = 'retry',\n\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n simpleSend = 'simpleSend',\n\n /**\n * A transaction that is signing typed data.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n signTypedData = 'eth_signTypedData',\n\n /**\n * A transaction sending a network's native asset to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n smart = 'smart',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n swap = 'swap',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps, then sending the swapped token to a recipient.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n swapAndSend = 'swapAndSend',\n\n /**\n * Similar to the approve type, a swap approval is a special case of ERC20\n * approve method that requests an allowance of the token to spend on behalf\n * of the user for the MetaMask Swaps contract. The first swap for any token\n * will have an accompanying swapApproval transaction.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n swapApproval = 'swapApproval',\n\n /**\n * A token transaction requesting an allowance of the token to spend on\n * behalf of the user.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodApprove = 'approve',\n\n /**\n * A token transaction transferring tokens from an account that the sender\n * has an allowance of. The method is prefixed with safe because when calling\n * this method the contract checks to ensure that the receiver is an address\n * capable of handling the token being sent.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodSafeTransferFrom = 'safetransferfrom',\n\n /**\n * A token transaction where the user is sending tokens that they own to\n * another address.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodTransfer = 'transfer',\n\n /**\n * A token transaction transferring tokens from an account that the sender\n * has an allowance of. For more information on allowances, see the approve\n * type.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodTransferFrom = 'transferfrom',\n\n /**\n * A token transaction requesting an allowance of all of a user's tokens to\n * spend on behalf of the user.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodSetApprovalForAll = 'setapprovalforall',\n\n /**\n * Increase the allowance by a given increment\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tokenMethodIncreaseAllowance = 'increaseAllowance',\n}\n\n/**\n * Standard data concerning a transaction to be processed by the blockchain.\n */\nexport type TransactionParams = {\n /**\n * A list of addresses and storage keys that the transaction plans to access.\n */\n accessList?: AccessList;\n\n /**\n * Network ID as per EIP-155.\n */\n chainId?: Hex;\n\n /**\n * Data to pass with this transaction.\n */\n data?: string;\n\n /**\n * Error message for gas estimation failure.\n */\n estimateGasError?: string;\n\n /**\n * Estimated base fee for this transaction.\n */\n estimatedBaseFee?: string;\n\n /**\n * Which estimate level that the API suggested.\n */\n estimateSuggested?: string;\n\n /**\n * Which estimate level was used\n */\n estimateUsed?: string;\n\n /**\n * Address to send this transaction from.\n */\n from: string;\n\n /**\n * same as gasLimit?\n */\n gas?: string;\n\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gasLimit?: string;\n\n /**\n * Price per gas for legacy txs\n */\n gasPrice?: string;\n\n /**\n * Gas used in the transaction.\n */\n gasUsed?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority\n * fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n\n /**\n * Unique number to prevent replay attacks.\n */\n nonce?: string;\n\n /**\n * Address to send this transaction to.\n */\n to?: string;\n\n /**\n * Value associated with this transaction.\n */\n value?: string;\n\n /**\n * Type of transaction.\n * 0x0 indicates a legacy transaction.\n */\n type?: string;\n};\n\n/**\n * Standard data concerning a transaction processed by the blockchain.\n */\nexport type TransactionReceipt = {\n /**\n * The block hash of the block that this transaction was included in.\n */\n blockHash?: string;\n\n /**\n * The block number of the block that this transaction was included in.\n */\n blockNumber?: string;\n\n /**\n * Effective gas price the transaction was charged at.\n */\n effectiveGasPrice?: string;\n\n /**\n * Gas used in the transaction.\n */\n gasUsed?: string;\n\n /**\n * Total used gas in hex.\n */\n l1Fee?: string;\n\n /**\n * All the logs emitted by this transaction.\n */\n logs?: Log[];\n\n /**\n * The status of the transaction.\n */\n status?: string;\n\n /**\n * The hexadecimal index of this transaction in the list of transactions included in the block this transaction was mined in.\n */\n transactionIndex?: string;\n};\n\n/**\n * Represents an event that has been included in a transaction using the EVM `LOG` opcode.\n */\nexport type Log = {\n /**\n * Address of the contract that generated log.\n */\n address?: string;\n /**\n * List of topics for log.\n */\n topics?: string;\n};\n\n/**\n * The configuration required to fetch transaction data from a RemoteTransactionSource.\n */\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface RemoteTransactionSourceRequest {\n /**\n * The address of the account to fetch transactions for.\n */\n address: string;\n\n /**\n * The chainId of the current network.\n */\n currentChainId: Hex;\n\n /**\n * Block number to start fetching transactions from.\n */\n fromBlock?: number;\n\n /**\n * Maximum number of transactions to retrieve.\n */\n limit?: number;\n}\n\n/**\n * An object capable of fetching transaction data from a remote source.\n * Used by the IncomingTransactionHelper to retrieve remote transaction data.\n */\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface RemoteTransactionSource {\n /**\n * @param chainId - The chainId of the current network.\n * @returns Whether the remote transaction source supports the specified network.\n */\n isSupportedNetwork: (chainId: Hex) => boolean;\n\n /**\n * @returns An array of additional keys to use when caching the last fetched block number.\n */\n getLastBlockVariations?: () => string[];\n\n /**\n * @param request - A request object containing data such as the address and chain ID.\n * @returns An array of transaction metadata for the retrieved transactions.\n */\n fetchTransactions: (\n request: RemoteTransactionSourceRequest,\n ) => Promise;\n}\n\n/**\n * Gas values initially suggested by the dApp.\n */\nexport type DappSuggestedGasFees = {\n gas?: string;\n gasPrice?: string;\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n};\n\n/**\n * Gas values saved by the user for a specific chain.\n */\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface SavedGasFees {\n maxBaseFee: string;\n priorityFee: string;\n}\n\n/**\n * A transaction history operation that includes a note and timestamp.\n */\ntype ExtendedHistoryOperation = JsonCompatibleOperation & {\n note?: string;\n timestamp?: number;\n};\n\n/**\n * A transaction history entry that includes the ExtendedHistoryOperation as the first element.\n */\nexport type TransactionHistoryEntry = [\n ExtendedHistoryOperation,\n ...JsonCompatibleOperation[],\n];\n\n/**\n * A transaction history that includes the transaction meta as the first element.\n * And the rest of the elements are the operation arrays that were applied to the transaction meta.\n */\nexport type TransactionHistory = [\n TransactionMeta,\n ...TransactionHistoryEntry[],\n];\n\n/**\n * Result of inferring the transaction type.\n */\nexport type InferTransactionTypeResult = {\n /**\n * The contract code, in hex format if it exists. '0x0' or\n * '0x' are also indicators of non-existent contract code.\n */\n getCodeResponse?: string | null;\n\n /**\n * The type of transaction\n */\n type: TransactionType;\n};\n\n/**\n * A function for verifying a transaction, whether it is malicious or not.\n */\nexport type SecurityProviderRequest = (\n requestData: TransactionMeta,\n messageType: string,\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise;\n\n/**\n * Specifies the shape of the base transaction parameters.\n * Added in EIP-2718.\n */\nexport enum TransactionEnvelopeType {\n /**\n * A legacy transaction, the very first type.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n legacy = '0x0',\n\n /**\n * EIP-2930 defined the access list transaction type that allowed for\n * specifying the state that a transaction would act upon in advance and\n * theoretically save on gas fees.\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n accessList = '0x1',\n\n /**\n * The type introduced comes from EIP-1559, Fee Market describes the addition\n * of a baseFee to blocks that will be burned instead of distributed to\n * miners. Transactions of this type have both a maxFeePerGas (maximum total\n * amount in gwei per gas to spend on the transaction) which is inclusive of\n * the maxPriorityFeePerGas (maximum amount of gwei per gas from the\n * transaction fee to distribute to miner).\n */\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n feeMarket = '0x2',\n}\n\n/**\n * The source of the gas fee parameters on a transaction.\n */\nexport enum UserFeeLevel {\n CUSTOM = 'custom',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n DAPP_SUGGESTED = 'dappSuggested',\n MEDIUM = 'medium',\n}\n\n/**\n * Initial gas values set when the transaction was first created.\n */\nexport type DefaultGasEstimates = {\n /**\n * Source of the gas fee values, such as `dappSuggested` or `medium`.\n */\n estimateType?: string;\n\n /**\n * Maxmimum number of units of gas to use for this transaction.\n */\n gas?: string;\n\n /**\n * Price per gas for legacy transactions.\n */\n gasPrice?: string;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority fee.\n */\n maxFeePerGas?: string;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n */\n maxPriorityFeePerGas?: string;\n};\n\n/**\n * Data concerning an error while processing a transaction.\n */\nexport type TransactionError = {\n /**\n * A descriptive error name.\n */\n name: string;\n\n /**\n * A descriptive error message providing details about the encountered error.\n */\n message: string;\n\n /**\n * The stack trace associated with the error, if available.\n */\n stack?: string;\n\n /**\n * An optional error code associated with the error.\n */\n code?: string;\n\n /**\n * The rpc property holds additional information related to the error.\n */\n // We are intentionally using `any` here instead of `Json` because it causes\n // `WritableDraft` from Immer to cause TypeScript to error\n // with \"Type instantiation is excessively deep and possibly infinite\". See:\n // \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rpc?: any;\n};\n\n/**\n * Type for security alert response from transaction validator.\n */\nexport type SecurityAlertResponse = {\n reason: string;\n features?: string[];\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n result_type: string;\n providerRequestsCount?: Record;\n};\n\n/** Alternate priority levels for which values are provided in gas fee estimates. */\nexport enum GasFeeEstimateLevel {\n Low = 'low',\n Medium = 'medium',\n High = 'high',\n}\n\n/** Type of gas fee estimate generated by a GasFeeFlow. */\nexport enum GasFeeEstimateType {\n FeeMarket = 'fee-market',\n Legacy = 'legacy',\n GasPrice = 'eth_gasPrice',\n}\n\n/** Gas fee estimates for a specific priority level. */\nexport type FeeMarketGasFeeEstimateForLevel = {\n /** Maximum amount to pay per gas. */\n maxFeePerGas: Hex;\n\n /** Maximum amount per gas to give to the validator as an incentive. */\n maxPriorityFeePerGas: Hex;\n};\n\n/** Gas fee estimates for a EIP-1559 transaction. */\nexport type FeeMarketGasFeeEstimates = {\n type: GasFeeEstimateType.FeeMarket;\n [GasFeeEstimateLevel.Low]: FeeMarketGasFeeEstimateForLevel;\n [GasFeeEstimateLevel.Medium]: FeeMarketGasFeeEstimateForLevel;\n [GasFeeEstimateLevel.High]: FeeMarketGasFeeEstimateForLevel;\n};\n\n/** Gas fee estimates for a legacy transaction. */\nexport type LegacyGasFeeEstimates = {\n type: GasFeeEstimateType.Legacy;\n [GasFeeEstimateLevel.Low]: Hex;\n [GasFeeEstimateLevel.Medium]: Hex;\n [GasFeeEstimateLevel.High]: Hex;\n};\n\n/** Gas fee estimates for a transaction retrieved with the eth_gasPrice method. */\nexport type GasPriceGasFeeEstimates = {\n type: GasFeeEstimateType.GasPrice;\n gasPrice: Hex;\n};\n\n/** Gas fee estimates for a transaction. */\nexport type GasFeeEstimates =\n | FeeMarketGasFeeEstimates\n | LegacyGasFeeEstimates\n | GasPriceGasFeeEstimates;\n\n/** Request to a gas fee flow to obtain gas fee estimates. */\nexport type GasFeeFlowRequest = {\n /** An EthQuery instance to enable queries to the associated RPC provider. */\n ethQuery: EthQuery;\n\n /** Gas fee controller data matching the chain ID of the transaction. */\n gasFeeControllerData: GasFeeState;\n\n /** The metadata of the transaction to obtain estimates for. */\n transactionMeta: TransactionMeta;\n};\n\n/** Response from a gas fee flow containing gas fee estimates. */\nexport type GasFeeFlowResponse = {\n /** The gas fee estimates for the transaction. */\n estimates: GasFeeEstimates;\n};\n\n/** A method of obtaining gas fee estimates for a specific transaction. */\nexport type GasFeeFlow = {\n /**\n * Determine if the gas fee flow supports the specified transaction.\n * @param transactionMeta - The transaction metadata.\n * @returns Whether the gas fee flow supports the transaction.\n */\n matchesTransaction(transactionMeta: TransactionMeta): boolean;\n\n /**\n * Get gas fee estimates for a specific transaction.\n * @param request - The gas fee flow request.\n * @returns The gas fee flow response containing the gas fee estimates.\n */\n getGasFees: (request: GasFeeFlowRequest) => Promise;\n};\n\n/** Request to a layer 1 gas fee flow to obtain layer 1 fee estimate. */\nexport type Layer1GasFeeFlowRequest = {\n /** RPC Provider instance. */\n provider: Provider;\n\n /** The metadata of the transaction to obtain estimates for. */\n transactionMeta: TransactionMeta;\n};\n\n/** Response from a layer 1 gas fee flow containing layer 1 fee estimate. */\nexport type Layer1GasFeeFlowResponse = {\n /** The gas fee estimates for the transaction. */\n layer1Fee: Hex;\n};\n\n/** A method of obtaining layer 1 gas fee estimates for a specific transaction. */\nexport type Layer1GasFeeFlow = {\n /**\n * Determine if the gas fee flow supports the specified transaction.\n * @param transactionMeta - The transaction metadata.\n * @returns Whether the layer1 gas fee flow supports the transaction.\n */\n matchesTransaction(transactionMeta: TransactionMeta): boolean;\n\n /**\n * Get layer 1 gas fee estimates for a specific transaction.\n * @param request - The gas fee flow request.\n * @returns The gas fee flow response containing the layer 1 gas fee estimate.\n */\n getLayer1Fee: (\n request: Layer1GasFeeFlowRequest,\n ) => Promise;\n};\n\n/** Simulation data concerning an update to a native or token balance. */\nexport type SimulationBalanceChange = {\n /** The balance before the transaction. */\n previousBalance: Hex;\n\n /** The balance after the transaction. */\n newBalance: Hex;\n\n /** The difference in balance. */\n difference: Hex;\n\n /** Whether the balance is increasing or decreasing. */\n isDecrease: boolean;\n};\n\n/** Token standards supported by simulation. */\nexport enum SimulationTokenStandard {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n erc20 = 'erc20',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n erc721 = 'erc721',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n erc1155 = 'erc1155',\n}\n\n/** Simulation data concerning an updated token. */\nexport type SimulationToken = {\n /** The token's contract address. */\n address: Hex;\n\n /** The standard of the token. */\n standard: SimulationTokenStandard;\n\n /** The ID of the token if supported by the standard. */\n id?: Hex;\n};\n\n/** Simulation data concerning a change to the a token balance. */\nexport type SimulationTokenBalanceChange = SimulationToken &\n SimulationBalanceChange;\n\nexport enum SimulationErrorCode {\n ChainNotSupported = 'chain-not-supported',\n Disabled = 'disabled',\n InvalidResponse = 'invalid-response',\n Reverted = 'reverted',\n}\n\n/** Error data for a failed simulation. */\nexport type SimulationError = {\n /** Error code to identify the error type. */\n code?: string | number;\n\n /** Error message to describe the error. */\n message?: string;\n};\n\n/** Simulation data for a transaction. */\nexport type SimulationData = {\n /** Error data if the simulation failed or the transaction reverted. */\n error?: SimulationError;\n\n /** Data concerning a change to the user's native balance. */\n nativeBalanceChange?: SimulationBalanceChange;\n\n /** Data concerning a change to the user's token balances. */\n tokenBalanceChanges: SimulationTokenBalanceChange[];\n};\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-C3WC4OJ3.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-C3WC4OJ3.js.map +deleted file mode 100644 +index 45d1c04..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-C3WC4OJ3.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/gas-fees.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,OAAO,0BAA0B;AAqC1C,IAAM,MAAM,mBAAmB,eAAe,UAAU;AAExD,eAAsB,cAAc,SAA+B;AACjE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,gBAAgB,EAAE,GAAG,OAAO,SAAS;AAE3C,QAAM,SAAS,uBAAuB;AAAA,IACpC,OAAO;AAAA,EACT;AACA,QAAM,eAAe,SACjB,SACA,QAAQ,gBAAgB,OAAO,OAAO;AAE1C,QAAM,mBAAmB,MAAM,oBAAoB,OAAO;AAE1D,MAAI,sBAAsB,gBAAgB;AAE1C,QAAM,mBAAqC;AAAA,IACzC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,SAAS,eAAe,gBAAgB,gBAAgB;AAE/D,SAAO,SAAS,uBACd,wBAAwB,gBAAgB;AAE1C,SAAO,SAAS,WAAW,YAAY,gBAAgB;AACvD,SAAO,eAAe,gBAAgB,gBAAgB;AAEtD,MAAI,8BAA8B;AAAA,IAChC,cAAc,OAAO,SAAS;AAAA,IAC9B,sBAAsB,OAAO,SAAS;AAAA,IACtC,UAAU,OAAO,SAAS;AAAA,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AC,IAClC;AAEJ,SAAO,EAAE,SAAS;AACpB","sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n\nimport {\n ORIGIN_METAMASK,\n gweiDecToWEIBN,\n query,\n toHex,\n} from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type {\n FetchGasFeeEstimateOptions,\n GasFeeState,\n} from '@metamask/gas-fee-controller';\nimport type { Hex } from '@metamask/utils';\nimport { add0x, createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type {\n SavedGasFees,\n TransactionParams,\n TransactionMeta,\n TransactionType,\n GasFeeFlow,\n} from '../types';\nimport { GasFeeEstimateType, UserFeeLevel } from '../types';\nimport { getGasFeeFlow } from './gas-flow';\nimport { SWAP_TRANSACTION_TYPES } from './swaps';\n\nexport type UpdateGasFeesRequest = {\n eip1559: boolean;\n ethQuery: EthQuery;\n gasFeeFlows: GasFeeFlow[];\n getGasFeeEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n getSavedGasFees: (chainId: Hex) => SavedGasFees | undefined;\n txMeta: TransactionMeta;\n};\n\nexport type GetGasFeeRequest = UpdateGasFeesRequest & {\n initialParams: TransactionParams;\n savedGasFees?: SavedGasFees;\n suggestedGasFees: SuggestedGasFees;\n};\n\ntype SuggestedGasFees = {\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n gasPrice?: string;\n};\n\nconst log = createModuleLogger(projectLogger, 'gas-fees');\n\nexport async function updateGasFees(request: UpdateGasFeesRequest) {\n const { txMeta } = request;\n const initialParams = { ...txMeta.txParams };\n\n const isSwap = SWAP_TRANSACTION_TYPES.includes(\n txMeta.type as TransactionType,\n );\n const savedGasFees = isSwap\n ? undefined\n : request.getSavedGasFees(txMeta.chainId);\n\n const suggestedGasFees = await getSuggestedGasFees(request);\n\n log('Suggested gas fees', suggestedGasFees);\n\n const getGasFeeRequest: GetGasFeeRequest = {\n ...request,\n initialParams,\n savedGasFees,\n suggestedGasFees,\n };\n\n txMeta.txParams.maxFeePerGas = getMaxFeePerGas(getGasFeeRequest);\n\n txMeta.txParams.maxPriorityFeePerGas =\n getMaxPriorityFeePerGas(getGasFeeRequest);\n\n txMeta.txParams.gasPrice = getGasPrice(getGasFeeRequest);\n txMeta.userFeeLevel = getUserFeeLevel(getGasFeeRequest);\n\n log('Updated gas fee properties', {\n maxFeePerGas: txMeta.txParams.maxFeePerGas,\n maxPriorityFeePerGas: txMeta.txParams.maxPriorityFeePerGas,\n gasPrice: txMeta.txParams.gasPrice,\n });\n\n if (txMeta.txParams.maxFeePerGas || txMeta.txParams.maxPriorityFeePerGas) {\n delete txMeta.txParams.gasPrice;\n }\n\n if (txMeta.txParams.gasPrice) {\n delete txMeta.txParams.maxFeePerGas;\n delete txMeta.txParams.maxPriorityFeePerGas;\n }\n\n updateDefaultGasEstimates(txMeta);\n}\n\nexport function gweiDecimalToWeiHex(value: string) {\n return toHex(gweiDecToWEIBN(value));\n}\n\nfunction getMaxFeePerGas(request: GetGasFeeRequest): string | undefined {\n const { savedGasFees, eip1559, initialParams, suggestedGasFees } = request;\n\n if (!eip1559) {\n return undefined;\n }\n\n if (savedGasFees) {\n const maxFeePerGas = gweiDecimalToWeiHex(savedGasFees.maxBaseFee as string);\n log('Using maxFeePerGas from savedGasFees', maxFeePerGas);\n return maxFeePerGas;\n }\n\n if (initialParams.maxFeePerGas) {\n log('Using maxFeePerGas from request', initialParams.maxFeePerGas);\n return initialParams.maxFeePerGas;\n }\n\n if (initialParams.gasPrice && !initialParams.maxPriorityFeePerGas) {\n log(\n 'Setting maxFeePerGas to gasPrice from request',\n initialParams.gasPrice,\n );\n return initialParams.gasPrice;\n }\n\n if (suggestedGasFees.maxFeePerGas) {\n log('Using suggested maxFeePerGas', suggestedGasFees.maxFeePerGas);\n return suggestedGasFees.maxFeePerGas;\n }\n\n if (suggestedGasFees.gasPrice) {\n log(\n 'Setting maxFeePerGas to suggested gasPrice',\n suggestedGasFees.gasPrice,\n );\n return suggestedGasFees.gasPrice;\n }\n\n log('maxFeePerGas not set');\n return undefined;\n}\n\nfunction getMaxPriorityFeePerGas(\n request: GetGasFeeRequest,\n): string | undefined {\n const { eip1559, initialParams, savedGasFees, suggestedGasFees, txMeta } =\n request;\n\n if (!eip1559) {\n return undefined;\n }\n\n if (savedGasFees) {\n const maxPriorityFeePerGas = gweiDecimalToWeiHex(savedGasFees.priorityFee);\n log(\n 'Using maxPriorityFeePerGas from savedGasFees.priorityFee',\n maxPriorityFeePerGas,\n );\n return maxPriorityFeePerGas;\n }\n\n if (initialParams.maxPriorityFeePerGas) {\n log(\n 'Using maxPriorityFeePerGas from request',\n initialParams.maxPriorityFeePerGas,\n );\n return initialParams.maxPriorityFeePerGas;\n }\n\n if (initialParams.gasPrice && !initialParams.maxFeePerGas) {\n log(\n 'Setting maxPriorityFeePerGas to gasPrice from request',\n initialParams.gasPrice,\n );\n return initialParams.gasPrice;\n }\n\n if (suggestedGasFees.maxPriorityFeePerGas) {\n log(\n 'Using suggested maxPriorityFeePerGas',\n suggestedGasFees.maxPriorityFeePerGas,\n );\n return suggestedGasFees.maxPriorityFeePerGas;\n }\n\n if (txMeta.txParams.maxFeePerGas) {\n log(\n 'Setting maxPriorityFeePerGas to maxFeePerGas',\n txMeta.txParams.maxFeePerGas,\n );\n return txMeta.txParams.maxFeePerGas;\n }\n\n log('maxPriorityFeePerGas not set');\n return undefined;\n}\n\nfunction getGasPrice(request: GetGasFeeRequest): string | undefined {\n const { eip1559, initialParams, suggestedGasFees } = request;\n\n if (eip1559) {\n return undefined;\n }\n\n if (initialParams.gasPrice) {\n log('Using gasPrice from request', initialParams.gasPrice);\n return initialParams.gasPrice;\n }\n\n if (suggestedGasFees.maxFeePerGas) {\n log('Using suggested maxFeePerGas', suggestedGasFees.maxFeePerGas);\n return suggestedGasFees.maxFeePerGas;\n }\n\n if (suggestedGasFees.gasPrice) {\n log('Using suggested gasPrice', suggestedGasFees.gasPrice);\n return suggestedGasFees.gasPrice;\n }\n\n log('gasPrice not set');\n return undefined;\n}\n\nfunction getUserFeeLevel(request: GetGasFeeRequest): UserFeeLevel | undefined {\n const { eip1559, initialParams, savedGasFees, suggestedGasFees, txMeta } =\n request;\n\n if (!eip1559) {\n return undefined;\n }\n\n if (savedGasFees) {\n return UserFeeLevel.CUSTOM;\n }\n\n if (\n !initialParams.maxFeePerGas &&\n !initialParams.maxPriorityFeePerGas &&\n initialParams.gasPrice\n ) {\n return txMeta.origin === ORIGIN_METAMASK\n ? UserFeeLevel.CUSTOM\n : UserFeeLevel.DAPP_SUGGESTED;\n }\n\n if (\n !initialParams.maxFeePerGas &&\n !initialParams.maxPriorityFeePerGas &&\n suggestedGasFees.maxFeePerGas &&\n suggestedGasFees.maxPriorityFeePerGas\n ) {\n return UserFeeLevel.MEDIUM;\n }\n\n if (txMeta.origin === ORIGIN_METAMASK) {\n return UserFeeLevel.MEDIUM;\n }\n\n return UserFeeLevel.DAPP_SUGGESTED;\n}\n\nfunction updateDefaultGasEstimates(txMeta: TransactionMeta) {\n if (!txMeta.defaultGasEstimates) {\n txMeta.defaultGasEstimates = {};\n }\n\n txMeta.defaultGasEstimates.maxFeePerGas = txMeta.txParams.maxFeePerGas;\n\n txMeta.defaultGasEstimates.maxPriorityFeePerGas =\n txMeta.txParams.maxPriorityFeePerGas;\n\n txMeta.defaultGasEstimates.gasPrice = txMeta.txParams.gasPrice;\n txMeta.defaultGasEstimates.estimateType = txMeta.userFeeLevel;\n}\n\nasync function getSuggestedGasFees(\n request: UpdateGasFeesRequest,\n): Promise {\n const { eip1559, ethQuery, gasFeeFlows, getGasFeeEstimates, txMeta } =\n request;\n\n const { networkClientId } = txMeta;\n\n if (\n (!eip1559 && txMeta.txParams.gasPrice) ||\n (eip1559 &&\n txMeta.txParams.maxFeePerGas &&\n txMeta.txParams.maxPriorityFeePerGas)\n ) {\n return {};\n }\n\n const gasFeeFlow = getGasFeeFlow(txMeta, gasFeeFlows) as GasFeeFlow;\n\n try {\n const gasFeeControllerData = await getGasFeeEstimates({ networkClientId });\n\n const response = await gasFeeFlow.getGasFees({\n ethQuery,\n gasFeeControllerData,\n transactionMeta: txMeta,\n });\n\n const gasFeeEstimateType = response.estimates?.type;\n\n switch (gasFeeEstimateType) {\n case GasFeeEstimateType.FeeMarket:\n return response.estimates.medium;\n case GasFeeEstimateType.Legacy:\n return {\n gasPrice: response.estimates.medium,\n };\n case GasFeeEstimateType.GasPrice:\n return { gasPrice: response.estimates.gasPrice };\n default:\n throw new Error(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Unsupported gas fee estimate type returned from flow: ${gasFeeEstimateType}`,\n );\n }\n } catch (error) {\n log('Failed to get suggested gas fees', error);\n }\n\n const gasPriceDecimal = (await query(ethQuery, 'gasPrice')) as number;\n\n const gasPrice = gasPriceDecimal\n ? add0x(gasPriceDecimal.toString(16))\n : undefined;\n\n return { gasPrice };\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-EGQCE3FK.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-EGQCE3FK.mjs.map +deleted file mode 100644 +index d4edfdb..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-EGQCE3FK.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/etherscan.ts"],"sourcesContent":["import { handleFetch } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport { ETHERSCAN_SUPPORTED_NETWORKS } from '../constants';\nimport { incomingTransactionsLogger as log } from '../logger';\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionMetaBase {\n blockNumber: string;\n blockHash: string;\n confirmations: string;\n contractAddress: string;\n cumulativeGasUsed: string;\n from: string;\n gas: string;\n gasPrice: string;\n gasUsed: string;\n hash: string;\n nonce: string;\n timeStamp: string;\n to: string;\n transactionIndex: string;\n value: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionMeta extends EtherscanTransactionMetaBase {\n functionName: string;\n input: string;\n isError: string;\n methodId: string;\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n txreceipt_status: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTokenTransactionMeta\n extends EtherscanTransactionMetaBase {\n tokenDecimal: string;\n tokenName: string;\n tokenSymbol: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionResponse<\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n T extends EtherscanTransactionMetaBase,\n> {\n status: '0' | '1';\n message?: string;\n result: string | T[];\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionRequest {\n address: string;\n chainId: Hex;\n fromBlock?: number;\n limit?: number;\n}\n\n/**\n * Retrieves transaction data from Etherscan.\n *\n * @param request - Configuration required to fetch transactions.\n * @param request.address - Address to retrieve transactions for.\n * @param request.chainId - Current chain ID used to determine subdomain and domain.\n * @param request.fromBlock - Block number to start fetching transactions from.\n * @param request.limit - Number of transactions to retrieve.\n * @returns An Etherscan response object containing the request status and an array of token transaction data.\n */\nexport async function fetchEtherscanTransactions({\n address,\n chainId,\n fromBlock,\n limit,\n}: EtherscanTransactionRequest): Promise<\n EtherscanTransactionResponse\n> {\n return await fetchTransactions('txlist', {\n address,\n chainId,\n fromBlock,\n limit,\n });\n}\n\n/**\n * Retrieves token transaction data from Etherscan.\n *\n * @param request - Configuration required to fetch token transactions.\n * @param request.address - Address to retrieve token transactions for.\n * @param request.chainId - Current chain ID used to determine subdomain and domain.\n * @param request.fromBlock - Block number to start fetching token transactions from.\n * @param request.limit - Number of token transactions to retrieve.\n * @returns An Etherscan response object containing the request status and an array of token transaction data.\n */\nexport async function fetchEtherscanTokenTransactions({\n address,\n chainId,\n fromBlock,\n limit,\n}: EtherscanTransactionRequest): Promise<\n EtherscanTransactionResponse\n> {\n return await fetchTransactions('tokentx', {\n address,\n chainId,\n fromBlock,\n limit,\n });\n}\n\n/**\n * Retrieves transaction data from Etherscan from a specific endpoint.\n *\n * @param action - The Etherscan endpoint to use.\n * @param options - Options bag.\n * @param options.address - Address to retrieve transactions for.\n * @param options.chainId - Current chain ID used to determine subdomain and domain.\n * @param options.fromBlock - Block number to start fetching transactions from.\n * @param options.limit - Number of transactions to retrieve.\n * @returns An object containing the request status and an array of transaction data.\n */\n// TODO: Either fix this lint violation or explain why it's necessary to ignore.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nasync function fetchTransactions(\n action: string,\n {\n address,\n chainId,\n fromBlock,\n limit,\n }: {\n address: string;\n chainId: Hex;\n fromBlock?: number;\n limit?: number;\n },\n): Promise> {\n const urlParams = {\n module: 'account',\n address,\n startBlock: fromBlock?.toString(),\n offset: limit?.toString(),\n sort: 'desc',\n };\n\n const etherscanTxUrl = getEtherscanApiUrl(chainId, {\n ...urlParams,\n action,\n });\n\n log('Sending Etherscan request', etherscanTxUrl);\n\n const response = (await handleFetch(\n etherscanTxUrl,\n )) as EtherscanTransactionResponse;\n\n return response;\n}\n\n/**\n * Return a URL that can be used to fetch data from Etherscan.\n *\n * @param chainId - Current chain ID used to determine subdomain and domain.\n * @param urlParams - The parameters used to construct the URL.\n * @returns URL to access Etherscan data.\n */\nfunction getEtherscanApiUrl(\n chainId: Hex,\n urlParams: Record,\n): string {\n const apiUrl = getEtherscanApiHost(chainId);\n let url = `${apiUrl}/api?`;\n\n for (const paramKey of Object.keys(urlParams)) {\n const value = urlParams[paramKey];\n\n if (!value) {\n continue;\n }\n\n url += `${paramKey}=${value}&`;\n }\n\n url += 'tag=latest&page=1';\n\n return url;\n}\n\n/**\n * Return the host url used to fetch data from Etherscan.\n *\n * @param chainId - Current chain ID used to determine subdomain and domain.\n * @returns host URL to access Etherscan data.\n */\nexport function getEtherscanApiHost(chainId: Hex) {\n // @ts-expect-error We account for `chainId` not being a property below\n const networkInfo = ETHERSCAN_SUPPORTED_NETWORKS[chainId];\n\n if (!networkInfo) {\n throw new Error(`Etherscan does not support chain with ID: ${chainId}`);\n }\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `https://${networkInfo.subdomain}.${networkInfo.domain}`;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,mBAAmB;AAmF5B,eAAsB,2BAA2B;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEE;AACA,SAAO,MAAM,kBAAkB,UAAU;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAYA,eAAsB,gCAAgC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEE;AACA,SAAO,MAAM,kBAAkB,WAAW;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAeA,eAAe,kBACb,QACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAM0C;AAC1C,QAAM,YAAY;AAAA,IAChB,QAAQ;AAAA,IACR;AAAA,IACA,YAAY,WAAW,SAAS;AAAA,IAChC,QAAQ,OAAO,SAAS;AAAA,IACxB,MAAM;AAAA,EACR;AAEA,QAAM,iBAAiB,mBAAmB,SAAS;AAAA,IACjD,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAED,6BAAI,6BAA6B,cAAc;AAE/C,QAAM,WAAY,MAAM;AAAA,IACtB;AAAA,EACF;AAEA,SAAO;AACT;AASA,SAAS,mBACP,SACA,WACQ;AACR,QAAM,SAAS,oBAAoB,OAAO;AAC1C,MAAI,MAAM,GAAG,MAAM;AAEnB,aAAW,YAAY,OAAO,KAAK,SAAS,GAAG;AAC7C,UAAM,QAAQ,UAAU,QAAQ;AAEhC,QAAI,CAAC,OAAO;AACV;AAAA,IACF;AAEA,WAAO,GAAG,QAAQ,IAAI,KAAK;AAAA,EAC7B;AAEA,SAAO;AAEP,SAAO;AACT;AAQO,SAAS,oBAAoB,SAAc;AAEhD,QAAM,cAAc,6BAA6B,OAAO;AAExD,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,6CAA6C,OAAO,EAAE;AAAA,EACxE;AAIA,SAAO,WAAW,YAAY,SAAS,IAAI,YAAY,MAAM;AAC/D;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-EKJXGERC.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-EKJXGERC.mjs.map +deleted file mode 100644 +index 70c0b87..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-EKJXGERC.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/EtherscanRemoteTransactionSource.ts"],"sourcesContent":["import { BNToHex } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport BN from 'bn.js';\nimport { v1 as random } from 'uuid';\n\nimport { ETHERSCAN_SUPPORTED_NETWORKS } from '../constants';\nimport { incomingTransactionsLogger as log } from '../logger';\nimport type {\n RemoteTransactionSource,\n RemoteTransactionSourceRequest,\n TransactionMeta,\n} from '../types';\nimport { TransactionStatus, TransactionType } from '../types';\nimport {\n fetchEtherscanTokenTransactions,\n fetchEtherscanTransactions,\n} from '../utils/etherscan';\nimport type {\n EtherscanTokenTransactionMeta,\n EtherscanTransactionMeta,\n EtherscanTransactionMetaBase,\n EtherscanTransactionRequest,\n EtherscanTransactionResponse,\n} from '../utils/etherscan';\n\nconst ETHERSCAN_RATE_LIMIT_INTERVAL = 5000;\n/**\n * A RemoteTransactionSource that fetches transaction data from Etherscan.\n */\nexport class EtherscanRemoteTransactionSource\n implements RemoteTransactionSource\n{\n #includeTokenTransfers: boolean;\n\n #isTokenRequestPending: boolean;\n\n #mutex = new Mutex();\n\n constructor({\n includeTokenTransfers,\n }: { includeTokenTransfers?: boolean } = {}) {\n this.#includeTokenTransfers = includeTokenTransfers ?? true;\n this.#isTokenRequestPending = false;\n }\n\n isSupportedNetwork(chainId: Hex): boolean {\n return Object.keys(ETHERSCAN_SUPPORTED_NETWORKS).includes(chainId);\n }\n\n getLastBlockVariations(): string[] {\n return [this.#isTokenRequestPending ? 'token' : 'normal'];\n }\n\n async fetchTransactions(\n request: RemoteTransactionSourceRequest,\n ): Promise {\n const releaseLock = await this.#mutex.acquire();\n const acquiredTime = Date.now();\n\n const etherscanRequest: EtherscanTransactionRequest = {\n ...request,\n chainId: request.currentChainId,\n };\n\n try {\n const transactions = this.#isTokenRequestPending\n ? await this.#fetchTokenTransactions(request, etherscanRequest)\n : await this.#fetchNormalTransactions(request, etherscanRequest);\n\n if (this.#includeTokenTransfers) {\n this.#isTokenRequestPending = !this.#isTokenRequestPending;\n }\n\n return transactions;\n } finally {\n this.#releaseLockAfterInterval(acquiredTime, releaseLock);\n }\n }\n\n #releaseLockAfterInterval(acquireTime: number, releaseLock: () => void) {\n const elapsedTime = Date.now() - acquireTime;\n const remainingTime = Math.max(\n 0,\n ETHERSCAN_RATE_LIMIT_INTERVAL - elapsedTime,\n );\n // Wait for the remaining time if it hasn't been 5 seconds yet\n if (remainingTime > 0) {\n setTimeout(releaseLock, remainingTime);\n } else {\n releaseLock();\n }\n }\n\n #fetchNormalTransactions = async (\n request: RemoteTransactionSourceRequest,\n etherscanRequest: EtherscanTransactionRequest,\n ) => {\n const { currentChainId } = request;\n\n const etherscanTransactions = await fetchEtherscanTransactions(\n etherscanRequest,\n );\n\n return this.#getResponseTransactions(etherscanTransactions).map((tx) =>\n this.#normalizeTransaction(tx, currentChainId),\n );\n };\n\n #fetchTokenTransactions = async (\n request: RemoteTransactionSourceRequest,\n etherscanRequest: EtherscanTransactionRequest,\n ) => {\n const { currentChainId } = request;\n\n const etherscanTransactions = await fetchEtherscanTokenTransactions(\n etherscanRequest,\n );\n\n return this.#getResponseTransactions(etherscanTransactions).map((tx) =>\n this.#normalizeTokenTransaction(tx, currentChainId),\n );\n };\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n #getResponseTransactions(\n response: EtherscanTransactionResponse,\n ): T[] {\n let result = response.result as T[];\n\n if (response.status === '0') {\n result = [];\n\n if (response.result.length) {\n log('Ignored Etherscan request error', {\n message: response.result,\n type: this.#isTokenRequestPending ? 'token' : 'normal',\n });\n }\n }\n\n return result;\n }\n\n #normalizeTransaction(\n txMeta: EtherscanTransactionMeta,\n currentChainId: Hex,\n ): TransactionMeta {\n const base = this.#normalizeTransactionBase(txMeta, currentChainId);\n\n return {\n ...base,\n txParams: {\n ...base.txParams,\n data: txMeta.input,\n },\n ...(txMeta.isError === '0'\n ? { status: TransactionStatus.confirmed }\n : {\n error: new Error('Transaction failed'),\n status: TransactionStatus.failed,\n }),\n };\n }\n\n #normalizeTokenTransaction(\n txMeta: EtherscanTokenTransactionMeta,\n currentChainId: Hex,\n ): TransactionMeta {\n const base = this.#normalizeTransactionBase(txMeta, currentChainId);\n\n return {\n ...base,\n isTransfer: true,\n transferInformation: {\n contractAddress: txMeta.contractAddress,\n decimals: Number(txMeta.tokenDecimal),\n symbol: txMeta.tokenSymbol,\n },\n };\n }\n\n #normalizeTransactionBase(\n txMeta: EtherscanTransactionMetaBase,\n currentChainId: Hex,\n ): TransactionMeta {\n const time = parseInt(txMeta.timeStamp, 10) * 1000;\n\n return {\n blockNumber: txMeta.blockNumber,\n chainId: currentChainId,\n hash: txMeta.hash,\n id: random({ msecs: time }),\n status: TransactionStatus.confirmed,\n time,\n txParams: {\n chainId: currentChainId,\n from: txMeta.from,\n gas: BNToHex(new BN(txMeta.gas)),\n gasPrice: BNToHex(new BN(txMeta.gasPrice)),\n gasUsed: BNToHex(new BN(txMeta.gasUsed)),\n nonce: BNToHex(new BN(txMeta.nonce)),\n to: txMeta.to,\n value: BNToHex(new BN(txMeta.value)),\n },\n type: TransactionType.incoming,\n verifiedOnBlockchain: false,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAExB,SAAS,aAAa;AACtB,OAAO,QAAQ;AACf,SAAS,MAAM,cAAc;AAsB7B,IAAM,gCAAgC;AA1BtC;AA8BO,IAAM,mCAAN,MAEP;AAAA,EAOE,YAAY;AAAA,IACV;AAAA,EACF,IAAyC,CAAC,GAAG;AAuC7C;AA8CA;AAAA;AAAA;AAmBA;AAqBA;AAiBA;AAtJA;AAEA;AAEA,+BAAS,IAAI,MAAM;AAyDnB,iDAA2B,OACzB,SACA,qBACG;AACH,YAAM,EAAE,eAAe,IAAI;AAE3B,YAAM,wBAAwB,MAAM;AAAA,QAClC;AAAA,MACF;AAEA,aAAO,sBAAK,sDAAL,WAA8B,uBAAuB;AAAA,QAAI,CAAC,OAC/D,sBAAK,gDAAL,WAA2B,IAAI;AAAA,MACjC;AAAA,IACF;AAEA,gDAA0B,OACxB,SACA,qBACG;AACH,YAAM,EAAE,eAAe,IAAI;AAE3B,YAAM,wBAAwB,MAAM;AAAA,QAClC;AAAA,MACF;AAEA,aAAO,sBAAK,sDAAL,WAA8B,uBAAuB;AAAA,QAAI,CAAC,OAC/D,sBAAK,0DAAL,WAAgC,IAAI;AAAA,MACtC;AAAA,IACF;AAhFE,uBAAK,wBAAyB,yBAAyB;AACvD,uBAAK,wBAAyB;AAAA,EAChC;AAAA,EAEA,mBAAmB,SAAuB;AACxC,WAAO,OAAO,KAAK,4BAA4B,EAAE,SAAS,OAAO;AAAA,EACnE;AAAA,E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AAU;AAAA,MACR,GAAG,KAAK;AAAA,MACR,MAAM,OAAO;AAAA,IACf;AAAA,IACA,GAAI,OAAO,YAAY,MACnB,EAAE,oCAAoC,IACtC;AAAA,MACE,OAAO,IAAI,MAAM,oBAAoB;AAAA,MACrC;AAAA,IACF;AAAA,EACN;AACF;AAEA;AAAA,+BAA0B,SACxB,QACA,gBACiB;AACjB,QAAM,OAAO,sBAAK,wDAAL,WAA+B,QAAQ;AAEpD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,qBAAqB;AAAA,MACnB,iBAAiB,OAAO;AAAA,MACxB,UAAU,OAAO,OAAO,YAAY;AAAA,MACpC,QAAQ,OAAO;AAAA,IACjB;AAAA,EACF;AACF;AAEA;AAAA,8BAAyB,SACvB,QACA,gBACiB;AACjB,QAAM,OAAO,SAAS,OAAO,WAAW,EAAE,IAAI;AAE9C,SAAO;AAAA,IACL,aAAa,OAAO;AAAA,IACpB,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb,IAAI,OAAO,EAAE,OAAO,KAAK,CAAC;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM,OAAO;AAAA,MACb,KAAK,QAAQ,IAAI,GAAG,OAAO,GAAG,CAAC;AAAA,MAC/B,UAAU,QAAQ,IAAI,GAAG,OAAO,QAAQ,CAAC;AAAA,MACzC,SAAS,QAAQ,IAAI,GAAG,OAAO,OAAO,CAAC;AAAA,MACvC,OAAO,QAAQ,IAAI,GAAG,OAAO,KAAK,CAAC;AAAA,MACnC,IAAI,OAAO;AAAA,MACX,OAAO,QAAQ,IAAI,GAAG,OAAO,KAAK,CAAC;AAAA,IACrC;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,EACxB;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-EVL6KODQ.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-EVL6KODQ.mjs.map +deleted file mode 100644 +index 861c1dd..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-EVL6KODQ.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/simulation.ts"],"sourcesContent":["import type { Fragment, LogDescription, Result } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { hexToBN, toHex } from '@metamask/controller-utils';\nimport { abiERC20, abiERC721, abiERC1155 } from '@metamask/metamask-eth-abis';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport {\n ABI_SIMULATION_ERC20_WRAPPED,\n ABI_SIMULATION_ERC721_LEGACY,\n} from '../constants';\nimport {\n SimulationError,\n SimulationInvalidResponseError,\n SimulationRevertedError,\n} from '../errors';\nimport { projectLogger } from '../logger';\nimport type {\n SimulationBalanceChange,\n SimulationData,\n SimulationTokenBalanceChange,\n SimulationToken,\n} from '../types';\nimport { SimulationTokenStandard } from '../types';\nimport { simulateTransactions } from './simulation-api';\nimport type {\n SimulationResponseLog,\n SimulationRequestTransaction,\n SimulationResponse,\n SimulationResponseCallTrace,\n SimulationResponseTransaction,\n} from './simulation-api';\n\nexport enum SupportedToken {\n ERC20 = 'erc20',\n ERC721 = 'erc721',\n ERC1155 = 'erc1155',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ERC20_WRAPPED = 'erc20Wrapped',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ERC721_LEGACY = 'erc721Legacy',\n}\n\ntype ABI = Fragment[];\n\nexport type GetSimulationDataRequest = {\n chainId: Hex;\n from: Hex;\n to?: Hex;\n value?: Hex;\n data?: Hex;\n};\n\ntype ParsedEvent = {\n contractAddress: Hex;\n tokenStandard: SimulationTokenStandard;\n name: string;\n args: Record;\n abi: ABI;\n};\n\nconst log = createModuleLogger(projectLogger, 'simulation');\n\nconst SUPPORTED_EVENTS = [\n 'Transfer',\n 'TransferSingle',\n 'TransferBatch',\n 'Deposit',\n 'Withdrawal',\n];\n\nconst SUPPORTED_TOKEN_ABIS = {\n [SupportedToken.ERC20]: {\n abi: abiERC20,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721]: {\n abi: abiERC721,\n standard: SimulationTokenStandard.erc721,\n },\n [SupportedToken.ERC1155]: {\n abi: abiERC1155,\n standard: SimulationTokenStandard.erc1155,\n },\n [SupportedToken.ERC20_WRAPPED]: {\n abi: ABI_SIMULATION_ERC20_WRAPPED,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721_LEGACY]: {\n abi: ABI_SIMULATION_ERC721_LEGACY,\n standard: SimulationTokenStandard.erc721,\n },\n};\n\nconst REVERTED_ERRORS = ['execution reverted', 'insufficient funds for gas'];\n\ntype BalanceTransactionMap = Map;\n\n/**\n * Generate simulation data for a transaction.\n * @param request - The transaction to simulate.\n * @param request.chainId - The chain ID of the transaction.\n * @param request.from - The sender of the transaction.\n * @param request.to - The recipient of the transaction.\n * @param request.value - The value of the transaction.\n * @param request.data - The data of the transaction.\n * @returns The simulation data.\n */\nexport async function getSimulationData(\n request: GetSimulationDataRequest,\n): Promise {\n const { chainId, from, to, value, data } = request;\n\n log('Getting simulation data', request);\n\n try {\n const response = await simulateTransactions(chainId, {\n transactions: [\n {\n data,\n from,\n maxFeePerGas: '0x0',\n maxPriorityFeePerGas: '0x0',\n to,\n value,\n },\n ],\n withCallTrace: true,\n withLogs: true,\n });\n\n const transactionError = response.transactions?.[0]?.error;\n\n if (transactionError) {\n throw new SimulationError(transactionError);\n }\n\n const nativeBalanceChange = getNativeBalanceChange(request.from, response);\n const events = getEvents(response);\n\n log('Parsed events', events);\n\n const tokenBalanceChanges = await getTokenBalanceChanges(request, events);\n\n return {\n nativeBalanceChange,\n tokenBalanceChanges,\n };\n } catch (error) {\n log('Failed to get simulation data', error, request);\n\n let simulationError = error as SimulationError;\n\n if (\n REVERTED_ERRORS.some((revertErrorMessage) =>\n simulationError.message?.includes(revertErrorMessage),\n )\n ) {\n simulationError = new SimulationRevertedError();\n }\n\n const { code, message } = simulationError;\n\n return {\n tokenBalanceChanges: [],\n error: {\n code,\n message,\n },\n };\n }\n}\n\n/**\n * Extract the native balance change from a simulation response.\n * @param userAddress - The user's account address.\n * @param response - The simulation response.\n * @returns The native balance change or undefined if unchanged.\n */\nfunction getNativeBalanceChange(\n userAddress: Hex,\n response: SimulationResponse,\n): SimulationBalanceChange | undefined {\n const transactionResponse = response.transactions[0];\n\n /* istanbul ignore next */\n if (!transactionResponse) {\n return undefined;\n }\n\n const { stateDiff } = transactionResponse;\n const previousBalance = stateDiff?.pre?.[userAddress]?.balance;\n const newBalance = stateDiff?.post?.[userAddress]?.balance;\n\n if (!previousBalance || !newBalance) {\n return undefined;\n }\n\n return getSimulationBalanceChange(previousBalance, newBalance);\n}\n\n/**\n * Extract events from a simulation response.\n * @param response - The simulation response.\n * @returns The parsed events.\n */\nexport function getEvents(response: SimulationResponse): ParsedEvent[] {\n /* istanbul ignore next */\n const logs = extractLogs(\n response.transactions[0]?.callTrace ?? ({} as SimulationResponseCallTrace),\n );\n\n log('Extracted logs', logs);\n\n const interfaces = getContractInterfaces();\n\n return logs\n .map((currentLog) => {\n const event = parseLog(currentLog, interfaces);\n\n if (!event) {\n log('Failed to parse log', currentLog);\n return undefined;\n }\n\n /* istanbul ignore next */\n const inputs = event.abi.find((e) => e.name === event.name)?.inputs;\n\n /* istanbul ignore if */\n if (!inputs) {\n log('Failed to find inputs for event', event);\n return undefined;\n }\n\n const args = parseEventArgs(event.args, inputs);\n\n return {\n contractAddress: currentLog.address,\n tokenStandard: event.standard,\n name: event.name,\n args,\n abi: event.abi,\n };\n })\n .filter((e) => e !== undefined) as ParsedEvent[];\n}\n\n/**\n * Parse event arguments using ABI input definitions.\n * @param args - The raw event arguments.\n * @param abiInputs - The ABI input definitions.\n * @returns The parsed event arguments.\n */\nfunction parseEventArgs(\n args: Result,\n abiInputs: { name: string }[],\n): Record {\n return args.reduce((result, arg, index) => {\n const name = abiInputs[index].name.replace('_', '');\n const value = parseEventArgValue(arg);\n\n result[name] = value;\n\n return result;\n }, {});\n}\n\n/**\n * Parse an event argument value.\n * @param value - The event argument value.\n * @returns The parsed event argument value.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction parseEventArgValue(value: any): Hex | Hex[] {\n if (Array.isArray(value)) {\n return value.map(parseEventArgValue) as Hex[];\n }\n\n return (value.toHexString?.() ?? value).toLowerCase();\n}\n\n/**\n * Generate token balance changes from parsed events.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns An array of token balance changes.\n */\nasync function getTokenBalanceChanges(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): Promise {\n const balanceTxs = getTokenBalanceTransactions(request, events);\n\n log('Generated balance transactions', [...balanceTxs.after.values()]);\n\n const transactions = [\n ...balanceTxs.before.values(),\n request,\n ...balanceTxs.after.values(),\n ];\n\n if (transactions.length === 1) {\n return [];\n }\n\n const response = await simulateTransactions(request.chainId as Hex, {\n transactions,\n });\n\n log('Balance simulation response', response);\n\n if (response.transactions.length !== transactions.length) {\n throw new SimulationInvalidResponseError();\n }\n\n let prevBalanceTxIndex = 0;\n return [...balanceTxs.after.keys()]\n .map((token, index) => {\n const previousBalanceCheckSkipped = !balanceTxs.before.get(token);\n const previousBalance = previousBalanceCheckSkipped\n ? '0x0'\n : getValueFromBalanceTransaction(\n request.from,\n token,\n // eslint-disable-next-line no-plusplus\n response.transactions[prevBalanceTxIndex++],\n );\n\n const newBalance = getValueFromBalanceTransaction(\n request.from,\n token,\n response.transactions[index + balanceTxs.before.size + 1],\n );\n\n const balanceChange = getSimulationBalanceChange(\n previousBalance,\n newBalance,\n );\n\n if (!balanceChange) {\n return undefined;\n }\n\n return {\n ...token,\n ...balanceChange,\n };\n })\n .filter((change) => change !== undefined) as SimulationTokenBalanceChange[];\n}\n\n/**\n * Generate transactions to check token balances.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns A map of token balance transactions keyed by token.\n */\nfunction getTokenBalanceTransactions(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): {\n before: BalanceTransactionMap;\n after: BalanceTransactionMap;\n} {\n const tokenKeys = new Set();\n const before = new Map();\n const after = new Map();\n\n const userEvents = events.filter(\n (event) =>\n SUPPORTED_EVENTS.includes(event.name) &&\n [event.args.from, event.args.to].includes(request.from),\n );\n\n log('Filtered user events', userEvents);\n\n for (const event of userEvents) {\n const tokenIds = getEventTokenIds(event);\n\n log('Extracted token ids', tokenIds);\n\n for (const tokenId of tokenIds) {\n const simulationToken: SimulationToken = {\n address: event.contractAddress,\n standard: event.tokenStandard,\n id: tokenId,\n };\n\n const tokenKey = JSON.stringify(simulationToken);\n\n if (tokenKeys.has(tokenKey)) {\n log(\n 'Ignoring additional event with same contract and token ID',\n simulationToken,\n );\n continue;\n }\n\n tokenKeys.add(tokenKey);\n\n const data = getBalanceTransactionData(\n event.tokenStandard,\n request.from,\n tokenId,\n );\n\n const transaction: SimulationRequestTransaction = {\n from: request.from,\n to: event.contractAddress,\n data,\n };\n\n if (skipPriorBalanceCheck(event)) {\n after.set(simulationToken, transaction);\n } else {\n before.set(simulationToken, transaction);\n after.set(simulationToken, transaction);\n }\n }\n }\n\n return { before, after };\n}\n\n/**\n * Check if an event needs to check the previous balance.\n * @param event - The parsed event.\n * @returns True if the prior balance check should be skipped.\n */\nfunction skipPriorBalanceCheck(event: ParsedEvent): boolean {\n // In the case of an NFT mint, we cannot check the NFT owner before the mint\n // as the balance check transaction would revert.\n return (\n event.name === 'Transfer' &&\n event.tokenStandard === SimulationTokenStandard.erc721 &&\n parseInt(event.args.from as string, 16) === 0\n );\n}\n\n/**\n * Extract token IDs from a parsed event.\n * @param event - The parsed event.\n * @returns An array of token IDs.\n */\nfunction getEventTokenIds(event: ParsedEvent): (Hex | undefined)[] {\n if (event.tokenStandard === SimulationTokenStandard.erc721) {\n return [event.args.tokenId as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferSingle'\n ) {\n return [event.args.id as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferBatch'\n ) {\n return event.args.ids as Hex[];\n }\n\n // ERC-20 does not have a token ID so default to undefined.\n return [undefined];\n}\n\n/**\n * Extract the value from a balance transaction response.\n * @param from - The address to check the balance of.\n * @param token - The token to check the balance of.\n * @param response - The balance transaction response.\n * @returns The value of the balance transaction.\n */\nfunction getValueFromBalanceTransaction(\n from: Hex,\n token: SimulationToken,\n response: SimulationResponseTransaction,\n): Hex {\n const normalizedReturn = normalizeReturnValue(response.return);\n\n if (token.standard === SimulationTokenStandard.erc721) {\n return normalizedReturn === from ? '0x1' : '0x0';\n }\n\n return normalizedReturn;\n}\n\n/**\n * Generate the balance transaction data for a token.\n * @param tokenStandard - The token standard.\n * @param from - The address to check the balance of.\n * @param tokenId - The token ID to check the balance of.\n * @returns The balance transaction data.\n */\nfunction getBalanceTransactionData(\n tokenStandard: SimulationTokenStandard,\n from: Hex,\n tokenId?: Hex,\n): Hex {\n switch (tokenStandard) {\n case SimulationTokenStandard.erc721:\n return new Interface(abiERC721).encodeFunctionData('ownerOf', [\n tokenId,\n ]) as Hex;\n\n case SimulationTokenStandard.erc1155:\n return new Interface(abiERC1155).encodeFunctionData('balanceOf', [\n from,\n tokenId,\n ]) as Hex;\n\n default:\n return new Interface(abiERC20).encodeFunctionData('balanceOf', [\n from,\n ]) as Hex;\n }\n}\n\n/**\n * Parse a raw event log using known ABIs.\n * @param eventLog - The raw event log.\n * @param interfaces - The contract interfaces.\n * @returns The parsed event log or undefined if it could not be parsed.\n */\nfunction parseLog(\n eventLog: SimulationResponseLog,\n interfaces: Map,\n):\n | (LogDescription & { abi: ABI; standard: SimulationTokenStandard })\n | undefined {\n const supportedTokens = Object.values(SupportedToken);\n\n for (const token of supportedTokens) {\n try {\n const contractInterface = interfaces.get(token) as Interface;\n const { abi, standard } = SUPPORTED_TOKEN_ABIS[token];\n\n return {\n ...contractInterface.parseLog(eventLog),\n abi,\n standard,\n };\n } catch (e) {\n continue;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extract all logs from a call trace tree.\n * @param call - The root call trace.\n * @returns An array of logs.\n */\nfunction extractLogs(\n call: SimulationResponseCallTrace,\n): SimulationResponseLog[] {\n /* istanbul ignore next */\n const logs = call.logs ?? [];\n\n /* istanbul ignore next */\n const nestedCalls = call.calls ?? [];\n\n return [\n ...logs,\n ...nestedCalls.map((nestedCall) => extractLogs(nestedCall)).flat(),\n ];\n}\n\n/**\n * Generate balance change data from previous and new balances.\n * @param previousBalance - The previous balance.\n * @param newBalance - The new balance.\n * @returns The balance change data or undefined if unchanged.\n */\nfunction getSimulationBalanceChange(\n previousBalance: Hex,\n newBalance: Hex,\n): SimulationBalanceChange | undefined {\n const differenceBN = hexToBN(newBalance).sub(hexToBN(previousBalance));\n const isDecrease = differenceBN.isNeg();\n const difference = toHex(differenceBN.abs());\n\n if (differenceBN.isZero()) {\n log('Balance change is zero');\n return undefined;\n }\n\n return {\n previousBalance,\n newBalance,\n difference,\n isDecrease,\n };\n}\n\n/**\n * Normalize a return value.\n * @param value - The return value to normalize.\n * @returns The normalized return value.\n */\nfunction normalizeReturnValue(value: Hex): Hex {\n return toHex(hexToBN(value));\n}\n\n/**\n * Get the contract interfaces for all supported tokens.\n * @returns A map of supported tokens to their contract interfaces.\n */\nfunction getContractInterfaces(): Map {\n const supportedTokens = Object.values(SupportedToken);\n\n return new Map(\n supportedTokens.map((tokenType) => {\n const { abi } = SUPPORTED_TOKEN_ABIS[tokenType];\n const contractInterface = new Interface(abi);\n return [tokenType, contractInterface];\n }),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,aAAa;AAC/B,SAAS,UAAU,WAAW,kBAAkB;AAChD,SAAS,0BAAoC;AA4BtC,IAAK,iBAAL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AI,UAAU,GAAG;AAC3C,aAAO,CAAC,WAAW,iBAAiB;AAAA,IACtC,CAAC;AAAA,EACH;AACF;","names":["SupportedToken"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-FG74Z3F5.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-FG74Z3F5.mjs.map +deleted file mode 100644 +index cb2178d..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-FG74Z3F5.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/OracleLayer1GasFeeFlow.ts"],"sourcesContent":["import { Common, Hardfork } from '@ethereumjs/common';\nimport { TransactionFactory } from '@ethereumjs/tx';\nimport { Contract } from '@ethersproject/contracts';\nimport { Web3Provider, type ExternalProvider } from '@ethersproject/providers';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\nimport { omit } from 'lodash';\n\nimport { projectLogger } from '../logger';\nimport type {\n Layer1GasFeeFlow,\n Layer1GasFeeFlowRequest,\n Layer1GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\n\nconst log = createModuleLogger(projectLogger, 'oracle-layer1-gas-fee-flow');\n\nconst DUMMY_KEY =\n 'abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789';\n\nconst GAS_PRICE_ORACLE_ABI = [\n {\n inputs: [{ internalType: 'bytes', name: '_data', type: 'bytes' }],\n name: 'getL1Fee',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n];\n\n/**\n * Layer 1 gas fee flow that obtains gas fee estimate using an oracle smart contract.\n */\nexport abstract class OracleLayer1GasFeeFlow implements Layer1GasFeeFlow {\n #oracleAddress: Hex;\n\n #signTransaction: boolean;\n\n constructor(oracleAddress: Hex, signTransaction?: boolean) {\n this.#oracleAddress = oracleAddress;\n this.#signTransaction = signTransaction ?? false;\n }\n\n abstract matchesTransaction(transactionMeta: TransactionMeta): boolean;\n\n async getLayer1Fee(\n request: Layer1GasFeeFlowRequest,\n ): Promise {\n try {\n return await this.#getOracleLayer1GasFee(request);\n } catch (error) {\n log('Failed to get oracle layer 1 gas fee', error);\n throw new Error(`Failed to get oracle layer 1 gas fee`);\n }\n }\n\n async #getOracleLayer1GasFee(\n request: Layer1GasFeeFlowRequest,\n ): Promise {\n const { provider, transactionMeta } = request;\n\n const contract = new Contract(\n this.#oracleAddress,\n GAS_PRICE_ORACLE_ABI,\n // Network controller provider type is incompatible with ethers provider\n new Web3Provider(provider as unknown as ExternalProvider),\n );\n\n const serializedTransaction = this.#buildUnserializedTransaction(\n transactionMeta,\n this.#signTransaction,\n ).serialize();\n\n const result = await contract.getL1Fee(serializedTransaction);\n\n if (result === undefined) {\n throw new Error('No value returned from oracle contract');\n }\n\n return {\n layer1Fee: result.toHexString(),\n };\n }\n\n #buildUnserializedTransaction(\n transactionMeta: TransactionMeta,\n sign: boolean,\n ) {\n const txParams = this.#buildTransactionParams(transactionMeta);\n const common = this.#buildTransactionCommon(transactionMeta);\n\n let unserializedTransaction = TransactionFactory.fromTxData(txParams, {\n common,\n });\n\n if (sign) {\n const keyBuffer = Buffer.from(DUMMY_KEY, 'hex');\n unserializedTransaction = unserializedTransaction.sign(keyBuffer);\n }\n\n return unserializedTransaction;\n }\n\n #buildTransactionParams(\n transactionMeta: TransactionMeta,\n ): TransactionMeta['txParams'] {\n return {\n ...omit(transactionMeta.txParams, 'gas'),\n gasLimit: transactionMeta.txParams.gas,\n };\n }\n\n #buildTransactionCommon(transactionMeta: TransactionMeta) {\n const chainId = Number(transactionMeta.chainId);\n\n return Common.custom({\n chainId,\n defaultHardfork: Hardfork.London,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AACzB,SAAS,oBAA2C;AAEpD,SAAS,0BAA0B;AACnC,SAAS,YAAY;AAUrB,IAAM,MAAM,mBAAmB,eA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mBAAmB,WAAW,UAAU;AAAA,IACpE;AAAA,EACF,CAAC;AAED,MAAI,MAAM;AACR,UAAM,YAAY,OAAO,KAAK,WAAW,KAAK;AAC9C,8BAA0B,wBAAwB,KAAK,SAAS;AAAA,EAClE;AAEA,SAAO;AACT;AAEA;AAAA,4BAAuB,SACrB,iBAC6B;AAC7B,SAAO;AAAA,IACL,GAAG,KAAK,gBAAgB,UAAU,KAAK;AAAA,IACvC,UAAU,gBAAgB,SAAS;AAAA,EACrC;AACF;AAEA;AAAA,4BAAuB,SAAC,iBAAkC;AACxD,QAAM,UAAU,OAAO,gBAAgB,OAAO;AAE9C,SAAO,OAAO,OAAO;AAAA,IACnB;AAAA,IACA,iBAAiB,SAAS;AAAA,EAC5B,CAAC;AACH;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-FMRLPVFZ.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-FMRLPVFZ.mjs.map +deleted file mode 100644 +index 7ac03ce..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-FMRLPVFZ.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/TestGasFeeFlow.ts"],"sourcesContent":["import { toHex } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport {\n GasFeeEstimateType,\n type GasFeeFlow,\n type GasFeeFlowRequest,\n type GasFeeFlowResponse,\n type TransactionMeta,\n} from '../types';\n\nconst INCREMENT = 1e15; // 0.001 ETH\nconst LEVEL_DIFFERENCE = 0.5;\n\n/**\n * A gas fee flow to facilitate testing in the clients.\n * Increments the total gas fee by a fixed amount each time it is called.\n * Relies on the transaction's gas value to generate a distinct total fee in the UI.\n */\nexport class TestGasFeeFlow implements GasFeeFlow {\n #counter = 1;\n\n matchesTransaction(_transactionMeta: TransactionMeta): boolean {\n return true;\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n const { transactionMeta } = request;\n const { txParams } = transactionMeta;\n const { gas: gasHex } = txParams;\n\n if (!gasHex) {\n throw new Error('Cannot estimate fee without gas value');\n }\n\n const gasDecimal = parseInt(gasHex, 16);\n const difference = INCREMENT * LEVEL_DIFFERENCE;\n\n const mediumMaxTarget = (this.#counter + 1) * INCREMENT;\n const mediumPriorityTarget = this.#counter * INCREMENT;\n\n const lowMaxTarget = mediumMaxTarget - difference;\n const lowPriorityTarget = mediumPriorityTarget - difference;\n\n const highMaxTarget = mediumMaxTarget + difference;\n const highPriorityTarget = mediumPriorityTarget + difference;\n\n this.#counter += 1;\n\n return {\n estimates: {\n type: GasFeeEstimateType.FeeMarket,\n low: {\n maxFeePerGas: this.#getValueForTotalFee(lowMaxTarget, gasDecimal),\n maxPriorityFeePerGas: this.#getValueForTotalFee(\n lowPriorityTarget,\n gasDecimal,\n ),\n },\n medium: {\n maxFeePerGas: this.#getValueForTotalFee(mediumMaxTarget, gasDecimal),\n maxPriorityFeePerGas: this.#getValueForTotalFee(\n mediumPriorityTarget,\n gasDecimal,\n ),\n },\n high: {\n maxFeePerGas: this.#getValueForTotalFee(highMaxTarget, gasDecimal),\n maxPriorityFeePerGas: this.#getValueForTotalFee(\n highPriorityTarget,\n gasDecimal,\n ),\n },\n },\n };\n }\n\n #getValueForTotalFee(totalFee: number, gas: number): Hex {\n const feeDecimal = Math.ceil(totalFee / gas);\n return toHex(feeDecimal);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,aAAa;AAWtB,IAAM,YAAY;AAClB,IAAM,mBAAmB;AAZzB;AAmBO,IAAM,iBAAN,MAA2C;AAAA,EAA3C;AA0DL;AAzDA,iCAAW;AAAA;AAAA,EAEX,mBAAmB,kBAA4C;AAC7D,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,WAAW,SAAyD;AACxE,UAAM,EAAE,gBAAgB,IAAI;AAC5B,UAAM,EAAE,SAAS,IAAI;AACrB,UAAM,EAAE,KAAK,OAAO,IAAI;AAExB,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,uCAAuC;AAAA,IACzD;AAEA,UAAM,aAAa,SAAS,QAAQ,EAAE;AACtC,UAAM,aAAa,YAAY;AAE/B,UAAM,mBAAmB,mBAAK,YAAW,KAAK;AAC9C,UAAM,uBAAuB,mBAAK,YAAW;AAE7C,UAAM,eAAe,kBAAkB;AACvC,UAAM,oBAAoB,uBAAuB;AAEjD,UAAM,gBAAgB,kBAAkB;AACxC,UAAM,qBAAqB,uBAAuB;AAElD,uBAAK,UAAL,mBAAK,YAAY;AAEjB,WAAO;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACA,KAAK;AAAA,UACH,cAAc,sBAAK,8CAAL,WAA0B,cAAc;AAAA,UACtD,sBAAsB,sBAAK,8CAAL,WACpB,mBACA;AAAA,QAEJ;AAAA,QACA,QAAQ;AAAA,UACN,cAAc,sBAAK,8CAAL,WAA0B,iBAAiB;AAAA,UACzD,sBAAsB,sBAAK,8CAAL,WACpB,sBACA;AAAA,QAEJ;AAAA,QACA,MAAM;AAAA,UACJ,cAAc,sBAAK,8CAAL,WAA0B,eAAe;AAAA,UACvD,sBAAsB,sBAAK,8CAAL,WACpB,oBACA;AAAA,QAEJ;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAMF;AA7DE;AAyDA;AAAA,yBAAoB,SAAC,UAAkB,KAAkB;AACvD,QAAM,aAAa,KAAK,KAAK,WAAW,GAAG;AAC3C,SAAO,MAAM,UAAU;AACzB;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-FRKQ3Z2L.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-FRKQ3Z2L.mjs.map +deleted file mode 100644 +index a1c5aad..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-FRKQ3Z2L.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/external-transactions.ts"],"sourcesContent":["// These utility functions are exclusively used by `confirmExternalTransaction` method in controller\nimport { rpcErrors } from '@metamask/rpc-errors';\n\nimport { TransactionStatus } from '../types';\nimport type { TransactionMeta } from '../types';\n\n/**\n * Validates the external provided transaction meta.\n *\n * @param transactionMeta - The transaction meta to validate.\n * @param confirmedTxs - The confirmed transactions in controller state.\n * @param pendingTxs - The submitted transactions in controller state.\n */\nexport function validateConfirmedExternalTransaction(\n transactionMeta?: TransactionMeta,\n confirmedTxs?: TransactionMeta[],\n pendingTxs?: TransactionMeta[],\n) {\n if (!transactionMeta || !transactionMeta.txParams) {\n throw rpcErrors.invalidParams(\n '\"transactionMeta\" or \"transactionMeta.txParams\" is missing',\n );\n }\n\n if (transactionMeta.status !== TransactionStatus.confirmed) {\n throw rpcErrors.invalidParams(\n 'External transaction status should be \"confirmed\"',\n );\n }\n\n const externalTxNonce = transactionMeta.txParams.nonce;\n if (pendingTxs && pendingTxs.length > 0) {\n const foundPendingTxByNonce = pendingTxs.find(\n (tx) => tx.txParams?.nonce === externalTxNonce,\n );\n if (foundPendingTxByNonce) {\n throw rpcErrors.invalidParams(\n 'External transaction nonce should not be in pending txs',\n );\n }\n }\n\n if (confirmedTxs && confirmedTxs.length > 0) {\n const foundConfirmedTxByNonce = confirmedTxs.find(\n (tx) => tx.txParams?.nonce === externalTxNonce,\n );\n if (foundConfirmedTxByNonce) {\n throw rpcErrors.invalidParams(\n 'External transaction nonce should not be in confirmed txs',\n );\n }\n }\n}\n"],"mappings":";AACA,SAAS,iBAAiB;AAYnB,SAAS,qCACd,iBACA,cACA,YACA;AACA,MAAI,CAAC,mBAAmB,CAAC,gBAAgB,UAAU;AACjD,UAAM,UAAU;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAEA,MAAI,gBAAgB,wCAAwC;AAC1D,UAAM,UAAU;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAkB,gBAAgB,SAAS;AACjD,MAAI,cAAc,WAAW,SAAS,GAAG;AACvC,UAAM,wBAAwB,WAAW;AAAA,MACvC,CAAC,OAAO,GAAG,UAAU,UAAU;AAAA,IACjC;AACA,QAAI,uBAAuB;AACzB,YAAM,UAAU;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,gBAAgB,aAAa,SAAS,GAAG;AAC3C,UAAM,0BAA0B,aAAa;AAAA,MAC3C,CAAC,OAAO,GAAG,UAAU,UAAU;AAAA,IACjC;AACA,QAAI,yBAAyB;AAC3B,YAAM,UAAU;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-GNAL5HC2.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-GNAL5HC2.mjs.map +deleted file mode 100644 +index 26cf9ce..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-GNAL5HC2.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/swaps.ts"],"sourcesContent":["import { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport { merge, pickBy } from 'lodash';\n\nimport { CHAIN_IDS } from '../constants';\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionControllerMessenger } from '../TransactionController';\nimport type { TransactionMeta } from '../types';\nimport { TransactionType } from '../types';\nimport { validateIfTransactionUnapproved } from './utils';\n\nconst log = createModuleLogger(projectLogger, 'swaps');\n\n/**\n * Interval in milliseconds between checks of post transaction balance\n */\nexport const UPDATE_POST_TX_BALANCE_TIMEOUT = 5000;\n\n/**\n * Retry attempts for checking post transaction balance\n */\nexport const UPDATE_POST_TX_BALANCE_ATTEMPTS = 6;\n\nconst SWAPS_TESTNET_CHAIN_ID = '0x539';\n\n/**\n * An address that the metaswap-api recognizes as the default token for the current network, in place of the token address that ERC-20 tokens have\n */\nexport const DEFAULT_TOKEN_ADDRESS =\n '0x0000000000000000000000000000000000000000';\n\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\ninterface SwapsTokenObject {\n /**\n * The name for the network\n */\n name: string;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n}\n\nconst ETH_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n};\n\nconst BNB_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Binance Coin',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst MATIC_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Matic',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst AVAX_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Avalanche',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst TEST_ETH_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Test Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst GOERLI_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst ARBITRUM_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nconst OPTIMISM_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nconst ZKSYNC_ERA_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nexport const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {\n [CHAIN_IDS.MAINNET]: ETH_SWAPS_TOKEN_OBJECT,\n [SWAPS_TESTNET_CHAIN_ID]: TEST_ETH_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.BSC]: BNB_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.POLYGON]: MATIC_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.GOERLI]: GOERLI_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.AVALANCHE]: AVAX_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.OPTIMISM]: OPTIMISM_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.ARBITRUM]: ARBITRUM_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_ERA_SWAPS_TOKEN_OBJECT,\n} as const;\n\nexport const SWAP_TRANSACTION_TYPES = [\n TransactionType.swap,\n TransactionType.swapAndSend,\n TransactionType.swapApproval,\n];\n\n/**\n * Updates the transaction meta object with the swap information\n *\n * @param transactionMeta - The transaction meta object to update\n * @param transactionType - The type of the transaction\n * @param swaps - The swaps object\n * @param swaps.hasApproveTx - Whether the swap has an approval transaction\n * @param swaps.meta - The swap meta object\n * @param updateSwapsTransactionRequest - Dependency bag\n * @param updateSwapsTransactionRequest.isSwapsDisabled - Whether swaps are disabled\n * @param updateSwapsTransactionRequest.cancelTransaction - Function to cancel a transaction\n * @param updateSwapsTransactionRequest.messenger - TransactionController messenger\n * @returns A copy of the transaction meta object with updates, or the same\n * transaction meta object if no updates were made.\n */\nexport function updateSwapsTransaction(\n transactionMeta: TransactionMeta,\n transactionType: TransactionType,\n swaps: {\n hasApproveTx?: boolean;\n meta?: Partial;\n },\n {\n isSwapsDisabled,\n cancelTransaction,\n messenger,\n }: {\n isSwapsDisabled: boolean;\n cancelTransaction: (transactionId: string) => void;\n messenger: TransactionControllerMessenger;\n },\n): TransactionMeta {\n if (isSwapsDisabled || !SWAP_TRANSACTION_TYPES.includes(transactionType)) {\n return transactionMeta;\n }\n\n // The simulationFails property is added if the estimateGas call fails. In cases\n // when no swaps approval tx is required, this indicates that the swap will likely\n // fail. There was an earlier estimateGas call made by the swaps controller,\n // but it is possible that external conditions have change since then, and\n // a previously succeeding estimate gas call could now fail. By checking for\n // the `simulationFails` property here, we can reduce the number of swap\n // transactions that get published to the blockchain only to fail and thereby\n // waste the user's funds on gas.\n if (\n transactionType === TransactionType.swap &&\n swaps?.hasApproveTx === false &&\n transactionMeta.simulationFails\n ) {\n cancelTransaction(transactionMeta.id);\n throw new Error('Simulation failed');\n }\n\n const swapsMeta = swaps?.meta as Partial;\n\n if (!swapsMeta) {\n return transactionMeta;\n }\n\n let updatedTransactionMeta = transactionMeta;\n\n if (transactionType === TransactionType.swapApproval) {\n updatedTransactionMeta = updateSwapApprovalTransaction(\n transactionMeta,\n swapsMeta,\n );\n messenger.publish('TransactionController:transactionNewSwapApproval', {\n transactionMeta: updatedTransactionMeta,\n });\n }\n\n if (transactionType === TransactionType.swapAndSend) {\n updatedTransactionMeta = updateSwapAndSendTransaction(\n transactionMeta,\n swapsMeta,\n );\n messenger.publish('TransactionController:transactionNewSwapAndSend', {\n transactionMeta: updatedTransactionMeta,\n });\n }\n\n if (transactionType === TransactionType.swap) {\n updatedTransactionMeta = updateSwapTransaction(transactionMeta, swapsMeta);\n messenger.publish('TransactionController:transactionNewSwap', {\n transactionMeta: updatedTransactionMeta,\n });\n }\n\n return updatedTransactionMeta;\n}\n\n/**\n * Attempts to update the post transaction balance of the provided transaction\n *\n * @param transactionMeta - Transaction meta object to update\n * @param updatePostTransactionBalanceRequest - Dependency bag\n * @param updatePostTransactionBalanceRequest.ethQuery - EthQuery object\n * @param updatePostTransactionBalanceRequest.getTransaction - Reading function for the latest transaction state\n * @param updatePostTransactionBalanceRequest.updateTransaction - Updating transaction function\n */\nexport async function updatePostTransactionBalance(\n transactionMeta: TransactionMeta,\n {\n ethQuery,\n getTransaction,\n updateTransaction,\n }: {\n ethQuery: EthQuery;\n getTransaction: (transactionId: string) => TransactionMeta | undefined;\n updateTransaction: (transactionMeta: TransactionMeta, note: string) => void;\n },\n): Promise<{\n updatedTransactionMeta: TransactionMeta;\n approvalTransactionMeta?: TransactionMeta;\n}> {\n log('Updating post transaction balance', transactionMeta.id);\n\n const transactionId = transactionMeta.id;\n let latestTransactionMeta: TransactionMeta | undefined;\n let approvalTransactionMeta;\n\n for (let i = 0; i < UPDATE_POST_TX_BALANCE_ATTEMPTS; i++) {\n log('Querying balance', { attempt: i });\n\n const postTransactionBalance = await query(ethQuery, 'getBalance', [\n transactionMeta.txParams.from,\n ]);\n\n latestTransactionMeta = {\n ...(getTransaction(transactionId) ?? ({} as TransactionMeta)),\n };\n\n approvalTransactionMeta = latestTransactionMeta.approvalTxId\n ? getTransaction(latestTransactionMeta.approvalTxId)\n : undefined;\n\n latestTransactionMeta.postTxBalance = postTransactionBalance.toString(16);\n\n const isDefaultTokenAddress = isSwapsDefaultTokenAddress(\n transactionMeta.destinationTokenAddress as string,\n transactionMeta.chainId,\n );\n\n if (\n !isDefaultTokenAddress ||\n transactionMeta.preTxBalance !== latestTransactionMeta.postTxBalance\n ) {\n log('Finishing post balance update', {\n isDefaultTokenAddress,\n preTxBalance: transactionMeta.preTxBalance,\n postTxBalance: latestTransactionMeta.postTxBalance,\n });\n\n break;\n }\n\n log('Waiting for balance to update', {\n delay: UPDATE_POST_TX_BALANCE_TIMEOUT,\n });\n\n await sleep(UPDATE_POST_TX_BALANCE_TIMEOUT);\n }\n\n updateTransaction(\n latestTransactionMeta as TransactionMeta,\n 'TransactionController#updatePostTransactionBalance - Add post transaction balance',\n );\n\n log('Completed post balance update', latestTransactionMeta?.postTxBalance);\n\n return {\n updatedTransactionMeta: latestTransactionMeta as TransactionMeta,\n approvalTransactionMeta,\n };\n}\n\n/**\n * Updates the transaction meta object with the swap information\n *\n * @param transactionMeta - Transaction meta object to update\n * @param propsToUpdate - Properties to update\n * @param propsToUpdate.sourceTokenSymbol - Symbol of the token to be swapped\n * @param propsToUpdate.destinationTokenSymbol - Symbol of the token to be received\n * @param propsToUpdate.type - Type of the transaction\n * @param propsToUpdate.destinationTokenDecimals - Decimals of the token to be received\n * @param propsToUpdate.destinationTokenAddress - Address of the token to be received\n * @param propsToUpdate.swapMetaData - Metadata of the swap\n * @param propsToUpdate.swapTokenValue - Value of the token to be swapped\n * @param propsToUpdate.estimatedBaseFee - Estimated base fee of the transaction\n * @param propsToUpdate.approvalTxId - Transaction id of the approval transaction\n * @returns The updated transaction meta object.\n */\nfunction updateSwapTransaction(\n transactionMeta: TransactionMeta,\n {\n sourceTokenSymbol,\n destinationTokenSymbol,\n type,\n destinationTokenDecimals,\n destinationTokenAddress,\n swapMetaData,\n swapTokenValue,\n estimatedBaseFee,\n approvalTxId,\n }: Partial,\n): TransactionMeta {\n validateIfTransactionUnapproved(transactionMeta, 'updateSwapTransaction');\n\n let swapTransaction = {\n sourceTokenSymbol,\n destinationTokenSymbol,\n type,\n destinationTokenDecimals,\n destinationTokenAddress,\n swapMetaData,\n swapTokenValue,\n estimatedBaseFee,\n approvalTxId,\n };\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n swapTransaction = pickBy(swapTransaction) as any;\n\n return merge({}, transactionMeta, swapTransaction);\n}\n\n/**\n * Updates the transaction meta object with the swap information\n *\n * @param transactionMeta - Transaction meta object to update\n * @param propsToUpdate - Properties to update\n * @param propsToUpdate.approvalTxId - Transaction id of the approval transaction\n * @param propsToUpdate.destinationTokenAddress - Address of the token to be received\n * @param propsToUpdate.destinationTokenAmount - The raw amount of the destination token\n * @param propsToUpdate.destinationTokenDecimals - Decimals of the token to be received\n * @param propsToUpdate.destinationTokenSymbol - Symbol of the token to be received\n * @param propsToUpdate.estimatedBaseFee - Estimated base fee of the transaction\n * @param propsToUpdate.sourceTokenAddress - The address of the source token\n * @param propsToUpdate.sourceTokenAmount - The raw amount of the source token\n * @param propsToUpdate.sourceTokenDecimals - The decimals of the source token\n * @param propsToUpdate.sourceTokenSymbol - Symbol of the token to be swapped\n * @param propsToUpdate.swapAndSendRecipient - The recipient of the swap and send transaction\n * @param propsToUpdate.swapMetaData - Metadata of the swap\n * @param propsToUpdate.swapTokenValue - Value of the token to be swapped – possibly the same as sourceTokenAmount; included for consistency\n * @param propsToUpdate.type - Type of the transaction\n * @returns The updated transaction meta object.\n */\nfunction updateSwapAndSendTransaction(\n transactionMeta: TransactionMeta,\n {\n approvalTxId,\n destinationTokenAddress,\n destinationTokenAmount,\n destinationTokenDecimals,\n destinationTokenSymbol,\n estimatedBaseFee,\n sourceTokenAddress,\n sourceTokenAmount,\n sourceTokenDecimals,\n sourceTokenSymbol,\n swapAndSendRecipient,\n swapMetaData,\n swapTokenValue,\n type,\n }: Partial,\n): TransactionMeta {\n validateIfTransactionUnapproved(transactionMeta, 'updateSwapTransaction');\n\n let swapTransaction = {\n approvalTxId,\n destinationTokenAddress,\n destinationTokenAmount,\n destinationTokenDecimals,\n destinationTokenSymbol,\n estimatedBaseFee,\n sourceTokenAddress,\n sourceTokenAmount,\n sourceTokenDecimals,\n sourceTokenSymbol,\n swapAndSendRecipient,\n swapMetaData,\n swapTokenValue,\n type,\n };\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n swapTransaction = pickBy(swapTransaction) as any;\n\n return merge({}, transactionMeta, swapTransaction);\n}\n\n/**\n * Updates the transaction meta object with the swap approval information\n *\n * @param transactionMeta - Transaction meta object to update\n * @param propsToUpdate - Properties to update\n * @param propsToUpdate.type - Type of the transaction\n * @param propsToUpdate.sourceTokenSymbol - Symbol of the token to be swapped\n * @returns The updated transaction meta object.\n */\nfunction updateSwapApprovalTransaction(\n transactionMeta: TransactionMeta,\n { type, sourceTokenSymbol }: Partial,\n): TransactionMeta {\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateSwapApprovalTransaction',\n );\n\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let swapApprovalTransaction = { type, sourceTokenSymbol } as any;\n swapApprovalTransaction = pickBy({\n type,\n sourceTokenSymbol,\n }) as Partial;\n\n return merge({}, transactionMeta, swapApprovalTransaction);\n}\n\n/**\n * Checks whether the provided address is strictly equal to the address for\n * the default swaps token of the provided chain.\n *\n * @param address - The string to compare to the default token address\n * @param chainId - The hex encoded chain ID of the default swaps token to check\n * @returns Whether the address is the provided chain's default token address\n */\nfunction isSwapsDefaultTokenAddress(address: string, chainId: string) {\n if (!address || !chainId) {\n return false;\n }\n\n return (\n address ===\n SWAPS_CHAINID_DEFAULT_TOKEN_MAP[\n chainId as keyof typeof SWAPS_CHAINID_DEFAULT_TOKEN_MAP\n ]?.address\n );\n}\n\n/**\n * Sleeps for the provided number of milliseconds\n *\n * @param ms - Number of milliseconds to sleep\n * @returns Promise that resolves after the provided number of milliseconds\n */\nfunction sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,aAAa;AAEtB,SAAS,OAAO,cAAc;AAS9B,IAAM,MAAM,mBAAmB,eAAe,OAAO;AAK9C,IAAM,iCAAiC;AAKvC,IAAM,kCAAkC;AAE/C,IAAM,yBAAyB;AAKxB,IAAM,wBACX;AAmBF,IAAM,yBAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,yBAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,2BAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,0BAA4C;AAAA,EAChD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,8BAAgD;AAAA,EACpD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,4BAA8C;AAAA,EAClD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,8BAAgD;AAAA,EACpD,GAAG;AACL;AAEA,IAAM,8BAAgD;AAAA,EACpD,GAAG;AACL;AAEA,IAAM,gCAAkD;AAAA,EACtD,GAAG;AACL;AAEO,IAAM,kCAAkC;AAAA,EAC7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GA,oBAAkB,OAAO,eAAe;AAExC,SAAO,MAAM,CAAC,GAAG,iBAAiB,eAAe;AACnD;AAuBA,SAAS,6BACP,iBACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACiB;AACjB,kCAAgC,iBAAiB,uBAAuB;AAExE,MAAI,kBAAkB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,oBAAkB,OAAO,eAAe;AAExC,SAAO,MAAM,CAAC,GAAG,iBAAiB,eAAe;AACnD;AAWA,SAAS,8BACP,iBACA,EAAE,MAAM,kBAAkB,GACT;AACjB;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAIA,MAAI,0BAA0B,EAAE,MAAM,kBAAkB;AACxD,4BAA0B,OAAO;AAAA,IAC/B;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,MAAM,CAAC,GAAG,iBAAiB,uBAAuB;AAC3D;AAUA,SAAS,2BAA2B,SAAiB,SAAiB;AACpE,MAAI,CAAC,WAAW,CAAC,SAAS;AACxB,WAAO;AAAA,EACT;AAEA,SACE,YACA,gCACE,OACF,GAAG;AAEP;AAQA,SAAS,MAAM,IAAY;AACzB,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC;AACzD;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-JXXTNVU4.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-GRMANXAN.mjs +similarity index 96% +rename from node_modules/@metamask/transaction-controller/dist/chunk-JXXTNVU4.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-GRMANXAN.mjs +index cfd8bad..a109095 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-JXXTNVU4.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-GRMANXAN.mjs +@@ -1,6 +1,6 @@ + import { + GasFeeEstimateLevel +-} from "./chunk-6SJYXSF3.mjs"; ++} from "./chunk-UF4IMTUO.mjs"; + + // src/utils/gas-flow.ts + import { weiHexToGweiDec } from "@metamask/controller-utils"; +@@ -64,4 +64,4 @@ export { + getGasFeeFlow, + mergeGasFeeEstimates + }; +-//# sourceMappingURL=chunk-JXXTNVU4.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-GRMANXAN.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-H2KZOK3J.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-H2KZOK3J.mjs.map +deleted file mode 100644 +index ae1d7d0..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-H2KZOK3J.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/DefaultGasFeeFlow.ts"],"sourcesContent":["import type {\n LegacyGasPriceEstimate,\n GasFeeEstimates as FeeMarketGasPriceEstimate,\n EthGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\nimport { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type {\n FeeMarketGasFeeEstimateForLevel,\n FeeMarketGasFeeEstimates,\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n GasPriceGasFeeEstimates,\n LegacyGasFeeEstimates,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel, GasFeeEstimateType } from '../types';\nimport { gweiDecimalToWeiHex } from '../utils/gas-fees';\n\nconst log = createModuleLogger(projectLogger, 'default-gas-fee-flow');\n\n/**\n * The standard implementation of a gas fee flow that obtains gas fee estimates using only the GasFeeController.\n */\nexport class DefaultGasFeeFlow implements GasFeeFlow {\n matchesTransaction(_transactionMeta: TransactionMeta): boolean {\n return true;\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n const { gasFeeControllerData } = request;\n const { gasEstimateType, gasFeeEstimates } = gasFeeControllerData;\n\n let response: GasFeeEstimates;\n\n switch (gasEstimateType) {\n case GAS_ESTIMATE_TYPES.FEE_MARKET:\n log('Using fee market estimates', gasFeeEstimates);\n response = this.#getFeeMarkEstimates(gasFeeEstimates);\n break;\n case GAS_ESTIMATE_TYPES.LEGACY:\n log('Using legacy estimates', gasFeeEstimates);\n response = this.#getLegacyEstimates(\n gasFeeEstimates as LegacyGasPriceEstimate,\n );\n break;\n case GAS_ESTIMATE_TYPES.ETH_GASPRICE:\n log('Using eth_gasPrice estimates', gasFeeEstimates);\n response = this.#getGasPriceEstimates(\n gasFeeEstimates as EthGasPriceEstimate,\n );\n break;\n default:\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported gas estimate type: ${gasEstimateType}`);\n }\n\n return {\n estimates: response,\n };\n }\n\n #getFeeMarkEstimates(\n gasFeeEstimates: FeeMarketGasPriceEstimate,\n ): FeeMarketGasFeeEstimates {\n const levels = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: this.#getFeeMarketLevel(gasFeeEstimates, level),\n }),\n {} as Omit,\n );\n\n return {\n type: GasFeeEstimateType.FeeMarket,\n ...levels,\n };\n }\n\n #getLegacyEstimates(\n gasFeeEstimates: LegacyGasPriceEstimate,\n ): LegacyGasFeeEstimates {\n const levels = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: this.#getLegacyLevel(gasFeeEstimates, level),\n }),\n {} as Omit,\n );\n\n return {\n type: GasFeeEstimateType.Legacy,\n ...levels,\n };\n }\n\n #getGasPriceEstimates(\n gasFeeEstimates: EthGasPriceEstimate,\n ): GasPriceGasFeeEstimates {\n return {\n type: GasFeeEstimateType.GasPrice,\n gasPrice: gweiDecimalToWeiHex(gasFeeEstimates.gasPrice),\n };\n }\n\n #getFeeMarketLevel(\n gasFeeEstimates: FeeMarketGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): FeeMarketGasFeeEstimateForLevel {\n const maxFeePerGas = gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxFeePerGas,\n );\n\n const maxPriorityFeePerGas = gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxPriorityFeePerGas,\n );\n\n return {\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n }\n\n #getLegacyLevel(\n gasFeeEstimates: LegacyGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): Hex {\n return gweiDecimalToWeiHex(gasFeeEstimates[level]);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAKA,SAAS,0BAA0B;AAEnC,SAAS,0BAA0B;AAiBnC,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAxBpE;AA6BO,IAAM,oBAAN,MAA8C;AAAA,EAA9C;AAuCL;AAiBA;AAiBA;AASA;AAkBA;AAAA;AAAA,EAnGA,mBAAmB,kBAA4C;AAC7D,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,WAAW,SAAyD;AACxE,UAAM,EAAE,qBAAqB,IAAI;AACjC,UAAM,EAAE,iBAAiB,gBAAgB,IAAI;AAE7C,QAAI;AAEJ,YAAQ,iBAAiB;AAAA,MACvB,KAAK,mBAAmB;AACtB,YAAI,8BAA8B,eAAe;AACjD,mBAAW,sBAAK,8CAAL,WAA0B;AACrC;AAAA,MACF,KAAK,mBAAmB;AACtB,YAAI,0BAA0B,eAAe;AAC7C,mBAAW,sBAAK,4CAAL,WACT;AAEF;AAAA,MACF,KAAK,mBAAmB;AACtB,YAAI,gCAAgC,eAAe;AACnD,mBAAW,sBAAK,gDAAL,WACT;AAEF;AAAA,MACF;AAGE,cAAM,IAAI,MAAM,kCAAkC,eAAe,EAAE;AAAA,IACvE;AAEA,WAAO;AAAA,MACL,WAAW;AAAA,IACb;AAAA,EACF;AAqEF;AAnEE;AAAA,yBAAoB,SAClB,iBAC0B;AAC1B,QAAM,SAAS,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAChD,CAAC,QAAQ,WAAW;AAAA,MAClB,GAAG;AAAA,MACH,CAAC,KAAK,GAAG,sBAAK,0CAAL,WAAwB,iBAAiB;AAAA,IACpD;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAEA;AAAA,wBAAmB,SACjB,iBACuB;AACvB,QAAM,SAAS,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAChD,CAAC,QAAQ,WAAW;AAAA,MAClB,GAAG;AAAA,MACH,CAAC,KAAK,GAAG,sBAAK,oCAAL,WAAqB,iBAAiB;AAAA,IACjD;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAEA;AAAA,0BAAqB,SACnB,iBACyB;AACzB,SAAO;AAAA,IACL;AAAA,IACA,UAAU,oBAAoB,gBAAgB,QAAQ;AAAA,EACxD;AACF;AAEA;AAAA,uBAAkB,SAChB,iBACA,OACiC;AACjC,QAAM,eAAe;AAAA,IACnB,gBAAgB,KAAK,EAAE;AAAA,EACzB;AAEA,QAAM,uBAAuB;AAAA,IAC3B,gBAAgB,KAAK,EAAE;AAAA,EACzB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEA;AAAA,oBAAe,SACb,iBACA,OACK;AACL,SAAO,oBAAoB,gBAAgB,KAAK,CAAC;AACnD;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-HMOSP33F.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-HMOSP33F.js.map +deleted file mode 100644 +index 339b07f..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-HMOSP33F.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/errors.ts"],"names":[],"mappings":";AAIO,IAAM,kBAAN,cAA8B,MAAM;AAAA,EAGzC,YAAY,SAAkB,MAAwB;AACpD,UAAM,WAAW,mBAAmB;AAEpC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,mCAAN,cAA+C,gBAAgB;AAAA,EACpE,YAAY,SAAc;AACxB;AAAA,MACE,2BAA2B,OAAO;AAAA;AAAA,IAEpC;AAAA,EACF;AACF;AAEO,IAAM,iCAAN,cAA6C,gBAAgB;AAAA,EAClE,cAAc;AACZ;AAAA,MACE;AAAA;AAAA,IAEF;AAAA,EACF;AACF;AAEO,IAAM,0BAAN,cAAsC,gBAAgB;AAAA,EAC3D,cAAc;AACZ,UAAM,qDAAwD;AAAA,EAChE;AACF","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport { SimulationErrorCode } from './types';\n\nexport class SimulationError extends Error {\n code?: string | number;\n\n constructor(message?: string, code?: string | number) {\n super(message ?? 'Simulation failed');\n\n this.code = code;\n }\n}\n\nexport class SimulationChainNotSupportedError extends SimulationError {\n constructor(chainId: Hex) {\n super(\n `Chain is not supported: ${chainId}`,\n SimulationErrorCode.ChainNotSupported,\n );\n }\n}\n\nexport class SimulationInvalidResponseError extends SimulationError {\n constructor() {\n super(\n 'Invalid response from simulation API',\n SimulationErrorCode.InvalidResponse,\n );\n }\n}\n\nexport class SimulationRevertedError extends SimulationError {\n constructor() {\n super('Transaction was reverted', SimulationErrorCode.Reverted);\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-HQSNKCXI.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-HQSNKCXI.mjs.map +deleted file mode 100644 +index 0f2efab..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-HQSNKCXI.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport { SimulationErrorCode } from './types';\n\nexport class SimulationError extends Error {\n code?: string | number;\n\n constructor(message?: string, code?: string | number) {\n super(message ?? 'Simulation failed');\n\n this.code = code;\n }\n}\n\nexport class SimulationChainNotSupportedError extends SimulationError {\n constructor(chainId: Hex) {\n super(\n `Chain is not supported: ${chainId}`,\n SimulationErrorCode.ChainNotSupported,\n );\n }\n}\n\nexport class SimulationInvalidResponseError extends SimulationError {\n constructor() {\n super(\n 'Invalid response from simulation API',\n SimulationErrorCode.InvalidResponse,\n );\n }\n}\n\nexport class SimulationRevertedError extends SimulationError {\n constructor() {\n super('Transaction was reverted', SimulationErrorCode.Reverted);\n }\n}\n"],"mappings":";AAIO,IAAM,kBAAN,cAA8B,MAAM;AAAA,EAGzC,YAAY,SAAkB,MAAwB;AACpD,UAAM,WAAW,mBAAmB;AAEpC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,mCAAN,cAA+C,gBAAgB;AAAA,EACpE,YAAY,SAAc;AACxB;AAAA,MACE,2BAA2B,OAAO;AAAA;AAAA,IAEpC;AAAA,EACF;AACF;AAEO,IAAM,iCAAN,cAA6C,gBAAgB;AAAA,EAClE,cAAc;AACZ;AAAA,MACE;AAAA;AAAA,IAEF;AAAA,EACF;AACF;AAEO,IAAM,0BAAN,cAAsC,gBAAgB;AAAA,EAC3D,cAAc;AACZ,UAAM,qDAAwD;AAAA,EAChE;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-H2KZOK3J.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-JQDBXSCG.mjs +similarity index 97% +rename from node_modules/@metamask/transaction-controller/dist/chunk-H2KZOK3J.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-JQDBXSCG.mjs +index 8f0bd49..9e5e04e 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-H2KZOK3J.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-JQDBXSCG.mjs +@@ -1,12 +1,12 @@ + import { + gweiDecimalToWeiHex +-} from "./chunk-VXNPVIYL.mjs"; ++} from "./chunk-UUBV6ROF.mjs"; + import { + projectLogger + } from "./chunk-UQQWZT6C.mjs"; + import { + GasFeeEstimateLevel +-} from "./chunk-6SJYXSF3.mjs"; ++} from "./chunk-UF4IMTUO.mjs"; + import { + __privateAdd, + __privateMethod +@@ -109,4 +109,4 @@ getLegacyLevel_fn = function(gasFeeEstimates, level) { + export { + DefaultGasFeeFlow + }; +-//# sourceMappingURL=chunk-H2KZOK3J.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-JQDBXSCG.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-JXXTNVU4.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-JXXTNVU4.mjs.map +deleted file mode 100644 +index a169c44..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-JXXTNVU4.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/gas-flow.ts"],"sourcesContent":["import { weiHexToGweiDec } from '@metamask/controller-utils';\nimport type {\n Eip1559GasFee,\n EthGasPriceEstimate,\n GasFeeEstimates,\n LegacyGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\nimport { type GasFeeState } from '@metamask/gas-fee-controller';\n\nimport type {\n FeeMarketGasFeeEstimates,\n GasPriceGasFeeEstimates,\n LegacyGasFeeEstimates,\n} from '../types';\nimport {\n type GasFeeFlow,\n type TransactionMeta,\n type FeeMarketGasFeeEstimateForLevel,\n GasFeeEstimateLevel,\n GasFeeEstimateType,\n} from '../types';\n\ntype MergeGasFeeEstimatesRequest = {\n gasFeeControllerEstimates:\n | GasFeeEstimates\n | LegacyGasPriceEstimate\n | EthGasPriceEstimate;\n transactionGasFeeEstimates:\n | FeeMarketGasFeeEstimates\n | LegacyGasFeeEstimates\n | GasPriceGasFeeEstimates;\n};\n\n/**\n * Returns the first gas fee flow that matches the transaction.\n *\n * @param transactionMeta - The transaction metadata to find a gas fee flow for.\n * @param gasFeeFlows - The gas fee flows to search.\n * @returns The first gas fee flow that matches the transaction, or undefined if none match.\n */\nexport function getGasFeeFlow(\n transactionMeta: TransactionMeta,\n gasFeeFlows: GasFeeFlow[],\n): GasFeeFlow | undefined {\n return gasFeeFlows.find((gasFeeFlow) =>\n gasFeeFlow.matchesTransaction(transactionMeta),\n );\n}\n\n/**\n * Merge the gas fee estimates from the gas fee controller with the gas fee estimates from a transaction.\n * @param request - Data required to merge gas fee estimates.\n * @param request.gasFeeControllerEstimates - Gas fee estimates from the GasFeeController.\n * @param request.transactionGasFeeEstimates - Gas fee estimates from the transaction.\n * @returns The merged gas fee estimates.\n */\nexport function mergeGasFeeEstimates({\n gasFeeControllerEstimates,\n transactionGasFeeEstimates,\n}: MergeGasFeeEstimatesRequest): GasFeeState['gasFeeEstimates'] {\n const transactionEstimateType = transactionGasFeeEstimates.type;\n\n if (transactionEstimateType === GasFeeEstimateType.FeeMarket) {\n return Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: mergeFeeMarketEstimate(\n (gasFeeControllerEstimates as GasFeeEstimates)?.[level],\n transactionGasFeeEstimates[level],\n ),\n }),\n { ...gasFeeControllerEstimates } as GasFeeEstimates,\n );\n }\n\n if (transactionEstimateType === GasFeeEstimateType.Legacy) {\n return Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: getLegacyEstimate(transactionGasFeeEstimates, level),\n }),\n {} as LegacyGasPriceEstimate,\n );\n }\n\n if (transactionEstimateType === GasFeeEstimateType.GasPrice) {\n return {\n gasPrice: getGasPriceEstimate(transactionGasFeeEstimates),\n };\n }\n\n return gasFeeControllerEstimates;\n}\n\n/**\n * Merge a specific priority level of EIP-1559 gas fee estimates.\n * @param gasFeeControllerEstimate - The gas fee estimate from the gas fee controller.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @returns The merged gas fee estimate.\n */\nfunction mergeFeeMarketEstimate(\n gasFeeControllerEstimate: Eip1559GasFee | undefined,\n transactionGasFeeEstimate: FeeMarketGasFeeEstimateForLevel,\n): Eip1559GasFee {\n return {\n ...gasFeeControllerEstimate,\n suggestedMaxFeePerGas: weiHexToGweiDec(\n transactionGasFeeEstimate.maxFeePerGas,\n ),\n suggestedMaxPriorityFeePerGas: weiHexToGweiDec(\n transactionGasFeeEstimate.maxPriorityFeePerGas,\n ),\n } as Eip1559GasFee;\n}\n\n/**\n * Generate a specific priority level for a legacy gas fee estimate.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @param level - The gas fee estimate level.\n * @returns The legacy gas fee estimate.\n */\nfunction getLegacyEstimate(\n transactionGasFeeEstimate: LegacyGasFeeEstimates,\n level: GasFeeEstimateLevel,\n): string {\n return weiHexToGweiDec(transactionGasFeeEstimate[level]);\n}\n\n/**\n * Generate the value for a gas price gas fee estimate.\n * @param transactionGasFeeEstimate - The gas fee estimate from the transaction.\n * @returns The legacy gas fee estimate.\n */\nfunction getGasPriceEstimate(\n transactionGasFeeEstimate: GasPriceGasFeeEstimates,\n): string {\n return weiHexToGweiDec(transactionGasFeeEstimate.gasPrice);\n}\n"],"mappings":";;;;;AAAA,SAAS,uBAAuB;AAwCzB,SAAS,cACd,iBACA,aACwB;AACxB,SAAO,YAAY;AAAA,IAAK,CAAC,eACvB,WAAW,mBAAmB,eAAe;AAAA,EAC/C;AACF;AASO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AACF,GAAgE;AAC9D,QAAM,0BAA0B,2BAA2B;AAE3D,MAAI,0DAA0D;AAC5D,WAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,MACxC,CAAC,QAAQ,WAAW;AAAA,QAClB,GAAG;AAAA,QACH,CAAC,KAAK,GAAG;AAAA,UACN,4BAAgD,KAAK;AAAA,UACtD,2BAA2B,KAAK;AAAA,QAClC;AAAA,MACF;AAAA,MACA,EAAE,GAAG,0BAA0B;AAAA,IACjC;AAAA,EACF;AAEA,MAAI,mDAAuD;AACzD,WAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,MACxC,CAAC,QAAQ,WAAW;AAAA,QAClB,GAAG;AAAA,QACH,CAAC,KAAK,GAAG,kBAAkB,4BAA4B,KAAK;AAAA,MAC9D;AAAA,MACA,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,2DAAyD;AAC3D,WAAO;AAAA,MACL,UAAU,oBAAoB,0BAA0B;AAAA,IAC1D;AAAA,EACF;AAEA,SAAO;AACT;AAQA,SAAS,uBACP,0BACA,2BACe;AACf,SAAO;AAAA,IACL,GAAG;AAAA,IACH,uBAAuB;AAAA,MACrB,0BAA0B;AAAA,IAC5B;AAAA,IACA,+BAA+B;AAAA,MAC7B,0BAA0B;AAAA,IAC5B;AAAA,EACF;AACF;AAQA,SAAS,kBACP,2BACA,OACQ;AACR,SAAO,gBAAgB,0BAA0B,KAAK,CAAC;AACzD;AAOA,SAAS,oBACP,2BACQ;AACR,SAAO,gBAAgB,0BAA0B,QAAQ;AAC3D;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-K4KOSAGM.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-K4KOSAGM.mjs.map +deleted file mode 100644 +index 3eaeccc..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-K4KOSAGM.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/simulation-api.ts"],"sourcesContent":["import { convertHexToDecimal } from '@metamask/controller-utils';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { SimulationChainNotSupportedError, SimulationError } from '../errors';\nimport { projectLogger } from '../logger';\n\nconst log = createModuleLogger(projectLogger, 'simulation-api');\n\nconst RPC_METHOD = 'infura_simulateTransactions';\nconst BASE_URL = 'https://tx-sentinel-{0}.api.cx.metamask.io/';\nconst ENDPOINT_NETWORKS = 'networks';\n\n/** Single transaction to simulate in a simulation API request. */\nexport type SimulationRequestTransaction = {\n /** Data to send with the transaction. */\n data?: Hex;\n\n /** Sender of the transaction. */\n from: Hex;\n\n /** Gas limit for the transaction. */\n gas?: Hex;\n\n /** Maximum fee per gas for the transaction. */\n maxFeePerGas?: Hex;\n\n /** Maximum priority fee per gas for the transaction. */\n maxPriorityFeePerGas?: Hex;\n\n /** Recipient of the transaction. */\n to?: Hex;\n\n /** Value to send with the transaction. */\n value?: Hex;\n};\n\n/** Request to the simulation API to simulate transactions. */\nexport type SimulationRequest = {\n /**\n * Transactions to be sequentially simulated.\n * State changes impact subsequent transactions in the list.\n */\n transactions: SimulationRequestTransaction[];\n\n /**\n * Overrides to the state of the blockchain, keyed by smart contract address.\n */\n overrides?: {\n [address: Hex]: {\n /** Overrides to the storage slots for a smart contract account. */\n stateDiff: {\n [slot: Hex]: Hex;\n };\n };\n };\n\n /**\n * Whether to include call traces in the response.\n * Defaults to false.\n */\n withCallTrace?: boolean;\n\n /**\n * Whether to include event logs in the response.\n * Defaults to false.\n */\n withLogs?: boolean;\n};\n\n/** Raw event log emitted by a simulated transaction. */\nexport type SimulationResponseLog = {\n /** Address of the account that created the event. */\n address: Hex;\n\n /** Raw data in the event that is not indexed. */\n data: Hex;\n\n /** Raw indexed data from the event. */\n topics: Hex[];\n};\n\n/** Call trace of a single simulated transaction. */\nexport type SimulationResponseCallTrace = {\n /** Nested calls. */\n calls: SimulationResponseCallTrace[];\n\n /** Raw event logs created by the call. */\n logs: SimulationResponseLog[];\n};\n\n/**\n * Changes to the blockchain state.\n * Keyed by account address.\n */\nexport type SimulationResponseStateDiff = {\n [address: Hex]: {\n /** Native balance of the account. */\n balance?: Hex;\n\n /** Nonce of the account. */\n nonce?: Hex;\n\n /** Storage values per slot. */\n storage?: {\n [slot: Hex]: Hex;\n };\n };\n};\n\n/** Response from the simulation API for a single transaction. */\nexport type SimulationResponseTransaction = {\n /** An error message indicating the transaction could not be simulated. */\n error?: string;\n\n /** Return value of the transaction, such as the balance if calling balanceOf. */\n return: Hex;\n\n /** Hierarchy of call data including nested calls and logs. */\n callTrace?: SimulationResponseCallTrace;\n\n /** Changes to the blockchain state. */\n stateDiff?: {\n /** Initial blockchain state before the transaction. */\n pre?: SimulationResponseStateDiff;\n\n /** Updated blockchain state after the transaction. */\n post?: SimulationResponseStateDiff;\n };\n};\n\n/** Response from the simulation API. */\nexport type SimulationResponse = {\n /** Simulation data for each transaction in the request. */\n transactions: SimulationResponseTransaction[];\n};\n\n/** Data for a network supported by the Simulation API. */\ntype SimulationNetwork = {\n /** Subdomain of the API for the network. */\n network: string;\n\n /** Whether the network supports confirmation simulations. */\n confirmations: boolean;\n};\n\n/** Response from the simulation API containing supported networks. */\ntype SimulationNetworkResponse = {\n [chainIdDecimal: string]: SimulationNetwork;\n};\n\nlet requestIdCounter = 0;\n\n/**\n * Simulate transactions using the transaction simulation API.\n * @param chainId - The chain ID to simulate transactions on.\n * @param request - The request to simulate transactions.\n */\nexport async function simulateTransactions(\n chainId: Hex,\n request: SimulationRequest,\n): Promise {\n const url = await getSimulationUrl(chainId);\n\n log('Sending request', url, request);\n\n const requestId = requestIdCounter;\n requestIdCounter += 1;\n\n const response = await fetch(url, {\n method: 'POST',\n body: JSON.stringify({\n id: String(requestId),\n jsonrpc: '2.0',\n method: RPC_METHOD,\n params: [request],\n }),\n });\n\n const responseJson = await response.json();\n\n log('Received response', responseJson);\n\n if (responseJson.error) {\n const { code, message } = responseJson.error;\n throw new SimulationError(message, code);\n }\n\n return responseJson?.result;\n}\n\n/**\n * Get the URL for the transaction simulation API.\n * @param chainId - The chain ID to get the URL for.\n * @returns The URL for the transaction simulation API.\n */\nasync function getSimulationUrl(chainId: Hex): Promise {\n const networkData = await getNetworkData();\n const chainIdDecimal = convertHexToDecimal(chainId);\n const network = networkData[chainIdDecimal];\n\n if (!network?.confirmations) {\n log('Chain is not supported', chainId);\n throw new SimulationChainNotSupportedError(chainId);\n }\n\n return getUrl(network.network);\n}\n\n/**\n * Retrieve the supported network data from the simulation API.\n */\nasync function getNetworkData(): Promise {\n const url = `${getUrl('ethereum-mainnet')}${ENDPOINT_NETWORKS}`;\n const response = await fetch(url);\n return response.json();\n}\n\n/**\n * Generate the URL for the specified subdomain in the simulation API.\n * @param subdomain - The subdomain to generate the URL for.\n * @returns The URL for the transaction simulation API.\n */\nfunction getUrl(subdomain: string): string {\n return BASE_URL.replace('{0}', subdomain);\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,2BAA2B;AACpC,SAAS,0BAAoC;AAK7C,IAAM,MAAM,mBAAmB,eAAe,gBAAgB;AAE9D,IAAM,aAAa;AACnB,IAAM,WAAW;AACjB,IAAM,oBAAoB;AA4I1B,IAAI,mBAAmB;AAOvB,eAAsB,qBACpB,SACA,SAC6B;AAC7B,QAAM,MAAM,MAAM,iBAAiB,OAAO;AAE1C,MAAI,mBAAmB,KAAK,OAAO;AAEnC,QAAM,YAAY;AAClB,sBAAoB;AAEpB,QAAM,WAAW,MAAM,MAAM,KAAK;AAAA,IAChC,QAAQ;AAAA,IACR,MAAM,KAAK,UAAU;AAAA,MACnB,IAAI,OAAO,SAAS;AAAA,MACpB,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,QAAQ,CAAC,OAAO;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAED,QAAM,eAAe,MAAM,SAAS,KAAK;AAEzC,MAAI,qBAAqB,YAAY;AAErC,MAAI,aAAa,OAAO;AACtB,UAAM,EAAE,MAAM,QAAQ,IAAI,aAAa;AACvC,UAAM,IAAI,gBAAgB,SAAS,IAAI;AAAA,EACzC;AAEA,SAAO,cAAc;AACvB;AAOA,eAAe,iBAAiB,SAA+B;AAC7D,QAAM,cAAc,MAAM,eAAe;AACzC,QAAM,iBAAiB,oBAAoB,OAAO;AAClD,QAAM,UAAU,YAAY,cAAc;AAE1C,MAAI,CAAC,SAAS,eAAe;AAC3B,QAAI,0BAA0B,OAAO;AACrC,UAAM,IAAI,iCAAiC,OAAO;AAAA,EACpD;AAEA,SAAO,OAAO,QAAQ,OAAO;AAC/B;AAKA,eAAe,iBAAqD;AAClE,QAAM,MAAM,GAAG,OAAO,kBAAkB,CAAC,GAAG,iBAAiB;AAC7D,QAAM,WAAW,MAAM,MAAM,GAAG;AAChC,SAAO,SAAS,KAAK;AACvB;AAOA,SAAS,OAAO,WAA2B;AACzC,SAAO,SAAS,QAAQ,OAAO,SAAS;AAC1C;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-KG4UW4K4.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-KG4UW4K4.mjs.map +deleted file mode 100644 +index 6054433..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-KG4UW4K4.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/transaction-type.ts"],"sourcesContent":["import type { TransactionDescription } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport {\n abiERC721,\n abiERC20,\n abiERC1155,\n abiFiatTokenV2,\n} from '@metamask/metamask-eth-abis';\n\nimport type { InferTransactionTypeResult, TransactionParams } from '../types';\nimport { TransactionType } from '../types';\n\nexport const ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error';\n\nconst ERC20Interface = new Interface(abiERC20);\nconst ERC721Interface = new Interface(abiERC721);\nconst ERC1155Interface = new Interface(abiERC1155);\nconst USDCInterface = new Interface(abiFiatTokenV2);\n\n/**\n * Determines the type of the transaction by analyzing the txParams.\n * It will never return TRANSACTION_TYPE_CANCEL or TRANSACTION_TYPE_RETRY as these\n * represent specific events that we specify manually at transaction creation.\n *\n * @param txParams - Parameters for the transaction.\n * @param ethQuery - EthQuery instance.\n * @returns A object with the transaction type and the contract code response in Hex.\n */\nexport async function determineTransactionType(\n txParams: TransactionParams,\n ethQuery: EthQuery,\n): Promise {\n const { data, to } = txParams;\n\n if (data && !to) {\n return { type: TransactionType.deployContract, getCodeResponse: undefined };\n }\n\n const { contractCode: getCodeResponse, isContractAddress } =\n await readAddressAsContract(ethQuery, to);\n\n if (!isContractAddress) {\n return { type: TransactionType.simpleSend, getCodeResponse };\n }\n\n const hasValue = Number(txParams.value ?? '0') !== 0;\n\n const contractInteractionResult = {\n type: TransactionType.contractInteraction,\n getCodeResponse,\n };\n\n if (!data || hasValue) {\n return contractInteractionResult;\n }\n\n const name = parseStandardTokenTransactionData(data)?.name;\n\n if (!name) {\n return contractInteractionResult;\n }\n\n const tokenMethodName = [\n TransactionType.tokenMethodApprove,\n TransactionType.tokenMethodSetApprovalForAll,\n TransactionType.tokenMethodTransfer,\n TransactionType.tokenMethodTransferFrom,\n TransactionType.tokenMethodSafeTransferFrom,\n TransactionType.tokenMethodIncreaseAllowance,\n ].find(\n (methodName) => methodName.toLowerCase() === (name as string).toLowerCase(),\n );\n\n if (tokenMethodName) {\n return { type: tokenMethodName, getCodeResponse };\n }\n\n return contractInteractionResult;\n}\n\n/**\n * Attempts to decode transaction data using ABIs for three different token standards: ERC20, ERC721, ERC1155.\n * The data will decode correctly if the transaction is an interaction with a contract that matches one of these\n * contract standards\n *\n * @param data - Encoded transaction data.\n * @returns A representation of an ethereum contract call.\n */\nfunction parseStandardTokenTransactionData(\n data?: string,\n): TransactionDescription | undefined {\n if (!data) {\n return undefined;\n }\n\n try {\n return ERC20Interface.parseTransaction({ data });\n } catch {\n // ignore and next try to parse with erc721 ABI\n }\n\n try {\n return ERC721Interface.parseTransaction({ data });\n } catch {\n // ignore and next try to parse with erc1155 ABI\n }\n\n try {\n return ERC1155Interface.parseTransaction({ data });\n } catch {\n // ignore and return undefined\n }\n\n try {\n return USDCInterface.parseTransaction({ data });\n } catch {\n // ignore and return undefined\n }\n\n return undefined;\n}\n\n/**\n * Reads an Ethereum address and determines if it is a contract address.\n *\n * @param ethQuery - The Ethereum query object used to interact with the Ethereum blockchain.\n * @param address - The Ethereum address.\n * @returns An object containing the contract code and a boolean indicating if it is a contract address.\n */\nasync function readAddressAsContract(\n ethQuery: EthQuery,\n address?: string,\n): Promise<{\n contractCode: string | null;\n isContractAddress: boolean;\n}> {\n let contractCode;\n try {\n contractCode = await query(ethQuery, 'getCode', [address]);\n } catch (e) {\n contractCode = null;\n }\n\n const isContractAddress = contractCode\n ? contractCode !== '0x' && contractCode !== '0x0'\n : false;\n return { contractCode, isContractAddress };\n}\n"],"mappings":";AACA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAEtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKA,IAAM,qBAAqB;AAElC,IAAM,iBAAiB,IAAI,UAAU,QAAQ;AAC7C,IAAM,kBAAkB,IAAI,UAAU,SAAS;AAC/C,IAAM,mBAAmB,IAAI,UAAU,UAAU;AACjD,IAAM,gBAAgB,IAAI,UAAU,cAAc;AAWlD,eAAsB,yBACpB,UACA,UACqC;AACrC,QAAM,EAAE,MAAM,GAAG,IAAI;AAErB,MAAI,QAAQ,CAAC,IAAI;AACf,WAAO,EAAE,iDAAsC,iBAAiB,OAAU;AAAA,EAC5E;AAEA,QAAM,EAAE,cAAc,iBAAiB,kBAAkB,IACvD,MAAM,sBAAsB,UAAU,EAAE;AAE1C,MAAI,CAAC,mBAAmB;AACtB,WAAO,EAAE,qCAAkC,gBAAgB;AAAA,EAC7D;AAEA,QAAM,WAAW,OAAO,SAAS,SAAS,GAAG,MAAM;AAEnD,QAAM,4BAA4B;AAAA,IAChC;AAAA,IACA;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,UAAU;AACrB,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,kCAAkC,IAAI,GAAG;AAEtD,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOxB,EAAE;AAAA,IACA,CAAC,eAAe,WAAW,YAAY,MAAO,KAAgB,YAAY;AAAA,EAC5E;AAEA,MAAI,iBAAiB;AACnB,WAAO,EAAE,MAAM,iBAAiB,gBAAgB;AAAA,EAClD;AAEA,SAAO;AACT;AAUA,SAAS,kCACP,MACoC;AACpC,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,MAAI;AACF,WAAO,eAAe,iBAAiB,EAAE,KAAK,CAAC;AAAA,EACjD,QAAQ;AAAA,EAER;AAEA,MAAI;AACF,WAAO,gBAAgB,iBAAiB,EAAE,KAAK,CAAC;AAAA,EAClD,QAAQ;AAAA,EAER;AAEA,MAAI;AACF,WAAO,iBAAiB,iBAAiB,EAAE,KAAK,CAAC;AAAA,EACnD,QAAQ;AAAA,EAER;AAEA,MAAI;AACF,WAAO,cAAc,iBAAiB,EAAE,KAAK,CAAC;AAAA,EAChD,QAAQ;AAAA,EAER;AAEA,SAAO;AACT;AASA,eAAe,sBACb,UACA,SAIC;AACD,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,MAAM,UAAU,WAAW,CAAC,OAAO,CAAC;AAAA,EAC3D,SAAS,GAAG;AACV,mBAAe;AAAA,EACjB;AAEA,QAAM,oBAAoB,eACtB,iBAAiB,QAAQ,iBAAiB,QAC1C;AACJ,SAAO,EAAE,cAAc,kBAAkB;AAC3C;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-KT6UAKBB.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-KT6UAKBB.js.map +deleted file mode 100644 +index c4adeb1..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-KT6UAKBB.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/simulation-api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,SAAS,2BAA2B;AACpC,SAAS,0BAAoC;AAK7C,IAAM,MAAM,mBAAmB,eAAe,gBAAgB;AAE9D,IAAM,aAAa;AACnB,IAAM,WAAW;AACjB,IAAM,oBAAoB;AA4I1B,IAAI,mBAAmB;AAOvB,eAAsB,qBACpB,SACA,SAC6B;AAC7B,QAAM,MAAM,MAAM,iBAAiB,OAAO;AAE1C,MAAI,mBAAmB,KAAK,OAAO;AAEnC,QAAM,YAAY;AAClB,sBAAoB;AAEpB,QAAM,WAAW,MAAM,MAAM,KAAK;AAAA,IAChC,QAAQ;AAAA,IACR,MAAM,KAAK,UAAU;AAAA,MACnB,IAAI,OAAO,SAAS;AAAA,MACpB,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,QAAQ,CAAC,OAAO;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAED,QAAM,eAAe,MAAM,SAAS,KAAK;AAEzC,MAAI,qBAAqB,YAAY;AAErC,MAAI,aAAa,OAAO;AACtB,UAAM,EAAE,MAAM,QAAQ,IAAI,aAAa;AACvC,UAAM,IAAI,gBAAgB,SAAS,IAAI;AAAA,EACzC;AAEA,SAAO,cAAc;AACvB;AAOA,eAAe,iBAAiB,SAA+B;AAC7D,QAAM,cAAc,MAAM,eAAe;AACzC,QAAM,iBAAiB,oBAAoB,OAAO;AAClD,QAAM,UAAU,YAAY,cAAc;AAE1C,MAAI,CAAC,SAAS,eAAe;AAC3B,QAAI,0BAA0B,OAAO;AACrC,UAAM,IAAI,iCAAiC,OAAO;AAAA,EACpD;AAEA,SAAO,OAAO,QAAQ,OAAO;AAC/B;AAKA,eAAe,iBAAqD;AAClE,QAAM,MAAM,GAAG,OAAO,kBAAkB,CAAC,GAAG,iBAAiB;AAC7D,QAAM,WAAW,MAAM,MAAM,GAAG;AAChC,SAAO,SAAS,KAAK;AACvB;AAOA,SAAS,OAAO,WAA2B;AACzC,SAAO,SAAS,QAAQ,OAAO,SAAS;AAC1C","sourcesContent":["import { convertHexToDecimal } from '@metamask/controller-utils';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { SimulationChainNotSupportedError, SimulationError } from '../errors';\nimport { projectLogger } from '../logger';\n\nconst log = createModuleLogger(projectLogger, 'simulation-api');\n\nconst RPC_METHOD = 'infura_simulateTransactions';\nconst BASE_URL = 'https://tx-sentinel-{0}.api.cx.metamask.io/';\nconst ENDPOINT_NETWORKS = 'networks';\n\n/** Single transaction to simulate in a simulation API request. */\nexport type SimulationRequestTransaction = {\n /** Data to send with the transaction. */\n data?: Hex;\n\n /** Sender of the transaction. */\n from: Hex;\n\n /** Gas limit for the transaction. */\n gas?: Hex;\n\n /** Maximum fee per gas for the transaction. */\n maxFeePerGas?: Hex;\n\n /** Maximum priority fee per gas for the transaction. */\n maxPriorityFeePerGas?: Hex;\n\n /** Recipient of the transaction. */\n to?: Hex;\n\n /** Value to send with the transaction. */\n value?: Hex;\n};\n\n/** Request to the simulation API to simulate transactions. */\nexport type SimulationRequest = {\n /**\n * Transactions to be sequentially simulated.\n * State changes impact subsequent transactions in the list.\n */\n transactions: SimulationRequestTransaction[];\n\n /**\n * Overrides to the state of the blockchain, keyed by smart contract address.\n */\n overrides?: {\n [address: Hex]: {\n /** Overrides to the storage slots for a smart contract account. */\n stateDiff: {\n [slot: Hex]: Hex;\n };\n };\n };\n\n /**\n * Whether to include call traces in the response.\n * Defaults to false.\n */\n withCallTrace?: boolean;\n\n /**\n * Whether to include event logs in the response.\n * Defaults to false.\n */\n withLogs?: boolean;\n};\n\n/** Raw event log emitted by a simulated transaction. */\nexport type SimulationResponseLog = {\n /** Address of the account that created the event. */\n address: Hex;\n\n /** Raw data in the event that is not indexed. */\n data: Hex;\n\n /** Raw indexed data from the event. */\n topics: Hex[];\n};\n\n/** Call trace of a single simulated transaction. */\nexport type SimulationResponseCallTrace = {\n /** Nested calls. */\n calls: SimulationResponseCallTrace[];\n\n /** Raw event logs created by the call. */\n logs: SimulationResponseLog[];\n};\n\n/**\n * Changes to the blockchain state.\n * Keyed by account address.\n */\nexport type SimulationResponseStateDiff = {\n [address: Hex]: {\n /** Native balance of the account. */\n balance?: Hex;\n\n /** Nonce of the account. */\n nonce?: Hex;\n\n /** Storage values per slot. */\n storage?: {\n [slot: Hex]: Hex;\n };\n };\n};\n\n/** Response from the simulation API for a single transaction. */\nexport type SimulationResponseTransaction = {\n /** An error message indicating the transaction could not be simulated. */\n error?: string;\n\n /** Return value of the transaction, such as the balance if calling balanceOf. */\n return: Hex;\n\n /** Hierarchy of call data including nested calls and logs. */\n callTrace?: SimulationResponseCallTrace;\n\n /** Changes to the blockchain state. */\n stateDiff?: {\n /** Initial blockchain state before the transaction. */\n pre?: SimulationResponseStateDiff;\n\n /** Updated blockchain state after the transaction. */\n post?: SimulationResponseStateDiff;\n };\n};\n\n/** Response from the simulation API. */\nexport type SimulationResponse = {\n /** Simulation data for each transaction in the request. */\n transactions: SimulationResponseTransaction[];\n};\n\n/** Data for a network supported by the Simulation API. */\ntype SimulationNetwork = {\n /** Subdomain of the API for the network. */\n network: string;\n\n /** Whether the network supports confirmation simulations. */\n confirmations: boolean;\n};\n\n/** Response from the simulation API containing supported networks. */\ntype SimulationNetworkResponse = {\n [chainIdDecimal: string]: SimulationNetwork;\n};\n\nlet requestIdCounter = 0;\n\n/**\n * Simulate transactions using the transaction simulation API.\n * @param chainId - The chain ID to simulate transactions on.\n * @param request - The request to simulate transactions.\n */\nexport async function simulateTransactions(\n chainId: Hex,\n request: SimulationRequest,\n): Promise {\n const url = await getSimulationUrl(chainId);\n\n log('Sending request', url, request);\n\n const requestId = requestIdCounter;\n requestIdCounter += 1;\n\n const response = await fetch(url, {\n method: 'POST',\n body: JSON.stringify({\n id: String(requestId),\n jsonrpc: '2.0',\n method: RPC_METHOD,\n params: [request],\n }),\n });\n\n const responseJson = await response.json();\n\n log('Received response', responseJson);\n\n if (responseJson.error) {\n const { code, message } = responseJson.error;\n throw new SimulationError(message, code);\n }\n\n return responseJson?.result;\n}\n\n/**\n * Get the URL for the transaction simulation API.\n * @param chainId - The chain ID to get the URL for.\n * @returns The URL for the transaction simulation API.\n */\nasync function getSimulationUrl(chainId: Hex): Promise {\n const networkData = await getNetworkData();\n const chainIdDecimal = convertHexToDecimal(chainId);\n const network = networkData[chainIdDecimal];\n\n if (!network?.confirmations) {\n log('Chain is not supported', chainId);\n throw new SimulationChainNotSupportedError(chainId);\n }\n\n return getUrl(network.network);\n}\n\n/**\n * Retrieve the supported network data from the simulation API.\n */\nasync function getNetworkData(): Promise {\n const url = `${getUrl('ethereum-mainnet')}${ENDPOINT_NETWORKS}`;\n const response = await fetch(url);\n return response.json();\n}\n\n/**\n * Generate the URL for the specified subdomain in the simulation API.\n * @param subdomain - The subdomain to generate the URL for.\n * @returns The URL for the transaction simulation API.\n */\nfunction getUrl(subdomain: string): string {\n return BASE_URL.replace('{0}', subdomain);\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-NOHEXQ7Y.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-NOHEXQ7Y.mjs.map +deleted file mode 100644 +index 808d567..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-NOHEXQ7Y.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/layer1-gas-fee-flow.ts"],"sourcesContent":["import type { Provider } from '@metamask/network-controller';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type { Layer1GasFeeFlow, TransactionMeta } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'layer-1-gas-fee-flow');\n\nexport type UpdateLayer1GasFeeRequest = {\n layer1GasFeeFlows: Layer1GasFeeFlow[];\n provider: Provider;\n transactionMeta: TransactionMeta;\n};\n\n/**\n * Updates the given transactionMeta with the layer 1 gas fee.\n * @param request - The request to use when getting the layer 1 gas fee.\n * @param request.provider - Provider used to create a new underlying EthQuery instance\n * @param request.transactionMeta - The transaction to get the layer 1 gas fee for.\n * @param request.layer1GasFeeFlows - The layer 1 gas fee flows to search.\n */\nexport async function updateTransactionLayer1GasFee(\n request: UpdateLayer1GasFeeRequest,\n) {\n const layer1GasFee = await getTransactionLayer1GasFee(request);\n\n if (!layer1GasFee) {\n return;\n }\n\n const { transactionMeta } = request;\n\n transactionMeta.layer1GasFee = layer1GasFee;\n\n log('Updated layer 1 gas fee', layer1GasFee, transactionMeta.id);\n}\n\n/**\n * Get the layer 1 gas fee flow for a transaction.\n * @param transactionMeta - The transaction to get the layer 1 gas fee flow for.\n * @param layer1GasFeeFlows - The layer 1 gas fee flows to search.\n * @returns The layer 1 gas fee flow for the transaction, or undefined if none match.\n */\nfunction getLayer1GasFeeFlow(\n transactionMeta: TransactionMeta,\n layer1GasFeeFlows: Layer1GasFeeFlow[],\n): Layer1GasFeeFlow | undefined {\n return layer1GasFeeFlows.find((layer1GasFeeFlow) =>\n layer1GasFeeFlow.matchesTransaction(transactionMeta),\n );\n}\n\n/**\n * Get the layer 1 gas fee for a transaction and return the layer1Fee.\n * @param request - The request to use when getting the layer 1 gas fee.\n * @param request.layer1GasFeeFlows - The layer 1 gas fee flows to search.\n * @param request.provider - The provider to use to get the layer 1 gas fee.\n * @param request.transactionMeta - The transaction to get the layer 1 gas fee for.\n */\nexport async function getTransactionLayer1GasFee({\n layer1GasFeeFlows,\n provider,\n transactionMeta,\n}: UpdateLayer1GasFeeRequest): Promise {\n const layer1GasFeeFlow = getLayer1GasFeeFlow(\n transactionMeta,\n layer1GasFeeFlows,\n );\n\n if (!layer1GasFeeFlow) {\n return undefined;\n }\n\n log(\n 'Found layer 1 gas fee flow',\n layer1GasFeeFlow.constructor.name,\n transactionMeta.id,\n );\n\n try {\n const { layer1Fee } = await layer1GasFeeFlow.getLayer1Fee({\n provider,\n transactionMeta,\n });\n return layer1Fee;\n } catch (error) {\n log('Failed to get layer 1 gas fee', transactionMeta.id, error);\n return undefined;\n }\n}\n"],"mappings":";;;;;AACA,SAAS,0BAAoC;AAK7C,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAepE,eAAsB,8BACpB,SACA;AACA,QAAM,eAAe,MAAM,2BAA2B,OAAO;AAE7D,MAAI,CAAC,cAAc;AACjB;AAAA,EACF;AAEA,QAAM,EAAE,gBAAgB,IAAI;AAE5B,kBAAgB,eAAe;AAE/B,MAAI,2BAA2B,cAAc,gBAAgB,EAAE;AACjE;AAQA,SAAS,oBACP,iBACA,mBAC8B;AAC9B,SAAO,kBAAkB;AAAA,IAAK,CAAC,qBAC7B,iBAAiB,mBAAmB,eAAe;AAAA,EACrD;AACF;AASA,eAAsB,2BAA2B;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AACF,GAAwD;AACtD,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,MAAI,CAAC,kBAAkB;AACrB,WAAO;AAAA,EACT;AAEA;AAAA,IACE;AAAA,IACA,iBAAiB,YAAY;AAAA,IAC7B,gBAAgB;AAAA,EAClB;AAEA,MAAI;AACF,UAAM,EAAE,UAAU,IAAI,MAAM,iBAAiB,aAAa;AAAA,MACxD;AAAA,MACA;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT,SAAS,OAAO;AACd,QAAI,iCAAiC,gBAAgB,IAAI,KAAK;AAC9D,WAAO;AAAA,EACT;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-NYKRCWBG.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-NYKRCWBG.js.map +deleted file mode 100644 +index dbe3864..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-NYKRCWBG.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/OptimismLayer1GasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;AAMA,IAAM,2BAAkC;AAAA,EACtC,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGA,IAAM,oCACJ;AAKK,IAAM,2BAAN,cAAuC,uBAAuB;AAAA,EACnE,cAAc;AACZ,UAAM,iCAAiC;AAAA,EACzC;AAAA,EAEA,mBAAmB,iBAA2C;AAC5D,WAAO,yBAAyB,SAAS,gBAAgB,OAAO;AAAA,EAClE;AACF","sourcesContent":["import { type Hex } from '@metamask/utils';\n\nimport { CHAIN_IDS } from '../constants';\nimport type { TransactionMeta } from '../types';\nimport { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow';\n\nconst OPTIMISM_STACK_CHAIN_IDS: Hex[] = [\n CHAIN_IDS.OPTIMISM,\n CHAIN_IDS.OPTIMISM_TESTNET,\n CHAIN_IDS.BASE,\n CHAIN_IDS.BASE_TESTNET,\n CHAIN_IDS.OPBNB,\n CHAIN_IDS.OPBNB_TESTNET,\n CHAIN_IDS.ZORA,\n];\n\n// BlockExplorer link: https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000f#code\nconst OPTIMISM_GAS_PRICE_ORACLE_ADDRESS =\n '0x420000000000000000000000000000000000000F';\n\n/**\n * Optimism layer 1 gas fee flow that obtains gas fee estimate using an oracle contract.\n */\nexport class OptimismLayer1GasFeeFlow extends OracleLayer1GasFeeFlow {\n constructor() {\n super(OPTIMISM_GAS_PRICE_ORACLE_ADDRESS);\n }\n\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return OPTIMISM_STACK_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-O6ZZVIFH.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-O6ZZVIFH.mjs.map +deleted file mode 100644 +index 5291170..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-O6ZZVIFH.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const CHAIN_IDS = {\n MAINNET: '0x1',\n GOERLI: '0x5',\n BASE: '0x2105',\n BASE_TESTNET: '0x14a33',\n BSC: '0x38',\n BSC_TESTNET: '0x61',\n OPTIMISM: '0xa',\n OPTIMISM_TESTNET: '0x1a4',\n OPBNB: '0xcc',\n OPBNB_TESTNET: '0x15eb',\n OPTIMISM_SEPOLIA: '0xaa37dc',\n POLYGON: '0x89',\n POLYGON_TESTNET: '0x13881',\n AVALANCHE: '0xa86a',\n AVALANCHE_TESTNET: '0xa869',\n FANTOM: '0xfa',\n FANTOM_TESTNET: '0xfa2',\n SEPOLIA: '0xaa36a7',\n LINEA_GOERLI: '0xe704',\n LINEA_SEPOLIA: '0xe705',\n LINEA_MAINNET: '0xe708',\n MOONBEAM: '0x504',\n MOONBEAM_TESTNET: '0x507',\n MOONRIVER: '0x505',\n GNOSIS: '0x64',\n ARBITRUM: '0xa4b1',\n ZKSYNC_ERA: '0x144',\n ZORA: '0x76adf1',\n SCROLL: '0x82750',\n SCROLL_SEPOLIA: '0x8274f',\n} as const;\n\nexport const DEFAULT_ETHERSCAN_DOMAIN = 'etherscan.io';\nexport const DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = 'api';\n\nexport const ETHERSCAN_SUPPORTED_NETWORKS = {\n [CHAIN_IDS.GOERLI]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli`,\n },\n [CHAIN_IDS.MAINNET]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.SEPOLIA]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia`,\n },\n [CHAIN_IDS.LINEA_GOERLI]: {\n domain: 'lineascan.build',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli`,\n },\n [CHAIN_IDS.LINEA_SEPOLIA]: {\n domain: 'lineascan.build',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia`,\n },\n [CHAIN_IDS.LINEA_MAINNET]: {\n domain: 'lineascan.build',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.BSC]: {\n domain: 'bscscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.BSC_TESTNET]: {\n domain: 'bscscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.OPTIMISM]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-optimistic`,\n },\n [CHAIN_IDS.OPTIMISM_SEPOLIA]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia-optimistic`,\n },\n [CHAIN_IDS.POLYGON]: {\n domain: 'polygonscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.POLYGON_TESTNET]: {\n domain: 'polygonscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-mumbai`,\n },\n [CHAIN_IDS.AVALANCHE]: {\n domain: 'snowtrace.io',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.AVALANCHE_TESTNET]: {\n domain: 'snowtrace.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.FANTOM]: {\n domain: 'ftmscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.FANTOM_TESTNET]: {\n domain: 'ftmscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.MOONBEAM]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonbeam`,\n },\n [CHAIN_IDS.MOONBEAM_TESTNET]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonbase`,\n },\n [CHAIN_IDS.MOONRIVER]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonriver`,\n },\n [CHAIN_IDS.GNOSIS]: {\n domain: 'gnosisscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-gnosis`,\n },\n};\n\nexport const GAS_BUFFER_CHAIN_OVERRIDES = {\n [CHAIN_IDS.OPTIMISM]: 1,\n [CHAIN_IDS.OPTIMISM_SEPOLIA]: 1,\n};\n\n/** Extract of the Wrapped ERC-20 ABI required for simulation. */\nexport const ABI_SIMULATION_ERC20_WRAPPED = [\n {\n anonymous: false,\n inputs: [\n { indexed: true, name: 'to', type: 'address' },\n { indexed: false, name: 'wad', type: 'uint256' },\n ],\n name: 'Deposit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n { indexed: true, name: 'from', type: 'address' },\n { indexed: false, name: 'wad', type: 'uint256' },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n];\n\n/** Extract of the legacy ERC-721 ABI required for simulation. */\nexport const ABI_SIMULATION_ERC721_LEGACY = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n name: '_from',\n type: 'address',\n },\n {\n indexed: false,\n name: '_to',\n type: 'address',\n },\n {\n indexed: false,\n name: '_tokenId',\n type: 'uint256',\n },\n ],\n name: 'Transfer',\n type: 'event',\n },\n];\n"],"mappings":";AAAO,IAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,cAAc;AAAA,EACd,KAAK;AAAA,EACL,aAAa;AAAA,EACb,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,SAAS;AAA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M,MAAM,MAAM,MAAM,UAAU;AAAA,MAC7C,EAAE,SAAS,OAAO,MAAM,OAAO,MAAM,UAAU;AAAA,IACjD;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,QAAQ;AAAA,MACN,EAAE,SAAS,MAAM,MAAM,QAAQ,MAAM,UAAU;AAAA,MAC/C,EAAE,SAAS,OAAO,MAAM,OAAO,MAAM,UAAU;AAAA,IACjD;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAGO,IAAM,+BAA+B;AAAA,EAC1C;AAAA,IACE,WAAW;AAAA,IACX,QAAQ;AAAA,MACN;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-76FONEDA.js b/node_modules/@metamask/transaction-controller/dist/chunk-OEMCU4FY.js +similarity index 89% +rename from node_modules/@metamask/transaction-controller/dist/chunk-76FONEDA.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-OEMCU4FY.js +index 5ea273a..2a67f0f 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-76FONEDA.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-OEMCU4FY.js +@@ -1,6 +1,6 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +-var _chunkAYTU4HU5js = require('./chunk-AYTU4HU5.js'); ++var _chunkVWDGWDFVjs = require('./chunk-VWDGWDFV.js'); + + // src/utils/gas-flow.ts + var _controllerutils = require('@metamask/controller-utils'); +@@ -15,7 +15,7 @@ function mergeGasFeeEstimates({ + }) { + const transactionEstimateType = transactionGasFeeEstimates.type; + if (transactionEstimateType === "fee-market" /* FeeMarket */) { +- return Object.values(_chunkAYTU4HU5js.GasFeeEstimateLevel).reduce( ++ return Object.values(_chunkVWDGWDFVjs.GasFeeEstimateLevel).reduce( + (result, level) => ({ + ...result, + [level]: mergeFeeMarketEstimate( +@@ -27,7 +27,7 @@ function mergeGasFeeEstimates({ + ); + } + if (transactionEstimateType === "legacy" /* Legacy */) { +- return Object.values(_chunkAYTU4HU5js.GasFeeEstimateLevel).reduce( ++ return Object.values(_chunkVWDGWDFVjs.GasFeeEstimateLevel).reduce( + (result, level) => ({ + ...result, + [level]: getLegacyEstimate(transactionGasFeeEstimates, level) +@@ -64,4 +64,4 @@ function getGasPriceEstimate(transactionGasFeeEstimate) { + + + exports.getGasFeeFlow = getGasFeeFlow; exports.mergeGasFeeEstimates = mergeGasFeeEstimates; +-//# sourceMappingURL=chunk-76FONEDA.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-OEMCU4FY.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-OZ6UB42C.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-OZ6UB42C.js.map +deleted file mode 100644 +index 982c006..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-OZ6UB42C.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/utils.ts"],"names":[],"mappings":";AAAA,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcA,IAAM,qBAAqB;AAIlC,IAAM,cAA2D;AAAA,EAC/D,MAAM,CAAC,SAAiB,MAAM,mBAAmB,IAAI,CAAC;AAAA,EACtD,MAAM,CAAC,SAAiB,MAAM,IAAI,EAAE,YAAY;AAAA,EAChD,KAAK,CAAC,QAAgB,MAAM,GAAG;AAAA,EAC/B,UAAU,CAAC,QAAgB,MAAM,GAAG;AAAA,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AAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AASO,SAAS,mBAAmB,KAAa;AAC9C,QAAM,SAAS,IAAI,YAAY,EAAE,WAAW,IAAI,IAAI,IAAI,MAAM,GAAG,CAAC,IAAI;AACtE,QAAM,OAAO,SAAS,IAAI,MAAM,CAAC,IAAI;AACrC,QAAM,WAAW,KAAK,SAAS,MAAM,IAAI,OAAO,IAAI,IAAI;AAExD,SAAO,SAAS;AAClB","sourcesContent":["import { convertHexToDecimal } from '@metamask/controller-utils';\nimport {\n add0x,\n getKnownPropertyNames,\n isStrictHexString,\n} from '@metamask/utils';\nimport type { Json } from '@metamask/utils';\n\nimport type {\n GasPriceValue,\n FeeMarketEIP1559Values,\n} from '../TransactionController';\nimport { TransactionStatus } from '../types';\nimport type {\n TransactionParams,\n TransactionMeta,\n TransactionError,\n} from '../types';\n\nexport const ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error';\n\n// TODO: Replace `any` with type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst NORMALIZERS: { [param in keyof TransactionParams]: any } = {\n data: (data: string) => add0x(padHexToEvenLength(data)),\n from: (from: string) => add0x(from).toLowerCase(),\n gas: (gas: string) => add0x(gas),\n gasLimit: (gas: string) => add0x(gas),\n gasPrice: (gasPrice: string) => add0x(gasPrice),\n nonce: (nonce: string) => add0x(nonce),\n to: (to: string) => add0x(to).toLowerCase(),\n value: (value: string) => add0x(value),\n maxFeePerGas: (maxFeePerGas: string) => add0x(maxFeePerGas),\n maxPriorityFeePerGas: (maxPriorityFeePerGas: string) =>\n add0x(maxPriorityFeePerGas),\n estimatedBaseFee: (maxPriorityFeePerGas: string) =>\n add0x(maxPriorityFeePerGas),\n type: (type: string) => add0x(type),\n};\n\n/**\n * Normalizes properties on transaction params.\n *\n * @param txParams - The transaction params to normalize.\n * @returns Normalized transaction params.\n */\nexport function normalizeTransactionParams(txParams: TransactionParams) {\n const normalizedTxParams: TransactionParams = { from: '' };\n\n for (const key of getKnownPropertyNames(NORMALIZERS)) {\n if (txParams[key]) {\n normalizedTxParams[key] = NORMALIZERS[key](txParams[key]);\n }\n }\n\n if (!normalizedTxParams.value) {\n normalizedTxParams.value = '0x0';\n }\n\n return normalizedTxParams;\n}\n\n/**\n * Checks if a transaction is EIP-1559 by checking for the existence of\n * maxFeePerGas and maxPriorityFeePerGas within its parameters.\n *\n * @param txParams - Transaction params object to add.\n * @returns Boolean that is true if the transaction is EIP-1559 (has maxFeePerGas and maxPriorityFeePerGas), otherwise returns false.\n */\nexport function isEIP1559Transaction(txParams: TransactionParams): boolean {\n const hasOwnProp = (obj: TransactionParams, key: string) =>\n Object.prototype.hasOwnProperty.call(obj, key);\n return (\n hasOwnProp(txParams, 'maxFeePerGas') &&\n hasOwnProp(txParams, 'maxPriorityFeePerGas')\n );\n}\n\nexport const validateGasValues = (\n gasValues: GasPriceValue | FeeMarketEIP1559Values,\n) => {\n Object.keys(gasValues).forEach((key) => {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const value = (gasValues as any)[key];\n if (typeof value !== 'string' || !isStrictHexString(value)) {\n throw new TypeError(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `expected hex string for ${key} but received: ${value}`,\n );\n }\n });\n};\n\nexport const isFeeMarketEIP1559Values = (\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n): gasValues is FeeMarketEIP1559Values =>\n (gasValues as FeeMarketEIP1559Values)?.maxFeePerGas !== undefined ||\n (gasValues as FeeMarketEIP1559Values)?.maxPriorityFeePerGas !== undefined;\n\nexport const isGasPriceValue = (\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n): gasValues is GasPriceValue =>\n (gasValues as GasPriceValue)?.gasPrice !== undefined;\n\nexport const getIncreasedPriceHex = (value: number, rate: number): string =>\n add0x(`${parseInt(`${value * rate}`, 10).toString(16)}`);\n\nexport const getIncreasedPriceFromExisting = (\n value: string | undefined,\n rate: number,\n): string => {\n return getIncreasedPriceHex(convertHexToDecimal(value), rate);\n};\n\n/**\n * Validates that the proposed value is greater than or equal to the minimum value.\n *\n * @param proposed - The proposed value.\n * @param min - The minimum value.\n * @returns The proposed value.\n * @throws Will throw if the proposed value is too low.\n */\nexport function validateMinimumIncrease(proposed: string, min: string) {\n const proposedDecimal = convertHexToDecimal(proposed);\n const minDecimal = convertHexToDecimal(min);\n if (proposedDecimal >= minDecimal) {\n return proposed;\n }\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n const errorMsg = `The proposed value: ${proposedDecimal} should meet or exceed the minimum value: ${minDecimal}`;\n throw new Error(errorMsg);\n}\n\n/**\n * Validates that a transaction is unapproved.\n * Throws if the transaction is not unapproved.\n *\n * @param transactionMeta - The transaction metadata to check.\n * @param fnName - The name of the function calling this helper.\n */\nexport function validateIfTransactionUnapproved(\n transactionMeta: TransactionMeta | undefined,\n fnName: string,\n) {\n if (transactionMeta?.status !== TransactionStatus.unapproved) {\n throw new Error(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `TransactionsController: Can only call ${fnName} on an unapproved transaction.\\n Current tx status: ${transactionMeta?.status}`,\n );\n }\n}\n\n/**\n * Normalizes properties on transaction params.\n *\n * @param error - The error to be normalize.\n * @returns Normalized transaction error.\n */\nexport function normalizeTxError(\n error: Error & { code?: string; value?: unknown },\n): TransactionError {\n return {\n name: error.name,\n message: error.message,\n stack: error.stack,\n code: error.code,\n rpc: isJsonCompatible(error.value) ? error.value : undefined,\n };\n}\n\n/**\n * Normalize an object containing gas fee values.\n *\n * @param gasFeeValues - An object containing gas fee values.\n * @returns An object containing normalized gas fee values.\n */\nexport function normalizeGasFeeValues(\n gasFeeValues: GasPriceValue | FeeMarketEIP1559Values,\n): GasPriceValue | FeeMarketEIP1559Values {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const normalize = (value: any) =>\n typeof value === 'string' ? add0x(value) : value;\n\n if ('gasPrice' in gasFeeValues) {\n return {\n gasPrice: normalize(gasFeeValues.gasPrice),\n };\n }\n\n return {\n maxFeePerGas: normalize(gasFeeValues.maxFeePerGas),\n maxPriorityFeePerGas: normalize(gasFeeValues.maxPriorityFeePerGas),\n };\n}\n\n/**\n * Determines whether the given value can be encoded as JSON.\n *\n * @param value - The value.\n * @returns True if the value is JSON-encodable, false if not.\n */\nfunction isJsonCompatible(value: unknown): value is Json {\n try {\n JSON.parse(JSON.stringify(value));\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Ensure a hex string is of even length by adding a leading 0 if necessary.\n * Any existing `0x` prefix is preserved but is not added if missing.\n *\n * @param hex - The hex string to ensure is even.\n * @returns The hex string with an even length.\n */\nexport function padHexToEvenLength(hex: string) {\n const prefix = hex.toLowerCase().startsWith('0x') ? hex.slice(0, 2) : '';\n const data = prefix ? hex.slice(2) : hex;\n const evenData = data.length % 2 === 0 ? data : `0${data}`;\n\n return prefix + evenData;\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-PRUNMTRD.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-PRUNMTRD.js.map +deleted file mode 100644 +index d8a63d4..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-PRUNMTRD.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/nonce.ts"],"names":[],"mappings":";;;;;;AAAA,SAAS,aAAa;AAStB,IAAM,MAAM,mBAAmB,eAAe,OAAO;AASrD,eAAsB,aACpB,QACA,cAC6C;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA,UAAU,EAAE,MAAM,OAAO,cAAc;AAAA,EACzC,IAAI;AAEJ,QAAM,cAAc,mBAAmB,MAAM,gBAAgB,IAAI;AAEjE,MAAI,aAAa;AACf,QAAI,sBAAsB,WAAW;AACrC,WAAO,CAAC,aAAa,MAAS;AAAA,EAChC;AAEA,MAAI,eAAe;AACjB,QAAI,wBAAwB,aAAa;AACzC,WAAO,CAAC,eAAe,MAAS;AAAA,EAClC;AAEA,QAAM,YAAY,MAAM,aAAa,IAAI;AACzC,QAAM,QAAQ,MAAM,UAAU,SAAS;AACvC,QAAM,cAAc,UAAU,YAAY,KAAK,SAAS;AAExD,MAAI,kCAAkC,OAAO,UAAU,YAAY;AAEnE,SAAO,CAAC,OAAO,WAAW;AAC5B;AAWO,SAAS,wCACd,gBACA,aACA,mBACA,cAC2B;AAC3B,SAAO,aACJ;AAAA,IACC,CAAC,EAAE,SAAS,YAAY,iBAAiB,QAAQ,UAAU,EAAE,KAAK,EAAE,MAClE,CAAC,cACD,CAAC,mBACD,YAAY,kBACZ,WAAW,qBACX,KAAK,YAAY,MAAM,YAAY,YAAY;AAAA,EACnD,EACC,IAAI,CAAC,EAAE,QAAQ,UAAU,EAAE,MAAM,KAAK,OAAO,MAAM,EAAE,MAAM;AAK1D,WAAO;AAAA,MACL;AAAA,MACA,SAAS,CAAC,CAAC,CAAC;AAAA,MACZ,UAAU;AAAA,QACR,MAAM,QAAQ;AAAA,QACd,KAAK,OAAO;AAAA,QACZ,OAAO,SAAS;AAAA,QAChB,OAAO,SAAS;AAAA,MAClB;AAAA,IACF;AAAA,EACF,CAAC;AACL","sourcesContent":["import { toHex } from '@metamask/controller-utils';\nimport type {\n NonceLock,\n Transaction as NonceTrackerTransaction,\n} from '@metamask/nonce-tracker';\n\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionMeta, TransactionStatus } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'nonce');\n\n/**\n * Determine the next nonce to be used for a transaction.\n *\n * @param txMeta - The transaction metadata.\n * @param getNonceLock - An anonymous function that acquires the nonce lock for an address\n * @returns The next hexadecimal nonce to be used for the given transaction, and optionally a function to release the nonce lock.\n */\nexport async function getNextNonce(\n txMeta: TransactionMeta,\n getNonceLock: (address: string) => Promise,\n): Promise<[string, (() => void) | undefined]> {\n const {\n customNonceValue,\n txParams: { from, nonce: existingNonce },\n } = txMeta;\n\n const customNonce = customNonceValue ? toHex(customNonceValue) : undefined;\n\n if (customNonce) {\n log('Using custom nonce', customNonce);\n return [customNonce, undefined];\n }\n\n if (existingNonce) {\n log('Using existing nonce', existingNonce);\n return [existingNonce, undefined];\n }\n\n const nonceLock = await getNonceLock(from);\n const nonce = toHex(nonceLock.nextNonce);\n const releaseLock = nonceLock.releaseLock.bind(nonceLock);\n\n log('Using nonce from nonce tracker', nonce, nonceLock.nonceDetails);\n\n return [nonce, releaseLock];\n}\n\n/**\n * Filter and format transactions for the nonce tracker.\n *\n * @param currentChainId - Chain ID of the current network.\n * @param fromAddress - Address of the account from which the transactions to filter from are sent.\n * @param transactionStatus - Status of the transactions for which to filter.\n * @param transactions - Array of transactionMeta objects that have been prefiltered.\n * @returns Array of transactions formatted for the nonce tracker.\n */\nexport function getAndFormatTransactionsForNonceTracker(\n currentChainId: string,\n fromAddress: string,\n transactionStatus: TransactionStatus,\n transactions: TransactionMeta[],\n): NonceTrackerTransaction[] {\n return transactions\n .filter(\n ({ chainId, isTransfer, isUserOperation, status, txParams: { from } }) =>\n !isTransfer &&\n !isUserOperation &&\n chainId === currentChainId &&\n status === transactionStatus &&\n from.toLowerCase() === fromAddress.toLowerCase(),\n )\n .map(({ status, txParams: { from, gas, value, nonce } }) => {\n // the only value we care about is the nonce\n // but we need to return the other values to satisfy the type\n // TODO: refactor nonceTracker to not require this\n /* istanbul ignore next */\n return {\n status,\n history: [{}],\n txParams: {\n from: from ?? '',\n gas: gas ?? '',\n value: value ?? '',\n nonce: nonce ?? '',\n },\n };\n });\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-Q56I5ONX.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-Q56I5ONX.mjs.map +deleted file mode 100644 +index 44b7d9f..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-Q56I5ONX.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/utils.ts"],"sourcesContent":["import { convertHexToDecimal } from '@metamask/controller-utils';\nimport {\n add0x,\n getKnownPropertyNames,\n isStrictHexString,\n} from '@metamask/utils';\nimport type { Json } from '@metamask/utils';\n\nimport type {\n GasPriceValue,\n FeeMarketEIP1559Values,\n} from '../TransactionController';\nimport { TransactionStatus } from '../types';\nimport type {\n TransactionParams,\n TransactionMeta,\n TransactionError,\n} from '../types';\n\nexport const ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error';\n\n// TODO: Replace `any` with type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst NORMALIZERS: { [param in keyof TransactionParams]: any } = {\n data: (data: string) => add0x(padHexToEvenLength(data)),\n from: (from: string) => add0x(from).toLowerCase(),\n gas: (gas: string) => add0x(gas),\n gasLimit: (gas: string) => add0x(gas),\n gasPrice: (gasPrice: string) => add0x(gasPrice),\n nonce: (nonce: string) => add0x(nonce),\n to: (to: string) => add0x(to).toLowerCase(),\n value: (value: string) => add0x(value),\n maxFeePerGas: (maxFeePerGas: string) => add0x(maxFeePerGas),\n maxPriorityFeePerGas: (maxPriorityFeePerGas: string) =>\n add0x(maxPriorityFeePerGas),\n estimatedBaseFee: (maxPriorityFeePerGas: string) =>\n add0x(maxPriorityFeePerGas),\n type: (type: string) => add0x(type),\n};\n\n/**\n * Normalizes properties on transaction params.\n *\n * @param txParams - The transaction params to normalize.\n * @returns Normalized transaction params.\n */\nexport function normalizeTransactionParams(txParams: TransactionParams) {\n const normalizedTxParams: TransactionParams = { from: '' };\n\n for (const key of getKnownPropertyNames(NORMALIZERS)) {\n if (txParams[key]) {\n normalizedTxParams[key] = NORMALIZERS[key](txParams[key]);\n }\n }\n\n if (!normalizedTxParams.value) {\n normalizedTxParams.value = '0x0';\n }\n\n return normalizedTxParams;\n}\n\n/**\n * Checks if a transaction is EIP-1559 by checking for the existence of\n * maxFeePerGas and maxPriorityFeePerGas within its parameters.\n *\n * @param txParams - Transaction params object to add.\n * @returns Boolean that is true if the transaction is EIP-1559 (has maxFeePerGas and maxPriorityFeePerGas), otherwise returns false.\n */\nexport function isEIP1559Transaction(txParams: TransactionParams): boolean {\n const hasOwnProp = (obj: TransactionParams, key: string) =>\n Object.prototype.hasOwnProperty.call(obj, key);\n return (\n hasOwnProp(txParams, 'maxFeePerGas') &&\n hasOwnProp(txParams, 'maxPriorityFeePerGas')\n );\n}\n\nexport const validateGasValues = (\n gasValues: GasPriceValue | FeeMarketEIP1559Values,\n) => {\n Object.keys(gasValues).forEach((key) => {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const value = (gasValues as any)[key];\n if (typeof value !== 'string' || !isStrictHexString(value)) {\n throw new TypeError(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `expected hex string for ${key} but received: ${value}`,\n );\n }\n });\n};\n\nexport const isFeeMarketEIP1559Values = (\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n): gasValues is FeeMarketEIP1559Values =>\n (gasValues as FeeMarketEIP1559Values)?.maxFeePerGas !== undefined ||\n (gasValues as FeeMarketEIP1559Values)?.maxPriorityFeePerGas !== undefined;\n\nexport const isGasPriceValue = (\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n): gasValues is GasPriceValue =>\n (gasValues as GasPriceValue)?.gasPrice !== undefined;\n\nexport const getIncreasedPriceHex = (value: number, rate: number): string =>\n add0x(`${parseInt(`${value * rate}`, 10).toString(16)}`);\n\nexport const getIncreasedPriceFromExisting = (\n value: string | undefined,\n rate: number,\n): string => {\n return getIncreasedPriceHex(convertHexToDecimal(value), rate);\n};\n\n/**\n * Validates that the proposed value is greater than or equal to the minimum value.\n *\n * @param proposed - The proposed value.\n * @param min - The minimum value.\n * @returns The proposed value.\n * @throws Will throw if the proposed value is too low.\n */\nexport function validateMinimumIncrease(proposed: string, min: string) {\n const proposedDecimal = convertHexToDecimal(proposed);\n const minDecimal = convertHexToDecimal(min);\n if (proposedDecimal >= minDecimal) {\n return proposed;\n }\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n const errorMsg = `The proposed value: ${proposedDecimal} should meet or exceed the minimum value: ${minDecimal}`;\n throw new Error(errorMsg);\n}\n\n/**\n * Validates that a transaction is unapproved.\n * Throws if the transaction is not unapproved.\n *\n * @param transactionMeta - The transaction metadata to check.\n * @param fnName - The name of the function calling this helper.\n */\nexport function validateIfTransactionUnapproved(\n transactionMeta: TransactionMeta | undefined,\n fnName: string,\n) {\n if (transactionMeta?.status !== TransactionStatus.unapproved) {\n throw new Error(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `TransactionsController: Can only call ${fnName} on an unapproved transaction.\\n Current tx status: ${transactionMeta?.status}`,\n );\n }\n}\n\n/**\n * Normalizes properties on transaction params.\n *\n * @param error - The error to be normalize.\n * @returns Normalized transaction error.\n */\nexport function normalizeTxError(\n error: Error & { code?: string; value?: unknown },\n): TransactionError {\n return {\n name: error.name,\n message: error.message,\n stack: error.stack,\n code: error.code,\n rpc: isJsonCompatible(error.value) ? error.value : undefined,\n };\n}\n\n/**\n * Normalize an object containing gas fee values.\n *\n * @param gasFeeValues - An object containing gas fee values.\n * @returns An object containing normalized gas fee values.\n */\nexport function normalizeGasFeeValues(\n gasFeeValues: GasPriceValue | FeeMarketEIP1559Values,\n): GasPriceValue | FeeMarketEIP1559Values {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const normalize = (value: any) =>\n typeof value === 'string' ? add0x(value) : value;\n\n if ('gasPrice' in gasFeeValues) {\n return {\n gasPrice: normalize(gasFeeValues.gasPrice),\n };\n }\n\n return {\n maxFeePerGas: normalize(gasFeeValues.maxFeePerGas),\n maxPriorityFeePerGas: normalize(gasFeeValues.maxPriorityFeePerGas),\n };\n}\n\n/**\n * Determines whether the given value can be encoded as JSON.\n *\n * @param value - The value.\n * @returns True if the value is JSON-encodable, false if not.\n */\nfunction isJsonCompatible(value: unknown): value is Json {\n try {\n JSON.parse(JSON.stringify(value));\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Ensure a hex string is of even length by adding a leading 0 if necessary.\n * Any existing `0x` prefix is preserved but is not added if missing.\n *\n * @param hex - The hex string to ensure is even.\n * @returns The hex string with an even length.\n */\nexport function padHexToEvenLength(hex: string) {\n const prefix = hex.toLowerCase().startsWith('0x') ? hex.slice(0, 2) : '';\n const data = prefix ? hex.slice(2) : hex;\n const evenData = data.length % 2 === 0 ? data : `0${data}`;\n\n return prefix + evenData;\n}\n"],"mappings":";AAAA,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcA,IAAM,qBAAqB;AAIlC,IAAM,cAA2D;AAAA,EAC/D,MAAM,CAAC,SAAiB,MAAM,mBAAmB,IAAI,CAAC;AAAA,EACtD,MAAM,CAAC,SAAiB,MAAM,IAAI,EAAE,YAAY;AAAA,EAChD,KAAK,CAAC,QAAgB,MAAM,GAAG;AAAA,EAC/B,UAAU,CAAC,QAAgB,MAAM,GAAG;AAAA,EACpC,UAAU,CAAC,aAAqB,MAAM,QAAQ;AAAA,EAC9C,OAAO,CAAC,UAAkB,MAAM,KAAK;AAAA,EACrC,IAAI,CAAC,OAAe,MAAM,EAAE,EAAE,YAAY;AAAA,EAC1C,OAAO,CAAC,UAAkB,MAAM,KAAK;AAAA,EACrC,cAAc,CAAC,iBAAyB,MAAM,YAAY;AAAA,EAC1D,sBAAsB,CAAC,yBACrB,MAAM,oBAAoB;AAAA,EAC5B,kBAAkB,CAAC,yBACjB,MAAM,oBAAoB;AAAA,EAC5B,MAAM,CAAC,SAAiB,MAAM,IAAI;AACpC;AAQO,SAAS,2BAA2B,UAA6B;AACtE,QAAM,qBAAwC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C,UAAU;AAC9G,QAAM,IAAI,MAAM,QAAQ;AAC1B;AASO,SAAS,gCACd,iBACA,QACA;AACA,MAAI,iBAAiB,0CAAyC;AAC5D,UAAM,IAAI;AAAA;AAAA;AAAA,MAGR,yCAAyC,MAAM;AAAA,2BAA4D,iBAAiB,MAAM;AAAA,IACpI;AAAA,EACF;AACF;AAQO,SAAS,iBACd,OACkB;AAClB,SAAO;AAAA,IACL,MAAM,MAAM;AAAA,IACZ,SAAS,MAAM;AAAA,IACf,OAAO,MAAM;AAAA,IACb,MAAM,MAAM;AAAA,IACZ,KAAK,iBAAiB,MAAM,KAAK,IAAI,MAAM,QAAQ;AAAA,EACrD;AACF;AAQO,SAAS,sBACd,cACwC;AAGxC,QAAM,YAAY,CAAC,UACjB,OAAO,UAAU,WAAW,MAAM,KAAK,IAAI;AAE7C,MAAI,cAAc,cAAc;AAC9B,WAAO;AAAA,MACL,UAAU,UAAU,aAAa,QAAQ;AAAA,IAC3C;AAAA,EACF;AAEA,SAAO;AAAA,IACL,cAAc,UAAU,aAAa,YAAY;AAAA,IACjD,sBAAsB,UAAU,aAAa,oBAAoB;AAAA,EACnE;AACF;AAQA,SAAS,iBAAiB,OAA+B;AACvD,MAAI;AACF,SAAK,MAAM,KAAK,UAAU,KAAK,CAAC;AAChC,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AASO,SAAS,mBAAmB,KAAa;AAC9C,QAAM,SAAS,IAAI,YAAY,EAAE,WAAW,IAAI,IAAI,IAAI,MAAM,GAAG,CAAC,IAAI;AACtE,QAAM,OAAO,SAAS,IAAI,MAAM,CAAC,IAAI;AACrC,QAAM,WAAW,KAAK,SAAS,MAAM,IAAI,OAAO,IAAI,IAAI;AAExD,SAAO,SAAS;AAClB;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-QH2H4W3N.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-QH2H4W3N.js.map +deleted file mode 100644 +index 8f45def..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-QH2H4W3N.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/swaps.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,aAAa;AAEtB,SAAS,OAAO,cAAc;AAS9B,IAAM,MAAM,mBAAmB,eAAe,OAAO;AAK9C,IAAM,iCAAiC;AAKvC,IAAM,kCAAkC;AAE/C,IAAM,yBAAyB;AAKxB,IAAM,wBACX;AAmBF,IAAM,yBAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,yBAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,2BAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,0BAA4C;AAAA,EAChD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,8BAAgD;AAAA,EACpD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,4BAA8C;AAAA,EAClD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,IAAM,8BAAgD;AAAA,EACpD,GAAG;AACL;AAEA,IAAM,8BAAgD;AAAA,EACpD,GAAG;AACL;AAEA,IAAM,gCAAkD;AAAA,EACtD,GAAG;AACL;AAEO,IAAM,kCAAkC;AAAA,EAC7C,CAAC,UAAU,OAAO,GAAG;AAAA,EACrB,CAAC,sBAAsB,GAAG;AAAA,EAC1B,CAAC,UAAU,GAAG,GAAG;AAAA,EACjB,CAAC,UAAU,OAAO,GAAG;AAAA,EACrB,CAAC,UAAU,MAAM,GAAG;AAAA,EACpB,CAAC,UAAU,SAAS,GAAG;AAAA,EACvB,CAAC,UAAU,QAAQ,GAAG;AAAA,EACtB,CAAC,UAAU,QAAQ,GAAG;AAAA,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uBAAuB;AAExE,MAAI,kBAAkB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,oBAAkB,OAAO,eAAe;AAExC,SAAO,MAAM,CAAC,GAAG,iBAAiB,eAAe;AACnD;AAWA,SAAS,8BACP,iBACA,EAAE,MAAM,kBAAkB,GACT;AACjB;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAIA,MAAI,0BAA0B,EAAE,MAAM,kBAAkB;AACxD,4BAA0B,OAAO;AAAA,IAC/B;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,MAAM,CAAC,GAAG,iBAAiB,uBAAuB;AAC3D;AAUA,SAAS,2BAA2B,SAAiB,SAAiB;AACpE,MAAI,CAAC,WAAW,CAAC,SAAS;AACxB,WAAO;AAAA,EACT;AAEA,SACE,YACA,gCACE,OACF,GAAG;AAEP;AAQA,SAAS,MAAM,IAAY;AACzB,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC;AACzD","sourcesContent":["import { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport { merge, pickBy } from 'lodash';\n\nimport { CHAIN_IDS } from '../constants';\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionControllerMessenger } from '../TransactionController';\nimport type { TransactionMeta } from '../types';\nimport { TransactionType } from '../types';\nimport { validateIfTransactionUnapproved } from './utils';\n\nconst log = createModuleLogger(projectLogger, 'swaps');\n\n/**\n * Interval in milliseconds between checks of post transaction balance\n */\nexport const UPDATE_POST_TX_BALANCE_TIMEOUT = 5000;\n\n/**\n * Retry attempts for checking post transaction balance\n */\nexport const UPDATE_POST_TX_BALANCE_ATTEMPTS = 6;\n\nconst SWAPS_TESTNET_CHAIN_ID = '0x539';\n\n/**\n * An address that the metaswap-api recognizes as the default token for the current network, in place of the token address that ERC-20 tokens have\n */\nexport const DEFAULT_TOKEN_ADDRESS =\n '0x0000000000000000000000000000000000000000';\n\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\ninterface SwapsTokenObject {\n /**\n * The name for the network\n */\n name: string;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n}\n\nconst ETH_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n};\n\nconst BNB_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Binance Coin',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst MATIC_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Matic',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst AVAX_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Avalanche',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst TEST_ETH_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Test Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst GOERLI_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n name: 'Ether',\n address: DEFAULT_TOKEN_ADDRESS,\n decimals: 18,\n} as const;\n\nconst ARBITRUM_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nconst OPTIMISM_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nconst ZKSYNC_ERA_SWAPS_TOKEN_OBJECT: SwapsTokenObject = {\n ...ETH_SWAPS_TOKEN_OBJECT,\n} as const;\n\nexport const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {\n [CHAIN_IDS.MAINNET]: ETH_SWAPS_TOKEN_OBJECT,\n [SWAPS_TESTNET_CHAIN_ID]: TEST_ETH_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.BSC]: BNB_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.POLYGON]: MATIC_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.GOERLI]: GOERLI_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.AVALANCHE]: AVAX_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.OPTIMISM]: OPTIMISM_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.ARBITRUM]: ARBITRUM_SWAPS_TOKEN_OBJECT,\n [CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_ERA_SWAPS_TOKEN_OBJECT,\n} as const;\n\nexport const SWAP_TRANSACTION_TYPES = [\n TransactionType.swap,\n TransactionType.swapAndSend,\n TransactionType.swapApproval,\n];\n\n/**\n * Updates the transaction meta object with the swap information\n *\n * @param transactionMeta - The transaction meta object to update\n * @param transactionType - The type of the transaction\n * @param swaps - The swaps object\n * @param swaps.hasApproveTx - Whether the swap has an approval transaction\n * @param swaps.meta - The swap meta object\n * @param updateSwapsTransactionRequest - Dependency bag\n * @param updateSwapsTransactionRequest.isSwapsDisabled - Whether swaps are disabled\n * @param updateSwapsTransactionRequest.cancelTransaction - Function to cancel a transaction\n * @param updateSwapsTransactionRequest.messenger - TransactionController messenger\n * @returns A copy of the transaction meta object with updates, or the same\n * transaction meta object if no updates were made.\n */\nexport function updateSwapsTransaction(\n transactionMeta: TransactionMeta,\n transactionType: TransactionType,\n swaps: {\n hasApproveTx?: boolean;\n meta?: Partial;\n },\n {\n isSwapsDisabled,\n cancelTransaction,\n messenger,\n }: {\n isSwapsDisabled: boolean;\n cancelTransaction: (transactionId: string) => void;\n messenger: TransactionControllerMessenger;\n },\n): TransactionMeta {\n if (isSwapsDisabled || !SWAP_TRANSACTION_TYPES.includes(transactionType)) {\n return transactionMeta;\n }\n\n // The simulationFails property is added if the estimateGas call fails. In cases\n // when no swaps approval tx is required, this indicates that the swap will likely\n // fail. There was an earlier estimateGas call made by the swaps controller,\n // but it is possible that external conditions have change since then, and\n // a previously succeeding estimate gas call could now fail. By checking for\n // the `simulationFails` property here, we can reduce the number of swap\n // transactions that get published to the blockchain only to fail and thereby\n // waste the user's funds on gas.\n if (\n transactionType === TransactionType.swap &&\n swaps?.hasApproveTx === false &&\n transactionMeta.simulationFails\n ) {\n cancelTransaction(transactionMeta.id);\n throw new Error('Simulation failed');\n }\n\n const swapsMeta = swaps?.meta as Partial;\n\n if (!swapsMeta) {\n return transactionMeta;\n }\n\n let updatedTransactionMeta = transactionMeta;\n\n if (transactionType === TransactionType.swapApproval) {\n updatedTransactionMeta = updateSwapApprovalTransaction(\n transactionMeta,\n swapsMeta,\n );\n messenger.publish('TransactionController:transactionNewSwapApproval', {\n transactionMeta: updatedTransactionMeta,\n });\n }\n\n if (transactionType === TransactionType.swapAndSend) {\n updatedTransactionMeta = updateSwapAndSendTransaction(\n transactionMeta,\n swapsMeta,\n );\n messenger.publish('TransactionController:transactionNewSwapAndSend', {\n transactionMeta: updatedTransactionMeta,\n });\n }\n\n if (transactionType === TransactionType.swap) {\n updatedTransactionMeta = updateSwapTransaction(transactionMeta, swapsMeta);\n messenger.publish('TransactionController:transactionNewSwap', {\n transactionMeta: updatedTransactionMeta,\n });\n }\n\n return updatedTransactionMeta;\n}\n\n/**\n * Attempts to update the post transaction balance of the provided transaction\n *\n * @param transactionMeta - Transaction meta object to update\n * @param updatePostTransactionBalanceRequest - Dependency bag\n * @param updatePostTransactionBalanceRequest.ethQuery - EthQuery object\n * @param updatePostTransactionBalanceRequest.getTransaction - Reading function for the latest transaction state\n * @param updatePostTransactionBalanceRequest.updateTransaction - Updating transaction function\n */\nexport async function updatePostTransactionBalance(\n transactionMeta: TransactionMeta,\n {\n ethQuery,\n getTransaction,\n updateTransaction,\n }: {\n ethQuery: EthQuery;\n getTransaction: (transactionId: string) => TransactionMeta | undefined;\n updateTransaction: (transactionMeta: TransactionMeta, note: string) => void;\n },\n): Promise<{\n updatedTransactionMeta: TransactionMeta;\n approvalTransactionMeta?: TransactionMeta;\n}> {\n log('Updating post transaction balance', transactionMeta.id);\n\n const transactionId = transactionMeta.id;\n let latestTransactionMeta: TransactionMeta | undefined;\n let approvalTransactionMeta;\n\n for (let i = 0; i < UPDATE_POST_TX_BALANCE_ATTEMPTS; i++) {\n log('Querying balance', { attempt: i });\n\n const postTransactionBalance = await query(ethQuery, 'getBalance', [\n transactionMeta.txParams.from,\n ]);\n\n latestTransactionMeta = {\n ...(getTransaction(transactionId) ?? ({} as TransactionMeta)),\n };\n\n approvalTransactionMeta = latestTransactionMeta.approvalTxId\n ? getTransaction(latestTransactionMeta.approvalTxId)\n : undefined;\n\n latestTransactionMeta.postTxBalance = postTransactionBalance.toString(16);\n\n const isDefaultTokenAddress = isSwapsDefaultTokenAddress(\n transactionMeta.destinationTokenAddress as string,\n transactionMeta.chainId,\n );\n\n if (\n !isDefaultTokenAddress ||\n transactionMeta.preTxBalance !== latestTransactionMeta.postTxBalance\n ) {\n log('Finishing post balance update', {\n isDefaultTokenAddress,\n preTxBalance: transactionMeta.preTxBalance,\n postTxBalance: latestTransactionMeta.postTxBalance,\n });\n\n break;\n }\n\n log('Waiting for balance to update', {\n delay: UPDATE_POST_TX_BALANCE_TIMEOUT,\n });\n\n await sleep(UPDATE_POST_TX_BALANCE_TIMEOUT);\n }\n\n updateTransaction(\n latestTransactionMeta as TransactionMeta,\n 'TransactionController#updatePostTransactionBalance - Add post transaction balance',\n );\n\n log('Completed post balance update', latestTransactionMeta?.postTxBalance);\n\n return {\n updatedTransactionMeta: latestTransactionMeta as TransactionMeta,\n approvalTransactionMeta,\n };\n}\n\n/**\n * Updates the transaction meta object with the swap information\n *\n * @param transactionMeta - Transaction meta object to update\n * @param propsToUpdate - Properties to update\n * @param propsToUpdate.sourceTokenSymbol - Symbol of the token to be swapped\n * @param propsToUpdate.destinationTokenSymbol - Symbol of the token to be received\n * @param propsToUpdate.type - Type of the transaction\n * @param propsToUpdate.destinationTokenDecimals - Decimals of the token to be received\n * @param propsToUpdate.destinationTokenAddress - Address of the token to be received\n * @param propsToUpdate.swapMetaData - Metadata of the swap\n * @param propsToUpdate.swapTokenValue - Value of the token to be swapped\n * @param propsToUpdate.estimatedBaseFee - Estimated base fee of the transaction\n * @param propsToUpdate.approvalTxId - Transaction id of the approval transaction\n * @returns The updated transaction meta object.\n */\nfunction updateSwapTransaction(\n transactionMeta: TransactionMeta,\n {\n sourceTokenSymbol,\n destinationTokenSymbol,\n type,\n destinationTokenDecimals,\n destinationTokenAddress,\n swapMetaData,\n swapTokenValue,\n estimatedBaseFee,\n approvalTxId,\n }: Partial,\n): TransactionMeta {\n validateIfTransactionUnapproved(transactionMeta, 'updateSwapTransaction');\n\n let swapTransaction = {\n sourceTokenSymbol,\n destinationTokenSymbol,\n type,\n destinationTokenDecimals,\n destinationTokenAddress,\n swapMetaData,\n swapTokenValue,\n estimatedBaseFee,\n approvalTxId,\n };\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n swapTransaction = pickBy(swapTransaction) as any;\n\n return merge({}, transactionMeta, swapTransaction);\n}\n\n/**\n * Updates the transaction meta object with the swap information\n *\n * @param transactionMeta - Transaction meta object to update\n * @param propsToUpdate - Properties to update\n * @param propsToUpdate.approvalTxId - Transaction id of the approval transaction\n * @param propsToUpdate.destinationTokenAddress - Address of the token to be received\n * @param propsToUpdate.destinationTokenAmount - The raw amount of the destination token\n * @param propsToUpdate.destinationTokenDecimals - Decimals of the token to be received\n * @param propsToUpdate.destinationTokenSymbol - Symbol of the token to be received\n * @param propsToUpdate.estimatedBaseFee - Estimated base fee of the transaction\n * @param propsToUpdate.sourceTokenAddress - The address of the source token\n * @param propsToUpdate.sourceTokenAmount - The raw amount of the source token\n * @param propsToUpdate.sourceTokenDecimals - The decimals of the source token\n * @param propsToUpdate.sourceTokenSymbol - Symbol of the token to be swapped\n * @param propsToUpdate.swapAndSendRecipient - The recipient of the swap and send transaction\n * @param propsToUpdate.swapMetaData - Metadata of the swap\n * @param propsToUpdate.swapTokenValue - Value of the token to be swapped – possibly the same as sourceTokenAmount; included for consistency\n * @param propsToUpdate.type - Type of the transaction\n * @returns The updated transaction meta object.\n */\nfunction updateSwapAndSendTransaction(\n transactionMeta: TransactionMeta,\n {\n approvalTxId,\n destinationTokenAddress,\n destinationTokenAmount,\n destinationTokenDecimals,\n destinationTokenSymbol,\n estimatedBaseFee,\n sourceTokenAddress,\n sourceTokenAmount,\n sourceTokenDecimals,\n sourceTokenSymbol,\n swapAndSendRecipient,\n swapMetaData,\n swapTokenValue,\n type,\n }: Partial,\n): TransactionMeta {\n validateIfTransactionUnapproved(transactionMeta, 'updateSwapTransaction');\n\n let swapTransaction = {\n approvalTxId,\n destinationTokenAddress,\n destinationTokenAmount,\n destinationTokenDecimals,\n destinationTokenSymbol,\n estimatedBaseFee,\n sourceTokenAddress,\n sourceTokenAmount,\n sourceTokenDecimals,\n sourceTokenSymbol,\n swapAndSendRecipient,\n swapMetaData,\n swapTokenValue,\n type,\n };\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n swapTransaction = pickBy(swapTransaction) as any;\n\n return merge({}, transactionMeta, swapTransaction);\n}\n\n/**\n * Updates the transaction meta object with the swap approval information\n *\n * @param transactionMeta - Transaction meta object to update\n * @param propsToUpdate - Properties to update\n * @param propsToUpdate.type - Type of the transaction\n * @param propsToUpdate.sourceTokenSymbol - Symbol of the token to be swapped\n * @returns The updated transaction meta object.\n */\nfunction updateSwapApprovalTransaction(\n transactionMeta: TransactionMeta,\n { type, sourceTokenSymbol }: Partial,\n): TransactionMeta {\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateSwapApprovalTransaction',\n );\n\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let swapApprovalTransaction = { type, sourceTokenSymbol } as any;\n swapApprovalTransaction = pickBy({\n type,\n sourceTokenSymbol,\n }) as Partial;\n\n return merge({}, transactionMeta, swapApprovalTransaction);\n}\n\n/**\n * Checks whether the provided address is strictly equal to the address for\n * the default swaps token of the provided chain.\n *\n * @param address - The string to compare to the default token address\n * @param chainId - The hex encoded chain ID of the default swaps token to check\n * @returns Whether the address is the provided chain's default token address\n */\nfunction isSwapsDefaultTokenAddress(address: string, chainId: string) {\n if (!address || !chainId) {\n return false;\n }\n\n return (\n address ===\n SWAPS_CHAINID_DEFAULT_TOKEN_MAP[\n chainId as keyof typeof SWAPS_CHAINID_DEFAULT_TOKEN_MAP\n ]?.address\n );\n}\n\n/**\n * Sleeps for the provided number of milliseconds\n *\n * @param ms - Number of milliseconds to sleep\n * @returns Promise that resolves after the provided number of milliseconds\n */\nfunction sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-QP75SWIQ.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-QP75SWIQ.js.map +deleted file mode 100644 +index c1690b4..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-QP75SWIQ.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/history.ts"],"names":[],"mappings":";AAAA,OAAO,gBAAgB;AACvB,SAAS,WAAW,aAAa;AAe1B,SAAS,0BACd,iBACiB;AACjB,QAAM,WAAW,4BAA4B,eAAe;AAC5D,SAAO,MAAM,CAAC,GAAG,iBAAiB,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC3D;AAWO,SAAS,yBACd,iBACA,MACiB;AACjB,MAAI,CAAC,gBAAgB,SAAS;AAC5B,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,4BAA4B,eAAe;AAChE,QAAM,gBAAgB,cAAc,gBAAgB,OAAO;AAC3D,QAAM,eAAe,qBAAqB,eAAe,cAAc,IAAI;AAE3E,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,MAAM,CAAC,GAAG,iBAAiB;AAAA,MAChC,SAAS,CAAC,GAAG,gBAAgB,SAAS,YAAY;AAAA,IACpD,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAUA,SAAS,qBAGP,eACA,cACA,MACyB;AACzB,QAAM,yBAAyB,WAAW;AAAA,IACxC;AAAA,IACA;AAAA,EACF;AAEA,MAAI,uBAAuB,CAAC,GAAG;AAC7B,QAAI,MAAM;AACR,6BAAuB,CAAC,EAAE,OAAO;AAAA,IACnC;AACA,2BAAuB,CAAC,EAAE,YAAY,KAAK,IAAI;AAAA,EACjD;AACA,SAAO;AACT;AAQA,SAAS,cACP,oBACiB;AACjB,QAAM,eAAe,UAAU,kBAAkB;AACjD,SAAO,aAAa;AAAA;AAAA;AAAA,IAGlB,CAAC,KAAK,UAAe,WAAW,WAAW,KAAK,KAAK,EAAE;AAAA,EACzD;AACF;AAQA,SAAS,4BACP,iBACiB;AACjB,QAAM,WAAW,EAAE,GAAG,gBAAgB;AACtC,SAAO,SAAS;AAChB,SAAO,UAAU,QAAQ;AAC3B","sourcesContent":["import jsonDiffer from 'fast-json-patch';\nimport { cloneDeep, merge } from 'lodash';\n\nimport type {\n TransactionHistory,\n TransactionHistoryEntry,\n TransactionMeta,\n} from '../types';\n\n/**\n * Build a new version of the provided transaction with an initial history\n * entry, which is just a snapshot of the transaction.\n *\n * @param transactionMeta - TransactionMeta to add initial history snapshot to.\n * @returns A copy of `transactionMeta` with a new `history` property.\n */\nexport function addInitialHistorySnapshot(\n transactionMeta: TransactionMeta,\n): TransactionMeta {\n const snapshot = snapshotFromTransactionMeta(transactionMeta);\n return merge({}, transactionMeta, { history: [snapshot] });\n}\n\n/**\n * Builds a new version of the transaction with a new history entry if\n * it has a `history` property, or just returns the transaction.\n *\n * @param transactionMeta - TransactionMeta to add history entry to.\n * @param note - Note to add to history entry.\n * @returns A copy of `transactionMeta` with a new `history` entry if it has an\n * existing non-empty `history` array.\n */\nexport function updateTransactionHistory(\n transactionMeta: TransactionMeta,\n note: string,\n): TransactionMeta {\n if (!transactionMeta.history) {\n return transactionMeta;\n }\n\n const currentState = snapshotFromTransactionMeta(transactionMeta);\n const previousState = replayHistory(transactionMeta.history);\n const historyEntry = generateHistoryEntry(previousState, currentState, note);\n\n if (historyEntry.length > 0) {\n return merge({}, transactionMeta, {\n history: [...transactionMeta.history, historyEntry],\n });\n }\n return transactionMeta;\n}\n\n/**\n * Generates a history entry from the previous and new transaction metadata.\n *\n * @param previousState - The previous transaction metadata.\n * @param currentState - The new transaction metadata.\n * @param note - A note for the transaction metada update.\n * @returns An array of history operation.\n */\nfunction generateHistoryEntry(\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n previousState: any,\n currentState: TransactionMeta,\n note: string,\n): TransactionHistoryEntry {\n const historyOperationsEntry = jsonDiffer.compare(\n previousState,\n currentState,\n ) as TransactionHistoryEntry;\n // Add a note to the first operation, since it breaks if we append it to the entry\n if (historyOperationsEntry[0]) {\n if (note) {\n historyOperationsEntry[0].note = note;\n }\n historyOperationsEntry[0].timestamp = Date.now();\n }\n return historyOperationsEntry;\n}\n\n/**\n * Recovers previous transactionMeta from passed history array.\n *\n * @param transactionHistory - The transaction metadata to replay.\n * @returns The transaction metadata.\n */\nfunction replayHistory(\n transactionHistory: TransactionHistory,\n): TransactionMeta {\n const shortHistory = cloneDeep(transactionHistory);\n return shortHistory.reduce(\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (val, entry: any) => jsonDiffer.applyPatch(val, entry).newDocument,\n ) as TransactionMeta;\n}\n\n/**\n * Clone the transaction meta data without the history property.\n *\n * @param transactionMeta - The transaction metadata to snapshot.\n * @returns A deep clone of transaction metadata without history property.\n */\nfunction snapshotFromTransactionMeta(\n transactionMeta: TransactionMeta,\n): TransactionMeta {\n const snapshot = { ...transactionMeta };\n delete snapshot.history;\n return cloneDeep(snapshot);\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-QTKXIDGE.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-QTKXIDGE.js.map +deleted file mode 100644 +index 32e000d..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-QTKXIDGE.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/DefaultGasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAKA,SAAS,0BAA0B;AAEnC,SAAS,0BAA0B;AAiBnC,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAxBpE;AA6BO,IAAM,oBAAN,MAA8C;AAAA,EAA9C;AAuCL;AAiBA;AAiBA;AASA;AAkBA;AAAA;AAAA,EAnGA,mBAAmB,kBAA4C;AAC7D,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,WAAW,SAAyD;AACxE,UAAM,EAAE,qBAAqB,IAAI;AACjC,UAAM,EAAE,iBAAiB,gBAAgB,IAAI;AAE7C,QAAI;AAEJ,YAAQ,iBAAiB;AAAA,MACvB,KAAK,mBAAmB;AACtB,YAAI,8BAA8B,eAAe;AACjD,mBAAW,sBAAK,8CAAL,WAA0B;AACrC;AAAA,MACF,KAAK,mBAAmB;AACtB,YAAI,0BAA0B,eAAe;AAC7C,mBAAW,sBAAK,4CAAL,WACT;AAEF;AAAA,MACF,KAAK,mBAAmB;AACtB,YAAI,gCAAgC,eAAe;AACnD,mBAAW,sBAAK,gDAAL,WACT;AAEF;AAAA,MACF;AAGE,cAAM,IAAI,MAAM,kCAAkC,eAAe,EAAE;AAAA,IACvE;AAEA,WAAO;AAAA,MACL,WAAW;AAAA,IACb;AAAA,EACF;AAqEF;AAnEE;AAAA,yBAAoB,SAClB,iBAC0B;AAC1B,QAAM,SAAS,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAChD,CAAC,QAAQ,WAAW;AAAA,MAClB,GAAG;AAAA,MACH,CAAC,KAAK,GAAG,sBAAK,0CAAL,WAAwB,iBAAiB;AAAA,IACpD;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAEA;AAAA,wBAAmB,SACjB,iBACuB;AACvB,QAAM,SAAS,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAChD,CAAC,QAAQ,WAAW;AAAA,MAClB,GAAG;AAAA,MACH,CAAC,KAAK,GAAG,sBAAK,oCAAL,WAAqB,iBAAiB;AAAA,IACjD;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAEA;AAAA,0BAAqB,SACnB,iBACyB;AACzB,SAAO;AAAA,IACL;AAAA,IACA,UAAU,oBAAoB,gBAAgB,QAAQ;AAAA,EACxD;AACF;AAEA;AAAA,uBAAkB,SAChB,iBACA,OACiC;AACjC,QAAM,eAAe;AAAA,IACnB,gBAAgB,KAAK,EAAE;AAAA,EACzB;AAEA,QAAM,uBAAuB;AAAA,IAC3B,gBAAgB,KAAK,EAAE;AAAA,EACzB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEA;AAAA,oBAAe,SACb,iBACA,OACK;AACL,SAAO,oBAAoB,gBAAgB,KAAK,CAAC;AACnD","sourcesContent":["import type {\n LegacyGasPriceEstimate,\n GasFeeEstimates as FeeMarketGasPriceEstimate,\n EthGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\nimport { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type {\n FeeMarketGasFeeEstimateForLevel,\n FeeMarketGasFeeEstimates,\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n GasPriceGasFeeEstimates,\n LegacyGasFeeEstimates,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel, GasFeeEstimateType } from '../types';\nimport { gweiDecimalToWeiHex } from '../utils/gas-fees';\n\nconst log = createModuleLogger(projectLogger, 'default-gas-fee-flow');\n\n/**\n * The standard implementation of a gas fee flow that obtains gas fee estimates using only the GasFeeController.\n */\nexport class DefaultGasFeeFlow implements GasFeeFlow {\n matchesTransaction(_transactionMeta: TransactionMeta): boolean {\n return true;\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n const { gasFeeControllerData } = request;\n const { gasEstimateType, gasFeeEstimates } = gasFeeControllerData;\n\n let response: GasFeeEstimates;\n\n switch (gasEstimateType) {\n case GAS_ESTIMATE_TYPES.FEE_MARKET:\n log('Using fee market estimates', gasFeeEstimates);\n response = this.#getFeeMarkEstimates(gasFeeEstimates);\n break;\n case GAS_ESTIMATE_TYPES.LEGACY:\n log('Using legacy estimates', gasFeeEstimates);\n response = this.#getLegacyEstimates(\n gasFeeEstimates as LegacyGasPriceEstimate,\n );\n break;\n case GAS_ESTIMATE_TYPES.ETH_GASPRICE:\n log('Using eth_gasPrice estimates', gasFeeEstimates);\n response = this.#getGasPriceEstimates(\n gasFeeEstimates as EthGasPriceEstimate,\n );\n break;\n default:\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported gas estimate type: ${gasEstimateType}`);\n }\n\n return {\n estimates: response,\n };\n }\n\n #getFeeMarkEstimates(\n gasFeeEstimates: FeeMarketGasPriceEstimate,\n ): FeeMarketGasFeeEstimates {\n const levels = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: this.#getFeeMarketLevel(gasFeeEstimates, level),\n }),\n {} as Omit,\n );\n\n return {\n type: GasFeeEstimateType.FeeMarket,\n ...levels,\n };\n }\n\n #getLegacyEstimates(\n gasFeeEstimates: LegacyGasPriceEstimate,\n ): LegacyGasFeeEstimates {\n const levels = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: this.#getLegacyLevel(gasFeeEstimates, level),\n }),\n {} as Omit,\n );\n\n return {\n type: GasFeeEstimateType.Legacy,\n ...levels,\n };\n }\n\n #getGasPriceEstimates(\n gasFeeEstimates: EthGasPriceEstimate,\n ): GasPriceGasFeeEstimates {\n return {\n type: GasFeeEstimateType.GasPrice,\n gasPrice: gweiDecimalToWeiHex(gasFeeEstimates.gasPrice),\n };\n }\n\n #getFeeMarketLevel(\n gasFeeEstimates: FeeMarketGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): FeeMarketGasFeeEstimateForLevel {\n const maxFeePerGas = gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxFeePerGas,\n );\n\n const maxPriorityFeePerGas = gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxPriorityFeePerGas,\n );\n\n return {\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n }\n\n #getLegacyLevel(\n gasFeeEstimates: LegacyGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): Hex {\n return gweiDecimalToWeiHex(gasFeeEstimates[level]);\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-RHDPOIS4.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-RHDPOIS4.js.map +deleted file mode 100644 +index 5f03ad7..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-RHDPOIS4.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/IncomingTransactionHelper.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,SAAS,aAAa;AACtB,OAAO,kBAAkB;AAKzB,IAAM,6BAA6B;AAInC,IAAM,gBAAsD;AAAA,EAC1D,CAAC,WAAW,OAAO;AAAA,EACnB,CAAC,WAAW,OAAO,SAAS;AAC9B;AAhBA;AAiCO,IAAM,4BAAN,MAAgC;AAAA,EA+BrC,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,I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AAL,WAAwB;AAC/C,QAAM,0BAA0B,mBAAK,6BAAL;AAChC,QAAM,gBAAgB,wBAAwB,cAAc;AAE5D,MAAI,iBAAiB,wBAAwB;AAC3C;AAAA,EACF;AAEA,OAAK,IAAI,KAAK,kCAAkC;AAAA,IAC9C,yBAAyB;AAAA,MACvB,GAAG;AAAA,MACH,CAAC,cAAc,GAAG;AAAA,IACpB;AAAA,IACA,aAAa;AAAA,EACf,CAAC;AACH;AAEA;AAAA,uBAAkB,SAAC,gBAAkC;AACnD,QAAM,iBAAiB,mBAAK,aAAL;AACvB,QAAM,iBAAiB,mBAAK,oBAAL,YAA2B,QAAQ,YAAY;AAEtE,SAAO,CAAC,gBAAgB,gBAAgB,GAAG,cAAc,EAAE,KAAK,GAAG;AACrE;AAEA;AAAA,cAAS,WAAY;AACnB,QAAM,YAAY,mBAAK,YAAL;AAClB,QAAM,iBAAiB,mBAAK,aAAL;AAEvB,QAAM,qBACJ,mBAAK,0BAAyB,mBAAmB,cAAc;AAEjE,SAAO,aAAa;AACtB","sourcesContent":["import type { AccountsController } from '@metamask/accounts-controller';\nimport type { BlockTracker } from '@metamask/network-controller';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport EventEmitter from 'events';\n\nimport { incomingTransactionsLogger as log } from '../logger';\nimport type { RemoteTransactionSource, TransactionMeta } from '../types';\n\nconst RECENT_HISTORY_BLOCK_RANGE = 10;\n\n// TODO: Replace `any` with type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst UPDATE_CHECKS: ((txMeta: TransactionMeta) => any)[] = [\n (txMeta) => txMeta.status,\n (txMeta) => txMeta.txParams.gasUsed,\n];\n\n/**\n * Configuration options for the IncomingTransactionHelper\n *\n * @property includeTokenTransfers - Whether or not to include ERC20 token transfers.\n * @property isEnabled - Whether or not incoming transaction retrieval is enabled.\n * @property queryEntireHistory - Whether to initially query the entire transaction history or only recent blocks.\n * @property updateTransactions - Whether to update local transactions using remote transaction data.\n */\nexport type IncomingTransactionOptions = {\n includeTokenTransfers?: boolean;\n isEnabled?: () => boolean;\n queryEntireHistory?: boolean;\n updateTransactions?: boolean;\n};\n\nexport class IncomingTransactionHelper {\n hub: EventEmitter;\n\n #blockTracker: BlockTracker;\n\n #getCurrentAccount: () => ReturnType<\n AccountsController['getSelectedAccount']\n >;\n\n #getLastFetchedBlockNumbers: () => Record;\n\n #getLocalTransactions: () => TransactionMeta[];\n\n #getChainId: () => Hex;\n\n #isEnabled: () => boolean;\n\n #isRunning: boolean;\n\n #mutex = new Mutex();\n\n #onLatestBlock: (blockNumberHex: Hex) => Promise;\n\n #queryEntireHistory: boolean;\n\n #remoteTransactionSource: RemoteTransactionSource;\n\n #transactionLimit?: number;\n\n #updateTransactions: boolean;\n\n constructor({\n blockTracker,\n getCurrentAccount,\n getLastFetchedBlockNumbers,\n getLocalTransactions,\n getChainId,\n isEnabled,\n queryEntireHistory,\n remoteTransactionSource,\n transactionLimit,\n updateTransactions,\n }: {\n blockTracker: BlockTracker;\n getCurrentAccount: () => ReturnType<\n AccountsController['getSelectedAccount']\n >;\n getLastFetchedBlockNumbers: () => Record;\n getLocalTransactions?: () => TransactionMeta[];\n getChainId: () => Hex;\n isEnabled?: () => boolean;\n queryEntireHistory?: boolean;\n remoteTransactionSource: RemoteTransactionSource;\n transactionLimit?: number;\n updateTransactions?: boolean;\n }) {\n this.hub = new EventEmitter();\n\n this.#blockTracker = blockTracker;\n this.#getCurrentAccount = getCurrentAccount;\n this.#getLastFetchedBlockNumbers = getLastFetchedBlockNumbers;\n this.#getLocalTransactions = getLocalTransactions || (() => []);\n this.#getChainId = getChainId;\n this.#isEnabled = isEnabled ?? (() => true);\n this.#isRunning = false;\n this.#queryEntireHistory = queryEntireHistory ?? true;\n this.#remoteTransactionSource = remoteTransactionSource;\n this.#transactionLimit = transactionLimit;\n this.#updateTransactions = updateTransactions ?? false;\n\n // Using a property instead of a method to provide a listener reference\n // with the correct scope that we can remove later if stopped.\n this.#onLatestBlock = async (blockNumberHex: Hex) => {\n try {\n await this.update(blockNumberHex);\n } catch (error) {\n console.error('Error while checking incoming transactions', error);\n }\n };\n }\n\n start() {\n if (this.#isRunning) {\n return;\n }\n\n if (!this.#canStart()) {\n return;\n }\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#blockTracker.addListener('latest', this.#onLatestBlock);\n this.#isRunning = true;\n }\n\n stop() {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#blockTracker.removeListener('latest', this.#onLatestBlock);\n this.#isRunning = false;\n }\n\n async update(latestBlockNumberHex?: Hex): Promise {\n const releaseLock = await this.#mutex.acquire();\n\n log('Checking for incoming transactions');\n\n try {\n if (!this.#canStart()) {\n return;\n }\n\n const latestBlockNumber = parseInt(\n latestBlockNumberHex || (await this.#blockTracker.getLatestBlock()),\n 16,\n );\n\n const additionalLastFetchedKeys =\n this.#remoteTransactionSource.getLastBlockVariations?.() ?? [];\n\n const fromBlock = this.#getFromBlock(latestBlockNumber);\n const account = this.#getCurrentAccount();\n const currentChainId = this.#getChainId();\n\n let remoteTransactions = [];\n\n try {\n remoteTransactions =\n await this.#remoteTransactionSource.fetchTransactions({\n address: account.address,\n currentChainId,\n fromBlock,\n limit: this.#transactionLimit,\n });\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n log('Error while fetching remote transactions', error);\n return;\n }\n if (!this.#updateTransactions) {\n const address = account.address.toLowerCase();\n remoteTransactions = remoteTransactions.filter(\n (tx) => tx.txParams.to?.toLowerCase() === address,\n );\n }\n\n const localTransactions = !this.#updateTransactions\n ? []\n : this.#getLocalTransactions();\n\n const newTransactions = this.#getNewTransactions(\n remoteTransactions,\n localTransactions,\n );\n\n const updatedTransactions = this.#getUpdatedTransactions(\n remoteTransactions,\n localTransactions,\n );\n\n if (newTransactions.length > 0 || updatedTransactions.length > 0) {\n this.#sortTransactionsByTime(newTransactions);\n this.#sortTransactionsByTime(updatedTransactions);\n\n log('Found incoming transactions', {\n new: newTransactions,\n updated: updatedTransactions,\n });\n\n this.hub.emit('transactions', {\n added: newTransactions,\n updated: updatedTransactions,\n });\n }\n this.#updateLastFetchedBlockNumber(\n remoteTransactions,\n additionalLastFetchedKeys,\n );\n } finally {\n releaseLock();\n }\n }\n\n #sortTransactionsByTime(transactions: TransactionMeta[]) {\n transactions.sort((a, b) => (a.time < b.time ? -1 : 1));\n }\n\n #getNewTransactions(\n remoteTxs: TransactionMeta[],\n localTxs: TransactionMeta[],\n ): TransactionMeta[] {\n return remoteTxs.filter(\n (tx) => !localTxs.some(({ hash }) => hash === tx.hash),\n );\n }\n\n #getUpdatedTransactions(\n remoteTxs: TransactionMeta[],\n localTxs: TransactionMeta[],\n ): TransactionMeta[] {\n return remoteTxs.filter((remoteTx) =>\n localTxs.some(\n (localTx) =>\n remoteTx.hash === localTx.hash &&\n this.#isTransactionOutdated(remoteTx, localTx),\n ),\n );\n }\n\n #isTransactionOutdated(\n remoteTx: TransactionMeta,\n localTx: TransactionMeta,\n ): boolean {\n return UPDATE_CHECKS.some(\n (getValue) => getValue(remoteTx) !== getValue(localTx),\n );\n }\n\n #getLastFetchedBlockNumberDec(): number {\n const additionalLastFetchedKeys =\n this.#remoteTransactionSource.getLastBlockVariations?.() ?? [];\n const lastFetchedKey = this.#getBlockNumberKey(additionalLastFetchedKeys);\n const lastFetchedBlockNumbers = this.#getLastFetchedBlockNumbers();\n return lastFetchedBlockNumbers[lastFetchedKey];\n }\n\n #getFromBlock(latestBlockNumber: number): number | undefined {\n const lastFetchedBlockNumber = this.#getLastFetchedBlockNumberDec();\n\n if (lastFetchedBlockNumber) {\n return lastFetchedBlockNumber + 1;\n }\n\n return this.#queryEntireHistory\n ? undefined\n : latestBlockNumber - RECENT_HISTORY_BLOCK_RANGE;\n }\n\n #updateLastFetchedBlockNumber(\n remoteTxs: TransactionMeta[],\n additionalKeys: string[],\n ) {\n let lastFetchedBlockNumber = -1;\n\n for (const tx of remoteTxs) {\n const currentBlockNumberValue = tx.blockNumber\n ? parseInt(tx.blockNumber, 10)\n : -1;\n\n lastFetchedBlockNumber = Math.max(\n lastFetchedBlockNumber,\n currentBlockNumberValue,\n );\n }\n\n if (lastFetchedBlockNumber === -1) {\n return;\n }\n\n const lastFetchedKey = this.#getBlockNumberKey(additionalKeys);\n const lastFetchedBlockNumbers = this.#getLastFetchedBlockNumbers();\n const previousValue = lastFetchedBlockNumbers[lastFetchedKey];\n\n if (previousValue >= lastFetchedBlockNumber) {\n return;\n }\n\n this.hub.emit('updatedLastFetchedBlockNumbers', {\n lastFetchedBlockNumbers: {\n ...lastFetchedBlockNumbers,\n [lastFetchedKey]: lastFetchedBlockNumber,\n },\n blockNumber: lastFetchedBlockNumber,\n });\n }\n\n #getBlockNumberKey(additionalKeys: string[]): string {\n const currentChainId = this.#getChainId();\n const currentAccount = this.#getCurrentAccount()?.address.toLowerCase();\n\n return [currentChainId, currentAccount, ...additionalKeys].join('#');\n }\n\n #canStart(): boolean {\n const isEnabled = this.#isEnabled();\n const currentChainId = this.#getChainId();\n\n const isSupportedNetwork =\n this.#remoteTransactionSource.isSupportedNetwork(currentChainId);\n\n return isEnabled && isSupportedNetwork;\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-RXIUMVA5.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-RXIUMVA5.js.map +deleted file mode 100644 +index f44a8d6..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-RXIUMVA5.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/validation.ts"],"names":[],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB,yBAAyB;AACnD,SAAS,gBAAgB;AACzB,SAAS,gBAAgB,iBAAiB;AAgB1C,eAAsB,0BACpB,oBACA,iBACA,MACA,QACA;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pE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AACA,wBAAoB,UAAU,cAAc;AAAA,EAC9C;AAEA,MAAI,SAAS,sBAAsB;AACjC;AAAA,MACE;AAAA,MACA;AAAA,IACF;AACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AACA,wBAAoB,UAAU,sBAAsB;AAAA,EACtD;AACF;AAYA,SAAS,4CACP,UACA,OACA;AACA,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AACH,UACE,SAAS,QACT,SAAS,gCACT;AACA,cAAM,UAAU;AAAA,UACd,sDAAsD,SAAS,IAAI,8FAA0G;AAAA,QAC/K;AAAA,MACF;AACA;AAAA,IACF,KAAK;AAAA,IACL;AACE,UACE,SAAS,QACT,SAAS,gCACT;AACA,cAAM,UAAU;AAAA,UACd,sDAAsD,SAAS,IAAI;AAAA,QACrE;AAAA,MACF;AAAA,EACJ;AACF;AAYA,SAAS,yCACP,UACA,qBACA,wBACA;AACA,MAAI,OAAO,SAAS,sBAAsB,MAAM,aAAa;AAC3D,UAAM,UAAU;AAAA,MACd,yCAAyC,mBAAmB,sBAAsB,sBAAsB;AAAA,IAC1G;AAAA,EACF;AACF;AAUA,SAAS,oBACP,UACA,OACA;AACA,MAAI,OAAO,SAAS,KAAK,MAAM,UAAU;AACvC,UAAM,UAAU;AAAA;AAAA;AAAA,MAGd,+BAA+B,KAAK,2BAA2B,SAAS,KAAK,CAAC;AAAA,IAChF;AAAA,EACF;AACF","sourcesContent":["import { Interface } from '@ethersproject/abi';\nimport { ORIGIN_METAMASK, isValidHexAddress } from '@metamask/controller-utils';\nimport { abiERC20 } from '@metamask/metamask-eth-abis';\nimport { providerErrors, rpcErrors } from '@metamask/rpc-errors';\n\nimport { TransactionEnvelopeType, type TransactionParams } from '../types';\nimport { isEIP1559Transaction } from './utils';\n\ntype GasFieldsToValidate = 'gasPrice' | 'maxFeePerGas' | 'maxPriorityFeePerGas';\n\n/**\n * Validates whether a transaction initiated by a specific 'from' address is permitted by the origin.\n *\n * @param permittedAddresses - The permitted accounts for the given origin.\n * @param selectedAddress - The currently selected Ethereum address in the wallet.\n * @param from - The address from which the transaction is initiated.\n * @param origin - The origin or source of the transaction.\n * @throws Throws an error if the transaction is not permitted.\n */\nexport async function validateTransactionOrigin(\n permittedAddresses: string[],\n selectedAddress: string,\n from: string,\n origin: string,\n) {\n if (origin === ORIGIN_METAMASK) {\n // Ensure the 'from' address matches the currently selected address\n if (from !== selectedAddress) {\n throw rpcErrors.internal({\n message: `Internally initiated transaction is using invalid account.`,\n data: {\n origin,\n fromAddress: from,\n selectedAddress,\n },\n });\n }\n return;\n }\n\n // Check if the origin has permissions to initiate transactions from the specified address\n if (!permittedAddresses.includes(from)) {\n throw providerErrors.unauthorized({ data: { origin } });\n }\n}\n\n/**\n * Validates the transaction params for required properties and throws in\n * the event of any validation error.\n *\n * @param txParams - Transaction params object to validate.\n * @param isEIP1559Compatible - whether or not the current network supports EIP-1559 transactions.\n */\nexport function validateTxParams(\n txParams: TransactionParams,\n isEIP1559Compatible = true,\n) {\n validateEIP1559Compatibility(txParams, isEIP1559Compatible);\n validateParamFrom(txParams.from);\n validateParamRecipient(txParams);\n validateParamValue(txParams.value);\n validateParamData(txParams.data);\n validateParamChainId(txParams.chainId);\n validateGasFeeParams(txParams);\n}\n\n/**\n * Validates EIP-1559 compatibility for transaction creation.\n *\n * @param txParams - The transaction parameters to validate.\n * @param isEIP1559Compatible - Indicates if the current network supports EIP-1559.\n * @throws Throws invalid params if the transaction specifies EIP-1559 but the network does not support it.\n */\nfunction validateEIP1559Compatibility(\n txParams: TransactionParams,\n isEIP1559Compatible: boolean,\n) {\n if (isEIP1559Transaction(txParams) && !isEIP1559Compatible) {\n throw rpcErrors.invalidParams(\n 'Invalid transaction params: params specify an EIP-1559 transaction but the current network does not support EIP-1559',\n );\n }\n}\n\n/**\n * Validates value property, ensuring it is a valid positive integer number\n * denominated in wei.\n *\n * @param value - The value to validate, expressed as a string.\n * @throws Throws an error if the value is not a valid positive integer\n * number denominated in wei.\n * - If the value contains a hyphen (-), it is considered invalid.\n * - If the value contains a decimal point (.), it is considered invalid.\n * - If the value is not a finite number, is NaN, or is not a safe integer, it is considered invalid.\n */\nfunction validateParamValue(value?: string) {\n if (value !== undefined) {\n if (value.includes('-')) {\n throw rpcErrors.invalidParams(\n `Invalid transaction value \"${value}\": not a positive number.`,\n );\n }\n\n if (value.includes('.')) {\n throw rpcErrors.invalidParams(\n `Invalid transaction value \"${value}\": number must be in wei.`,\n );\n }\n const intValue = parseInt(value, 10);\n const isValid =\n Number.isFinite(intValue) &&\n !Number.isNaN(intValue) &&\n !isNaN(Number(value)) &&\n Number.isSafeInteger(intValue);\n if (!isValid) {\n throw rpcErrors.invalidParams(\n `Invalid transaction value ${value}: number must be a valid number.`,\n );\n }\n }\n}\n\n/**\n * Validates the recipient address in a transaction's parameters.\n *\n * @param txParams - The transaction parameters object to validate.\n * @throws Throws an error if the recipient address is invalid:\n * - If the recipient address is an empty string ('0x') or undefined and the transaction contains data,\n * the \"to\" field is removed from the transaction parameters.\n * - If the recipient address is not a valid hexadecimal Ethereum address, an error is thrown.\n */\nfunction validateParamRecipient(txParams: TransactionParams) {\n if (txParams.to === '0x' || txParams.to === undefined) {\n if (txParams.data) {\n delete txParams.to;\n } else {\n throw rpcErrors.invalidParams(`Invalid \"to\" address.`);\n }\n } else if (txParams.to !== undefined && !isValidHexAddress(txParams.to)) {\n throw rpcErrors.invalidParams(`Invalid \"to\" address.`);\n }\n}\n\n/**\n * Validates the recipient address in a transaction's parameters.\n *\n * @param from - The from property to validate.\n * @throws Throws an error if the recipient address is invalid:\n * - If the recipient address is an empty string ('0x') or undefined and the transaction contains data,\n * the \"to\" field is removed from the transaction parameters.\n * - If the recipient address is not a valid hexadecimal Ethereum address, an error is thrown.\n */\nfunction validateParamFrom(from: string) {\n if (!from || typeof from !== 'string') {\n throw rpcErrors.invalidParams(\n `Invalid \"from\" address ${from}: not a string.`,\n );\n }\n if (!isValidHexAddress(from)) {\n throw rpcErrors.invalidParams('Invalid \"from\" address.');\n }\n}\n\n/**\n * Validates input data for transactions.\n *\n * @param value - The input data to validate.\n * @throws Throws invalid params if the input data is invalid.\n */\nfunction validateParamData(value?: string) {\n if (value) {\n const ERC20Interface = new Interface(abiERC20);\n try {\n ERC20Interface.parseTransaction({ data: value });\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n if (error.message.match(/BUFFER_OVERRUN/u)) {\n throw rpcErrors.invalidParams(\n 'Invalid transaction params: data out-of-bounds, BUFFER_OVERRUN.',\n );\n }\n }\n }\n}\n\n/**\n * Validates chainId type.\n *\n * @param chainId - The chainId to validate.\n */\nfunction validateParamChainId(chainId: number | string | undefined) {\n if (\n chainId !== undefined &&\n typeof chainId !== 'number' &&\n typeof chainId !== 'string'\n ) {\n throw rpcErrors.invalidParams(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Invalid transaction params: chainId is not a Number or hex string. got: (${chainId})`,\n );\n }\n}\n\n/**\n * Validates gas values.\n *\n * @param txParams - The transaction parameters to validate.\n */\nfunction validateGasFeeParams(txParams: TransactionParams) {\n if (txParams.gasPrice) {\n ensureProperTransactionEnvelopeTypeProvided(txParams, 'gasPrice');\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'gasPrice',\n 'maxFeePerGas',\n );\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'gasPrice',\n 'maxPriorityFeePerGas',\n );\n ensureFieldIsString(txParams, 'gasPrice');\n }\n\n if (txParams.maxFeePerGas) {\n ensureProperTransactionEnvelopeTypeProvided(txParams, 'maxFeePerGas');\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'maxFeePerGas',\n 'gasPrice',\n );\n ensureFieldIsString(txParams, 'maxFeePerGas');\n }\n\n if (txParams.maxPriorityFeePerGas) {\n ensureProperTransactionEnvelopeTypeProvided(\n txParams,\n 'maxPriorityFeePerGas',\n );\n ensureMutuallyExclusiveFieldsNotProvided(\n txParams,\n 'maxPriorityFeePerGas',\n 'gasPrice',\n );\n ensureFieldIsString(txParams, 'maxPriorityFeePerGas');\n }\n}\n\n/**\n * Ensures that the provided txParams has the proper 'type' specified for the\n * given field, if it is provided. If types do not match throws an\n * invalidParams error.\n *\n * @param txParams - The transaction parameters object\n * @param field - The current field being validated\n * @throws {ethErrors.rpc.invalidParams} Throws if type does not match the\n * expectations for provided field.\n */\nfunction ensureProperTransactionEnvelopeTypeProvided(\n txParams: TransactionParams,\n field: GasFieldsToValidate,\n) {\n switch (field) {\n case 'maxFeePerGas':\n case 'maxPriorityFeePerGas':\n if (\n txParams.type &&\n txParams.type !== TransactionEnvelopeType.feeMarket\n ) {\n throw rpcErrors.invalidParams(\n `Invalid transaction envelope type: specified type \"${txParams.type}\" but including maxFeePerGas and maxPriorityFeePerGas requires type: \"${TransactionEnvelopeType.feeMarket}\"`,\n );\n }\n break;\n case 'gasPrice':\n default:\n if (\n txParams.type &&\n txParams.type === TransactionEnvelopeType.feeMarket\n ) {\n throw rpcErrors.invalidParams(\n `Invalid transaction envelope type: specified type \"${txParams.type}\" but included a gasPrice instead of maxFeePerGas and maxPriorityFeePerGas`,\n );\n }\n }\n}\n\n/**\n * Given two fields, ensure that the second field is not included in txParams,\n * and if it is throw an invalidParams error.\n *\n * @param txParams - The transaction parameters object\n * @param fieldBeingValidated - The current field being validated\n * @param mutuallyExclusiveField - The field to ensure is not provided\n * @throws {ethErrors.rpc.invalidParams} Throws if mutuallyExclusiveField is\n * present in txParams.\n */\nfunction ensureMutuallyExclusiveFieldsNotProvided(\n txParams: TransactionParams,\n fieldBeingValidated: GasFieldsToValidate,\n mutuallyExclusiveField: GasFieldsToValidate,\n) {\n if (typeof txParams[mutuallyExclusiveField] !== 'undefined') {\n throw rpcErrors.invalidParams(\n `Invalid transaction params: specified ${fieldBeingValidated} but also included ${mutuallyExclusiveField}, these cannot be mixed`,\n );\n }\n}\n\n/**\n * Ensures that the provided value for field is a string, throws an\n * invalidParams error if field is not a string.\n *\n * @param txParams - The transaction parameters object\n * @param field - The current field being validated\n * @throws {rpcErrors.invalidParams} Throws if field is not a string\n */\nfunction ensureFieldIsString(\n txParams: TransactionParams,\n field: GasFieldsToValidate,\n) {\n if (typeof txParams[field] !== 'string') {\n throw rpcErrors.invalidParams(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Invalid transaction params: ${field} is not a string. got: (${txParams[field]})`,\n );\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-S6VGOPUY.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-S6VGOPUY.js.map +deleted file mode 100644 +index cf80a78..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-S6VGOPUY.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/logger.ts"],"names":[],"mappings":";AAEA,SAAS,qBAAqB,0BAA0B;AAEjD,IAAM,gBAAgB,oBAAoB,wBAAwB;AAElE,IAAM,6BAA6B;AAAA,EACxC;AAAA,EACA;AACF","sourcesContent":["/* istanbul ignore file */\n\nimport { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nexport const projectLogger = createProjectLogger('transaction-controller');\n\nexport const incomingTransactionsLogger = createModuleLogger(\n projectLogger,\n 'incoming-transactions',\n);\n\nexport { createModuleLogger };\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-S7Q622IS.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-S7Q622IS.js.map +deleted file mode 100644 +index a170538..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-S7Q622IS.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/TransactionController.ts"],"names":["ApprovalState","transactionMeta"],"mappings":";;;;;;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,wBAAmB,WAAG;AACpB,SAAO,KAAK,gBAAgB,KAAK,uCAAuC;AAC1E","sourcesContent":["import { Hardfork, Common, type ChainConfig } from '@ethereumjs/common';\nimport type { TypedTransaction } from '@ethereumjs/tx';\nimport { TransactionFactory } from '@ethereumjs/tx';\nimport { bufferToHex } from '@ethereumjs/util';\nimport type { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller';\nimport type {\n AcceptResultCallbacks,\n AddApprovalRequest,\n AddResult,\n} from '@metamask/approval-controller';\nimport type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n RestrictedControllerMessenger,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport {\n query,\n ApprovalType,\n ORIGIN_METAMASK,\n convertHexToDecimal,\n isInfuraNetworkType,\n} from '@metamask/controller-utils';\nimport EthQuery from '@metamask/eth-query';\nimport type {\n FetchGasFeeEstimateOptions,\n GasFeeState,\n} from '@metamask/gas-fee-controller';\nimport type {\n BlockTracker,\n NetworkClientId,\n NetworkController,\n NetworkControllerStateChangeEvent,\n NetworkState,\n Provider,\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport { NetworkClientType } from '@metamask/network-controller';\nimport type {\n NonceLock,\n Transaction as NonceTrackerTransaction,\n} from '@metamask/nonce-tracker';\nimport { NonceTracker } from '@metamask/nonce-tracker';\nimport { errorCodes, rpcErrors, providerErrors } from '@metamask/rpc-errors';\nimport type { Hex } from '@metamask/utils';\nimport { add0x } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport { MethodRegistry } from 'eth-method-registry';\nimport { EventEmitter } from 'events';\nimport { cloneDeep, mapValues, merge, pickBy, sortBy, isEqual } from 'lodash';\nimport { v1 as random } from 'uuid';\n\nimport { DefaultGasFeeFlow } from './gas-flows/DefaultGasFeeFlow';\nimport { LineaGasFeeFlow } from './gas-flows/LineaGasFeeFlow';\nimport { OptimismLayer1GasFeeFlow } from './gas-flows/OptimismLayer1GasFeeFlow';\nimport { ScrollLayer1GasFeeFlow } from './gas-flows/ScrollLayer1GasFeeFlow';\nimport { TestGasFeeFlow } from './gas-flows/TestGasFeeFlow';\nimport { EtherscanRemoteTransactionSource } from './helpers/EtherscanRemoteTransactionSource';\nimport { GasFeePoller } from './helpers/GasFeePoller';\nimport type { IncomingTransactionOptions } from './helpers/IncomingTransactionHelper';\nimport { IncomingTransactionHelper } from './helpers/IncomingTransactionHelper';\nimport { MultichainTrackingHelper } from './helpers/MultichainTrackingHelper';\nimport { PendingTransactionTracker } from './helpers/PendingTransactionTracker';\nimport { projectLogger as log } from './logger';\nimport type {\n DappSuggestedGasFees,\n Layer1GasFeeFlow,\n SavedGasFees,\n SecurityProviderRequest,\n SendFlowHistoryEntry,\n TransactionParams,\n TransactionMeta,\n TransactionReceipt,\n WalletDevice,\n SecurityAlertResponse,\n GasFeeFlow,\n SimulationData,\n GasFeeEstimates,\n GasFeeFlowResponse,\n} from './types';\nimport {\n TransactionEnvelopeType,\n TransactionType,\n TransactionStatus,\n SimulationErrorCode,\n} from './types';\nimport { validateConfirmedExternalTransaction } from './utils/external-transactions';\nimport { addGasBuffer, estimateGas, updateGas } from './utils/gas';\nimport { updateGasFees } from './utils/gas-fees';\nimport { getGasFeeFlow } from './utils/gas-flow';\nimport {\n addInitialHistorySnapshot,\n updateTransactionHistory,\n} from './utils/history';\nimport {\n getTransactionLayer1GasFee,\n updateTransactionLayer1GasFee,\n} from './utils/layer1-gas-fee-flow';\nimport {\n getAndFormatTransactionsForNonceTracker,\n getNextNonce,\n} from './utils/nonce';\nimport { getSimulationData } from './utils/simulation';\nimport {\n updatePostTransactionBalance,\n updateSwapsTransaction,\n} from './utils/swaps';\nimport { determineTransactionType } from './utils/transaction-type';\nimport {\n getIncreasedPriceFromExisting,\n normalizeTransactionParams,\n isEIP1559Transaction,\n isFeeMarketEIP1559Values,\n isGasPriceValue,\n validateGasValues,\n validateIfTransactionUnapproved,\n validateMinimumIncrease,\n normalizeTxError,\n normalizeGasFeeValues,\n} from './utils/utils';\nimport {\n validateTransactionOrigin,\n validateTxParams,\n} from './utils/validation';\n\n/**\n * Metadata for the TransactionController state, describing how to \"anonymize\"\n * the state and which parts should be persisted.\n */\nconst metadata = {\n transactions: {\n persist: true,\n anonymous: false,\n },\n methodData: {\n persist: true,\n anonymous: false,\n },\n lastFetchedBlockNumbers: {\n persist: true,\n anonymous: false,\n },\n};\n\nexport const HARDFORK = Hardfork.London;\n\n/**\n * Object with new transaction's meta and a promise resolving to the\n * transaction hash if successful.\n *\n * @property result - Promise resolving to a new transaction hash\n * @property transactionMeta - Meta information about this new transaction\n */\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface Result {\n result: Promise;\n transactionMeta: TransactionMeta;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface GasPriceValue {\n gasPrice: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface FeeMarketEIP1559Values {\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n}\n\n/**\n * Method data registry object\n *\n * @property registryMethod - Registry method raw string\n * @property parsedRegistryMethod - Registry method object, containing name and method arguments\n */\nexport type MethodData = {\n registryMethod: string;\n parsedRegistryMethod:\n | {\n name: string;\n args: { type: string }[];\n }\n | {\n // We're using `any` instead of `undefined` for compatibility with `Json`\n // TODO: Correct this type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n name?: any;\n // We're using `any` instead of `undefined` for compatibility with `Json`\n // TODO: Correct this type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args?: any;\n };\n};\n\n/**\n * Transaction controller state\n *\n * @property transactions - A list of TransactionMeta objects\n * @property methodData - Object containing all known method data information\n * @property lastFetchedBlockNumbers - Last fetched block numbers.\n */\nexport type TransactionControllerState = {\n transactions: TransactionMeta[];\n methodData: Record;\n lastFetchedBlockNumbers: { [key: string]: number };\n};\n\n/**\n * Multiplier used to determine a transaction's increased gas fee during cancellation\n */\nexport const CANCEL_RATE = 1.1;\n\n/**\n * Multiplier used to determine a transaction's increased gas fee during speed up\n */\nexport const SPEED_UP_RATE = 1.1;\n\n/**\n * Represents the `TransactionController:getState` action.\n */\nexport type TransactionControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n TransactionControllerState\n>;\n\n/**\n * The internal actions available to the TransactionController.\n */\nexport type TransactionControllerActions = TransactionControllerGetStateAction;\n\n/**\n * Configuration options for the PendingTransactionTracker\n *\n * @property isResubmitEnabled - Whether transaction publishing is automatically retried.\n */\nexport type PendingTransactionOptions = {\n isResubmitEnabled?: () => boolean;\n};\n\n/**\n * TransactionController constructor options.\n *\n * @property blockTracker - The block tracker used to poll for new blocks data.\n * @property disableHistory - Whether to disable storing history in transaction metadata.\n * @property disableSendFlowHistory - Explicitly disable transaction metadata history.\n * @property disableSwaps - Whether to disable additional processing on swaps transactions.\n * @property getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.\n * @property getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.\n * @property getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.\n * @property getGasFeeEstimates - Callback to retrieve gas fee estimates.\n * @property getNetworkClientRegistry - Gets the network client registry.\n * @property getNetworkState - Gets the state of the network controller.\n * @property getPermittedAccounts - Get accounts that a given origin has permissions for.\n * @property getSavedGasFees - Gets the saved gas fee config.\n * @property getSelectedAddress - Gets the address of the currently selected account.\n * @property incomingTransactions - Configuration options for incoming transaction support.\n * @property isMultichainEnabled - Enable multichain support.\n * @property isSimulationEnabled - Whether new transactions will be automatically simulated.\n * @property messenger - The controller messenger.\n * @property onNetworkStateChange - Allows subscribing to network controller state changes.\n * @property pendingTransactions - Configuration options for pending transaction support.\n * @property provider - The provider used to create the underlying EthQuery instance.\n * @property securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.\n * @property sign - Function used to sign transactions.\n * @property state - Initial state to set on this controller.\n * @property transactionHistoryLimit - Transaction history limit.\n * @property hooks - The controller hooks.\n * @property hooks.afterSign - Additional logic to execute after signing a transaction. Return false to not change the status to signed.\n * @property hooks.beforeApproveOnInit - Additional logic to execute before starting an approval flow for a transaction during initialization. Return false to skip the transaction.\n * @property hooks.beforeCheckPendingTransaction - Additional logic to execute before checking pending transactions. Return false to prevent the broadcast of the transaction.\n * @property hooks.beforePublish - Additional logic to execute before publishing a transaction. Return false to prevent the broadcast of the transaction.\n * @property hooks.getAdditionalSignArguments - Returns additional arguments required to sign a transaction.\n * @property hooks.publish - Alternate logic to publish a transaction.\n */\nexport type TransactionControllerOptions = {\n blockTracker: BlockTracker;\n disableHistory: boolean;\n disableSendFlowHistory: boolean;\n disableSwaps: boolean;\n getCurrentAccountEIP1559Compatibility?: () => Promise;\n getCurrentNetworkEIP1559Compatibility: () => Promise;\n getExternalPendingTransactions?: (\n address: string,\n chainId?: string,\n ) => NonceTrackerTransaction[];\n getGasFeeEstimates?: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];\n getNetworkState: () => NetworkState;\n getPermittedAccounts: (origin?: string) => Promise;\n getSavedGasFees?: (chainId: Hex) => SavedGasFees | undefined;\n incomingTransactions?: IncomingTransactionOptions;\n isMultichainEnabled: boolean;\n isSimulationEnabled?: () => boolean;\n messenger: TransactionControllerMessenger;\n onNetworkStateChange: (listener: (state: NetworkState) => void) => void;\n pendingTransactions?: PendingTransactionOptions;\n provider: Provider;\n securityProviderRequest?: SecurityProviderRequest;\n sign?: (\n transaction: TypedTransaction,\n from: string,\n transactionMeta?: TransactionMeta,\n ) => Promise;\n state?: Partial;\n testGasFeeFlows?: boolean;\n transactionHistoryLimit: number;\n hooks: {\n afterSign?: (\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ) => boolean;\n beforeApproveOnInit?: (transactionMeta: TransactionMeta) => boolean;\n beforeCheckPendingTransaction?: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n beforePublish?: (transactionMeta: TransactionMeta) => boolean;\n getAdditionalSignArguments?: (\n transactionMeta: TransactionMeta,\n ) => (TransactionMeta | undefined)[];\n publish?: (\n transactionMeta: TransactionMeta,\n ) => Promise<{ transactionHash: string }>;\n };\n};\n\n/**\n * The name of the {@link TransactionController}.\n */\nconst controllerName = 'TransactionController';\n\n/**\n * The external actions available to the {@link TransactionController}.\n */\nexport type AllowedActions =\n | AddApprovalRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | AccountsControllerGetSelectedAccountAction;\n\n/**\n * The external events available to the {@link TransactionController}.\n */\nexport type AllowedEvents = NetworkControllerStateChangeEvent;\n\n/**\n * Represents the `TransactionController:stateChange` event.\n */\nexport type TransactionControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n TransactionControllerState\n>;\n\n/**\n * Represents the `TransactionController:incomingTransactionBlockReceived` event.\n */\nexport type TransactionControllerIncomingTransactionBlockReceivedEvent = {\n type: `${typeof controllerName}:incomingTransactionBlockReceived`;\n payload: [blockNumber: number];\n};\n\n/**\n * Represents the `TransactionController:postTransactionBalanceUpdated` event.\n */\nexport type TransactionControllerPostTransactionBalanceUpdatedEvent = {\n type: `${typeof controllerName}:postTransactionBalanceUpdated`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n approvalTransactionMeta?: TransactionMeta;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:speedUpTransactionAdded` event.\n */\nexport type TransactionControllerSpeedupTransactionAddedEvent = {\n type: `${typeof controllerName}:speedupTransactionAdded`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionApproved` event.\n */\nexport type TransactionControllerTransactionApprovedEvent = {\n type: `${typeof controllerName}:transactionApproved`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n actionId?: string;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionConfirmed` event.\n */\nexport type TransactionControllerTransactionConfirmedEvent = {\n type: `${typeof controllerName}:transactionConfirmed`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionDropped` event.\n */\nexport type TransactionControllerTransactionDroppedEvent = {\n type: `${typeof controllerName}:transactionDropped`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionFailed` event.\n */\nexport type TransactionControllerTransactionFailedEvent = {\n type: `${typeof controllerName}:transactionFailed`;\n payload: [\n {\n actionId?: string;\n error: string;\n transactionMeta: TransactionMeta;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionFinished` event.\n */\nexport type TransactionControllerTransactionFinishedEvent = {\n type: `${typeof controllerName}:transactionFinished`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionNewSwapApproval` event.\n */\nexport type TransactionControllerTransactionNewSwapApprovalEvent = {\n type: `${typeof controllerName}:transactionNewSwapApproval`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionNewSwap` event.\n */\nexport type TransactionControllerTransactionNewSwapEvent = {\n type: `${typeof controllerName}:transactionNewSwap`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionNewSwapApproval` event.\n */\nexport type TransactionControllerTransactionNewSwapAndSendEvent = {\n type: `${typeof controllerName}:transactionNewSwapAndSend`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionPublishingSkipped` event.\n */\nexport type TransactionControllerTransactionPublishingSkipped = {\n type: `${typeof controllerName}:transactionPublishingSkipped`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionRejected` event.\n */\nexport type TransactionControllerTransactionRejectedEvent = {\n type: `${typeof controllerName}:transactionRejected`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n actionId?: string;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionStatusUpdated` event.\n */\nexport type TransactionControllerTransactionStatusUpdatedEvent = {\n type: `${typeof controllerName}:transactionStatusUpdated`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionSubmitted` event.\n */\nexport type TransactionControllerTransactionSubmittedEvent = {\n type: `${typeof controllerName}:transactionSubmitted`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n actionId?: string;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:unapprovedTransactionAdded` event.\n */\nexport type TransactionControllerUnapprovedTransactionAddedEvent = {\n type: `${typeof controllerName}:unapprovedTransactionAdded`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * The internal events available to the {@link TransactionController}.\n */\nexport type TransactionControllerEvents =\n | TransactionControllerIncomingTransactionBlockReceivedEvent\n | TransactionControllerPostTransactionBalanceUpdatedEvent\n | TransactionControllerSpeedupTransactionAddedEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerTransactionApprovedEvent\n | TransactionControllerTransactionConfirmedEvent\n | TransactionControllerTransactionDroppedEvent\n | TransactionControllerTransactionFailedEvent\n | TransactionControllerTransactionFinishedEvent\n | TransactionControllerTransactionNewSwapApprovalEvent\n | TransactionControllerTransactionNewSwapEvent\n | TransactionControllerTransactionNewSwapAndSendEvent\n | TransactionControllerTransactionPublishingSkipped\n | TransactionControllerTransactionRejectedEvent\n | TransactionControllerTransactionStatusUpdatedEvent\n | TransactionControllerTransactionSubmittedEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\n/**\n * The messenger of the {@link TransactionController}.\n */\nexport type TransactionControllerMessenger = RestrictedControllerMessenger<\n typeof controllerName,\n TransactionControllerActions | AllowedActions,\n TransactionControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n\n/**\n * Possible states of the approve transaction step.\n */\nexport enum ApprovalState {\n Approved = 'approved',\n NotApproved = 'not-approved',\n SkippedViaBeforePublishHook = 'skipped-via-before-publish-hook',\n}\n\n/**\n * Get the default TransactionsController state.\n *\n * @returns The default TransactionsController state.\n */\nfunction getDefaultTransactionControllerState(): TransactionControllerState {\n return {\n methodData: {},\n transactions: [],\n lastFetchedBlockNumbers: {},\n };\n}\n\n/**\n * Controller responsible for submitting and managing transactions.\n */\nexport class TransactionController extends BaseController<\n typeof controllerName,\n TransactionControllerState,\n TransactionControllerMessenger\n> {\n #internalEvents = new EventEmitter();\n\n private readonly isHistoryDisabled: boolean;\n\n private readonly isSwapsDisabled: boolean;\n\n private readonly isSendFlowHistoryDisabled: boolean;\n\n private readonly approvingTransactionIds: Set = new Set();\n\n private readonly nonceTracker: NonceTracker;\n\n private readonly registry: MethodRegistry;\n\n private readonly mutex = new Mutex();\n\n private readonly gasFeeFlows: GasFeeFlow[];\n\n private readonly getSavedGasFees: (chainId: Hex) => SavedGasFees | undefined;\n\n private readonly getNetworkState: () => NetworkState;\n\n private readonly getCurrentAccountEIP1559Compatibility: () => Promise;\n\n private readonly getCurrentNetworkEIP1559Compatibility: (\n networkClientId?: NetworkClientId,\n ) => Promise;\n\n private readonly getGasFeeEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n\n private readonly getPermittedAccounts: (origin?: string) => Promise;\n\n private readonly getExternalPendingTransactions: (\n address: string,\n chainId?: string,\n ) => NonceTrackerTransaction[];\n\n private readonly layer1GasFeeFlows: Layer1GasFeeFlow[];\n\n readonly #incomingTransactionOptions: IncomingTransactionOptions;\n\n private readonly incomingTransactionHelper: IncomingTransactionHelper;\n\n private readonly securityProviderRequest?: SecurityProviderRequest;\n\n readonly #pendingTransactionOptions: PendingTransactionOptions;\n\n private readonly pendingTransactionTracker: PendingTransactionTracker;\n\n private readonly signAbortCallbacks: Map void> = new Map();\n\n #transactionHistoryLimit: number;\n\n #isSimulationEnabled: () => boolean;\n\n #testGasFeeFlows: boolean;\n\n private readonly afterSign: (\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ) => boolean;\n\n private readonly beforeApproveOnInit: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n\n private readonly beforeCheckPendingTransaction: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n\n private readonly beforePublish: (transactionMeta: TransactionMeta) => boolean;\n\n private readonly publish: (\n transactionMeta: TransactionMeta,\n rawTx: string,\n ) => Promise<{ transactionHash?: string }>;\n\n private readonly getAdditionalSignArguments: (\n transactionMeta: TransactionMeta,\n ) => (TransactionMeta | undefined)[];\n\n private failTransaction(\n transactionMeta: TransactionMeta,\n error: Error,\n actionId?: string,\n ) {\n const newTransactionMeta = merge({}, transactionMeta, {\n error: normalizeTxError(error),\n status: TransactionStatus.failed as const,\n });\n this.messagingSystem.publish(`${controllerName}:transactionFailed`, {\n actionId,\n error: error.message,\n transactionMeta: newTransactionMeta,\n });\n this.updateTransaction(\n newTransactionMeta,\n 'TransactionController#failTransaction - Add error message and set status to failed',\n );\n this.onTransactionStatusChange(newTransactionMeta);\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n newTransactionMeta,\n );\n this.#internalEvents.emit(\n `${transactionMeta.id}:finished`,\n newTransactionMeta,\n );\n }\n\n private async registryLookup(fourBytePrefix: string): Promise {\n const registryMethod = await this.registry.lookup(fourBytePrefix);\n if (!registryMethod) {\n return {\n registryMethod: '',\n parsedRegistryMethod: { name: undefined, args: undefined },\n };\n }\n const parsedRegistryMethod = this.registry.parse(registryMethod);\n return { registryMethod, parsedRegistryMethod };\n }\n\n #multichainTrackingHelper: MultichainTrackingHelper;\n\n /**\n * Method used to sign transactions\n */\n sign?: (\n transaction: TypedTransaction,\n from: string,\n transactionMeta?: TransactionMeta,\n ) => Promise;\n\n /**\n * Constructs a TransactionController.\n *\n * @param options - The controller options.\n * @param options.blockTracker - The block tracker used to poll for new blocks data.\n * @param options.disableHistory - Whether to disable storing history in transaction metadata.\n * @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.\n * @param options.disableSwaps - Whether to disable additional processing on swaps transactions.\n * @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.\n * @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.\n * @param options.getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.\n * @param options.getGasFeeEstimates - Callback to retrieve gas fee estimates.\n * @param options.getNetworkClientRegistry - Gets the network client registry.\n * @param options.getNetworkState - Gets the state of the network controller.\n * @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.\n * @param options.getSavedGasFees - Gets the saved gas fee config.\n * @param options.incomingTransactions - Configuration options for incoming transaction support.\n * @param options.isMultichainEnabled - Enable multichain support.\n * @param options.isSimulationEnabled - Whether new transactions will be automatically simulated.\n * @param options.messenger - The controller messenger.\n * @param options.onNetworkStateChange - Allows subscribing to network controller state changes.\n * @param options.pendingTransactions - Configuration options for pending transaction support.\n * @param options.provider - The provider used to create the underlying EthQuery instance.\n * @param options.securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.\n * @param options.sign - Function used to sign transactions.\n * @param options.state - Initial state to set on this controller.\n * @param options.testGasFeeFlows - Whether to use the test gas fee flow.\n * @param options.transactionHistoryLimit - Transaction history limit.\n * @param options.hooks - The controller hooks.\n */\n constructor({\n blockTracker,\n disableHistory,\n disableSendFlowHistory,\n disableSwaps,\n getCurrentAccountEIP1559Compatibility,\n getCurrentNetworkEIP1559Compatibility,\n getExternalPendingTransactions,\n getGasFeeEstimates,\n getNetworkClientRegistry,\n getNetworkState,\n getPermittedAccounts,\n getSavedGasFees,\n incomingTransactions = {},\n isMultichainEnabled = false,\n isSimulationEnabled,\n messenger,\n onNetworkStateChange,\n pendingTransactions = {},\n provider,\n securityProviderRequest,\n sign,\n state,\n testGasFeeFlows,\n transactionHistoryLimit = 40,\n hooks,\n }: TransactionControllerOptions) {\n super({\n name: controllerName,\n metadata,\n messenger,\n state: {\n ...getDefaultTransactionControllerState(),\n ...state,\n },\n });\n\n this.messagingSystem = messenger;\n this.getNetworkState = getNetworkState;\n this.isSendFlowHistoryDisabled = disableSendFlowHistory ?? false;\n this.isHistoryDisabled = disableHistory ?? false;\n this.isSwapsDisabled = disableSwaps ?? false;\n this.#isSimulationEnabled = isSimulationEnabled ?? (() => true);\n // @ts-expect-error the type in eth-method-registry is inappropriate and should be changed\n this.registry = new MethodRegistry({ provider });\n this.getSavedGasFees = getSavedGasFees ?? ((_chainId) => undefined);\n this.getCurrentAccountEIP1559Compatibility =\n getCurrentAccountEIP1559Compatibility ?? (() => Promise.resolve(true));\n this.getCurrentNetworkEIP1559Compatibility =\n getCurrentNetworkEIP1559Compatibility;\n this.getGasFeeEstimates =\n getGasFeeEstimates || (() => Promise.resolve({} as GasFeeState));\n this.getPermittedAccounts = getPermittedAccounts;\n this.getExternalPendingTransactions =\n getExternalPendingTransactions ?? (() => []);\n this.securityProviderRequest = securityProviderRequest;\n this.#incomingTransactionOptions = incomingTransactions;\n this.#pendingTransactionOptions = pendingTransactions;\n this.#transactionHistoryLimit = transactionHistoryLimit;\n this.sign = sign;\n this.#testGasFeeFlows = testGasFeeFlows === true;\n\n this.afterSign = hooks?.afterSign ?? (() => true);\n this.beforeApproveOnInit = hooks?.beforeApproveOnInit ?? (() => true);\n this.beforeCheckPendingTransaction =\n hooks?.beforeCheckPendingTransaction ??\n /* istanbul ignore next */\n (() => true);\n this.beforePublish = hooks?.beforePublish ?? (() => true);\n this.getAdditionalSignArguments =\n hooks?.getAdditionalSignArguments ?? (() => []);\n this.publish =\n hooks?.publish ?? (() => Promise.resolve({ transactionHash: undefined }));\n\n this.nonceTracker = this.#createNonceTracker({\n provider,\n blockTracker,\n });\n\n const findNetworkClientIdByChainId = (chainId: Hex) => {\n return this.messagingSystem.call(\n `NetworkController:findNetworkClientIdByChainId`,\n chainId,\n );\n };\n\n this.#multichainTrackingHelper = new MultichainTrackingHelper({\n isMultichainEnabled,\n provider,\n nonceTracker: this.nonceTracker,\n incomingTransactionOptions: incomingTransactions,\n findNetworkClientIdByChainId,\n getNetworkClientById: ((networkClientId: NetworkClientId) => {\n return this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n networkClientId,\n );\n }) as NetworkController['getNetworkClientById'],\n getNetworkClientRegistry,\n removeIncomingTransactionHelperListeners:\n this.#removeIncomingTransactionHelperListeners.bind(this),\n removePendingTransactionTrackerListeners:\n this.#removePendingTransactionTrackerListeners.bind(this),\n createNonceTracker: this.#createNonceTracker.bind(this),\n createIncomingTransactionHelper:\n this.#createIncomingTransactionHelper.bind(this),\n createPendingTransactionTracker:\n this.#createPendingTransactionTracker.bind(this),\n onNetworkStateChange: (listener) => {\n this.messagingSystem.subscribe(\n 'NetworkController:stateChange',\n listener,\n );\n },\n });\n this.#multichainTrackingHelper.initialize();\n\n const etherscanRemoteTransactionSource =\n new EtherscanRemoteTransactionSource({\n includeTokenTransfers: incomingTransactions.includeTokenTransfers,\n });\n\n this.incomingTransactionHelper = this.#createIncomingTransactionHelper({\n blockTracker,\n etherscanRemoteTransactionSource,\n });\n\n this.pendingTransactionTracker = this.#createPendingTransactionTracker({\n provider,\n blockTracker,\n });\n\n this.gasFeeFlows = this.#getGasFeeFlows();\n this.layer1GasFeeFlows = this.#getLayer1GasFeeFlows();\n\n const gasFeePoller = new GasFeePoller({\n findNetworkClientIdByChainId,\n gasFeeFlows: this.gasFeeFlows,\n getGasFeeControllerEstimates: this.getGasFeeEstimates,\n getProvider: (chainId, networkClientId) =>\n this.#multichainTrackingHelper.getProvider({\n networkClientId,\n chainId,\n }),\n getTransactions: () => this.state.transactions,\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n onStateChange: (listener) => {\n this.messagingSystem.subscribe(\n 'TransactionController:stateChange',\n listener,\n );\n },\n });\n\n gasFeePoller.hub.on(\n 'transaction-updated',\n this.#onGasFeePollerTransactionUpdate.bind(this),\n );\n\n // when transactionsController state changes\n // check for pending transactions and start polling if there are any\n this.messagingSystem.subscribe(\n 'TransactionController:stateChange',\n this.#checkForPendingTransactionAndStartPolling,\n );\n\n // TODO once v2 is merged make sure this only runs when\n // selectedNetworkClientId changes\n onNetworkStateChange(() => {\n log('Detected network change', this.getChainId());\n this.pendingTransactionTracker.startIfPendingTransactions();\n this.onBootCleanup();\n });\n\n this.onBootCleanup();\n this.#checkForPendingTransactionAndStartPolling();\n }\n\n /**\n * Stops polling and removes listeners to prepare the controller for garbage collection.\n */\n destroy() {\n this.#stopAllTracking();\n }\n\n /**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @returns The method data object corresponding to the given signature prefix.\n */\n async handleMethodData(fourBytePrefix: string): Promise {\n const releaseLock = await this.mutex.acquire();\n try {\n const { methodData } = this.state;\n const knownMethod = Object.keys(methodData).find(\n (knownFourBytePrefix) => fourBytePrefix === knownFourBytePrefix,\n );\n if (knownMethod) {\n return methodData[fourBytePrefix];\n }\n const registry = await this.registryLookup(fourBytePrefix);\n this.update((state) => {\n state.methodData[fourBytePrefix] = registry;\n });\n return registry;\n } finally {\n releaseLock();\n }\n }\n\n /**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction id will be generated, and gas and gasPrice will be calculated\n * if not provided. If A `:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param opts - Additional options to control how the transaction is added.\n * @param opts.actionId - Unique ID to prevent duplicate requests.\n * @param opts.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.\n * @param opts.method - RPC method that requested the transaction.\n * @param opts.origin - The origin of the transaction request, such as a dApp hostname.\n * @param opts.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.\n * @param opts.securityAlertResponse - Response from security validator.\n * @param opts.sendFlowHistory - The sendFlowHistory entries to add.\n * @param opts.type - Type of transaction to add, such as 'cancel' or 'swap'.\n * @param opts.swaps - Options for swaps transactions.\n * @param opts.swaps.hasApproveTx - Whether the transaction has an approval transaction.\n * @param opts.swaps.meta - Metadata for swap transaction.\n * @param opts.networkClientId - The id of the network client for this transaction.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\n async addTransaction(\n txParams: TransactionParams,\n {\n actionId,\n deviceConfirmedOn,\n method,\n origin,\n requireApproval,\n securityAlertResponse,\n sendFlowHistory,\n swaps = {},\n type,\n networkClientId: requestNetworkClientId,\n }: {\n actionId?: string;\n deviceConfirmedOn?: WalletDevice;\n method?: string;\n origin?: string;\n requireApproval?: boolean | undefined;\n securityAlertResponse?: SecurityAlertResponse;\n sendFlowHistory?: SendFlowHistoryEntry[];\n swaps?: {\n hasApproveTx?: boolean;\n meta?: Partial;\n };\n type?: TransactionType;\n networkClientId?: NetworkClientId;\n } = {},\n ): Promise {\n log('Adding transaction', txParams);\n\n txParams = normalizeTransactionParams(txParams);\n if (\n requestNetworkClientId &&\n !this.#multichainTrackingHelper.has(requestNetworkClientId)\n ) {\n throw new Error(\n 'The networkClientId for this transaction could not be found',\n );\n }\n\n const networkClientId =\n requestNetworkClientId ?? this.#getGlobalNetworkClientId();\n\n const isEIP1559Compatible = await this.getEIP1559Compatibility(\n networkClientId,\n );\n\n validateTxParams(txParams, isEIP1559Compatible);\n\n if (origin) {\n await validateTransactionOrigin(\n await this.getPermittedAccounts(origin),\n this.#getSelectedAccount().address,\n txParams.from,\n origin,\n );\n }\n\n const dappSuggestedGasFees = this.generateDappSuggestedGasFees(\n txParams,\n origin,\n );\n\n const chainId = this.getChainId(networkClientId);\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n chainId,\n });\n\n const transactionType =\n type ?? (await determineTransactionType(txParams, ethQuery)).type;\n\n const existingTransactionMeta = this.getTransactionWithActionId(actionId);\n\n // If a request to add a transaction with the same actionId is submitted again, a new transaction will not be created for it.\n let addedTransactionMeta = existingTransactionMeta\n ? cloneDeep(existingTransactionMeta)\n : {\n // Add actionId to txMeta to check if same actionId is seen again\n actionId,\n chainId,\n dappSuggestedGasFees,\n deviceConfirmedOn,\n id: random(),\n origin,\n securityAlertResponse,\n status: TransactionStatus.unapproved as const,\n time: Date.now(),\n txParams,\n userEditedGasLimit: false,\n verifiedOnBlockchain: false,\n type: transactionType,\n networkClientId,\n };\n\n await this.updateGasProperties(addedTransactionMeta);\n\n // Checks if a transaction already exists with a given actionId\n if (!existingTransactionMeta) {\n // Set security provider response\n if (method && this.securityProviderRequest) {\n const securityProviderResponse = await this.securityProviderRequest(\n addedTransactionMeta,\n method,\n );\n addedTransactionMeta.securityProviderResponse =\n securityProviderResponse;\n }\n\n if (!this.isSendFlowHistoryDisabled) {\n addedTransactionMeta.sendFlowHistory = sendFlowHistory ?? [];\n }\n // Initial history push\n if (!this.isHistoryDisabled) {\n addedTransactionMeta = addInitialHistorySnapshot(addedTransactionMeta);\n }\n\n addedTransactionMeta = updateSwapsTransaction(\n addedTransactionMeta,\n transactionType,\n swaps,\n {\n isSwapsDisabled: this.isSwapsDisabled,\n cancelTransaction: this.cancelTransaction.bind(this),\n messenger: this.messagingSystem,\n },\n );\n\n this.addMetadata(addedTransactionMeta);\n\n if (requireApproval !== false) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#updateSimulationData(addedTransactionMeta);\n } else {\n log('Skipping simulation as approval not required');\n }\n\n this.messagingSystem.publish(\n `${controllerName}:unapprovedTransactionAdded`,\n addedTransactionMeta,\n );\n }\n\n return {\n result: this.processApproval(addedTransactionMeta, {\n isExisting: Boolean(existingTransactionMeta),\n requireApproval,\n actionId,\n }),\n transactionMeta: addedTransactionMeta,\n };\n }\n\n startIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n if (networkClientIds.length === 0) {\n this.incomingTransactionHelper.start();\n return;\n }\n this.#multichainTrackingHelper.startIncomingTransactionPolling(\n networkClientIds,\n );\n }\n\n stopIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n if (networkClientIds.length === 0) {\n this.incomingTransactionHelper.stop();\n return;\n }\n this.#multichainTrackingHelper.stopIncomingTransactionPolling(\n networkClientIds,\n );\n }\n\n stopAllIncomingTransactionPolling() {\n this.incomingTransactionHelper.stop();\n this.#multichainTrackingHelper.stopAllIncomingTransactionPolling();\n }\n\n async updateIncomingTransactions(networkClientIds: NetworkClientId[] = []) {\n if (networkClientIds.length === 0) {\n await this.incomingTransactionHelper.update();\n return;\n }\n await this.#multichainTrackingHelper.updateIncomingTransactions(\n networkClientIds,\n );\n }\n\n /**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\n async stopTransaction(\n transactionId: string,\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n {\n estimatedBaseFee,\n actionId,\n }: { estimatedBaseFee?: string; actionId?: string } = {},\n ) {\n // If transaction is found for same action id, do not create a cancel transaction.\n if (this.getTransactionWithActionId(actionId)) {\n return;\n }\n\n if (gasValues) {\n // Not good practice to reassign a parameter but temporarily avoiding a larger refactor.\n gasValues = normalizeGasFeeValues(gasValues);\n validateGasValues(gasValues);\n }\n\n log('Creating cancel transaction', transactionId, gasValues);\n\n const transactionMeta = this.getTransaction(transactionId);\n if (!transactionMeta) {\n return;\n }\n\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n // gasPrice (legacy non EIP1559)\n const minGasPrice = getIncreasedPriceFromExisting(\n transactionMeta.txParams.gasPrice,\n CANCEL_RATE,\n );\n\n const gasPriceFromValues = isGasPriceValue(gasValues) && gasValues.gasPrice;\n\n const newGasPrice =\n (gasPriceFromValues &&\n validateMinimumIncrease(gasPriceFromValues, minGasPrice)) ||\n minGasPrice;\n\n // maxFeePerGas (EIP1559)\n const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;\n const minMaxFeePerGas = getIncreasedPriceFromExisting(\n existingMaxFeePerGas,\n CANCEL_RATE,\n );\n const maxFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxFeePerGas;\n const newMaxFeePerGas =\n (maxFeePerGasValues &&\n validateMinimumIncrease(maxFeePerGasValues, minMaxFeePerGas)) ||\n (existingMaxFeePerGas && minMaxFeePerGas);\n\n // maxPriorityFeePerGas (EIP1559)\n const existingMaxPriorityFeePerGas =\n transactionMeta.txParams?.maxPriorityFeePerGas;\n const minMaxPriorityFeePerGas = getIncreasedPriceFromExisting(\n existingMaxPriorityFeePerGas,\n CANCEL_RATE,\n );\n const maxPriorityFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxPriorityFeePerGas;\n const newMaxPriorityFeePerGas =\n (maxPriorityFeePerGasValues &&\n validateMinimumIncrease(\n maxPriorityFeePerGasValues,\n minMaxPriorityFeePerGas,\n )) ||\n (existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas);\n\n const newTxParams: TransactionParams =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n from: transactionMeta.txParams.from,\n gasLimit: transactionMeta.txParams.gas,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n type: TransactionEnvelopeType.feeMarket,\n nonce: transactionMeta.txParams.nonce,\n to: transactionMeta.txParams.from,\n value: '0x0',\n }\n : {\n from: transactionMeta.txParams.from,\n gasLimit: transactionMeta.txParams.gas,\n gasPrice: newGasPrice,\n nonce: transactionMeta.txParams.nonce,\n to: transactionMeta.txParams.from,\n value: '0x0',\n };\n\n const unsignedEthTx = this.prepareUnsignedEthTx(\n transactionMeta.chainId,\n newTxParams,\n );\n\n const signedTx = await this.sign(\n unsignedEthTx,\n transactionMeta.txParams.from,\n );\n\n const rawTx = bufferToHex(signedTx.serialize());\n\n const newFee = newTxParams.maxFeePerGas ?? newTxParams.gasPrice;\n\n const oldFee = newTxParams.maxFeePerGas\n ? transactionMeta.txParams.maxFeePerGas\n : transactionMeta.txParams.gasPrice;\n\n log('Submitting cancel transaction', {\n oldFee,\n newFee,\n txParams: newTxParams,\n });\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n const hash = await this.publishTransactionForRetry(\n ethQuery,\n rawTx,\n transactionMeta,\n );\n\n const cancelTransactionMeta = {\n actionId,\n chainId: transactionMeta.chainId,\n networkClientId: transactionMeta.networkClientId,\n estimatedBaseFee,\n hash,\n id: random(),\n originalGasEstimate: transactionMeta.txParams.gas,\n status: TransactionStatus.submitted as const,\n time: Date.now(),\n type: TransactionType.cancel as const,\n txParams: newTxParams,\n };\n\n this.addMetadata(cancelTransactionMeta);\n\n // stopTransaction has no approval request, so we assume the user has already approved the transaction\n this.messagingSystem.publish(`${controllerName}:transactionApproved`, {\n transactionMeta: cancelTransactionMeta,\n actionId,\n });\n this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {\n transactionMeta: cancelTransactionMeta,\n actionId,\n });\n\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n cancelTransactionMeta,\n );\n this.#internalEvents.emit(\n `${transactionMeta.id}:finished`,\n cancelTransactionMeta,\n );\n }\n\n /**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\n async speedUpTransaction(\n transactionId: string,\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n {\n actionId,\n estimatedBaseFee,\n }: { actionId?: string; estimatedBaseFee?: string } = {},\n ) {\n // If transaction is found for same action id, do not create a new speed up transaction.\n if (this.getTransactionWithActionId(actionId)) {\n return;\n }\n\n if (gasValues) {\n // Not good practice to reassign a parameter but temporarily avoiding a larger refactor.\n gasValues = normalizeGasFeeValues(gasValues);\n validateGasValues(gasValues);\n }\n\n log('Creating speed up transaction', transactionId, gasValues);\n\n const transactionMeta = this.getTransaction(transactionId);\n /* istanbul ignore next */\n if (!transactionMeta) {\n return;\n }\n\n /* istanbul ignore next */\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n // gasPrice (legacy non EIP1559)\n const minGasPrice = getIncreasedPriceFromExisting(\n transactionMeta.txParams.gasPrice,\n SPEED_UP_RATE,\n );\n\n const gasPriceFromValues = isGasPriceValue(gasValues) && gasValues.gasPrice;\n\n const newGasPrice =\n (gasPriceFromValues &&\n validateMinimumIncrease(gasPriceFromValues, minGasPrice)) ||\n minGasPrice;\n\n // maxFeePerGas (EIP1559)\n const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;\n const minMaxFeePerGas = getIncreasedPriceFromExisting(\n existingMaxFeePerGas,\n SPEED_UP_RATE,\n );\n const maxFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxFeePerGas;\n const newMaxFeePerGas =\n (maxFeePerGasValues &&\n validateMinimumIncrease(maxFeePerGasValues, minMaxFeePerGas)) ||\n (existingMaxFeePerGas && minMaxFeePerGas);\n\n // maxPriorityFeePerGas (EIP1559)\n const existingMaxPriorityFeePerGas =\n transactionMeta.txParams?.maxPriorityFeePerGas;\n const minMaxPriorityFeePerGas = getIncreasedPriceFromExisting(\n existingMaxPriorityFeePerGas,\n SPEED_UP_RATE,\n );\n const maxPriorityFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxPriorityFeePerGas;\n const newMaxPriorityFeePerGas =\n (maxPriorityFeePerGasValues &&\n validateMinimumIncrease(\n maxPriorityFeePerGasValues,\n minMaxPriorityFeePerGas,\n )) ||\n (existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas);\n\n const txParams: TransactionParams =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n type: TransactionEnvelopeType.feeMarket,\n }\n : {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n gasPrice: newGasPrice,\n };\n\n const unsignedEthTx = this.prepareUnsignedEthTx(\n transactionMeta.chainId,\n txParams,\n );\n\n const signedTx = await this.sign(\n unsignedEthTx,\n transactionMeta.txParams.from,\n );\n\n const transactionMetaWithRsv = this.updateTransactionMetaRSV(\n transactionMeta,\n signedTx,\n );\n const rawTx = bufferToHex(signedTx.serialize());\n\n const newFee = txParams.maxFeePerGas ?? txParams.gasPrice;\n\n const oldFee = txParams.maxFeePerGas\n ? transactionMetaWithRsv.txParams.maxFeePerGas\n : transactionMetaWithRsv.txParams.gasPrice;\n\n log('Submitting speed up transaction', { oldFee, newFee, txParams });\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n const hash = await this.publishTransactionForRetry(\n ethQuery,\n rawTx,\n transactionMeta,\n );\n\n const baseTransactionMeta = {\n ...transactionMetaWithRsv,\n estimatedBaseFee,\n id: random(),\n time: Date.now(),\n hash,\n actionId,\n originalGasEstimate: transactionMeta.txParams.gas,\n type: TransactionType.retry as const,\n originalType: transactionMeta.type,\n };\n\n const newTransactionMeta =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n ...baseTransactionMeta,\n txParams: {\n ...transactionMeta.txParams,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n },\n }\n : {\n ...baseTransactionMeta,\n txParams: {\n ...transactionMeta.txParams,\n gasPrice: newGasPrice,\n },\n };\n\n this.addMetadata(newTransactionMeta);\n\n // speedUpTransaction has no approval request, so we assume the user has already approved the transaction\n this.messagingSystem.publish(`${controllerName}:transactionApproved`, {\n transactionMeta: newTransactionMeta,\n actionId,\n });\n\n this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {\n transactionMeta: newTransactionMeta,\n actionId,\n });\n\n this.messagingSystem.publish(\n `${controllerName}:speedupTransactionAdded`,\n newTransactionMeta,\n );\n }\n\n /**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @param networkClientId - The network client id to use for the estimate.\n * @returns The gas and gas price.\n */\n async estimateGas(\n transaction: TransactionParams,\n networkClientId?: NetworkClientId,\n ) {\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n });\n const { estimatedGas, simulationFails } = await estimateGas(\n transaction,\n ethQuery,\n );\n\n return { gas: estimatedGas, simulationFails };\n }\n\n /**\n * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.\n *\n * @param transaction - The transaction params to estimate gas for.\n * @param multiplier - The multiplier to use for the gas buffer.\n * @param networkClientId - The network client id to use for the estimate.\n */\n async estimateGasBuffered(\n transaction: TransactionParams,\n multiplier: number,\n networkClientId?: NetworkClientId,\n ) {\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n });\n const { blockGasLimit, estimatedGas, simulationFails } = await estimateGas(\n transaction,\n ethQuery,\n );\n\n const gas = addGasBuffer(estimatedGas, blockGasLimit, multiplier);\n\n return {\n gas,\n simulationFails,\n };\n }\n\n /**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to include in the transaction history.\n */\n updateTransaction(transactionMeta: TransactionMeta, note: string) {\n const { id: transactionId } = transactionMeta;\n\n this.#updateTransactionInternal({ transactionId, note }, () => ({\n ...transactionMeta,\n }));\n }\n\n /**\n * Update the security alert response for a transaction.\n *\n * @param transactionId - ID of the transaction.\n * @param securityAlertResponse - The new security alert response for the transaction.\n */\n updateSecurityAlertResponse(\n transactionId: string,\n securityAlertResponse: SecurityAlertResponse,\n ) {\n if (!securityAlertResponse) {\n throw new Error(\n 'updateSecurityAlertResponse: securityAlertResponse should not be null',\n );\n }\n const transactionMeta = this.getTransaction(transactionId);\n if (!transactionMeta) {\n throw new Error(\n `Cannot update security alert response as no transaction metadata found`,\n );\n }\n const updatedTransactionMeta = {\n ...transactionMeta,\n securityAlertResponse,\n };\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:updatesecurityAlertResponse - securityAlertResponse updated`,\n );\n }\n\n /**\n * Removes all transactions from state, optionally based on the current network.\n *\n * @param ignoreNetwork - Determines whether to wipe all transactions, or just those on the\n * current network. If `true`, all transactions are wiped.\n * @param address - If specified, only transactions originating from this address will be\n * wiped on current network.\n */\n wipeTransactions(ignoreNetwork?: boolean, address?: string) {\n /* istanbul ignore next */\n if (ignoreNetwork && !address) {\n this.update((state) => {\n state.transactions = [];\n });\n return;\n }\n const currentChainId = this.getChainId();\n const newTransactions = this.state.transactions.filter(\n ({ chainId, txParams }) => {\n const isMatchingNetwork = ignoreNetwork || chainId === currentChainId;\n\n if (!isMatchingNetwork) {\n return true;\n }\n\n const isMatchingAddress =\n !address || txParams.from?.toLowerCase() === address.toLowerCase();\n\n return !isMatchingAddress;\n },\n );\n\n this.update((state) => {\n state.transactions = this.trimTransactionsForState(newTransactions);\n });\n }\n\n /**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\n async confirmExternalTransaction(\n transactionMeta: TransactionMeta,\n transactionReceipt: TransactionReceipt,\n baseFeePerGas: Hex,\n ) {\n // Run validation and add external transaction to state.\n const newTransactionMeta = this.addExternalTransaction(transactionMeta);\n\n try {\n const transactionId = newTransactionMeta.id;\n\n // Make sure status is confirmed and define gasUsed as in receipt.\n const updatedTransactionMeta = {\n ...newTransactionMeta,\n status: TransactionStatus.confirmed as const,\n txReceipt: transactionReceipt,\n };\n if (baseFeePerGas) {\n updatedTransactionMeta.baseFeePerGas = baseFeePerGas;\n }\n\n // Update same nonce local transactions as dropped and define replacedBy properties.\n this.markNonceDuplicatesDropped(transactionId);\n\n // Update external provided transaction with updated gas values and confirmed status.\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:confirmExternalTransaction - Add external transaction`,\n );\n this.onTransactionStatusChange(updatedTransactionMeta);\n\n // Intentional given potential duration of process.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updatePostBalance(updatedTransactionMeta);\n\n this.messagingSystem.publish(\n `${controllerName}:transactionConfirmed`,\n updatedTransactionMeta,\n );\n } catch (error) {\n console.error('Failed to confirm external transaction', error);\n }\n }\n\n /**\n * Append new send flow history to a transaction.\n *\n * @param transactionID - The ID of the transaction to update.\n * @param currentSendFlowHistoryLength - The length of the current sendFlowHistory array.\n * @param sendFlowHistoryToAdd - The sendFlowHistory entries to add.\n * @returns The updated transactionMeta.\n */\n updateTransactionSendFlowHistory(\n transactionID: string,\n currentSendFlowHistoryLength: number,\n sendFlowHistoryToAdd: SendFlowHistoryEntry[],\n ): TransactionMeta {\n if (this.isSendFlowHistoryDisabled) {\n throw new Error(\n 'Send flow history is disabled for the current transaction controller',\n );\n }\n\n const transactionMeta = this.getTransaction(transactionID);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update send flow history as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateTransactionSendFlowHistory',\n );\n\n const sendFlowHistory = transactionMeta.sendFlowHistory ?? [];\n if (currentSendFlowHistoryLength === sendFlowHistory.length) {\n const updatedTransactionMeta = {\n ...transactionMeta,\n sendFlowHistory: [...sendFlowHistory, ...sendFlowHistoryToAdd],\n };\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:updateTransactionSendFlowHistory - sendFlowHistory updated`,\n );\n }\n\n return this.getTransaction(transactionID) as TransactionMeta;\n }\n\n /**\n * Update the gas values of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param gasValues - Gas values to update.\n * @param gasValues.gas - Same as transaction.gasLimit.\n * @param gasValues.gasLimit - Maxmimum number of units of gas to use for this transaction.\n * @param gasValues.gasPrice - Price per gas for legacy transactions.\n * @param gasValues.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param gasValues.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param gasValues.estimateUsed - Which estimate level was used.\n * @param gasValues.estimateSuggested - Which estimate level that the API suggested.\n * @param gasValues.defaultGasEstimates - The default estimate for gas.\n * @param gasValues.originalGasEstimate - Original estimate for gas.\n * @param gasValues.userEditedGasLimit - The gas limit supplied by user.\n * @param gasValues.userFeeLevel - Estimate level user selected.\n * @returns The updated transactionMeta.\n */\n updateTransactionGasFees(\n transactionId: string,\n {\n defaultGasEstimates,\n estimateUsed,\n estimateSuggested,\n gas,\n gasLimit,\n gasPrice,\n maxPriorityFeePerGas,\n maxFeePerGas,\n originalGasEstimate,\n userEditedGasLimit,\n userFeeLevel,\n }: {\n defaultGasEstimates?: string;\n estimateUsed?: string;\n estimateSuggested?: string;\n gas?: string;\n gasLimit?: string;\n gasPrice?: string;\n maxPriorityFeePerGas?: string;\n maxFeePerGas?: string;\n originalGasEstimate?: string;\n userEditedGasLimit?: boolean;\n userFeeLevel?: string;\n },\n ): TransactionMeta {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update transaction as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateTransactionGasFees',\n );\n\n let transactionGasFees = {\n txParams: {\n gas,\n gasLimit,\n gasPrice,\n maxPriorityFeePerGas,\n maxFeePerGas,\n },\n defaultGasEstimates,\n estimateUsed,\n estimateSuggested,\n originalGasEstimate,\n userEditedGasLimit,\n userFeeLevel,\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any;\n\n // only update what is defined\n transactionGasFees.txParams = pickBy(transactionGasFees.txParams);\n transactionGasFees = pickBy(transactionGasFees);\n\n // merge updated gas values with existing transaction meta\n const updatedMeta = merge({}, transactionMeta, transactionGasFees);\n\n this.updateTransaction(\n updatedMeta,\n `${controllerName}:updateTransactionGasFees - gas values updated`,\n );\n\n return this.getTransaction(transactionId) as TransactionMeta;\n }\n\n /**\n * Update the previous gas values of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param previousGas - Previous gas values to update.\n * @param previousGas.gasLimit - Maxmimum number of units of gas to use for this transaction.\n * @param previousGas.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param previousGas.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @returns The updated transactionMeta.\n */\n updatePreviousGasParams(\n transactionId: string,\n {\n gasLimit,\n maxFeePerGas,\n maxPriorityFeePerGas,\n }: {\n gasLimit?: string;\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n },\n ): TransactionMeta {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update transaction as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(transactionMeta, 'updatePreviousGasParams');\n\n const transactionPreviousGas = {\n previousGas: {\n gasLimit,\n maxFeePerGas,\n maxPriorityFeePerGas,\n },\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any;\n\n // only update what is defined\n transactionPreviousGas.previousGas = pickBy(\n transactionPreviousGas.previousGas,\n );\n\n // merge updated previous gas values with existing transaction meta\n const updatedMeta = merge({}, transactionMeta, transactionPreviousGas);\n\n this.updateTransaction(\n updatedMeta,\n `${controllerName}:updatePreviousGasParams - Previous gas values updated`,\n );\n\n return this.getTransaction(transactionId) as TransactionMeta;\n }\n\n async getNonceLock(\n address: string,\n networkClientId?: NetworkClientId,\n ): Promise {\n return this.#multichainTrackingHelper.getNonceLock(\n address,\n networkClientId,\n );\n }\n\n /**\n * Updates the editable parameters of a transaction.\n *\n * @param txId - The ID of the transaction to update.\n * @param params - The editable parameters to update.\n * @param params.data - Data to pass with the transaction.\n * @param params.gas - Maximum number of units of gas to use for the transaction.\n * @param params.gasPrice - Price per gas for legacy transactions.\n * @param params.from - Address to send the transaction from.\n * @param params.to - Address to send the transaction to.\n * @param params.value - Value associated with the transaction.\n * @returns The updated transaction metadata.\n */\n async updateEditableParams(\n txId: string,\n {\n data,\n gas,\n gasPrice,\n from,\n to,\n value,\n }: {\n data?: string;\n gas?: string;\n gasPrice?: string;\n from?: string;\n to?: string;\n value?: string;\n },\n ) {\n const transactionMeta = this.getTransaction(txId);\n if (!transactionMeta) {\n throw new Error(\n `Cannot update editable params as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(transactionMeta, 'updateEditableParams');\n\n const editableParams = {\n txParams: {\n data,\n from,\n to,\n value,\n gas,\n gasPrice,\n },\n } as Partial;\n\n editableParams.txParams = pickBy(\n editableParams.txParams,\n ) as TransactionParams;\n\n const updatedTransaction = merge({}, transactionMeta, editableParams);\n const provider = this.#multichainTrackingHelper.getProvider({\n chainId: transactionMeta.chainId,\n networkClientId: transactionMeta.networkClientId,\n });\n const ethQuery = new EthQuery(provider);\n const { type } = await determineTransactionType(\n updatedTransaction.txParams,\n ethQuery,\n );\n updatedTransaction.type = type;\n\n await updateTransactionLayer1GasFee({\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n provider,\n transactionMeta: updatedTransaction,\n });\n\n this.updateTransaction(\n updatedTransaction,\n `Update Editable Params for ${txId}`,\n );\n return this.getTransaction(txId);\n }\n\n /**\n * Signs and returns the raw transaction data for provided transaction params list.\n *\n * @param listOfTxParams - The list of transaction params to approve.\n * @param opts - Options bag.\n * @param opts.hasNonce - Whether the transactions already have a nonce.\n * @returns The raw transactions.\n */\n async approveTransactionsWithSameNonce(\n listOfTxParams: (TransactionParams & { chainId: Hex })[] = [],\n { hasNonce }: { hasNonce?: boolean } = {},\n ): Promise {\n log('Approving transactions with same nonce', {\n transactions: listOfTxParams,\n });\n\n if (listOfTxParams.length === 0) {\n return '';\n }\n\n const initialTx = listOfTxParams[0];\n const common = this.getCommonConfiguration(initialTx.chainId);\n\n // We need to ensure we get the nonce using the the NonceTracker on the chain matching\n // the txParams. In this context we only have chainId available to us, but the\n // NonceTrackers are keyed by networkClientId. To workaround this, we attempt to find\n // a networkClientId that matches the chainId. As a fallback, the globally selected\n // network's NonceTracker will be used instead.\n let networkClientId: NetworkClientId | undefined;\n try {\n networkClientId = this.messagingSystem.call(\n `NetworkController:findNetworkClientIdByChainId`,\n initialTx.chainId,\n );\n } catch (err) {\n log('failed to find networkClientId from chainId', err);\n }\n\n const initialTxAsEthTx = TransactionFactory.fromTxData(initialTx, {\n common,\n });\n const initialTxAsSerializedHex = bufferToHex(initialTxAsEthTx.serialize());\n\n if (this.approvingTransactionIds.has(initialTxAsSerializedHex)) {\n return '';\n }\n this.approvingTransactionIds.add(initialTxAsSerializedHex);\n\n let rawTransactions, nonceLock;\n try {\n // TODO: we should add a check to verify that all transactions have the same from address\n const fromAddress = initialTx.from;\n const requiresNonce = hasNonce !== true;\n\n nonceLock = requiresNonce\n ? await this.getNonceLock(fromAddress, networkClientId)\n : undefined;\n\n const nonce = nonceLock\n ? add0x(nonceLock.nextNonce.toString(16))\n : initialTx.nonce;\n\n if (nonceLock) {\n log('Using nonce from nonce tracker', nonce, nonceLock.nonceDetails);\n }\n\n rawTransactions = await Promise.all(\n listOfTxParams.map((txParams) => {\n txParams.nonce = nonce;\n return this.signExternalTransaction(txParams.chainId, txParams);\n }),\n );\n } catch (err) {\n log('Error while signing transactions with same nonce', err);\n // Must set transaction to submitted/failed before releasing lock\n // continue with error chain\n throw err;\n } finally {\n nonceLock?.releaseLock();\n this.approvingTransactionIds.delete(initialTxAsSerializedHex);\n }\n return rawTransactions;\n }\n\n /**\n * Update a custodial transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param options - The custodial transaction options to update.\n * @param options.errorMessage - The error message to be assigned in case transaction status update to failed.\n * @param options.hash - The new hash value to be assigned.\n * @param options.status - The new status value to be assigned.\n */\n updateCustodialTransaction(\n transactionId: string,\n {\n errorMessage,\n hash,\n status,\n }: {\n errorMessage?: string;\n hash?: string;\n status?: TransactionStatus;\n },\n ) {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update custodial transaction as no transaction metadata found`,\n );\n }\n\n if (!transactionMeta.custodyId) {\n throw new Error('Transaction must be a custodian transaction');\n }\n\n if (\n status &&\n ![\n TransactionStatus.submitted,\n TransactionStatus.signed,\n TransactionStatus.failed,\n ].includes(status)\n ) {\n throw new Error(\n `Cannot update custodial transaction with status: ${status}`,\n );\n }\n\n const updatedTransactionMeta = merge(\n {},\n transactionMeta,\n pickBy({ hash, status }),\n ) as TransactionMeta;\n\n if (updatedTransactionMeta.status === TransactionStatus.submitted) {\n updatedTransactionMeta.submittedTime = new Date().getTime();\n }\n\n if (updatedTransactionMeta.status === TransactionStatus.failed) {\n updatedTransactionMeta.error = normalizeTxError(new Error(errorMessage));\n }\n\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:updateCustodialTransaction - Custodial transaction updated`,\n );\n\n if (\n [TransactionStatus.submitted, TransactionStatus.failed].includes(\n status as TransactionStatus,\n )\n ) {\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n updatedTransactionMeta,\n );\n this.#internalEvents.emit(\n `${updatedTransactionMeta.id}:finished`,\n updatedTransactionMeta,\n );\n }\n }\n\n /**\n * Creates approvals for all unapproved transactions persisted.\n */\n initApprovals() {\n const chainId = this.getChainId();\n const unapprovedTxs = this.state.transactions.filter(\n (transaction) =>\n transaction.status === TransactionStatus.unapproved &&\n transaction.chainId === chainId &&\n !transaction.isUserOperation,\n );\n\n for (const txMeta of unapprovedTxs) {\n this.processApproval(txMeta, {\n shouldShowRequest: false,\n }).catch((error) => {\n if (error?.code === errorCodes.provider.userRejectedRequest) {\n return;\n }\n console.error('Error during persisted transaction approval', error);\n });\n }\n }\n\n /**\n * Search transaction metadata for matching entries.\n *\n * @param opts - Options bag.\n * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.\n * @param opts.initialList - The transactions to search. Defaults to the current state.\n * @param opts.filterToCurrentNetwork - Whether to filter the results to the current network. Defaults to true.\n * @param opts.limit - The maximum number of transactions to return. No limit by default.\n * @returns An array of transactions matching the provided options.\n */\n getTransactions({\n searchCriteria = {},\n initialList,\n filterToCurrentNetwork = true,\n limit,\n }: {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n searchCriteria?: any;\n initialList?: TransactionMeta[];\n filterToCurrentNetwork?: boolean;\n limit?: number;\n } = {}): TransactionMeta[] {\n const chainId = this.getChainId();\n // searchCriteria is an object that might have values that aren't predicate\n // methods. When providing any other value type (string, number, etc), we\n // consider this shorthand for \"check the value at key for strict equality\n // with the provided value\". To conform this object to be only methods, we\n // mapValues (lodash) such that every value on the object is a method that\n // returns a boolean.\n const predicateMethods = mapValues(searchCriteria, (predicate) => {\n return typeof predicate === 'function'\n ? predicate\n : // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (v: any) => v === predicate;\n });\n\n const transactionsToFilter = initialList ?? this.state.transactions;\n\n // Combine sortBy and pickBy to transform our state object into an array of\n // matching transactions that are sorted by time.\n const filteredTransactions = sortBy(\n pickBy(transactionsToFilter, (transaction) => {\n if (filterToCurrentNetwork && transaction.chainId !== chainId) {\n return false;\n }\n // iterate over the predicateMethods keys to check if the transaction\n // matches the searchCriteria\n for (const [key, predicate] of Object.entries(predicateMethods)) {\n // We return false early as soon as we know that one of the specified\n // search criteria do not match the transaction. This prevents\n // needlessly checking all criteria when we already know the criteria\n // are not fully satisfied. We check both txParams and the base\n // object as predicate keys can be either.\n if (key in transaction.txParams) {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (predicate((transaction.txParams as any)[key]) === false) {\n return false;\n }\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } else if (predicate((transaction as any)[key]) === false) {\n return false;\n }\n }\n\n return true;\n }),\n 'time',\n );\n if (limit !== undefined) {\n // We need to have all transactions of a given nonce in order to display\n // necessary details in the UI. We use the size of this set to determine\n // whether we have reached the limit provided, thus ensuring that all\n // transactions of nonces we include will be sent to the UI.\n const nonces = new Set();\n const txs = [];\n // By default, the transaction list we filter from is sorted by time ASC.\n // To ensure that filtered results prefers the newest transactions we\n // iterate from right to left, inserting transactions into front of a new\n // array. The original order is preserved, but we ensure that newest txs\n // are preferred.\n for (let i = filteredTransactions.length - 1; i > -1; i--) {\n const txMeta = filteredTransactions[i];\n const { nonce } = txMeta.txParams;\n if (!nonces.has(nonce)) {\n if (nonces.size < limit) {\n nonces.add(nonce);\n } else {\n continue;\n }\n }\n // Push transaction into the beginning of our array to ensure the\n // original order is preserved.\n txs.unshift(txMeta);\n }\n return txs;\n }\n return filteredTransactions;\n }\n\n async estimateGasFee({\n transactionParams,\n chainId,\n networkClientId: requestNetworkClientId,\n }: {\n transactionParams: TransactionParams;\n chainId?: Hex;\n networkClientId?: NetworkClientId;\n }): Promise {\n const networkClientId = this.#getNetworkClientId({\n networkClientId: requestNetworkClientId,\n chainId,\n });\n\n const transactionMeta = {\n txParams: transactionParams,\n chainId,\n networkClientId,\n } as TransactionMeta;\n\n // Guaranteed as the default gas fee flow matches all transactions.\n const gasFeeFlow = getGasFeeFlow(\n transactionMeta,\n this.gasFeeFlows,\n ) as GasFeeFlow;\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n chainId,\n });\n\n const gasFeeControllerData = await this.getGasFeeEstimates({\n networkClientId,\n });\n\n return gasFeeFlow.getGasFees({\n ethQuery,\n gasFeeControllerData,\n transactionMeta,\n });\n }\n\n /**\n * Determine the layer 1 gas fee for the given transaction parameters.\n *\n * @param request - The request object.\n * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.\n * @param request.chainId - The ID of the chain where the transaction will be executed.\n * @param request.networkClientId - The ID of a specific network client to process the transaction.\n */\n async getLayer1GasFee({\n transactionParams,\n chainId,\n networkClientId,\n }: {\n transactionParams: TransactionParams;\n chainId?: Hex;\n networkClientId?: NetworkClientId;\n }): Promise {\n const provider = this.#multichainTrackingHelper.getProvider({\n networkClientId,\n chainId,\n });\n\n return await getTransactionLayer1GasFee({\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n provider,\n transactionMeta: {\n txParams: transactionParams,\n chainId,\n } as TransactionMeta,\n });\n }\n\n private async signExternalTransaction(\n chainId: Hex,\n transactionParams: TransactionParams,\n ): Promise {\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n const normalizedTransactionParams =\n normalizeTransactionParams(transactionParams);\n const type = isEIP1559Transaction(normalizedTransactionParams)\n ? TransactionEnvelopeType.feeMarket\n : TransactionEnvelopeType.legacy;\n const updatedTransactionParams = {\n ...normalizedTransactionParams,\n type,\n gasLimit: normalizedTransactionParams.gas,\n chainId,\n };\n\n const { from } = updatedTransactionParams;\n const common = this.getCommonConfiguration(chainId);\n const unsignedTransaction = TransactionFactory.fromTxData(\n updatedTransactionParams,\n { common },\n );\n const signedTransaction = await this.sign(unsignedTransaction, from);\n\n const rawTransaction = bufferToHex(signedTransaction.serialize());\n return rawTransaction;\n }\n\n /**\n * Removes unapproved transactions from state.\n */\n clearUnapprovedTransactions() {\n const transactions = this.state.transactions.filter(\n ({ status }) => status !== TransactionStatus.unapproved,\n );\n this.update((state) => {\n state.transactions = this.trimTransactionsForState(transactions);\n });\n }\n\n /**\n * Stop the signing process for a specific transaction.\n * Throws an error causing the transaction status to be set to failed.\n * @param transactionId - The ID of the transaction to stop signing.\n */\n abortTransactionSigning(transactionId: string) {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(`Cannot abort signing as no transaction metadata found`);\n }\n\n const abortCallback = this.signAbortCallbacks.get(transactionId);\n\n if (!abortCallback) {\n throw new Error(\n `Cannot abort signing as transaction is not waiting for signing`,\n );\n }\n\n abortCallback();\n\n this.signAbortCallbacks.delete(transactionId);\n }\n\n private addMetadata(transactionMeta: TransactionMeta) {\n this.update((state) => {\n state.transactions = this.trimTransactionsForState([\n ...state.transactions,\n transactionMeta,\n ]);\n });\n }\n\n private async updateGasProperties(transactionMeta: TransactionMeta) {\n const isEIP1559Compatible =\n (await this.getEIP1559Compatibility(transactionMeta.networkClientId)) &&\n transactionMeta.txParams.type !== TransactionEnvelopeType.legacy;\n\n const { networkClientId, chainId } = transactionMeta;\n\n const isCustomNetwork = this.#isCustomNetwork(networkClientId);\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n chainId,\n });\n\n const provider = this.#multichainTrackingHelper.getProvider({\n networkClientId,\n chainId,\n });\n\n await updateGas({\n ethQuery,\n chainId,\n isCustomNetwork,\n txMeta: transactionMeta,\n });\n\n await updateGasFees({\n eip1559: isEIP1559Compatible,\n ethQuery,\n gasFeeFlows: this.gasFeeFlows,\n getGasFeeEstimates: this.getGasFeeEstimates,\n getSavedGasFees: this.getSavedGasFees.bind(this),\n txMeta: transactionMeta,\n });\n\n await updateTransactionLayer1GasFee({\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n provider,\n transactionMeta,\n });\n }\n\n private onBootCleanup() {\n this.submitApprovedTransactions();\n }\n\n /**\n * Force submit approved transactions for all chains.\n */\n private submitApprovedTransactions() {\n const approvedTransactions = this.state.transactions.filter(\n (transaction) => transaction.status === TransactionStatus.approved,\n );\n\n for (const transactionMeta of approvedTransactions) {\n if (this.beforeApproveOnInit(transactionMeta)) {\n this.approveTransaction(transactionMeta.id).catch((error) => {\n /* istanbul ignore next */\n console.error('Error while submitting persisted transaction', error);\n });\n }\n }\n }\n\n private async processApproval(\n transactionMeta: TransactionMeta,\n {\n isExisting = false,\n requireApproval,\n shouldShowRequest = true,\n actionId,\n }: {\n isExisting?: boolean;\n requireApproval?: boolean | undefined;\n shouldShowRequest?: boolean;\n actionId?: string;\n },\n ): Promise {\n const transactionId = transactionMeta.id;\n let resultCallbacks: AcceptResultCallbacks | undefined;\n const { meta, isCompleted } = this.isTransactionCompleted(transactionId);\n const finishedPromise = isCompleted\n ? Promise.resolve(meta)\n : this.waitForTransactionFinished(transactionId);\n\n if (meta && !isExisting && !isCompleted) {\n try {\n if (requireApproval !== false) {\n const acceptResult = await this.requestApproval(transactionMeta, {\n shouldShowRequest,\n });\n resultCallbacks = acceptResult.resultCallbacks;\n\n const approvalValue = acceptResult.value as\n | {\n txMeta?: TransactionMeta;\n }\n | undefined;\n\n const updatedTransaction = approvalValue?.txMeta;\n\n if (updatedTransaction) {\n log('Updating transaction with approval data', {\n customNonce: updatedTransaction.customNonceValue,\n params: updatedTransaction.txParams,\n });\n\n this.updateTransaction(\n updatedTransaction,\n 'TransactionController#processApproval - Updated with approval data',\n );\n }\n }\n\n const { isCompleted: isTxCompleted } =\n this.isTransactionCompleted(transactionId);\n\n if (!isTxCompleted) {\n const approvalResult = await this.approveTransaction(transactionId);\n if (\n approvalResult === ApprovalState.SkippedViaBeforePublishHook &&\n resultCallbacks\n ) {\n resultCallbacks.success();\n }\n const updatedTransactionMeta = this.getTransaction(\n transactionId,\n ) as TransactionMeta;\n this.messagingSystem.publish(\n `${controllerName}:transactionApproved`,\n {\n transactionMeta: updatedTransactionMeta,\n actionId,\n },\n );\n }\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const { isCompleted: isTxCompleted } =\n this.isTransactionCompleted(transactionId);\n if (!isTxCompleted) {\n if (error?.code === errorCodes.provider.userRejectedRequest) {\n this.cancelTransaction(transactionId, actionId);\n\n throw providerErrors.userRejectedRequest(\n 'MetaMask Tx Signature: User denied transaction signature.',\n );\n } else {\n this.failTransaction(meta, error, actionId);\n }\n }\n }\n }\n\n const finalMeta = await finishedPromise;\n\n switch (finalMeta?.status) {\n case TransactionStatus.failed:\n resultCallbacks?.error(finalMeta.error);\n throw rpcErrors.internal(finalMeta.error.message);\n\n case TransactionStatus.submitted:\n resultCallbacks?.success();\n return finalMeta.hash as string;\n\n default:\n const internalError = rpcErrors.internal(\n `MetaMask Tx Signature: Unknown problem: ${JSON.stringify(\n finalMeta || transactionId,\n )}`,\n );\n\n resultCallbacks?.error(internalError);\n throw internalError;\n }\n }\n\n /**\n * Approves a transaction and updates it's status in state. If this is not a\n * retry transaction, a nonce will be generated. The transaction is signed\n * using the sign configuration property, then published to the blockchain.\n * A `:finished` hub event is fired after success or failure.\n *\n * @param transactionId - The ID of the transaction to approve.\n */\n private async approveTransaction(transactionId: string) {\n const cleanupTasks = new Array<() => void>();\n cleanupTasks.push(await this.mutex.acquire());\n\n let transactionMeta = this.getTransactionOrThrow(transactionId);\n\n try {\n if (!this.sign) {\n this.failTransaction(\n transactionMeta,\n new Error('No sign method defined.'),\n );\n return ApprovalState.NotApproved;\n } else if (!transactionMeta.chainId) {\n this.failTransaction(transactionMeta, new Error('No chainId defined.'));\n return ApprovalState.NotApproved;\n }\n\n if (this.approvingTransactionIds.has(transactionId)) {\n log('Skipping approval as signing in progress', transactionId);\n return ApprovalState.NotApproved;\n }\n this.approvingTransactionIds.add(transactionId);\n cleanupTasks.push(() =>\n this.approvingTransactionIds.delete(transactionId),\n );\n\n const [nonce, releaseNonce] = await getNextNonce(\n transactionMeta,\n (address: string) =>\n this.#multichainTrackingHelper.getNonceLock(\n address,\n transactionMeta.networkClientId,\n ),\n );\n\n // must set transaction to submitted/failed before releasing lock\n releaseNonce && cleanupTasks.push(releaseNonce);\n\n transactionMeta = this.#updateTransactionInternal(\n {\n transactionId,\n note: 'TransactionController#approveTransaction - Transaction approved',\n },\n (draftTxMeta) => {\n const { txParams, chainId } = draftTxMeta;\n\n draftTxMeta.status = TransactionStatus.approved;\n draftTxMeta.txParams = {\n ...txParams,\n nonce,\n chainId,\n gasLimit: txParams.gas,\n ...(isEIP1559Transaction(txParams) && {\n type: TransactionEnvelopeType.feeMarket,\n }),\n };\n },\n );\n\n this.onTransactionStatusChange(transactionMeta);\n\n const rawTx = await this.signTransaction(\n transactionMeta,\n transactionMeta.txParams,\n );\n\n if (!this.beforePublish(transactionMeta)) {\n log('Skipping publishing transaction based on hook');\n this.messagingSystem.publish(\n `${controllerName}:transactionPublishingSkipped`,\n transactionMeta,\n );\n return ApprovalState.SkippedViaBeforePublishHook;\n }\n\n if (!rawTx) {\n return ApprovalState.NotApproved;\n }\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n\n let preTxBalance: string | undefined;\n const shouldUpdatePreTxBalance =\n transactionMeta.type === TransactionType.swap;\n\n if (shouldUpdatePreTxBalance) {\n log('Determining pre-transaction balance');\n\n preTxBalance = await query(ethQuery, 'getBalance', [\n transactionMeta.txParams.from,\n ]);\n }\n\n log('Publishing transaction', transactionMeta.txParams);\n\n let { transactionHash: hash } = await this.publish(\n transactionMeta,\n rawTx,\n );\n\n if (hash === undefined) {\n hash = await this.publishTransaction(ethQuery, rawTx);\n }\n\n log('Publish successful', hash);\n\n transactionMeta = this.#updateTransactionInternal(\n {\n transactionId,\n note: 'TransactionController#approveTransaction - Transaction submitted',\n },\n (draftTxMeta) => {\n draftTxMeta.hash = hash;\n draftTxMeta.status = TransactionStatus.submitted;\n draftTxMeta.submittedTime = new Date().getTime();\n if (shouldUpdatePreTxBalance) {\n draftTxMeta.preTxBalance = preTxBalance;\n log('Updated pre-transaction balance', preTxBalance);\n }\n },\n );\n\n this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {\n transactionMeta,\n });\n\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n transactionMeta,\n );\n this.#internalEvents.emit(`${transactionId}:finished`, transactionMeta);\n\n this.onTransactionStatusChange(transactionMeta);\n return ApprovalState.Approved;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n this.failTransaction(transactionMeta, error);\n return ApprovalState.NotApproved;\n } finally {\n cleanupTasks.forEach((task) => task());\n }\n }\n\n private async publishTransaction(\n ethQuery: EthQuery,\n rawTransaction: string,\n ): Promise {\n return await query(ethQuery, 'sendRawTransaction', [rawTransaction]);\n }\n\n /**\n * Cancels a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param actionId - The actionId passed from UI\n */\n private cancelTransaction(transactionId: string, actionId?: string) {\n const transactionMeta = this.state.transactions.find(\n ({ id }) => id === transactionId,\n );\n if (!transactionMeta) {\n return;\n }\n this.update((state) => {\n const transactions = state.transactions.filter(\n ({ id }) => id !== transactionId,\n );\n state.transactions = this.trimTransactionsForState(transactions);\n });\n const updatedTransactionMeta = {\n ...transactionMeta,\n status: TransactionStatus.rejected as const,\n };\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n updatedTransactionMeta,\n );\n this.#internalEvents.emit(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `${transactionMeta.id}:finished`,\n updatedTransactionMeta,\n );\n this.messagingSystem.publish(`${controllerName}:transactionRejected`, {\n transactionMeta: updatedTransactionMeta,\n actionId,\n });\n this.onTransactionStatusChange(updatedTransactionMeta);\n }\n\n /**\n * Trim the amount of transactions that are set on the state. Checks\n * if the length of the tx history is longer then desired persistence\n * limit and then if it is removes the oldest confirmed or rejected tx.\n * Pending or unapproved transactions will not be removed by this\n * operation. For safety of presenting a fully functional transaction UI\n * representation, this function will not break apart transactions with the\n * same nonce, created on the same day, per network. Not accounting for\n * transactions of the same nonce, same day and network combo can result in\n * confusing or broken experiences in the UI.\n *\n * @param transactions - The transactions to be applied to the state.\n * @returns The trimmed list of transactions.\n */\n private trimTransactionsForState(\n transactions: TransactionMeta[],\n ): TransactionMeta[] {\n const nonceNetworkSet = new Set();\n\n const txsToKeep = [...transactions]\n .sort((a, b) => (a.time > b.time ? -1 : 1)) // Descending time order\n .filter((tx) => {\n const { chainId, status, txParams, time } = tx;\n\n if (txParams) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n const key = `${String(txParams.nonce)}-${convertHexToDecimal(\n chainId,\n )}-${new Date(time).toDateString()}`;\n\n if (nonceNetworkSet.has(key)) {\n return true;\n } else if (\n nonceNetworkSet.size < this.#transactionHistoryLimit ||\n !this.isFinalState(status)\n ) {\n nonceNetworkSet.add(key);\n return true;\n }\n }\n\n return false;\n });\n\n txsToKeep.reverse(); // Ascending time order\n return txsToKeep;\n }\n\n /**\n * Determines if the transaction is in a final state.\n *\n * @param status - The transaction status.\n * @returns Whether the transaction is in a final state.\n */\n private isFinalState(status: TransactionStatus): boolean {\n return (\n status === TransactionStatus.rejected ||\n status === TransactionStatus.confirmed ||\n status === TransactionStatus.failed\n );\n }\n\n /**\n * Whether the transaction has at least completed all local processing.\n *\n * @param status - The transaction status.\n * @returns Whether the transaction is in a final state.\n */\n private isLocalFinalState(status: TransactionStatus): boolean {\n return [\n TransactionStatus.confirmed,\n TransactionStatus.failed,\n TransactionStatus.rejected,\n TransactionStatus.submitted,\n ].includes(status);\n }\n\n private async requestApproval(\n txMeta: TransactionMeta,\n { shouldShowRequest }: { shouldShowRequest: boolean },\n ): Promise {\n const id = this.getApprovalId(txMeta);\n const { origin } = txMeta;\n const type = ApprovalType.Transaction;\n const requestData = { txId: txMeta.id };\n\n return (await this.messagingSystem.call(\n 'ApprovalController:addRequest',\n {\n id,\n origin: origin || ORIGIN_METAMASK,\n type,\n requestData,\n expectsResult: true,\n },\n shouldShowRequest,\n )) as Promise;\n }\n\n private getTransaction(\n transactionId: string,\n ): Readonly | undefined {\n const { transactions } = this.state;\n return transactions.find(({ id }) => id === transactionId);\n }\n\n private getTransactionOrThrow(\n transactionId: string,\n errorMessagePrefix = 'TransactionController',\n ): Readonly {\n const txMeta = this.getTransaction(transactionId);\n if (!txMeta) {\n throw new Error(\n `${errorMessagePrefix}: No transaction found with id ${transactionId}`,\n );\n }\n return txMeta;\n }\n\n private getApprovalId(txMeta: TransactionMeta) {\n return String(txMeta.id);\n }\n\n private isTransactionCompleted(transactionId: string): {\n meta?: TransactionMeta;\n isCompleted: boolean;\n } {\n const transaction = this.getTransaction(transactionId);\n\n if (!transaction) {\n return { meta: undefined, isCompleted: false };\n }\n\n const isCompleted = this.isLocalFinalState(transaction.status);\n\n return { meta: transaction, isCompleted };\n }\n\n private getChainId(networkClientId?: NetworkClientId): Hex {\n const globalChainId = this.#getGlobalChainId();\n const globalNetworkClientId = this.#getGlobalNetworkClientId();\n\n if (!networkClientId || networkClientId === globalNetworkClientId) {\n return globalChainId;\n }\n\n return this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n networkClientId,\n ).configuration.chainId;\n }\n\n private prepareUnsignedEthTx(\n chainId: Hex,\n txParams: TransactionParams,\n ): TypedTransaction {\n return TransactionFactory.fromTxData(txParams, {\n freeze: false,\n common: this.getCommonConfiguration(chainId),\n });\n }\n\n /**\n * `@ethereumjs/tx` uses `@ethereumjs/common` as a configuration tool for\n * specifying which chain, network, hardfork and EIPs to support for\n * a transaction. By referencing this configuration, and analyzing the fields\n * specified in txParams, @ethereumjs/tx is able to determine which EIP-2718\n * transaction type to use.\n *\n * @param chainId - The chainId to use for the configuration.\n * @returns common configuration object\n */\n private getCommonConfiguration(chainId: Hex): Common {\n const customChainParams: Partial = {\n chainId: parseInt(chainId, 16),\n defaultHardfork: HARDFORK,\n };\n\n return Common.custom(customChainParams);\n }\n\n private onIncomingTransactions({\n added,\n updated,\n }: {\n added: TransactionMeta[];\n updated: TransactionMeta[];\n }) {\n this.update((state) => {\n const { transactions: currentTransactions } = state;\n const updatedTransactions = [\n ...added,\n ...currentTransactions.map((originalTransaction) => {\n const updatedTransaction = updated.find(\n ({ hash }) => hash === originalTransaction.hash,\n );\n\n return updatedTransaction ?? originalTransaction;\n }),\n ];\n\n state.transactions = this.trimTransactionsForState(updatedTransactions);\n });\n }\n\n private onUpdatedLastFetchedBlockNumbers({\n lastFetchedBlockNumbers,\n blockNumber,\n }: {\n lastFetchedBlockNumbers: {\n [key: string]: number;\n };\n blockNumber: number;\n }) {\n this.update((state) => {\n state.lastFetchedBlockNumbers = lastFetchedBlockNumbers;\n });\n this.messagingSystem.publish(\n `${controllerName}:incomingTransactionBlockReceived`,\n blockNumber,\n );\n }\n\n private generateDappSuggestedGasFees(\n txParams: TransactionParams,\n origin?: string,\n ): DappSuggestedGasFees | undefined {\n if (!origin || origin === ORIGIN_METAMASK) {\n return undefined;\n }\n\n const { gasPrice, maxFeePerGas, maxPriorityFeePerGas, gas } = txParams;\n\n if (\n gasPrice === undefined &&\n maxFeePerGas === undefined &&\n maxPriorityFeePerGas === undefined &&\n gas === undefined\n ) {\n return undefined;\n }\n\n const dappSuggestedGasFees: DappSuggestedGasFees = {};\n\n if (gasPrice !== undefined) {\n dappSuggestedGasFees.gasPrice = gasPrice;\n } else if (\n maxFeePerGas !== undefined ||\n maxPriorityFeePerGas !== undefined\n ) {\n dappSuggestedGasFees.maxFeePerGas = maxFeePerGas;\n dappSuggestedGasFees.maxPriorityFeePerGas = maxPriorityFeePerGas;\n }\n\n if (gas !== undefined) {\n dappSuggestedGasFees.gas = gas;\n }\n\n return dappSuggestedGasFees;\n }\n\n /**\n * Validates and adds external provided transaction to state.\n *\n * @param transactionMeta - Nominated external transaction to be added to state.\n * @returns The new transaction.\n */\n private addExternalTransaction(transactionMeta: TransactionMeta) {\n const { chainId } = transactionMeta;\n const { transactions } = this.state;\n const fromAddress = transactionMeta?.txParams?.from;\n const sameFromAndNetworkTransactions = transactions.filter(\n (transaction) =>\n transaction.txParams.from === fromAddress &&\n transaction.chainId === chainId,\n );\n const confirmedTxs = sameFromAndNetworkTransactions.filter(\n (transaction) => transaction.status === TransactionStatus.confirmed,\n );\n const pendingTxs = sameFromAndNetworkTransactions.filter(\n (transaction) => transaction.status === TransactionStatus.submitted,\n );\n\n validateConfirmedExternalTransaction(\n transactionMeta,\n confirmedTxs,\n pendingTxs,\n );\n\n // Make sure provided external transaction has non empty history array\n const newTransactionMeta =\n (transactionMeta.history ?? []).length === 0 && !this.isHistoryDisabled\n ? addInitialHistorySnapshot(transactionMeta)\n : transactionMeta;\n\n this.update((state) => {\n state.transactions = this.trimTransactionsForState([\n ...state.transactions,\n newTransactionMeta,\n ]);\n });\n\n return newTransactionMeta;\n }\n\n /**\n * Sets other txMeta statuses to dropped if the txMeta that has been confirmed has other transactions\n * in the transactions have the same nonce.\n *\n * @param transactionId - Used to identify original transaction.\n */\n private markNonceDuplicatesDropped(transactionId: string) {\n const transactionMeta = this.getTransaction(transactionId);\n if (!transactionMeta) {\n return;\n }\n const nonce = transactionMeta.txParams?.nonce;\n const from = transactionMeta.txParams?.from;\n const { chainId } = transactionMeta;\n\n const sameNonceTransactions = this.state.transactions.filter(\n (transaction) =>\n transaction.id !== transactionId &&\n transaction.txParams.from === from &&\n transaction.txParams.nonce === nonce &&\n transaction.chainId === chainId &&\n transaction.type !== TransactionType.incoming,\n );\n const sameNonceTransactionIds = sameNonceTransactions.map(\n (transaction) => transaction.id,\n );\n\n if (sameNonceTransactions.length === 0) {\n return;\n }\n\n this.update((state) => {\n for (const transaction of state.transactions) {\n if (sameNonceTransactionIds.includes(transaction.id)) {\n transaction.replacedBy = transactionMeta?.hash;\n transaction.replacedById = transactionMeta?.id;\n }\n }\n });\n\n for (const transaction of this.state.transactions) {\n if (\n sameNonceTransactionIds.includes(transaction.id) &&\n transaction.status !== TransactionStatus.failed\n ) {\n this.setTransactionStatusDropped(transaction);\n }\n }\n }\n\n /**\n * Method to set transaction status to dropped.\n *\n * @param transactionMeta - TransactionMeta of transaction to be marked as dropped.\n */\n private setTransactionStatusDropped(transactionMeta: TransactionMeta) {\n const updatedTransactionMeta = {\n ...transactionMeta,\n status: TransactionStatus.dropped as const,\n };\n this.messagingSystem.publish(`${controllerName}:transactionDropped`, {\n transactionMeta: updatedTransactionMeta,\n });\n this.updateTransaction(\n updatedTransactionMeta,\n 'TransactionController#setTransactionStatusDropped - Transaction dropped',\n );\n this.onTransactionStatusChange(updatedTransactionMeta);\n }\n\n /**\n * Get transaction with provided actionId.\n *\n * @param actionId - Unique ID to prevent duplicate requests\n * @returns the filtered transaction\n */\n private getTransactionWithActionId(actionId?: string) {\n return this.state.transactions.find(\n (transaction) => actionId && transaction.actionId === actionId,\n );\n }\n\n private async waitForTransactionFinished(\n transactionId: string,\n ): Promise {\n return new Promise((resolve) => {\n this.#internalEvents.once(`${transactionId}:finished`, (txMeta) => {\n resolve(txMeta);\n });\n });\n }\n\n /**\n * Updates the r, s, and v properties of a TransactionMeta object\n * with values from a signed transaction.\n *\n * @param transactionMeta - The TransactionMeta object to update.\n * @param signedTx - The encompassing type for all transaction types containing r, s, and v values.\n * @returns The updated TransactionMeta object.\n */\n private updateTransactionMetaRSV(\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ): TransactionMeta {\n const transactionMetaWithRsv = cloneDeep(transactionMeta);\n\n for (const key of ['r', 's', 'v'] as const) {\n const value = signedTx[key];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n transactionMetaWithRsv[key] = add0x(value.toString(16));\n }\n\n return transactionMetaWithRsv;\n }\n\n private async getEIP1559Compatibility(networkClientId?: NetworkClientId) {\n const currentNetworkIsEIP1559Compatible =\n await this.getCurrentNetworkEIP1559Compatibility(networkClientId);\n\n const currentAccountIsEIP1559Compatible =\n await this.getCurrentAccountEIP1559Compatibility();\n\n return (\n currentNetworkIsEIP1559Compatible && currentAccountIsEIP1559Compatible\n );\n }\n\n private async signTransaction(\n transactionMeta: TransactionMeta,\n txParams: TransactionParams,\n ): Promise {\n log('Signing transaction', txParams);\n\n const unsignedEthTx = this.prepareUnsignedEthTx(\n transactionMeta.chainId,\n txParams,\n );\n\n this.approvingTransactionIds.add(transactionMeta.id);\n\n const signedTx = await new Promise((resolve, reject) => {\n this.sign?.(\n unsignedEthTx,\n txParams.from,\n ...this.getAdditionalSignArguments(transactionMeta),\n ).then(resolve, reject);\n\n this.signAbortCallbacks.set(transactionMeta.id, () =>\n reject(new Error('Signing aborted by user')),\n );\n });\n\n this.signAbortCallbacks.delete(transactionMeta.id);\n\n if (!signedTx) {\n log('Skipping signed status as no signed transaction');\n return undefined;\n }\n\n const transactionMetaFromHook = cloneDeep(transactionMeta);\n if (!this.afterSign(transactionMetaFromHook, signedTx)) {\n this.updateTransaction(\n transactionMetaFromHook,\n 'TransactionController#signTransaction - Update after sign',\n );\n\n log('Skipping signed status based on hook');\n\n return undefined;\n }\n\n const transactionMetaWithRsv = {\n ...this.updateTransactionMetaRSV(transactionMetaFromHook, signedTx),\n status: TransactionStatus.signed as const,\n };\n\n this.updateTransaction(\n transactionMetaWithRsv,\n 'TransactionController#approveTransaction - Transaction signed',\n );\n\n this.onTransactionStatusChange(transactionMetaWithRsv);\n\n const rawTx = bufferToHex(signedTx.serialize());\n\n const transactionMetaWithRawTx = merge({}, transactionMetaWithRsv, {\n rawTx,\n });\n\n this.updateTransaction(\n transactionMetaWithRawTx,\n 'TransactionController#approveTransaction - RawTransaction added',\n );\n\n return rawTx;\n }\n\n private onTransactionStatusChange(transactionMeta: TransactionMeta) {\n this.messagingSystem.publish(`${controllerName}:transactionStatusUpdated`, {\n transactionMeta,\n });\n }\n\n private getNonceTrackerTransactions(\n status: TransactionStatus,\n address: string,\n chainId: string = this.getChainId(),\n ) {\n return getAndFormatTransactionsForNonceTracker(\n chainId,\n address,\n status,\n this.state.transactions,\n );\n }\n\n private onConfirmedTransaction(transactionMeta: TransactionMeta) {\n log('Processing confirmed transaction', transactionMeta.id);\n\n this.markNonceDuplicatesDropped(transactionMeta.id);\n\n this.messagingSystem.publish(\n `${controllerName}:transactionConfirmed`,\n transactionMeta,\n );\n\n this.onTransactionStatusChange(transactionMeta);\n\n // Intentional given potential duration of process.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updatePostBalance(transactionMeta);\n }\n\n private async updatePostBalance(transactionMeta: TransactionMeta) {\n try {\n if (transactionMeta.type !== TransactionType.swap) {\n return;\n }\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n const { updatedTransactionMeta, approvalTransactionMeta } =\n await updatePostTransactionBalance(transactionMeta, {\n ethQuery,\n getTransaction: this.getTransaction.bind(this),\n updateTransaction: this.updateTransaction.bind(this),\n });\n\n this.messagingSystem.publish(\n `${controllerName}:postTransactionBalanceUpdated`,\n {\n transactionMeta: updatedTransactionMeta,\n approvalTransactionMeta,\n },\n );\n } catch (error) {\n /* istanbul ignore next */\n log('Error while updating post transaction balance', error);\n }\n }\n\n #createNonceTracker({\n provider,\n blockTracker,\n chainId,\n }: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }): NonceTracker {\n return new NonceTracker({\n // TODO: Fix types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n provider: provider as any,\n // @ts-expect-error TODO: Fix types\n blockTracker,\n getPendingTransactions: this.#getNonceTrackerPendingTransactions.bind(\n this,\n chainId,\n ),\n getConfirmedTransactions: this.getNonceTrackerTransactions.bind(\n this,\n TransactionStatus.confirmed,\n ),\n });\n }\n\n #createIncomingTransactionHelper({\n blockTracker,\n etherscanRemoteTransactionSource,\n chainId,\n }: {\n blockTracker: BlockTracker;\n etherscanRemoteTransactionSource: EtherscanRemoteTransactionSource;\n chainId?: Hex;\n }): IncomingTransactionHelper {\n const incomingTransactionHelper = new IncomingTransactionHelper({\n blockTracker,\n getCurrentAccount: () => this.#getSelectedAccount(),\n getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers,\n getChainId: chainId ? () => chainId : this.getChainId.bind(this),\n isEnabled: this.#incomingTransactionOptions.isEnabled,\n queryEntireHistory: this.#incomingTransactionOptions.queryEntireHistory,\n remoteTransactionSource: etherscanRemoteTransactionSource,\n transactionLimit: this.#transactionHistoryLimit,\n updateTransactions: this.#incomingTransactionOptions.updateTransactions,\n });\n\n this.#addIncomingTransactionHelperListeners(incomingTransactionHelper);\n\n return incomingTransactionHelper;\n }\n\n #createPendingTransactionTracker({\n provider,\n blockTracker,\n chainId,\n }: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }): PendingTransactionTracker {\n const ethQuery = new EthQuery(provider);\n const getChainId = chainId ? () => chainId : this.getChainId.bind(this);\n\n const pendingTransactionTracker = new PendingTransactionTracker({\n approveTransaction: async (transactionId: string) => {\n await this.approveTransaction(transactionId);\n },\n blockTracker,\n getChainId,\n getEthQuery: () => ethQuery,\n getTransactions: () => this.state.transactions,\n isResubmitEnabled: this.#pendingTransactionOptions.isResubmitEnabled,\n getGlobalLock: () =>\n this.#multichainTrackingHelper.acquireNonceLockForChainIdKey({\n chainId: getChainId(),\n }),\n publishTransaction: this.publishTransaction.bind(this),\n hooks: {\n beforeCheckPendingTransaction:\n this.beforeCheckPendingTransaction.bind(this),\n beforePublish: this.beforePublish.bind(this),\n },\n });\n\n this.#addPendingTransactionTrackerListeners(pendingTransactionTracker);\n\n return pendingTransactionTracker;\n }\n\n #checkForPendingTransactionAndStartPolling = () => {\n // PendingTransactionTracker reads state through its getTransactions hook\n this.pendingTransactionTracker.startIfPendingTransactions();\n this.#multichainTrackingHelper.checkForPendingTransactionAndStartPolling();\n };\n\n #stopAllTracking() {\n this.pendingTransactionTracker.stop();\n this.#removePendingTransactionTrackerListeners(\n this.pendingTransactionTracker,\n );\n this.incomingTransactionHelper.stop();\n this.#removeIncomingTransactionHelperListeners(\n this.incomingTransactionHelper,\n );\n\n this.#multichainTrackingHelper.stopAllTracking();\n }\n\n #removeIncomingTransactionHelperListeners(\n incomingTransactionHelper: IncomingTransactionHelper,\n ) {\n incomingTransactionHelper.hub.removeAllListeners('transactions');\n incomingTransactionHelper.hub.removeAllListeners(\n 'updatedLastFetchedBlockNumbers',\n );\n }\n\n #addIncomingTransactionHelperListeners(\n incomingTransactionHelper: IncomingTransactionHelper,\n ) {\n incomingTransactionHelper.hub.on(\n 'transactions',\n this.onIncomingTransactions.bind(this),\n );\n incomingTransactionHelper.hub.on(\n 'updatedLastFetchedBlockNumbers',\n this.onUpdatedLastFetchedBlockNumbers.bind(this),\n );\n }\n\n #removePendingTransactionTrackerListeners(\n pendingTransactionTracker: PendingTransactionTracker,\n ) {\n pendingTransactionTracker.hub.removeAllListeners('transaction-confirmed');\n pendingTransactionTracker.hub.removeAllListeners('transaction-dropped');\n pendingTransactionTracker.hub.removeAllListeners('transaction-failed');\n pendingTransactionTracker.hub.removeAllListeners('transaction-updated');\n }\n\n #addPendingTransactionTrackerListeners(\n pendingTransactionTracker: PendingTransactionTracker,\n ) {\n pendingTransactionTracker.hub.on(\n 'transaction-confirmed',\n this.onConfirmedTransaction.bind(this),\n );\n\n pendingTransactionTracker.hub.on(\n 'transaction-dropped',\n this.setTransactionStatusDropped.bind(this),\n );\n\n pendingTransactionTracker.hub.on(\n 'transaction-failed',\n this.failTransaction.bind(this),\n );\n\n pendingTransactionTracker.hub.on(\n 'transaction-updated',\n this.updateTransaction.bind(this),\n );\n }\n\n #getNonceTrackerPendingTransactions(\n chainId: string | undefined,\n address: string,\n ) {\n const standardPendingTransactions = this.getNonceTrackerTransactions(\n TransactionStatus.submitted,\n address,\n chainId,\n );\n\n const externalPendingTransactions = this.getExternalPendingTransactions(\n address,\n chainId,\n );\n return [...standardPendingTransactions, ...externalPendingTransactions];\n }\n\n private async publishTransactionForRetry(\n ethQuery: EthQuery,\n rawTx: string,\n transactionMeta: TransactionMeta,\n ): Promise {\n try {\n const hash = await this.publishTransaction(ethQuery, rawTx);\n return hash;\n } catch (error: unknown) {\n if (this.isTransactionAlreadyConfirmedError(error as Error)) {\n await this.pendingTransactionTracker.forceCheckTransaction(\n transactionMeta,\n );\n throw new Error('Previous transaction is already confirmed');\n }\n throw error;\n }\n }\n\n /**\n * Ensures that error is a nonce issue\n *\n * @param error - The error to check\n * @returns Whether or not the error is a nonce issue\n */\n // TODO: Replace `any` with type\n // Some networks are returning original error in the data field\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private isTransactionAlreadyConfirmedError(error: any): boolean {\n return (\n error?.message?.includes('nonce too low') ||\n error?.data?.message?.includes('nonce too low')\n );\n }\n\n #getGasFeeFlows(): GasFeeFlow[] {\n if (this.#testGasFeeFlows) {\n return [new TestGasFeeFlow()];\n }\n\n return [new LineaGasFeeFlow(), new DefaultGasFeeFlow()];\n }\n\n #getLayer1GasFeeFlows(): Layer1GasFeeFlow[] {\n return [new OptimismLayer1GasFeeFlow(), new ScrollLayer1GasFeeFlow()];\n }\n\n #updateTransactionInternal(\n {\n transactionId,\n note,\n skipHistory,\n }: { transactionId: string; note?: string; skipHistory?: boolean },\n callback: (transactionMeta: TransactionMeta) => TransactionMeta | void,\n ): Readonly {\n let updatedTransactionParams: (keyof TransactionParams)[] = [];\n\n this.update((state) => {\n const index = state.transactions.findIndex(\n ({ id }) => id === transactionId,\n );\n\n let transactionMeta = state.transactions[index];\n\n // eslint-disable-next-line n/callback-return\n transactionMeta = callback(transactionMeta) ?? transactionMeta;\n\n transactionMeta.txParams = normalizeTransactionParams(\n transactionMeta.txParams,\n );\n\n validateTxParams(transactionMeta.txParams);\n\n updatedTransactionParams =\n this.#checkIfTransactionParamsUpdated(transactionMeta);\n\n const shouldSkipHistory = this.isHistoryDisabled || skipHistory;\n\n if (!shouldSkipHistory) {\n transactionMeta = updateTransactionHistory(\n transactionMeta,\n note ?? 'Transaction updated',\n );\n }\n state.transactions[index] = transactionMeta;\n });\n\n const transactionMeta = this.getTransaction(\n transactionId,\n ) as TransactionMeta;\n\n if (updatedTransactionParams.length > 0) {\n this.#onTransactionParamsUpdated(\n transactionMeta,\n updatedTransactionParams,\n );\n }\n\n return transactionMeta;\n }\n\n #checkIfTransactionParamsUpdated(newTransactionMeta: TransactionMeta) {\n const { id: transactionId, txParams: newParams } = newTransactionMeta;\n\n const originalParams = this.getTransaction(transactionId)?.txParams;\n\n if (!originalParams || isEqual(originalParams, newParams)) {\n return [];\n }\n\n const params = Object.keys(newParams) as (keyof TransactionParams)[];\n\n const updatedProperties = params.filter(\n (param) => newParams[param] !== originalParams[param],\n );\n\n log(\n 'Transaction parameters have been updated',\n transactionId,\n updatedProperties,\n originalParams,\n newParams,\n );\n\n return updatedProperties;\n }\n\n #onTransactionParamsUpdated(\n transactionMeta: TransactionMeta,\n updatedParams: (keyof TransactionParams)[],\n ) {\n if (\n (['to', 'value', 'data'] as const).some((param) =>\n updatedParams.includes(param),\n )\n ) {\n log('Updating simulation data due to transaction parameter update');\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#updateSimulationData(transactionMeta);\n }\n }\n\n async #updateSimulationData(transactionMeta: TransactionMeta) {\n const { id: transactionId, chainId, txParams } = transactionMeta;\n const { from, to, value, data } = txParams;\n\n let simulationData: SimulationData = {\n error: {\n code: SimulationErrorCode.Disabled,\n message: 'Simulation disabled',\n },\n tokenBalanceChanges: [],\n };\n\n if (this.#isSimulationEnabled()) {\n this.#updateTransactionInternal(\n { transactionId, skipHistory: true },\n (txMeta) => {\n txMeta.simulationData = undefined;\n },\n );\n\n simulationData = await getSimulationData({\n chainId,\n from: from as Hex,\n to: to as Hex,\n value: value as Hex,\n data: data as Hex,\n });\n }\n\n const finalTransactionMeta = this.getTransaction(transactionId);\n\n /* istanbul ignore if */\n if (!finalTransactionMeta) {\n log(\n 'Cannot update simulation data as transaction not found',\n transactionId,\n simulationData,\n );\n\n return;\n }\n\n this.#updateTransactionInternal(\n {\n transactionId,\n note: 'TransactionController#updateSimulationData - Update simulation data',\n },\n (txMeta) => {\n txMeta.simulationData = simulationData;\n },\n );\n\n log('Updated simulation data', transactionId, simulationData);\n }\n\n #onGasFeePollerTransactionUpdate({\n transactionId,\n gasFeeEstimates,\n gasFeeEstimatesLoaded,\n layer1GasFee,\n }: {\n transactionId: string;\n gasFeeEstimates?: GasFeeEstimates;\n gasFeeEstimatesLoaded?: boolean;\n layer1GasFee?: Hex;\n }) {\n this.#updateTransactionInternal(\n { transactionId, skipHistory: true },\n (txMeta) => {\n if (gasFeeEstimates) {\n txMeta.gasFeeEstimates = gasFeeEstimates;\n }\n\n if (gasFeeEstimatesLoaded !== undefined) {\n txMeta.gasFeeEstimatesLoaded = gasFeeEstimatesLoaded;\n }\n\n if (layer1GasFee) {\n txMeta.layer1GasFee = layer1GasFee;\n }\n },\n );\n }\n\n #getNetworkClientId({\n networkClientId: requestNetworkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n }) {\n const globalChainId = this.#getGlobalChainId();\n const globalNetworkClientId = this.#getGlobalNetworkClientId();\n\n if (requestNetworkClientId) {\n return requestNetworkClientId;\n }\n\n if (!chainId || chainId === globalChainId) {\n return globalNetworkClientId;\n }\n\n return this.messagingSystem.call(\n `NetworkController:findNetworkClientIdByChainId`,\n chainId,\n );\n }\n\n #getGlobalNetworkClientId() {\n return this.getNetworkState().selectedNetworkClientId;\n }\n\n #getGlobalChainId() {\n return this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n this.getNetworkState().selectedNetworkClientId,\n ).configuration.chainId;\n }\n\n #isCustomNetwork(networkClientId?: NetworkClientId) {\n const globalNetworkClientId = this.#getGlobalNetworkClientId();\n\n if (!networkClientId || networkClientId === globalNetworkClientId) {\n return !isInfuraNetworkType(\n this.getNetworkState().selectedNetworkClientId,\n );\n }\n\n return (\n this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n networkClientId,\n ).configuration.type === NetworkClientType.Custom\n );\n }\n\n #getSelectedAccount() {\n return this.messagingSystem.call('AccountsController:getSelectedAccount');\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-SD6CWFDF.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-SD6CWFDF.js.map +deleted file mode 100644 +index 0e4276d..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-SD6CWFDF.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/transaction-type.ts"],"names":[],"mappings":";AACA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAEtB;AAAA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AAQ;AAAA,EAER;AAEA,MAAI;AACF,WAAO,iBAAiB,iBAAiB,EAAE,KAAK,CAAC;AAAA,EACnD,QAAQ;AAAA,EAER;AAEA,MAAI;AACF,WAAO,cAAc,iBAAiB,EAAE,KAAK,CAAC;AAAA,EAChD,QAAQ;AAAA,EAER;AAEA,SAAO;AACT;AASA,eAAe,sBACb,UACA,SAIC;AACD,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,MAAM,UAAU,WAAW,CAAC,OAAO,CAAC;AAAA,EAC3D,SAAS,GAAG;AACV,mBAAe;AAAA,EACjB;AAEA,QAAM,oBAAoB,eACtB,iBAAiB,QAAQ,iBAAiB,QAC1C;AACJ,SAAO,EAAE,cAAc,kBAAkB;AAC3C","sourcesContent":["import type { TransactionDescription } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport {\n abiERC721,\n abiERC20,\n abiERC1155,\n abiFiatTokenV2,\n} from '@metamask/metamask-eth-abis';\n\nimport type { InferTransactionTypeResult, TransactionParams } from '../types';\nimport { TransactionType } from '../types';\n\nexport const ESTIMATE_GAS_ERROR = 'eth_estimateGas rpc method error';\n\nconst ERC20Interface = new Interface(abiERC20);\nconst ERC721Interface = new Interface(abiERC721);\nconst ERC1155Interface = new Interface(abiERC1155);\nconst USDCInterface = new Interface(abiFiatTokenV2);\n\n/**\n * Determines the type of the transaction by analyzing the txParams.\n * It will never return TRANSACTION_TYPE_CANCEL or TRANSACTION_TYPE_RETRY as these\n * represent specific events that we specify manually at transaction creation.\n *\n * @param txParams - Parameters for the transaction.\n * @param ethQuery - EthQuery instance.\n * @returns A object with the transaction type and the contract code response in Hex.\n */\nexport async function determineTransactionType(\n txParams: TransactionParams,\n ethQuery: EthQuery,\n): Promise {\n const { data, to } = txParams;\n\n if (data && !to) {\n return { type: TransactionType.deployContract, getCodeResponse: undefined };\n }\n\n const { contractCode: getCodeResponse, isContractAddress } =\n await readAddressAsContract(ethQuery, to);\n\n if (!isContractAddress) {\n return { type: TransactionType.simpleSend, getCodeResponse };\n }\n\n const hasValue = Number(txParams.value ?? '0') !== 0;\n\n const contractInteractionResult = {\n type: TransactionType.contractInteraction,\n getCodeResponse,\n };\n\n if (!data || hasValue) {\n return contractInteractionResult;\n }\n\n const name = parseStandardTokenTransactionData(data)?.name;\n\n if (!name) {\n return contractInteractionResult;\n }\n\n const tokenMethodName = [\n TransactionType.tokenMethodApprove,\n TransactionType.tokenMethodSetApprovalForAll,\n TransactionType.tokenMethodTransfer,\n TransactionType.tokenMethodTransferFrom,\n TransactionType.tokenMethodSafeTransferFrom,\n TransactionType.tokenMethodIncreaseAllowance,\n ].find(\n (methodName) => methodName.toLowerCase() === (name as string).toLowerCase(),\n );\n\n if (tokenMethodName) {\n return { type: tokenMethodName, getCodeResponse };\n }\n\n return contractInteractionResult;\n}\n\n/**\n * Attempts to decode transaction data using ABIs for three different token standards: ERC20, ERC721, ERC1155.\n * The data will decode correctly if the transaction is an interaction with a contract that matches one of these\n * contract standards\n *\n * @param data - Encoded transaction data.\n * @returns A representation of an ethereum contract call.\n */\nfunction parseStandardTokenTransactionData(\n data?: string,\n): TransactionDescription | undefined {\n if (!data) {\n return undefined;\n }\n\n try {\n return ERC20Interface.parseTransaction({ data });\n } catch {\n // ignore and next try to parse with erc721 ABI\n }\n\n try {\n return ERC721Interface.parseTransaction({ data });\n } catch {\n // ignore and next try to parse with erc1155 ABI\n }\n\n try {\n return ERC1155Interface.parseTransaction({ data });\n } catch {\n // ignore and return undefined\n }\n\n try {\n return USDCInterface.parseTransaction({ data });\n } catch {\n // ignore and return undefined\n }\n\n return undefined;\n}\n\n/**\n * Reads an Ethereum address and determines if it is a contract address.\n *\n * @param ethQuery - The Ethereum query object used to interact with the Ethereum blockchain.\n * @param address - The Ethereum address.\n * @returns An object containing the contract code and a boolean indicating if it is a contract address.\n */\nasync function readAddressAsContract(\n ethQuery: EthQuery,\n address?: string,\n): Promise<{\n contractCode: string | null;\n isContractAddress: boolean;\n}> {\n let contractCode;\n try {\n contractCode = await query(ethQuery, 'getCode', [address]);\n } catch (e) {\n contractCode = null;\n }\n\n const isContractAddress = contractCode\n ? contractCode !== '0x' && contractCode !== '0x0'\n : false;\n return { contractCode, isContractAddress };\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-SFFTNB2X.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-SFFTNB2X.mjs.map +deleted file mode 100644 +index abed464..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-SFFTNB2X.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/GasFeePoller.ts"],"sourcesContent":["import EthQuery from '@metamask/eth-query';\nimport type {\n FetchGasFeeEstimateOptions,\n GasFeeState,\n} from '@metamask/gas-fee-controller';\nimport type { NetworkClientId, Provider } from '@metamask/network-controller';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\nimport EventEmitter from 'events';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n Layer1GasFeeFlow,\n} from '../types';\nimport { TransactionStatus, type TransactionMeta } from '../types';\nimport { getGasFeeFlow } from '../utils/gas-flow';\nimport { getTransactionLayer1GasFee } from '../utils/layer1-gas-fee-flow';\n\nconst log = createModuleLogger(projectLogger, 'gas-fee-poller');\n\nconst INTERVAL_MILLISECONDS = 10000;\n\n/**\n * Automatically polls and updates suggested gas fees on unapproved transactions.\n */\nexport class GasFeePoller {\n hub: EventEmitter = new EventEmitter();\n\n #findNetworkClientIdByChainId: (chainId: Hex) => NetworkClientId | undefined;\n\n #gasFeeFlows: GasFeeFlow[];\n\n #getGasFeeControllerEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n\n #getProvider: (chainId: Hex, networkClientId?: NetworkClientId) => Provider;\n\n #getTransactions: () => TransactionMeta[];\n\n #layer1GasFeeFlows: Layer1GasFeeFlow[];\n\n #timeout: ReturnType | undefined;\n\n #running = false;\n\n /**\n * Constructs a new instance of the GasFeePoller.\n * @param options - The options for this instance.\n * @param options.findNetworkClientIdByChainId - Callback to find the network client ID by chain ID.\n * @param options.gasFeeFlows - The gas fee flows to use to obtain suitable gas fees.\n * @param options.getGasFeeControllerEstimates - Callback to obtain the default fee estimates.\n * @param options.getProvider - Callback to obtain a provider instance.\n * @param options.getTransactions - Callback to obtain the transaction data.\n * @param options.layer1GasFeeFlows - The layer 1 gas fee flows to use to obtain suitable layer 1 gas fees.\n * @param options.onStateChange - Callback to register a listener for controller state changes.\n */\n constructor({\n findNetworkClientIdByChainId,\n gasFeeFlows,\n getGasFeeControllerEstimates,\n getProvider,\n getTransactions,\n layer1GasFeeFlows,\n onStateChange,\n }: {\n findNetworkClientIdByChainId: (chainId: Hex) => NetworkClientId | undefined;\n gasFeeFlows: GasFeeFlow[];\n getGasFeeControllerEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n getProvider: (chainId: Hex, networkClientId?: NetworkClientId) => Provider;\n getTransactions: () => TransactionMeta[];\n layer1GasFeeFlows: Layer1GasFeeFlow[];\n onStateChange: (listener: () => void) => void;\n }) {\n this.#findNetworkClientIdByChainId = findNetworkClientIdByChainId;\n this.#gasFeeFlows = gasFeeFlows;\n this.#layer1GasFeeFlows = layer1GasFeeFlows;\n this.#getGasFeeControllerEstimates = getGasFeeControllerEstimates;\n this.#getProvider = getProvider;\n this.#getTransactions = getTransactions;\n\n onStateChange(() => {\n const unapprovedTransactions = this.#getUnapprovedTransactions();\n\n if (unapprovedTransactions.length) {\n this.#start();\n } else {\n this.#stop();\n }\n });\n }\n\n #start() {\n if (this.#running) {\n return;\n }\n\n // Intentionally not awaiting since this starts the timeout chain.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#onTimeout();\n\n this.#running = true;\n\n log('Started polling');\n }\n\n #stop() {\n if (!this.#running) {\n return;\n }\n\n clearTimeout(this.#timeout);\n\n this.#timeout = undefined;\n this.#running = false;\n\n log('Stopped polling');\n }\n\n async #onTimeout() {\n await this.#updateUnapprovedTransactions();\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#timeout = setTimeout(() => this.#onTimeout(), INTERVAL_MILLISECONDS);\n }\n\n async #updateUnapprovedTransactions() {\n const unapprovedTransactions = this.#getUnapprovedTransactions();\n\n if (!unapprovedTransactions.length) {\n return;\n }\n\n log('Found unapproved transactions', unapprovedTransactions.length);\n\n const gasFeeControllerDataByChainId = await this.#getGasFeeControllerData(\n unapprovedTransactions,\n );\n\n log('Retrieved gas fee controller data', gasFeeControllerDataByChainId);\n\n await Promise.all(\n unapprovedTransactions.flatMap((tx) => {\n const { chainId } = tx;\n\n const gasFeeControllerData = gasFeeControllerDataByChainId.get(\n chainId,\n ) as GasFeeState;\n\n return this.#updateUnapprovedTransaction(tx, gasFeeControllerData);\n }),\n );\n }\n\n async #updateUnapprovedTransaction(\n transactionMeta: TransactionMeta,\n gasFeeControllerData: GasFeeState,\n ) {\n const { id } = transactionMeta;\n\n const [gasFeeEstimatesResponse, layer1GasFee] = await Promise.all([\n this.#updateTransactionGasFeeEstimates(\n transactionMeta,\n gasFeeControllerData,\n ),\n this.#updateTransactionLayer1GasFee(transactionMeta),\n ]);\n\n if (!gasFeeEstimatesResponse && !layer1GasFee) {\n return;\n }\n\n this.hub.emit('transaction-updated', {\n transactionId: id,\n gasFeeEstimates: gasFeeEstimatesResponse?.gasFeeEstimates,\n gasFeeEstimatesLoaded: gasFeeEstimatesResponse?.gasFeeEstimatesLoaded,\n layer1GasFee,\n });\n }\n\n async #updateTransactionGasFeeEstimates(\n transactionMeta: TransactionMeta,\n gasFeeControllerData: GasFeeState,\n ): Promise<\n | { gasFeeEstimates?: GasFeeEstimates; gasFeeEstimatesLoaded: boolean }\n | undefined\n > {\n const { chainId, networkClientId } = transactionMeta;\n\n const ethQuery = new EthQuery(this.#getProvider(chainId, networkClientId));\n const gasFeeFlow = getGasFeeFlow(transactionMeta, this.#gasFeeFlows);\n\n if (gasFeeFlow) {\n log(\n 'Found gas fee flow',\n gasFeeFlow.constructor.name,\n transactionMeta.id,\n );\n }\n\n const request: GasFeeFlowRequest = {\n ethQuery,\n gasFeeControllerData,\n transactionMeta,\n };\n\n let gasFeeEstimates: GasFeeEstimates | undefined;\n\n if (gasFeeFlow) {\n try {\n const response = await gasFeeFlow.getGasFees(request);\n gasFeeEstimates = response.estimates;\n } catch (error) {\n log('Failed to get suggested gas fees', transactionMeta.id, error);\n }\n }\n\n if (!gasFeeEstimates && transactionMeta.gasFeeEstimatesLoaded) {\n return undefined;\n }\n\n log('Updated gas fee estimates', {\n gasFeeEstimates,\n transaction: transactionMeta.id,\n });\n\n return { gasFeeEstimates, gasFeeEstimatesLoaded: true };\n }\n\n async #updateTransactionLayer1GasFee(\n transactionMeta: TransactionMeta,\n ): Promise {\n const { chainId, networkClientId } = transactionMeta;\n const provider = this.#getProvider(chainId, networkClientId);\n\n const layer1GasFee = await getTransactionLayer1GasFee({\n layer1GasFeeFlows: this.#layer1GasFeeFlows,\n provider,\n transactionMeta,\n });\n\n if (layer1GasFee) {\n log('Updated layer 1 gas fee', layer1GasFee, transactionMeta.id);\n }\n\n return layer1GasFee;\n }\n\n #getUnapprovedTransactions() {\n return this.#getTransactions().filter(\n (tx) => tx.status === TransactionStatus.unapproved,\n );\n }\n\n async #getGasFeeControllerData(\n transactions: TransactionMeta[],\n ): Promise> {\n const networkClientIdsByChainId = new Map();\n\n for (const transaction of transactions) {\n const { chainId, networkClientId: transactionNetworkClientId } =\n transaction;\n\n if (networkClientIdsByChainId.has(chainId)) {\n continue;\n }\n\n const networkClientId =\n transactionNetworkClientId ??\n (this.#findNetworkClientIdByChainId(chainId) as string);\n\n networkClientIdsByChainId.set(chainId, networkClientId);\n }\n\n log('Extracted network client IDs by chain ID', networkClientIdsByChainId);\n\n const entryPromises = Array.from(networkClientIdsByChainId.entries()).map(\n async ([chainId, networkClientId]) => {\n return [\n chainId,\n await this.#getGasFeeControllerEstimates({ networkClientId }),\n ] as const;\n },\n );\n\n return new Map(await Promise.all(entryPromises));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO,cAAc;AAOrB,SAAS,0BAA0B;AACnC,OAAO,kBAAkB;AAazB,IAAM,MAAM,mBAAmB,eAAe,gBAAgB;AAE9D,IAAM,wBAAwB;AAvB9B;AA4BO,IAAM,eAAN,MAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgCxB,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAUG;AAmBH;AAcA;AAaA,uBAAM;AAON,uBAAM;AA4BN,uBAAM;AA0BN,uBAAM;AAiDN,uBAAM;AAmBN;AAMA,uBAAM;AAtON,eAAoB,IAAI,aAAa;AAErC;AAEA;AAEA;AAIA;AAEA;AAEA;AAEA;AAEA,iCAAW;AAgCT,uBAAK,+BAAgC;AACrC,uBAAK,cAAe;AACpB,uBAAK,oBAAqB;AAC1B,uBAAK,+BAAgC;AACrC,uBAAK,cAAe;AACpB,uBAAK,kBAAmB;AAExB,kBAAc,MAAM;AAClB,YAAM,yBAAyB,sBAAK,0DAAL;AAE/B,UAAI,uBAAuB,QAAQ;AACjC,8BAAK,kBAAL;AAAA,MACF,OAAO;AACL,8BAAK,gBAAL;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAqMF;AArQE;AAEA;AAEA;AAIA;AAEA;AAEA;AAEA;AAEA;AAkDA;AAAA,WAAM,WAAG;AACP,MAAI,mBAAK,WAAU;AACjB;AAAA,EACF;AAIA,wBAAK,0BAAL;AAEA,qBAAK,UAAW;AAEhB,MAAI,iBAAiB;AACvB;AAEA;AAAA,UAAK,WAAG;AACN,MAAI,CAAC,mBAAK,WAAU;AAClB;AAAA,EACF;AA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AAEtC,8BAA0B,IAAI,SAAS,eAAe;AAAA,EACxD;AAEA,MAAI,4CAA4C,yBAAyB;AAEzE,QAAM,gBAAgB,MAAM,KAAK,0BAA0B,QAAQ,CAAC,EAAE;AAAA,IACpE,OAAO,CAAC,SAAS,eAAe,MAAM;AACpC,aAAO;AAAA,QACL;AAAA,QACA,MAAM,mBAAK,+BAAL,WAAmC,EAAE,gBAAgB;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAEA,SAAO,IAAI,IAAI,MAAM,QAAQ,IAAI,aAAa,CAAC;AACjD;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-TJMQEH57.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-TJMQEH57.js.map +deleted file mode 100644 +index fe3a4f0..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-TJMQEH57.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/TestGasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;AAAA,SAAS,aAAa;AAWtB,IAAM,YAAY;AAClB,IAAM,mBAAmB;AAZzB;AAmBO,IAAM,iBAAN,MAA2C;AAAA,EAA3C;AA0DL;AAzDA,iCAAW;AAAA;AAAA,EAEX,mBAAmB,kBAA4C;AAC7D,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,WAAW,SAAyD;AACxE,UAAM,EAAE,gBAAgB,IAAI;AAC5B,UAAM,EAAE,SAAS,IAAI;AACrB,UAAM,EAAE,KAAK,OAAO,IAAI;AAExB,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,uCAAuC;AAAA,IACzD;AAEA,UAAM,aAAa,SAAS,QAAQ,EAAE;AACtC,UAAM,aAAa,YAAY;AAE/B,UAAM,mBAAmB,mBAAK,YAAW,KAAK;AAC9C,UAAM,uBAAuB,mBAAK,YAAW;AAE7C,UAAM,eAAe,kBAAkB;AACvC,UAAM,oBAAoB,uBAAuB;AAEjD,UAAM,gBAAgB,kBAAkB;AACxC,UAAM,qBAAqB,uBAAuB;AAElD,uBAAK,UAAL,mBAAK,YAAY;AAEjB,WAAO;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACA,KAAK;AAAA,UACH,cAAc,sBAAK,8CAAL,WAA0B,cAAc;AAAA,UACtD,sBAAsB,sBAAK,8CAAL,WACpB,mBACA;AAAA,QAEJ;AAAA,QACA,QAAQ;AAAA,UACN,cAAc,sBAAK,8CAAL,WAA0B,iBAAiB;AAAA,UACzD,sBAAsB,sBAAK,8CAAL,WACpB,sBACA;AAAA,QAEJ;AAAA,QACA,MAAM;AAAA,UACJ,cAAc,sBAAK,8CAAL,WAA0B,eAAe;AAAA,UACvD,sBAAsB,sBAAK,8CAAL,WACpB,oBACA;AAAA,QAEJ;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAMF;AA7DE;AAyDA;AAAA,yBAAoB,SAAC,UAAkB,KAAkB;AACvD,QAAM,aAAa,KAAK,KAAK,WAAW,GAAG;AAC3C,SAAO,MAAM,UAAU;AACzB","sourcesContent":["import { toHex } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport {\n GasFeeEstimateType,\n type GasFeeFlow,\n type GasFeeFlowRequest,\n type GasFeeFlowResponse,\n type TransactionMeta,\n} from '../types';\n\nconst INCREMENT = 1e15; // 0.001 ETH\nconst LEVEL_DIFFERENCE = 0.5;\n\n/**\n * A gas fee flow to facilitate testing in the clients.\n * Increments the total gas fee by a fixed amount each time it is called.\n * Relies on the transaction's gas value to generate a distinct total fee in the UI.\n */\nexport class TestGasFeeFlow implements GasFeeFlow {\n #counter = 1;\n\n matchesTransaction(_transactionMeta: TransactionMeta): boolean {\n return true;\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n const { transactionMeta } = request;\n const { txParams } = transactionMeta;\n const { gas: gasHex } = txParams;\n\n if (!gasHex) {\n throw new Error('Cannot estimate fee without gas value');\n }\n\n const gasDecimal = parseInt(gasHex, 16);\n const difference = INCREMENT * LEVEL_DIFFERENCE;\n\n const mediumMaxTarget = (this.#counter + 1) * INCREMENT;\n const mediumPriorityTarget = this.#counter * INCREMENT;\n\n const lowMaxTarget = mediumMaxTarget - difference;\n const lowPriorityTarget = mediumPriorityTarget - difference;\n\n const highMaxTarget = mediumMaxTarget + difference;\n const highPriorityTarget = mediumPriorityTarget + difference;\n\n this.#counter += 1;\n\n return {\n estimates: {\n type: GasFeeEstimateType.FeeMarket,\n low: {\n maxFeePerGas: this.#getValueForTotalFee(lowMaxTarget, gasDecimal),\n maxPriorityFeePerGas: this.#getValueForTotalFee(\n lowPriorityTarget,\n gasDecimal,\n ),\n },\n medium: {\n maxFeePerGas: this.#getValueForTotalFee(mediumMaxTarget, gasDecimal),\n maxPriorityFeePerGas: this.#getValueForTotalFee(\n mediumPriorityTarget,\n gasDecimal,\n ),\n },\n high: {\n maxFeePerGas: this.#getValueForTotalFee(highMaxTarget, gasDecimal),\n maxPriorityFeePerGas: this.#getValueForTotalFee(\n highPriorityTarget,\n gasDecimal,\n ),\n },\n },\n };\n }\n\n #getValueForTotalFee(totalFee: number, gas: number): Hex {\n const feeDecimal = Math.ceil(totalFee / gas);\n return toHex(feeDecimal);\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-SFFTNB2X.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-TKS27C32.mjs +similarity index 99% +rename from node_modules/@metamask/transaction-controller/dist/chunk-SFFTNB2X.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-TKS27C32.mjs +index 23b3af2..aa976cc 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-SFFTNB2X.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-TKS27C32.mjs +@@ -3,7 +3,7 @@ import { + } from "./chunk-NOHEXQ7Y.mjs"; + import { + getGasFeeFlow +-} from "./chunk-JXXTNVU4.mjs"; ++} from "./chunk-GRMANXAN.mjs"; + import { + projectLogger + } from "./chunk-UQQWZT6C.mjs"; +@@ -225,4 +225,4 @@ getGasFeeControllerData_fn = async function(transactions) { + export { + GasFeePoller + }; +-//# sourceMappingURL=chunk-SFFTNB2X.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-TKS27C32.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-6SJYXSF3.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-UF4IMTUO.mjs +similarity index 98% +rename from node_modules/@metamask/transaction-controller/dist/chunk-6SJYXSF3.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-UF4IMTUO.mjs +index 4452732..80a7813 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-6SJYXSF3.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-UF4IMTUO.mjs +@@ -89,4 +89,4 @@ export { + SimulationTokenStandard, + SimulationErrorCode + }; +-//# sourceMappingURL=chunk-6SJYXSF3.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-UF4IMTUO.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-UGN7PBON.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-UGN7PBON.js.map +deleted file mode 100644 +index 2d4abdf..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-UGN7PBON.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/constants.ts"],"names":[],"mappings":";AAAO,IAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,cAAc;AAAA,EACd,KAAK;AAAA,EACL,aAAa;AAAA,EACb,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,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,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,QAAQ;AAAA,MACN,EAAE,SAAS,MAAM,MAAM,QAAQ,MAAM,UAAU;AAAA,MAC/C,EAAE,SAAS,OAAO,MAAM,OAAO,MAAM,UAAU;AAAA,IACjD;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAGO,IAAM,+BAA+B;AAAA,EAC1C;AAAA,IACE,WAAW;AAAA,IACX,QAAQ;AAAA,MACN;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF","sourcesContent":["export const CHAIN_IDS = {\n MAINNET: '0x1',\n GOERLI: '0x5',\n BASE: '0x2105',\n BASE_TESTNET: '0x14a33',\n BSC: '0x38',\n BSC_TESTNET: '0x61',\n OPTIMISM: '0xa',\n OPTIMISM_TESTNET: '0x1a4',\n OPBNB: '0xcc',\n OPBNB_TESTNET: '0x15eb',\n OPTIMISM_SEPOLIA: '0xaa37dc',\n POLYGON: '0x89',\n POLYGON_TESTNET: '0x13881',\n AVALANCHE: '0xa86a',\n AVALANCHE_TESTNET: '0xa869',\n FANTOM: '0xfa',\n FANTOM_TESTNET: '0xfa2',\n SEPOLIA: '0xaa36a7',\n LINEA_GOERLI: '0xe704',\n LINEA_SEPOLIA: '0xe705',\n LINEA_MAINNET: '0xe708',\n MOONBEAM: '0x504',\n MOONBEAM_TESTNET: '0x507',\n MOONRIVER: '0x505',\n GNOSIS: '0x64',\n ARBITRUM: '0xa4b1',\n ZKSYNC_ERA: '0x144',\n ZORA: '0x76adf1',\n SCROLL: '0x82750',\n SCROLL_SEPOLIA: '0x8274f',\n} as const;\n\nexport const DEFAULT_ETHERSCAN_DOMAIN = 'etherscan.io';\nexport const DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX = 'api';\n\nexport const ETHERSCAN_SUPPORTED_NETWORKS = {\n [CHAIN_IDS.GOERLI]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli`,\n },\n [CHAIN_IDS.MAINNET]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.SEPOLIA]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia`,\n },\n [CHAIN_IDS.LINEA_GOERLI]: {\n domain: 'lineascan.build',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-goerli`,\n },\n [CHAIN_IDS.LINEA_SEPOLIA]: {\n domain: 'lineascan.build',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia`,\n },\n [CHAIN_IDS.LINEA_MAINNET]: {\n domain: 'lineascan.build',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.BSC]: {\n domain: 'bscscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.BSC_TESTNET]: {\n domain: 'bscscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.OPTIMISM]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-optimistic`,\n },\n [CHAIN_IDS.OPTIMISM_SEPOLIA]: {\n domain: DEFAULT_ETHERSCAN_DOMAIN,\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-sepolia-optimistic`,\n },\n [CHAIN_IDS.POLYGON]: {\n domain: 'polygonscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.POLYGON_TESTNET]: {\n domain: 'polygonscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-mumbai`,\n },\n [CHAIN_IDS.AVALANCHE]: {\n domain: 'snowtrace.io',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.AVALANCHE_TESTNET]: {\n domain: 'snowtrace.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.FANTOM]: {\n domain: 'ftmscan.com',\n subdomain: DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX,\n },\n [CHAIN_IDS.FANTOM_TESTNET]: {\n domain: 'ftmscan.com',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-testnet`,\n },\n [CHAIN_IDS.MOONBEAM]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonbeam`,\n },\n [CHAIN_IDS.MOONBEAM_TESTNET]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonbase`,\n },\n [CHAIN_IDS.MOONRIVER]: {\n domain: 'moonscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-moonriver`,\n },\n [CHAIN_IDS.GNOSIS]: {\n domain: 'gnosisscan.io',\n subdomain: `${DEFAULT_ETHERSCAN_SUBDOMAIN_PREFIX}-gnosis`,\n },\n};\n\nexport const GAS_BUFFER_CHAIN_OVERRIDES = {\n [CHAIN_IDS.OPTIMISM]: 1,\n [CHAIN_IDS.OPTIMISM_SEPOLIA]: 1,\n};\n\n/** Extract of the Wrapped ERC-20 ABI required for simulation. */\nexport const ABI_SIMULATION_ERC20_WRAPPED = [\n {\n anonymous: false,\n inputs: [\n { indexed: true, name: 'to', type: 'address' },\n { indexed: false, name: 'wad', type: 'uint256' },\n ],\n name: 'Deposit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n { indexed: true, name: 'from', type: 'address' },\n { indexed: false, name: 'wad', type: 'uint256' },\n ],\n name: 'Withdrawal',\n type: 'event',\n },\n];\n\n/** Extract of the legacy ERC-721 ABI required for simulation. */\nexport const ABI_SIMULATION_ERC721_LEGACY = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n name: '_from',\n type: 'address',\n },\n {\n indexed: false,\n name: '_to',\n type: 'address',\n },\n {\n indexed: false,\n name: '_tokenId',\n type: 'uint256',\n },\n ],\n name: 'Transfer',\n type: 'event',\n },\n];\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-UHG2LLVV.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-UHG2LLVV.mjs.map +deleted file mode 100644 +index fb3df62..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-UHG2LLVV.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/LineaGasFeeFlow.ts"],"sourcesContent":["import { ChainId, hexToBN, query, toHex } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\nimport type BN from 'bn.js';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel, GasFeeEstimateType } from '../types';\nimport { DefaultGasFeeFlow } from './DefaultGasFeeFlow';\n\ntype LineaEstimateGasResponse = {\n baseFeePerGas: Hex;\n priorityFeePerGas: Hex;\n};\n\ntype FeesByLevel = {\n [key in GasFeeEstimateLevel]: BN;\n};\n\nconst log = createModuleLogger(projectLogger, 'linea-gas-fee-flow');\n\nconst LINEA_CHAIN_IDS: Hex[] = [\n ChainId['linea-mainnet'],\n ChainId['linea-goerli'],\n ChainId['linea-sepolia'],\n];\n\nconst BASE_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.35,\n high: 1.7,\n};\n\nconst PRIORITY_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.05,\n high: 1.1,\n};\n\n/**\n * Implementation of a gas fee flow specific to Linea networks that obtains gas fee estimates using:\n * - The `linea_estimateGas` RPC method to obtain the base fee and lowest priority fee.\n * - Static multipliers to increase the base and priority fees.\n */\nexport class LineaGasFeeFlow implements GasFeeFlow {\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return LINEA_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise {\n try {\n return await this.#getLineaGasFees(request);\n } catch (error) {\n log('Using default flow as fallback due to error', error);\n return new DefaultGasFeeFlow().getGasFees(request);\n }\n }\n\n async #getLineaGasFees(\n request: GasFeeFlowRequest,\n ): Promise {\n const { ethQuery, transactionMeta } = request;\n\n const lineaResponse = await this.#getLineaResponse(\n transactionMeta,\n ethQuery,\n );\n\n log('Received Linea response', lineaResponse);\n\n const baseFees = this.#getValuesFromMultipliers(\n lineaResponse.baseFeePerGas,\n BASE_FEE_MULTIPLIERS,\n );\n\n log('Generated base fees', this.#feesToString(baseFees));\n\n const priorityFees = this.#getValuesFromMultipliers(\n lineaResponse.priorityFeePerGas,\n PRIORITY_FEE_MULTIPLIERS,\n );\n\n log('Generated priority fees', this.#feesToString(priorityFees));\n\n const maxFees = this.#getMaxFees(baseFees, priorityFees);\n\n log('Generated max fees', this.#feesToString(maxFees));\n\n const estimates = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: {\n maxFeePerGas: toHex(maxFees[level]),\n maxPriorityFeePerGas: toHex(priorityFees[level]),\n },\n }),\n { type: GasFeeEstimateType.FeeMarket } as GasFeeEstimates,\n );\n\n return { estimates };\n }\n\n #getLineaResponse(\n transactionMeta: TransactionMeta,\n ethQuery: EthQuery,\n ): Promise {\n return query(ethQuery, 'linea_estimateGas', [\n {\n from: transactionMeta.txParams.from,\n to: transactionMeta.txParams.to,\n value: transactionMeta.txParams.value,\n input: transactionMeta.txParams.data,\n // Required in request but no impact on response.\n gasPrice: '0x100000000',\n },\n ]);\n }\n\n #getValuesFromMultipliers(\n value: Hex,\n multipliers: { low: number; medium: number; high: number },\n ): FeesByLevel {\n const base = hexToBN(value);\n const low = base.muln(multipliers.low);\n const medium = base.muln(multipliers.medium);\n const high = base.muln(multipliers.high);\n\n return {\n low,\n medium,\n high,\n };\n }\n\n #getMaxFees(\n baseFees: Record,\n priorityFees: Record,\n ): FeesByLevel {\n return {\n low: baseFees.low.add(priorityFees.low),\n medium: baseFees.medium.add(priorityFees.medium),\n high: baseFees.high.add(priorityFees.high),\n };\n }\n\n #feesToString(fees: FeesByLevel) {\n return Object.values(GasFeeEstimateLevel).map((level) =>\n fees[level].toString(10),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,SAAS,SAAS,OAAO,aAAa;AAE/C,SAAS,0BAAoC;AAuB7C,IAAM,MAAM,mBAAmB,eAAe,oBAAoB;AAElE,IAAM,kBAAyB;AAAA,EAC7B,QAAQ,eAAe;AAAA,EACvB,QAAQ,cAAc;AAAA,EACtB,QAAQ,eAAe;AACzB;AAEA,IAAM,uBAAuB;AAAA,EAC3B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,IAAM,2BAA2B;AAAA,EAC/B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AACR;AA3CA;AAkDO,IAAM,kBAAN,MAA4C;AAAA,EAA5C;AAcL,uBAAM;AA4CN;AAgBA;AAgBA;AAWA;AAAA;AAAA,EApGA,mBAAmB,iBAA2C;AAC5D,WAAO,gBAAgB,SA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,IACZ;AAAA,EACF,CAAC;AACH;AAEA;AAAA,8BAAyB,SACvB,OACA,aACa;AACb,QAAM,OAAO,QAAQ,KAAK;AAC1B,QAAM,MAAM,KAAK,KAAK,YAAY,GAAG;AACrC,QAAM,SAAS,KAAK,KAAK,YAAY,MAAM;AAC3C,QAAM,OAAO,KAAK,KAAK,YAAY,IAAI;AAEvC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA;AAAA,gBAAW,SACT,UACA,cACa;AACb,SAAO;AAAA,IACL,KAAK,SAAS,IAAI,IAAI,aAAa,GAAG;AAAA,IACtC,QAAQ,SAAS,OAAO,IAAI,aAAa,MAAM;AAAA,IAC/C,MAAM,SAAS,KAAK,IAAI,aAAa,IAAI;AAAA,EAC3C;AACF;AAEA;AAAA,kBAAa,SAAC,MAAmB;AAC/B,SAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAAI,CAAC,UAC7C,KAAK,KAAK,EAAE,SAAS,EAAE;AAAA,EACzB;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-UKV5HIMT.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-UKV5HIMT.mjs.map +deleted file mode 100644 +index d562a47..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-UKV5HIMT.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/TransactionController.ts"],"sourcesContent":["import { Hardfork, Common, type ChainConfig } from '@ethereumjs/common';\nimport type { TypedTransaction } from '@ethereumjs/tx';\nimport { TransactionFactory } from '@ethereumjs/tx';\nimport { bufferToHex } from '@ethereumjs/util';\nimport type { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller';\nimport type {\n AcceptResultCallbacks,\n AddApprovalRequest,\n AddResult,\n} from '@metamask/approval-controller';\nimport type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n RestrictedControllerMessenger,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport {\n query,\n ApprovalType,\n ORIGIN_METAMASK,\n convertHexToDecimal,\n isInfuraNetworkType,\n} from '@metamask/controller-utils';\nimport EthQuery from '@metamask/eth-query';\nimport type {\n FetchGasFeeEstimateOptions,\n GasFeeState,\n} from '@metamask/gas-fee-controller';\nimport type {\n BlockTracker,\n NetworkClientId,\n NetworkController,\n NetworkControllerStateChangeEvent,\n NetworkState,\n Provider,\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport { NetworkClientType } from '@metamask/network-controller';\nimport type {\n NonceLock,\n Transaction as NonceTrackerTransaction,\n} from '@metamask/nonce-tracker';\nimport { NonceTracker } from '@metamask/nonce-tracker';\nimport { errorCodes, rpcErrors, providerErrors } from '@metamask/rpc-errors';\nimport type { Hex } from '@metamask/utils';\nimport { add0x } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport { MethodRegistry } from 'eth-method-registry';\nimport { EventEmitter } from 'events';\nimport { cloneDeep, mapValues, merge, pickBy, sortBy, isEqual } from 'lodash';\nimport { v1 as random } from 'uuid';\n\nimport { DefaultGasFeeFlow } from './gas-flows/DefaultGasFeeFlow';\nimport { LineaGasFeeFlow } from './gas-flows/LineaGasFeeFlow';\nimport { OptimismLayer1GasFeeFlow } from './gas-flows/OptimismLayer1GasFeeFlow';\nimport { ScrollLayer1GasFeeFlow } from './gas-flows/ScrollLayer1GasFeeFlow';\nimport { TestGasFeeFlow } from './gas-flows/TestGasFeeFlow';\nimport { EtherscanRemoteTransactionSource } from './helpers/EtherscanRemoteTransactionSource';\nimport { GasFeePoller } from './helpers/GasFeePoller';\nimport type { IncomingTransactionOptions } from './helpers/IncomingTransactionHelper';\nimport { IncomingTransactionHelper } from './helpers/IncomingTransactionHelper';\nimport { MultichainTrackingHelper } from './helpers/MultichainTrackingHelper';\nimport { PendingTransactionTracker } from './helpers/PendingTransactionTracker';\nimport { projectLogger as log } from './logger';\nimport type {\n DappSuggestedGasFees,\n Layer1GasFeeFlow,\n SavedGasFees,\n SecurityProviderRequest,\n SendFlowHistoryEntry,\n TransactionParams,\n TransactionMeta,\n TransactionReceipt,\n WalletDevice,\n SecurityAlertResponse,\n GasFeeFlow,\n SimulationData,\n GasFeeEstimates,\n GasFeeFlowResponse,\n} from './types';\nimport {\n TransactionEnvelopeType,\n TransactionType,\n TransactionStatus,\n SimulationErrorCode,\n} from './types';\nimport { validateConfirmedExternalTransaction } from './utils/external-transactions';\nimport { addGasBuffer, estimateGas, updateGas } from './utils/gas';\nimport { updateGasFees } from './utils/gas-fees';\nimport { getGasFeeFlow } from './utils/gas-flow';\nimport {\n addInitialHistorySnapshot,\n updateTransactionHistory,\n} from './utils/history';\nimport {\n getTransactionLayer1GasFee,\n updateTransactionLayer1GasFee,\n} from './utils/layer1-gas-fee-flow';\nimport {\n getAndFormatTransactionsForNonceTracker,\n getNextNonce,\n} from './utils/nonce';\nimport { getSimulationData } from './utils/simulation';\nimport {\n updatePostTransactionBalance,\n updateSwapsTransaction,\n} from './utils/swaps';\nimport { determineTransactionType } from './utils/transaction-type';\nimport {\n getIncreasedPriceFromExisting,\n normalizeTransactionParams,\n isEIP1559Transaction,\n isFeeMarketEIP1559Values,\n isGasPriceValue,\n validateGasValues,\n validateIfTransactionUnapproved,\n validateMinimumIncrease,\n normalizeTxError,\n normalizeGasFeeValues,\n} from './utils/utils';\nimport {\n validateTransactionOrigin,\n validateTxParams,\n} from './utils/validation';\n\n/**\n * Metadata for the TransactionController state, describing how to \"anonymize\"\n * the state and which parts should be persisted.\n */\nconst metadata = {\n transactions: {\n persist: true,\n anonymous: false,\n },\n methodData: {\n persist: true,\n anonymous: false,\n },\n lastFetchedBlockNumbers: {\n persist: true,\n anonymous: false,\n },\n};\n\nexport const HARDFORK = Hardfork.London;\n\n/**\n * Object with new transaction's meta and a promise resolving to the\n * transaction hash if successful.\n *\n * @property result - Promise resolving to a new transaction hash\n * @property transactionMeta - Meta information about this new transaction\n */\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface Result {\n result: Promise;\n transactionMeta: TransactionMeta;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface GasPriceValue {\n gasPrice: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface FeeMarketEIP1559Values {\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n}\n\n/**\n * Method data registry object\n *\n * @property registryMethod - Registry method raw string\n * @property parsedRegistryMethod - Registry method object, containing name and method arguments\n */\nexport type MethodData = {\n registryMethod: string;\n parsedRegistryMethod:\n | {\n name: string;\n args: { type: string }[];\n }\n | {\n // We're using `any` instead of `undefined` for compatibility with `Json`\n // TODO: Correct this type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n name?: any;\n // We're using `any` instead of `undefined` for compatibility with `Json`\n // TODO: Correct this type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args?: any;\n };\n};\n\n/**\n * Transaction controller state\n *\n * @property transactions - A list of TransactionMeta objects\n * @property methodData - Object containing all known method data information\n * @property lastFetchedBlockNumbers - Last fetched block numbers.\n */\nexport type TransactionControllerState = {\n transactions: TransactionMeta[];\n methodData: Record;\n lastFetchedBlockNumbers: { [key: string]: number };\n};\n\n/**\n * Multiplier used to determine a transaction's increased gas fee during cancellation\n */\nexport const CANCEL_RATE = 1.1;\n\n/**\n * Multiplier used to determine a transaction's increased gas fee during speed up\n */\nexport const SPEED_UP_RATE = 1.1;\n\n/**\n * Represents the `TransactionController:getState` action.\n */\nexport type TransactionControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n TransactionControllerState\n>;\n\n/**\n * The internal actions available to the TransactionController.\n */\nexport type TransactionControllerActions = TransactionControllerGetStateAction;\n\n/**\n * Configuration options for the PendingTransactionTracker\n *\n * @property isResubmitEnabled - Whether transaction publishing is automatically retried.\n */\nexport type PendingTransactionOptions = {\n isResubmitEnabled?: () => boolean;\n};\n\n/**\n * TransactionController constructor options.\n *\n * @property blockTracker - The block tracker used to poll for new blocks data.\n * @property disableHistory - Whether to disable storing history in transaction metadata.\n * @property disableSendFlowHistory - Explicitly disable transaction metadata history.\n * @property disableSwaps - Whether to disable additional processing on swaps transactions.\n * @property getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.\n * @property getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.\n * @property getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.\n * @property getGasFeeEstimates - Callback to retrieve gas fee estimates.\n * @property getNetworkClientRegistry - Gets the network client registry.\n * @property getNetworkState - Gets the state of the network controller.\n * @property getPermittedAccounts - Get accounts that a given origin has permissions for.\n * @property getSavedGasFees - Gets the saved gas fee config.\n * @property getSelectedAddress - Gets the address of the currently selected account.\n * @property incomingTransactions - Configuration options for incoming transaction support.\n * @property isMultichainEnabled - Enable multichain support.\n * @property isSimulationEnabled - Whether new transactions will be automatically simulated.\n * @property messenger - The controller messenger.\n * @property onNetworkStateChange - Allows subscribing to network controller state changes.\n * @property pendingTransactions - Configuration options for pending transaction support.\n * @property provider - The provider used to create the underlying EthQuery instance.\n * @property securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.\n * @property sign - Function used to sign transactions.\n * @property state - Initial state to set on this controller.\n * @property transactionHistoryLimit - Transaction history limit.\n * @property hooks - The controller hooks.\n * @property hooks.afterSign - Additional logic to execute after signing a transaction. Return false to not change the status to signed.\n * @property hooks.beforeApproveOnInit - Additional logic to execute before starting an approval flow for a transaction during initialization. Return false to skip the transaction.\n * @property hooks.beforeCheckPendingTransaction - Additional logic to execute before checking pending transactions. Return false to prevent the broadcast of the transaction.\n * @property hooks.beforePublish - Additional logic to execute before publishing a transaction. Return false to prevent the broadcast of the transaction.\n * @property hooks.getAdditionalSignArguments - Returns additional arguments required to sign a transaction.\n * @property hooks.publish - Alternate logic to publish a transaction.\n */\nexport type TransactionControllerOptions = {\n blockTracker: BlockTracker;\n disableHistory: boolean;\n disableSendFlowHistory: boolean;\n disableSwaps: boolean;\n getCurrentAccountEIP1559Compatibility?: () => Promise;\n getCurrentNetworkEIP1559Compatibility: () => Promise;\n getExternalPendingTransactions?: (\n address: string,\n chainId?: string,\n ) => NonceTrackerTransaction[];\n getGasFeeEstimates?: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];\n getNetworkState: () => NetworkState;\n getPermittedAccounts: (origin?: string) => Promise;\n getSavedGasFees?: (chainId: Hex) => SavedGasFees | undefined;\n incomingTransactions?: IncomingTransactionOptions;\n isMultichainEnabled: boolean;\n isSimulationEnabled?: () => boolean;\n messenger: TransactionControllerMessenger;\n onNetworkStateChange: (listener: (state: NetworkState) => void) => void;\n pendingTransactions?: PendingTransactionOptions;\n provider: Provider;\n securityProviderRequest?: SecurityProviderRequest;\n sign?: (\n transaction: TypedTransaction,\n from: string,\n transactionMeta?: TransactionMeta,\n ) => Promise;\n state?: Partial;\n testGasFeeFlows?: boolean;\n transactionHistoryLimit: number;\n hooks: {\n afterSign?: (\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ) => boolean;\n beforeApproveOnInit?: (transactionMeta: TransactionMeta) => boolean;\n beforeCheckPendingTransaction?: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n beforePublish?: (transactionMeta: TransactionMeta) => boolean;\n getAdditionalSignArguments?: (\n transactionMeta: TransactionMeta,\n ) => (TransactionMeta | undefined)[];\n publish?: (\n transactionMeta: TransactionMeta,\n ) => Promise<{ transactionHash: string }>;\n };\n};\n\n/**\n * The name of the {@link TransactionController}.\n */\nconst controllerName = 'TransactionController';\n\n/**\n * The external actions available to the {@link TransactionController}.\n */\nexport type AllowedActions =\n | AddApprovalRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | AccountsControllerGetSelectedAccountAction;\n\n/**\n * The external events available to the {@link TransactionController}.\n */\nexport type AllowedEvents = NetworkControllerStateChangeEvent;\n\n/**\n * Represents the `TransactionController:stateChange` event.\n */\nexport type TransactionControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n TransactionControllerState\n>;\n\n/**\n * Represents the `TransactionController:incomingTransactionBlockReceived` event.\n */\nexport type TransactionControllerIncomingTransactionBlockReceivedEvent = {\n type: `${typeof controllerName}:incomingTransactionBlockReceived`;\n payload: [blockNumber: number];\n};\n\n/**\n * Represents the `TransactionController:postTransactionBalanceUpdated` event.\n */\nexport type TransactionControllerPostTransactionBalanceUpdatedEvent = {\n type: `${typeof controllerName}:postTransactionBalanceUpdated`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n approvalTransactionMeta?: TransactionMeta;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:speedUpTransactionAdded` event.\n */\nexport type TransactionControllerSpeedupTransactionAddedEvent = {\n type: `${typeof controllerName}:speedupTransactionAdded`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionApproved` event.\n */\nexport type TransactionControllerTransactionApprovedEvent = {\n type: `${typeof controllerName}:transactionApproved`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n actionId?: string;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionConfirmed` event.\n */\nexport type TransactionControllerTransactionConfirmedEvent = {\n type: `${typeof controllerName}:transactionConfirmed`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionDropped` event.\n */\nexport type TransactionControllerTransactionDroppedEvent = {\n type: `${typeof controllerName}:transactionDropped`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionFailed` event.\n */\nexport type TransactionControllerTransactionFailedEvent = {\n type: `${typeof controllerName}:transactionFailed`;\n payload: [\n {\n actionId?: string;\n error: string;\n transactionMeta: TransactionMeta;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionFinished` event.\n */\nexport type TransactionControllerTransactionFinishedEvent = {\n type: `${typeof controllerName}:transactionFinished`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionNewSwapApproval` event.\n */\nexport type TransactionControllerTransactionNewSwapApprovalEvent = {\n type: `${typeof controllerName}:transactionNewSwapApproval`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionNewSwap` event.\n */\nexport type TransactionControllerTransactionNewSwapEvent = {\n type: `${typeof controllerName}:transactionNewSwap`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionNewSwapApproval` event.\n */\nexport type TransactionControllerTransactionNewSwapAndSendEvent = {\n type: `${typeof controllerName}:transactionNewSwapAndSend`;\n payload: [{ transactionMeta: TransactionMeta }];\n};\n\n/**\n * Represents the `TransactionController:transactionPublishingSkipped` event.\n */\nexport type TransactionControllerTransactionPublishingSkipped = {\n type: `${typeof controllerName}:transactionPublishingSkipped`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * Represents the `TransactionController:transactionRejected` event.\n */\nexport type TransactionControllerTransactionRejectedEvent = {\n type: `${typeof controllerName}:transactionRejected`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n actionId?: string;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionStatusUpdated` event.\n */\nexport type TransactionControllerTransactionStatusUpdatedEvent = {\n type: `${typeof controllerName}:transactionStatusUpdated`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:transactionSubmitted` event.\n */\nexport type TransactionControllerTransactionSubmittedEvent = {\n type: `${typeof controllerName}:transactionSubmitted`;\n payload: [\n {\n transactionMeta: TransactionMeta;\n actionId?: string;\n },\n ];\n};\n\n/**\n * Represents the `TransactionController:unapprovedTransactionAdded` event.\n */\nexport type TransactionControllerUnapprovedTransactionAddedEvent = {\n type: `${typeof controllerName}:unapprovedTransactionAdded`;\n payload: [transactionMeta: TransactionMeta];\n};\n\n/**\n * The internal events available to the {@link TransactionController}.\n */\nexport type TransactionControllerEvents =\n | TransactionControllerIncomingTransactionBlockReceivedEvent\n | TransactionControllerPostTransactionBalanceUpdatedEvent\n | TransactionControllerSpeedupTransactionAddedEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerTransactionApprovedEvent\n | TransactionControllerTransactionConfirmedEvent\n | TransactionControllerTransactionDroppedEvent\n | TransactionControllerTransactionFailedEvent\n | TransactionControllerTransactionFinishedEvent\n | TransactionControllerTransactionNewSwapApprovalEvent\n | TransactionControllerTransactionNewSwapEvent\n | TransactionControllerTransactionNewSwapAndSendEvent\n | TransactionControllerTransactionPublishingSkipped\n | TransactionControllerTransactionRejectedEvent\n | TransactionControllerTransactionStatusUpdatedEvent\n | TransactionControllerTransactionSubmittedEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\n/**\n * The messenger of the {@link TransactionController}.\n */\nexport type TransactionControllerMessenger = RestrictedControllerMessenger<\n typeof controllerName,\n TransactionControllerActions | AllowedActions,\n TransactionControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n\n/**\n * Possible states of the approve transaction step.\n */\nexport enum ApprovalState {\n Approved = 'approved',\n NotApproved = 'not-approved',\n SkippedViaBeforePublishHook = 'skipped-via-before-publish-hook',\n}\n\n/**\n * Get the default TransactionsController state.\n *\n * @returns The default TransactionsController state.\n */\nfunction getDefaultTransactionControllerState(): TransactionControllerState {\n return {\n methodData: {},\n transactions: [],\n lastFetchedBlockNumbers: {},\n };\n}\n\n/**\n * Controller responsible for submitting and managing transactions.\n */\nexport class TransactionController extends BaseController<\n typeof controllerName,\n TransactionControllerState,\n TransactionControllerMessenger\n> {\n #internalEvents = new EventEmitter();\n\n private readonly isHistoryDisabled: boolean;\n\n private readonly isSwapsDisabled: boolean;\n\n private readonly isSendFlowHistoryDisabled: boolean;\n\n private readonly approvingTransactionIds: Set = new Set();\n\n private readonly nonceTracker: NonceTracker;\n\n private readonly registry: MethodRegistry;\n\n private readonly mutex = new Mutex();\n\n private readonly gasFeeFlows: GasFeeFlow[];\n\n private readonly getSavedGasFees: (chainId: Hex) => SavedGasFees | undefined;\n\n private readonly getNetworkState: () => NetworkState;\n\n private readonly getCurrentAccountEIP1559Compatibility: () => Promise;\n\n private readonly getCurrentNetworkEIP1559Compatibility: (\n networkClientId?: NetworkClientId,\n ) => Promise;\n\n private readonly getGasFeeEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n\n private readonly getPermittedAccounts: (origin?: string) => Promise;\n\n private readonly getExternalPendingTransactions: (\n address: string,\n chainId?: string,\n ) => NonceTrackerTransaction[];\n\n private readonly layer1GasFeeFlows: Layer1GasFeeFlow[];\n\n readonly #incomingTransactionOptions: IncomingTransactionOptions;\n\n private readonly incomingTransactionHelper: IncomingTransactionHelper;\n\n private readonly securityProviderRequest?: SecurityProviderRequest;\n\n readonly #pendingTransactionOptions: PendingTransactionOptions;\n\n private readonly pendingTransactionTracker: PendingTransactionTracker;\n\n private readonly signAbortCallbacks: Map void> = new Map();\n\n #transactionHistoryLimit: number;\n\n #isSimulationEnabled: () => boolean;\n\n #testGasFeeFlows: boolean;\n\n private readonly afterSign: (\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ) => boolean;\n\n private readonly beforeApproveOnInit: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n\n private readonly beforeCheckPendingTransaction: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n\n private readonly beforePublish: (transactionMeta: TransactionMeta) => boolean;\n\n private readonly publish: (\n transactionMeta: TransactionMeta,\n rawTx: string,\n ) => Promise<{ transactionHash?: string }>;\n\n private readonly getAdditionalSignArguments: (\n transactionMeta: TransactionMeta,\n ) => (TransactionMeta | undefined)[];\n\n private failTransaction(\n transactionMeta: TransactionMeta,\n error: Error,\n actionId?: string,\n ) {\n const newTransactionMeta = merge({}, transactionMeta, {\n error: normalizeTxError(error),\n status: TransactionStatus.failed as const,\n });\n this.messagingSystem.publish(`${controllerName}:transactionFailed`, {\n actionId,\n error: error.message,\n transactionMeta: newTransactionMeta,\n });\n this.updateTransaction(\n newTransactionMeta,\n 'TransactionController#failTransaction - Add error message and set status to failed',\n );\n this.onTransactionStatusChange(newTransactionMeta);\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n newTransactionMeta,\n );\n this.#internalEvents.emit(\n `${transactionMeta.id}:finished`,\n newTransactionMeta,\n );\n }\n\n private async registryLookup(fourBytePrefix: string): Promise {\n const registryMethod = await this.registry.lookup(fourBytePrefix);\n if (!registryMethod) {\n return {\n registryMethod: '',\n parsedRegistryMethod: { name: undefined, args: undefined },\n };\n }\n const parsedRegistryMethod = this.registry.parse(registryMethod);\n return { registryMethod, parsedRegistryMethod };\n }\n\n #multichainTrackingHelper: MultichainTrackingHelper;\n\n /**\n * Method used to sign transactions\n */\n sign?: (\n transaction: TypedTransaction,\n from: string,\n transactionMeta?: TransactionMeta,\n ) => Promise;\n\n /**\n * Constructs a TransactionController.\n *\n * @param options - The controller options.\n * @param options.blockTracker - The block tracker used to poll for new blocks data.\n * @param options.disableHistory - Whether to disable storing history in transaction metadata.\n * @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.\n * @param options.disableSwaps - Whether to disable additional processing on swaps transactions.\n * @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.\n * @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.\n * @param options.getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.\n * @param options.getGasFeeEstimates - Callback to retrieve gas fee estimates.\n * @param options.getNetworkClientRegistry - Gets the network client registry.\n * @param options.getNetworkState - Gets the state of the network controller.\n * @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.\n * @param options.getSavedGasFees - Gets the saved gas fee config.\n * @param options.incomingTransactions - Configuration options for incoming transaction support.\n * @param options.isMultichainEnabled - Enable multichain support.\n * @param options.isSimulationEnabled - Whether new transactions will be automatically simulated.\n * @param options.messenger - The controller messenger.\n * @param options.onNetworkStateChange - Allows subscribing to network controller state changes.\n * @param options.pendingTransactions - Configuration options for pending transaction support.\n * @param options.provider - The provider used to create the underlying EthQuery instance.\n * @param options.securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.\n * @param options.sign - Function used to sign transactions.\n * @param options.state - Initial state to set on this controller.\n * @param options.testGasFeeFlows - Whether to use the test gas fee flow.\n * @param options.transactionHistoryLimit - Transaction history limit.\n * @param options.hooks - The controller hooks.\n */\n constructor({\n blockTracker,\n disableHistory,\n disableSendFlowHistory,\n disableSwaps,\n getCurrentAccountEIP1559Compatibility,\n getCurrentNetworkEIP1559Compatibility,\n getExternalPendingTransactions,\n getGasFeeEstimates,\n getNetworkClientRegistry,\n getNetworkState,\n getPermittedAccounts,\n getSavedGasFees,\n incomingTransactions = {},\n isMultichainEnabled = false,\n isSimulationEnabled,\n messenger,\n onNetworkStateChange,\n pendingTransactions = {},\n provider,\n securityProviderRequest,\n sign,\n state,\n testGasFeeFlows,\n transactionHistoryLimit = 40,\n hooks,\n }: TransactionControllerOptions) {\n super({\n name: controllerName,\n metadata,\n messenger,\n state: {\n ...getDefaultTransactionControllerState(),\n ...state,\n },\n });\n\n this.messagingSystem = messenger;\n this.getNetworkState = getNetworkState;\n this.isSendFlowHistoryDisabled = disableSendFlowHistory ?? false;\n this.isHistoryDisabled = disableHistory ?? false;\n this.isSwapsDisabled = disableSwaps ?? false;\n this.#isSimulationEnabled = isSimulationEnabled ?? (() => true);\n // @ts-expect-error the type in eth-method-registry is inappropriate and should be changed\n this.registry = new MethodRegistry({ provider });\n this.getSavedGasFees = getSavedGasFees ?? ((_chainId) => undefined);\n this.getCurrentAccountEIP1559Compatibility =\n getCurrentAccountEIP1559Compatibility ?? (() => Promise.resolve(true));\n this.getCurrentNetworkEIP1559Compatibility =\n getCurrentNetworkEIP1559Compatibility;\n this.getGasFeeEstimates =\n getGasFeeEstimates || (() => Promise.resolve({} as GasFeeState));\n this.getPermittedAccounts = getPermittedAccounts;\n this.getExternalPendingTransactions =\n getExternalPendingTransactions ?? (() => []);\n this.securityProviderRequest = securityProviderRequest;\n this.#incomingTransactionOptions = incomingTransactions;\n this.#pendingTransactionOptions = pendingTransactions;\n this.#transactionHistoryLimit = transactionHistoryLimit;\n this.sign = sign;\n this.#testGasFeeFlows = testGasFeeFlows === true;\n\n this.afterSign = hooks?.afterSign ?? (() => true);\n this.beforeApproveOnInit = hooks?.beforeApproveOnInit ?? (() => true);\n this.beforeCheckPendingTransaction =\n hooks?.beforeCheckPendingTransaction ??\n /* istanbul ignore next */\n (() => true);\n this.beforePublish = hooks?.beforePublish ?? (() => true);\n this.getAdditionalSignArguments =\n hooks?.getAdditionalSignArguments ?? (() => []);\n this.publish =\n hooks?.publish ?? (() => Promise.resolve({ transactionHash: undefined }));\n\n this.nonceTracker = this.#createNonceTracker({\n provider,\n blockTracker,\n });\n\n const findNetworkClientIdByChainId = (chainId: Hex) => {\n return this.messagingSystem.call(\n `NetworkController:findNetworkClientIdByChainId`,\n chainId,\n );\n };\n\n this.#multichainTrackingHelper = new MultichainTrackingHelper({\n isMultichainEnabled,\n provider,\n nonceTracker: this.nonceTracker,\n incomingTransactionOptions: incomingTransactions,\n findNetworkClientIdByChainId,\n getNetworkClientById: ((networkClientId: NetworkClientId) => {\n return this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n networkClientId,\n );\n }) as NetworkController['getNetworkClientById'],\n getNetworkClientRegistry,\n removeIncomingTransactionHelperListeners:\n this.#removeIncomingTransactionHelperListeners.bind(this),\n removePendingTransactionTrackerListeners:\n this.#removePendingTransactionTrackerListeners.bind(this),\n createNonceTracker: this.#createNonceTracker.bind(this),\n createIncomingTransactionHelper:\n this.#createIncomingTransactionHelper.bind(this),\n createPendingTransactionTracker:\n this.#createPendingTransactionTracker.bind(this),\n onNetworkStateChange: (listener) => {\n this.messagingSystem.subscribe(\n 'NetworkController:stateChange',\n listener,\n );\n },\n });\n this.#multichainTrackingHelper.initialize();\n\n const etherscanRemoteTransactionSource =\n new EtherscanRemoteTransactionSource({\n includeTokenTransfers: incomingTransactions.includeTokenTransfers,\n });\n\n this.incomingTransactionHelper = this.#createIncomingTransactionHelper({\n blockTracker,\n etherscanRemoteTransactionSource,\n });\n\n this.pendingTransactionTracker = this.#createPendingTransactionTracker({\n provider,\n blockTracker,\n });\n\n this.gasFeeFlows = this.#getGasFeeFlows();\n this.layer1GasFeeFlows = this.#getLayer1GasFeeFlows();\n\n const gasFeePoller = new GasFeePoller({\n findNetworkClientIdByChainId,\n gasFeeFlows: this.gasFeeFlows,\n getGasFeeControllerEstimates: this.getGasFeeEstimates,\n getProvider: (chainId, networkClientId) =>\n this.#multichainTrackingHelper.getProvider({\n networkClientId,\n chainId,\n }),\n getTransactions: () => this.state.transactions,\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n onStateChange: (listener) => {\n this.messagingSystem.subscribe(\n 'TransactionController:stateChange',\n listener,\n );\n },\n });\n\n gasFeePoller.hub.on(\n 'transaction-updated',\n this.#onGasFeePollerTransactionUpdate.bind(this),\n );\n\n // when transactionsController state changes\n // check for pending transactions and start polling if there are any\n this.messagingSystem.subscribe(\n 'TransactionController:stateChange',\n this.#checkForPendingTransactionAndStartPolling,\n );\n\n // TODO once v2 is merged make sure this only runs when\n // selectedNetworkClientId changes\n onNetworkStateChange(() => {\n log('Detected network change', this.getChainId());\n this.pendingTransactionTracker.startIfPendingTransactions();\n this.onBootCleanup();\n });\n\n this.onBootCleanup();\n this.#checkForPendingTransactionAndStartPolling();\n }\n\n /**\n * Stops polling and removes listeners to prepare the controller for garbage collection.\n */\n destroy() {\n this.#stopAllTracking();\n }\n\n /**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @returns The method data object corresponding to the given signature prefix.\n */\n async handleMethodData(fourBytePrefix: string): Promise {\n const releaseLock = await this.mutex.acquire();\n try {\n const { methodData } = this.state;\n const knownMethod = Object.keys(methodData).find(\n (knownFourBytePrefix) => fourBytePrefix === knownFourBytePrefix,\n );\n if (knownMethod) {\n return methodData[fourBytePrefix];\n }\n const registry = await this.registryLookup(fourBytePrefix);\n this.update((state) => {\n state.methodData[fourBytePrefix] = registry;\n });\n return registry;\n } finally {\n releaseLock();\n }\n }\n\n /**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction id will be generated, and gas and gasPrice will be calculated\n * if not provided. If A `:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param opts - Additional options to control how the transaction is added.\n * @param opts.actionId - Unique ID to prevent duplicate requests.\n * @param opts.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.\n * @param opts.method - RPC method that requested the transaction.\n * @param opts.origin - The origin of the transaction request, such as a dApp hostname.\n * @param opts.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.\n * @param opts.securityAlertResponse - Response from security validator.\n * @param opts.sendFlowHistory - The sendFlowHistory entries to add.\n * @param opts.type - Type of transaction to add, such as 'cancel' or 'swap'.\n * @param opts.swaps - Options for swaps transactions.\n * @param opts.swaps.hasApproveTx - Whether the transaction has an approval transaction.\n * @param opts.swaps.meta - Metadata for swap transaction.\n * @param opts.networkClientId - The id of the network client for this transaction.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\n async addTransaction(\n txParams: TransactionParams,\n {\n actionId,\n deviceConfirmedOn,\n method,\n origin,\n requireApproval,\n securityAlertResponse,\n sendFlowHistory,\n swaps = {},\n type,\n networkClientId: requestNetworkClientId,\n }: {\n actionId?: string;\n deviceConfirmedOn?: WalletDevice;\n method?: string;\n origin?: string;\n requireApproval?: boolean | undefined;\n securityAlertResponse?: SecurityAlertResponse;\n sendFlowHistory?: SendFlowHistoryEntry[];\n swaps?: {\n hasApproveTx?: boolean;\n meta?: Partial;\n };\n type?: TransactionType;\n networkClientId?: NetworkClientId;\n } = {},\n ): Promise {\n log('Adding transaction', txParams);\n\n txParams = normalizeTransactionParams(txParams);\n if (\n requestNetworkClientId &&\n !this.#multichainTrackingHelper.has(requestNetworkClientId)\n ) {\n throw new Error(\n 'The networkClientId for this transaction could not be found',\n );\n }\n\n const networkClientId =\n requestNetworkClientId ?? this.#getGlobalNetworkClientId();\n\n const isEIP1559Compatible = await this.getEIP1559Compatibility(\n networkClientId,\n );\n\n validateTxParams(txParams, isEIP1559Compatible);\n\n if (origin) {\n await validateTransactionOrigin(\n await this.getPermittedAccounts(origin),\n this.#getSelectedAccount().address,\n txParams.from,\n origin,\n );\n }\n\n const dappSuggestedGasFees = this.generateDappSuggestedGasFees(\n txParams,\n origin,\n );\n\n const chainId = this.getChainId(networkClientId);\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n chainId,\n });\n\n const transactionType =\n type ?? (await determineTransactionType(txParams, ethQuery)).type;\n\n const existingTransactionMeta = this.getTransactionWithActionId(actionId);\n\n // If a request to add a transaction with the same actionId is submitted again, a new transaction will not be created for it.\n let addedTransactionMeta = existingTransactionMeta\n ? cloneDeep(existingTransactionMeta)\n : {\n // Add actionId to txMeta to check if same actionId is seen again\n actionId,\n chainId,\n dappSuggestedGasFees,\n deviceConfirmedOn,\n id: random(),\n origin,\n securityAlertResponse,\n status: TransactionStatus.unapproved as const,\n time: Date.now(),\n txParams,\n userEditedGasLimit: false,\n verifiedOnBlockchain: false,\n type: transactionType,\n networkClientId,\n };\n\n await this.updateGasProperties(addedTransactionMeta);\n\n // Checks if a transaction already exists with a given actionId\n if (!existingTransactionMeta) {\n // Set security provider response\n if (method && this.securityProviderRequest) {\n const securityProviderResponse = await this.securityProviderRequest(\n addedTransactionMeta,\n method,\n );\n addedTransactionMeta.securityProviderResponse =\n securityProviderResponse;\n }\n\n if (!this.isSendFlowHistoryDisabled) {\n addedTransactionMeta.sendFlowHistory = sendFlowHistory ?? [];\n }\n // Initial history push\n if (!this.isHistoryDisabled) {\n addedTransactionMeta = addInitialHistorySnapshot(addedTransactionMeta);\n }\n\n addedTransactionMeta = updateSwapsTransaction(\n addedTransactionMeta,\n transactionType,\n swaps,\n {\n isSwapsDisabled: this.isSwapsDisabled,\n cancelTransaction: this.cancelTransaction.bind(this),\n messenger: this.messagingSystem,\n },\n );\n\n this.addMetadata(addedTransactionMeta);\n\n if (requireApproval !== false) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#updateSimulationData(addedTransactionMeta);\n } else {\n log('Skipping simulation as approval not required');\n }\n\n this.messagingSystem.publish(\n `${controllerName}:unapprovedTransactionAdded`,\n addedTransactionMeta,\n );\n }\n\n return {\n result: this.processApproval(addedTransactionMeta, {\n isExisting: Boolean(existingTransactionMeta),\n requireApproval,\n actionId,\n }),\n transactionMeta: addedTransactionMeta,\n };\n }\n\n startIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n if (networkClientIds.length === 0) {\n this.incomingTransactionHelper.start();\n return;\n }\n this.#multichainTrackingHelper.startIncomingTransactionPolling(\n networkClientIds,\n );\n }\n\n stopIncomingTransactionPolling(networkClientIds: NetworkClientId[] = []) {\n if (networkClientIds.length === 0) {\n this.incomingTransactionHelper.stop();\n return;\n }\n this.#multichainTrackingHelper.stopIncomingTransactionPolling(\n networkClientIds,\n );\n }\n\n stopAllIncomingTransactionPolling() {\n this.incomingTransactionHelper.stop();\n this.#multichainTrackingHelper.stopAllIncomingTransactionPolling();\n }\n\n async updateIncomingTransactions(networkClientIds: NetworkClientId[] = []) {\n if (networkClientIds.length === 0) {\n await this.incomingTransactionHelper.update();\n return;\n }\n await this.#multichainTrackingHelper.updateIncomingTransactions(\n networkClientIds,\n );\n }\n\n /**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\n async stopTransaction(\n transactionId: string,\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n {\n estimatedBaseFee,\n actionId,\n }: { estimatedBaseFee?: string; actionId?: string } = {},\n ) {\n // If transaction is found for same action id, do not create a cancel transaction.\n if (this.getTransactionWithActionId(actionId)) {\n return;\n }\n\n if (gasValues) {\n // Not good practice to reassign a parameter but temporarily avoiding a larger refactor.\n gasValues = normalizeGasFeeValues(gasValues);\n validateGasValues(gasValues);\n }\n\n log('Creating cancel transaction', transactionId, gasValues);\n\n const transactionMeta = this.getTransaction(transactionId);\n if (!transactionMeta) {\n return;\n }\n\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n // gasPrice (legacy non EIP1559)\n const minGasPrice = getIncreasedPriceFromExisting(\n transactionMeta.txParams.gasPrice,\n CANCEL_RATE,\n );\n\n const gasPriceFromValues = isGasPriceValue(gasValues) && gasValues.gasPrice;\n\n const newGasPrice =\n (gasPriceFromValues &&\n validateMinimumIncrease(gasPriceFromValues, minGasPrice)) ||\n minGasPrice;\n\n // maxFeePerGas (EIP1559)\n const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;\n const minMaxFeePerGas = getIncreasedPriceFromExisting(\n existingMaxFeePerGas,\n CANCEL_RATE,\n );\n const maxFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxFeePerGas;\n const newMaxFeePerGas =\n (maxFeePerGasValues &&\n validateMinimumIncrease(maxFeePerGasValues, minMaxFeePerGas)) ||\n (existingMaxFeePerGas && minMaxFeePerGas);\n\n // maxPriorityFeePerGas (EIP1559)\n const existingMaxPriorityFeePerGas =\n transactionMeta.txParams?.maxPriorityFeePerGas;\n const minMaxPriorityFeePerGas = getIncreasedPriceFromExisting(\n existingMaxPriorityFeePerGas,\n CANCEL_RATE,\n );\n const maxPriorityFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxPriorityFeePerGas;\n const newMaxPriorityFeePerGas =\n (maxPriorityFeePerGasValues &&\n validateMinimumIncrease(\n maxPriorityFeePerGasValues,\n minMaxPriorityFeePerGas,\n )) ||\n (existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas);\n\n const newTxParams: TransactionParams =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n from: transactionMeta.txParams.from,\n gasLimit: transactionMeta.txParams.gas,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n type: TransactionEnvelopeType.feeMarket,\n nonce: transactionMeta.txParams.nonce,\n to: transactionMeta.txParams.from,\n value: '0x0',\n }\n : {\n from: transactionMeta.txParams.from,\n gasLimit: transactionMeta.txParams.gas,\n gasPrice: newGasPrice,\n nonce: transactionMeta.txParams.nonce,\n to: transactionMeta.txParams.from,\n value: '0x0',\n };\n\n const unsignedEthTx = this.prepareUnsignedEthTx(\n transactionMeta.chainId,\n newTxParams,\n );\n\n const signedTx = await this.sign(\n unsignedEthTx,\n transactionMeta.txParams.from,\n );\n\n const rawTx = bufferToHex(signedTx.serialize());\n\n const newFee = newTxParams.maxFeePerGas ?? newTxParams.gasPrice;\n\n const oldFee = newTxParams.maxFeePerGas\n ? transactionMeta.txParams.maxFeePerGas\n : transactionMeta.txParams.gasPrice;\n\n log('Submitting cancel transaction', {\n oldFee,\n newFee,\n txParams: newTxParams,\n });\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n const hash = await this.publishTransactionForRetry(\n ethQuery,\n rawTx,\n transactionMeta,\n );\n\n const cancelTransactionMeta = {\n actionId,\n chainId: transactionMeta.chainId,\n networkClientId: transactionMeta.networkClientId,\n estimatedBaseFee,\n hash,\n id: random(),\n originalGasEstimate: transactionMeta.txParams.gas,\n status: TransactionStatus.submitted as const,\n time: Date.now(),\n type: TransactionType.cancel as const,\n txParams: newTxParams,\n };\n\n this.addMetadata(cancelTransactionMeta);\n\n // stopTransaction has no approval request, so we assume the user has already approved the transaction\n this.messagingSystem.publish(`${controllerName}:transactionApproved`, {\n transactionMeta: cancelTransactionMeta,\n actionId,\n });\n this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {\n transactionMeta: cancelTransactionMeta,\n actionId,\n });\n\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n cancelTransactionMeta,\n );\n this.#internalEvents.emit(\n `${transactionMeta.id}:finished`,\n cancelTransactionMeta,\n );\n }\n\n /**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\n async speedUpTransaction(\n transactionId: string,\n gasValues?: GasPriceValue | FeeMarketEIP1559Values,\n {\n actionId,\n estimatedBaseFee,\n }: { actionId?: string; estimatedBaseFee?: string } = {},\n ) {\n // If transaction is found for same action id, do not create a new speed up transaction.\n if (this.getTransactionWithActionId(actionId)) {\n return;\n }\n\n if (gasValues) {\n // Not good practice to reassign a parameter but temporarily avoiding a larger refactor.\n gasValues = normalizeGasFeeValues(gasValues);\n validateGasValues(gasValues);\n }\n\n log('Creating speed up transaction', transactionId, gasValues);\n\n const transactionMeta = this.getTransaction(transactionId);\n /* istanbul ignore next */\n if (!transactionMeta) {\n return;\n }\n\n /* istanbul ignore next */\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n // gasPrice (legacy non EIP1559)\n const minGasPrice = getIncreasedPriceFromExisting(\n transactionMeta.txParams.gasPrice,\n SPEED_UP_RATE,\n );\n\n const gasPriceFromValues = isGasPriceValue(gasValues) && gasValues.gasPrice;\n\n const newGasPrice =\n (gasPriceFromValues &&\n validateMinimumIncrease(gasPriceFromValues, minGasPrice)) ||\n minGasPrice;\n\n // maxFeePerGas (EIP1559)\n const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;\n const minMaxFeePerGas = getIncreasedPriceFromExisting(\n existingMaxFeePerGas,\n SPEED_UP_RATE,\n );\n const maxFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxFeePerGas;\n const newMaxFeePerGas =\n (maxFeePerGasValues &&\n validateMinimumIncrease(maxFeePerGasValues, minMaxFeePerGas)) ||\n (existingMaxFeePerGas && minMaxFeePerGas);\n\n // maxPriorityFeePerGas (EIP1559)\n const existingMaxPriorityFeePerGas =\n transactionMeta.txParams?.maxPriorityFeePerGas;\n const minMaxPriorityFeePerGas = getIncreasedPriceFromExisting(\n existingMaxPriorityFeePerGas,\n SPEED_UP_RATE,\n );\n const maxPriorityFeePerGasValues =\n isFeeMarketEIP1559Values(gasValues) && gasValues.maxPriorityFeePerGas;\n const newMaxPriorityFeePerGas =\n (maxPriorityFeePerGasValues &&\n validateMinimumIncrease(\n maxPriorityFeePerGasValues,\n minMaxPriorityFeePerGas,\n )) ||\n (existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas);\n\n const txParams: TransactionParams =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n type: TransactionEnvelopeType.feeMarket,\n }\n : {\n ...transactionMeta.txParams,\n gasLimit: transactionMeta.txParams.gas,\n gasPrice: newGasPrice,\n };\n\n const unsignedEthTx = this.prepareUnsignedEthTx(\n transactionMeta.chainId,\n txParams,\n );\n\n const signedTx = await this.sign(\n unsignedEthTx,\n transactionMeta.txParams.from,\n );\n\n const transactionMetaWithRsv = this.updateTransactionMetaRSV(\n transactionMeta,\n signedTx,\n );\n const rawTx = bufferToHex(signedTx.serialize());\n\n const newFee = txParams.maxFeePerGas ?? txParams.gasPrice;\n\n const oldFee = txParams.maxFeePerGas\n ? transactionMetaWithRsv.txParams.maxFeePerGas\n : transactionMetaWithRsv.txParams.gasPrice;\n\n log('Submitting speed up transaction', { oldFee, newFee, txParams });\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n const hash = await this.publishTransactionForRetry(\n ethQuery,\n rawTx,\n transactionMeta,\n );\n\n const baseTransactionMeta = {\n ...transactionMetaWithRsv,\n estimatedBaseFee,\n id: random(),\n time: Date.now(),\n hash,\n actionId,\n originalGasEstimate: transactionMeta.txParams.gas,\n type: TransactionType.retry as const,\n originalType: transactionMeta.type,\n };\n\n const newTransactionMeta =\n newMaxFeePerGas && newMaxPriorityFeePerGas\n ? {\n ...baseTransactionMeta,\n txParams: {\n ...transactionMeta.txParams,\n maxFeePerGas: newMaxFeePerGas,\n maxPriorityFeePerGas: newMaxPriorityFeePerGas,\n },\n }\n : {\n ...baseTransactionMeta,\n txParams: {\n ...transactionMeta.txParams,\n gasPrice: newGasPrice,\n },\n };\n\n this.addMetadata(newTransactionMeta);\n\n // speedUpTransaction has no approval request, so we assume the user has already approved the transaction\n this.messagingSystem.publish(`${controllerName}:transactionApproved`, {\n transactionMeta: newTransactionMeta,\n actionId,\n });\n\n this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {\n transactionMeta: newTransactionMeta,\n actionId,\n });\n\n this.messagingSystem.publish(\n `${controllerName}:speedupTransactionAdded`,\n newTransactionMeta,\n );\n }\n\n /**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @param networkClientId - The network client id to use for the estimate.\n * @returns The gas and gas price.\n */\n async estimateGas(\n transaction: TransactionParams,\n networkClientId?: NetworkClientId,\n ) {\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n });\n const { estimatedGas, simulationFails } = await estimateGas(\n transaction,\n ethQuery,\n );\n\n return { gas: estimatedGas, simulationFails };\n }\n\n /**\n * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.\n *\n * @param transaction - The transaction params to estimate gas for.\n * @param multiplier - The multiplier to use for the gas buffer.\n * @param networkClientId - The network client id to use for the estimate.\n */\n async estimateGasBuffered(\n transaction: TransactionParams,\n multiplier: number,\n networkClientId?: NetworkClientId,\n ) {\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n });\n const { blockGasLimit, estimatedGas, simulationFails } = await estimateGas(\n transaction,\n ethQuery,\n );\n\n const gas = addGasBuffer(estimatedGas, blockGasLimit, multiplier);\n\n return {\n gas,\n simulationFails,\n };\n }\n\n /**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to include in the transaction history.\n */\n updateTransaction(transactionMeta: TransactionMeta, note: string) {\n const { id: transactionId } = transactionMeta;\n\n this.#updateTransactionInternal({ transactionId, note }, () => ({\n ...transactionMeta,\n }));\n }\n\n /**\n * Update the security alert response for a transaction.\n *\n * @param transactionId - ID of the transaction.\n * @param securityAlertResponse - The new security alert response for the transaction.\n */\n updateSecurityAlertResponse(\n transactionId: string,\n securityAlertResponse: SecurityAlertResponse,\n ) {\n if (!securityAlertResponse) {\n throw new Error(\n 'updateSecurityAlertResponse: securityAlertResponse should not be null',\n );\n }\n const transactionMeta = this.getTransaction(transactionId);\n if (!transactionMeta) {\n throw new Error(\n `Cannot update security alert response as no transaction metadata found`,\n );\n }\n const updatedTransactionMeta = {\n ...transactionMeta,\n securityAlertResponse,\n };\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:updatesecurityAlertResponse - securityAlertResponse updated`,\n );\n }\n\n /**\n * Removes all transactions from state, optionally based on the current network.\n *\n * @param ignoreNetwork - Determines whether to wipe all transactions, or just those on the\n * current network. If `true`, all transactions are wiped.\n * @param address - If specified, only transactions originating from this address will be\n * wiped on current network.\n */\n wipeTransactions(ignoreNetwork?: boolean, address?: string) {\n /* istanbul ignore next */\n if (ignoreNetwork && !address) {\n this.update((state) => {\n state.transactions = [];\n });\n return;\n }\n const currentChainId = this.getChainId();\n const newTransactions = this.state.transactions.filter(\n ({ chainId, txParams }) => {\n const isMatchingNetwork = ignoreNetwork || chainId === currentChainId;\n\n if (!isMatchingNetwork) {\n return true;\n }\n\n const isMatchingAddress =\n !address || txParams.from?.toLowerCase() === address.toLowerCase();\n\n return !isMatchingAddress;\n },\n );\n\n this.update((state) => {\n state.transactions = this.trimTransactionsForState(newTransactions);\n });\n }\n\n /**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\n async confirmExternalTransaction(\n transactionMeta: TransactionMeta,\n transactionReceipt: TransactionReceipt,\n baseFeePerGas: Hex,\n ) {\n // Run validation and add external transaction to state.\n const newTransactionMeta = this.addExternalTransaction(transactionMeta);\n\n try {\n const transactionId = newTransactionMeta.id;\n\n // Make sure status is confirmed and define gasUsed as in receipt.\n const updatedTransactionMeta = {\n ...newTransactionMeta,\n status: TransactionStatus.confirmed as const,\n txReceipt: transactionReceipt,\n };\n if (baseFeePerGas) {\n updatedTransactionMeta.baseFeePerGas = baseFeePerGas;\n }\n\n // Update same nonce local transactions as dropped and define replacedBy properties.\n this.markNonceDuplicatesDropped(transactionId);\n\n // Update external provided transaction with updated gas values and confirmed status.\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:confirmExternalTransaction - Add external transaction`,\n );\n this.onTransactionStatusChange(updatedTransactionMeta);\n\n // Intentional given potential duration of process.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updatePostBalance(updatedTransactionMeta);\n\n this.messagingSystem.publish(\n `${controllerName}:transactionConfirmed`,\n updatedTransactionMeta,\n );\n } catch (error) {\n console.error('Failed to confirm external transaction', error);\n }\n }\n\n /**\n * Append new send flow history to a transaction.\n *\n * @param transactionID - The ID of the transaction to update.\n * @param currentSendFlowHistoryLength - The length of the current sendFlowHistory array.\n * @param sendFlowHistoryToAdd - The sendFlowHistory entries to add.\n * @returns The updated transactionMeta.\n */\n updateTransactionSendFlowHistory(\n transactionID: string,\n currentSendFlowHistoryLength: number,\n sendFlowHistoryToAdd: SendFlowHistoryEntry[],\n ): TransactionMeta {\n if (this.isSendFlowHistoryDisabled) {\n throw new Error(\n 'Send flow history is disabled for the current transaction controller',\n );\n }\n\n const transactionMeta = this.getTransaction(transactionID);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update send flow history as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateTransactionSendFlowHistory',\n );\n\n const sendFlowHistory = transactionMeta.sendFlowHistory ?? [];\n if (currentSendFlowHistoryLength === sendFlowHistory.length) {\n const updatedTransactionMeta = {\n ...transactionMeta,\n sendFlowHistory: [...sendFlowHistory, ...sendFlowHistoryToAdd],\n };\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:updateTransactionSendFlowHistory - sendFlowHistory updated`,\n );\n }\n\n return this.getTransaction(transactionID) as TransactionMeta;\n }\n\n /**\n * Update the gas values of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param gasValues - Gas values to update.\n * @param gasValues.gas - Same as transaction.gasLimit.\n * @param gasValues.gasLimit - Maxmimum number of units of gas to use for this transaction.\n * @param gasValues.gasPrice - Price per gas for legacy transactions.\n * @param gasValues.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param gasValues.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param gasValues.estimateUsed - Which estimate level was used.\n * @param gasValues.estimateSuggested - Which estimate level that the API suggested.\n * @param gasValues.defaultGasEstimates - The default estimate for gas.\n * @param gasValues.originalGasEstimate - Original estimate for gas.\n * @param gasValues.userEditedGasLimit - The gas limit supplied by user.\n * @param gasValues.userFeeLevel - Estimate level user selected.\n * @returns The updated transactionMeta.\n */\n updateTransactionGasFees(\n transactionId: string,\n {\n defaultGasEstimates,\n estimateUsed,\n estimateSuggested,\n gas,\n gasLimit,\n gasPrice,\n maxPriorityFeePerGas,\n maxFeePerGas,\n originalGasEstimate,\n userEditedGasLimit,\n userFeeLevel,\n }: {\n defaultGasEstimates?: string;\n estimateUsed?: string;\n estimateSuggested?: string;\n gas?: string;\n gasLimit?: string;\n gasPrice?: string;\n maxPriorityFeePerGas?: string;\n maxFeePerGas?: string;\n originalGasEstimate?: string;\n userEditedGasLimit?: boolean;\n userFeeLevel?: string;\n },\n ): TransactionMeta {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update transaction as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(\n transactionMeta,\n 'updateTransactionGasFees',\n );\n\n let transactionGasFees = {\n txParams: {\n gas,\n gasLimit,\n gasPrice,\n maxPriorityFeePerGas,\n maxFeePerGas,\n },\n defaultGasEstimates,\n estimateUsed,\n estimateSuggested,\n originalGasEstimate,\n userEditedGasLimit,\n userFeeLevel,\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any;\n\n // only update what is defined\n transactionGasFees.txParams = pickBy(transactionGasFees.txParams);\n transactionGasFees = pickBy(transactionGasFees);\n\n // merge updated gas values with existing transaction meta\n const updatedMeta = merge({}, transactionMeta, transactionGasFees);\n\n this.updateTransaction(\n updatedMeta,\n `${controllerName}:updateTransactionGasFees - gas values updated`,\n );\n\n return this.getTransaction(transactionId) as TransactionMeta;\n }\n\n /**\n * Update the previous gas values of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param previousGas - Previous gas values to update.\n * @param previousGas.gasLimit - Maxmimum number of units of gas to use for this transaction.\n * @param previousGas.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param previousGas.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @returns The updated transactionMeta.\n */\n updatePreviousGasParams(\n transactionId: string,\n {\n gasLimit,\n maxFeePerGas,\n maxPriorityFeePerGas,\n }: {\n gasLimit?: string;\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n },\n ): TransactionMeta {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update transaction as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(transactionMeta, 'updatePreviousGasParams');\n\n const transactionPreviousGas = {\n previousGas: {\n gasLimit,\n maxFeePerGas,\n maxPriorityFeePerGas,\n },\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any;\n\n // only update what is defined\n transactionPreviousGas.previousGas = pickBy(\n transactionPreviousGas.previousGas,\n );\n\n // merge updated previous gas values with existing transaction meta\n const updatedMeta = merge({}, transactionMeta, transactionPreviousGas);\n\n this.updateTransaction(\n updatedMeta,\n `${controllerName}:updatePreviousGasParams - Previous gas values updated`,\n );\n\n return this.getTransaction(transactionId) as TransactionMeta;\n }\n\n async getNonceLock(\n address: string,\n networkClientId?: NetworkClientId,\n ): Promise {\n return this.#multichainTrackingHelper.getNonceLock(\n address,\n networkClientId,\n );\n }\n\n /**\n * Updates the editable parameters of a transaction.\n *\n * @param txId - The ID of the transaction to update.\n * @param params - The editable parameters to update.\n * @param params.data - Data to pass with the transaction.\n * @param params.gas - Maximum number of units of gas to use for the transaction.\n * @param params.gasPrice - Price per gas for legacy transactions.\n * @param params.from - Address to send the transaction from.\n * @param params.to - Address to send the transaction to.\n * @param params.value - Value associated with the transaction.\n * @returns The updated transaction metadata.\n */\n async updateEditableParams(\n txId: string,\n {\n data,\n gas,\n gasPrice,\n from,\n to,\n value,\n }: {\n data?: string;\n gas?: string;\n gasPrice?: string;\n from?: string;\n to?: string;\n value?: string;\n },\n ) {\n const transactionMeta = this.getTransaction(txId);\n if (!transactionMeta) {\n throw new Error(\n `Cannot update editable params as no transaction metadata found`,\n );\n }\n\n validateIfTransactionUnapproved(transactionMeta, 'updateEditableParams');\n\n const editableParams = {\n txParams: {\n data,\n from,\n to,\n value,\n gas,\n gasPrice,\n },\n } as Partial;\n\n editableParams.txParams = pickBy(\n editableParams.txParams,\n ) as TransactionParams;\n\n const updatedTransaction = merge({}, transactionMeta, editableParams);\n const provider = this.#multichainTrackingHelper.getProvider({\n chainId: transactionMeta.chainId,\n networkClientId: transactionMeta.networkClientId,\n });\n const ethQuery = new EthQuery(provider);\n const { type } = await determineTransactionType(\n updatedTransaction.txParams,\n ethQuery,\n );\n updatedTransaction.type = type;\n\n await updateTransactionLayer1GasFee({\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n provider,\n transactionMeta: updatedTransaction,\n });\n\n this.updateTransaction(\n updatedTransaction,\n `Update Editable Params for ${txId}`,\n );\n return this.getTransaction(txId);\n }\n\n /**\n * Signs and returns the raw transaction data for provided transaction params list.\n *\n * @param listOfTxParams - The list of transaction params to approve.\n * @param opts - Options bag.\n * @param opts.hasNonce - Whether the transactions already have a nonce.\n * @returns The raw transactions.\n */\n async approveTransactionsWithSameNonce(\n listOfTxParams: (TransactionParams & { chainId: Hex })[] = [],\n { hasNonce }: { hasNonce?: boolean } = {},\n ): Promise {\n log('Approving transactions with same nonce', {\n transactions: listOfTxParams,\n });\n\n if (listOfTxParams.length === 0) {\n return '';\n }\n\n const initialTx = listOfTxParams[0];\n const common = this.getCommonConfiguration(initialTx.chainId);\n\n // We need to ensure we get the nonce using the the NonceTracker on the chain matching\n // the txParams. In this context we only have chainId available to us, but the\n // NonceTrackers are keyed by networkClientId. To workaround this, we attempt to find\n // a networkClientId that matches the chainId. As a fallback, the globally selected\n // network's NonceTracker will be used instead.\n let networkClientId: NetworkClientId | undefined;\n try {\n networkClientId = this.messagingSystem.call(\n `NetworkController:findNetworkClientIdByChainId`,\n initialTx.chainId,\n );\n } catch (err) {\n log('failed to find networkClientId from chainId', err);\n }\n\n const initialTxAsEthTx = TransactionFactory.fromTxData(initialTx, {\n common,\n });\n const initialTxAsSerializedHex = bufferToHex(initialTxAsEthTx.serialize());\n\n if (this.approvingTransactionIds.has(initialTxAsSerializedHex)) {\n return '';\n }\n this.approvingTransactionIds.add(initialTxAsSerializedHex);\n\n let rawTransactions, nonceLock;\n try {\n // TODO: we should add a check to verify that all transactions have the same from address\n const fromAddress = initialTx.from;\n const requiresNonce = hasNonce !== true;\n\n nonceLock = requiresNonce\n ? await this.getNonceLock(fromAddress, networkClientId)\n : undefined;\n\n const nonce = nonceLock\n ? add0x(nonceLock.nextNonce.toString(16))\n : initialTx.nonce;\n\n if (nonceLock) {\n log('Using nonce from nonce tracker', nonce, nonceLock.nonceDetails);\n }\n\n rawTransactions = await Promise.all(\n listOfTxParams.map((txParams) => {\n txParams.nonce = nonce;\n return this.signExternalTransaction(txParams.chainId, txParams);\n }),\n );\n } catch (err) {\n log('Error while signing transactions with same nonce', err);\n // Must set transaction to submitted/failed before releasing lock\n // continue with error chain\n throw err;\n } finally {\n nonceLock?.releaseLock();\n this.approvingTransactionIds.delete(initialTxAsSerializedHex);\n }\n return rawTransactions;\n }\n\n /**\n * Update a custodial transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param options - The custodial transaction options to update.\n * @param options.errorMessage - The error message to be assigned in case transaction status update to failed.\n * @param options.hash - The new hash value to be assigned.\n * @param options.status - The new status value to be assigned.\n */\n updateCustodialTransaction(\n transactionId: string,\n {\n errorMessage,\n hash,\n status,\n }: {\n errorMessage?: string;\n hash?: string;\n status?: TransactionStatus;\n },\n ) {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(\n `Cannot update custodial transaction as no transaction metadata found`,\n );\n }\n\n if (!transactionMeta.custodyId) {\n throw new Error('Transaction must be a custodian transaction');\n }\n\n if (\n status &&\n ![\n TransactionStatus.submitted,\n TransactionStatus.signed,\n TransactionStatus.failed,\n ].includes(status)\n ) {\n throw new Error(\n `Cannot update custodial transaction with status: ${status}`,\n );\n }\n\n const updatedTransactionMeta = merge(\n {},\n transactionMeta,\n pickBy({ hash, status }),\n ) as TransactionMeta;\n\n if (updatedTransactionMeta.status === TransactionStatus.submitted) {\n updatedTransactionMeta.submittedTime = new Date().getTime();\n }\n\n if (updatedTransactionMeta.status === TransactionStatus.failed) {\n updatedTransactionMeta.error = normalizeTxError(new Error(errorMessage));\n }\n\n this.updateTransaction(\n updatedTransactionMeta,\n `${controllerName}:updateCustodialTransaction - Custodial transaction updated`,\n );\n\n if (\n [TransactionStatus.submitted, TransactionStatus.failed].includes(\n status as TransactionStatus,\n )\n ) {\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n updatedTransactionMeta,\n );\n this.#internalEvents.emit(\n `${updatedTransactionMeta.id}:finished`,\n updatedTransactionMeta,\n );\n }\n }\n\n /**\n * Creates approvals for all unapproved transactions persisted.\n */\n initApprovals() {\n const chainId = this.getChainId();\n const unapprovedTxs = this.state.transactions.filter(\n (transaction) =>\n transaction.status === TransactionStatus.unapproved &&\n transaction.chainId === chainId &&\n !transaction.isUserOperation,\n );\n\n for (const txMeta of unapprovedTxs) {\n this.processApproval(txMeta, {\n shouldShowRequest: false,\n }).catch((error) => {\n if (error?.code === errorCodes.provider.userRejectedRequest) {\n return;\n }\n console.error('Error during persisted transaction approval', error);\n });\n }\n }\n\n /**\n * Search transaction metadata for matching entries.\n *\n * @param opts - Options bag.\n * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.\n * @param opts.initialList - The transactions to search. Defaults to the current state.\n * @param opts.filterToCurrentNetwork - Whether to filter the results to the current network. Defaults to true.\n * @param opts.limit - The maximum number of transactions to return. No limit by default.\n * @returns An array of transactions matching the provided options.\n */\n getTransactions({\n searchCriteria = {},\n initialList,\n filterToCurrentNetwork = true,\n limit,\n }: {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n searchCriteria?: any;\n initialList?: TransactionMeta[];\n filterToCurrentNetwork?: boolean;\n limit?: number;\n } = {}): TransactionMeta[] {\n const chainId = this.getChainId();\n // searchCriteria is an object that might have values that aren't predicate\n // methods. When providing any other value type (string, number, etc), we\n // consider this shorthand for \"check the value at key for strict equality\n // with the provided value\". To conform this object to be only methods, we\n // mapValues (lodash) such that every value on the object is a method that\n // returns a boolean.\n const predicateMethods = mapValues(searchCriteria, (predicate) => {\n return typeof predicate === 'function'\n ? predicate\n : // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (v: any) => v === predicate;\n });\n\n const transactionsToFilter = initialList ?? this.state.transactions;\n\n // Combine sortBy and pickBy to transform our state object into an array of\n // matching transactions that are sorted by time.\n const filteredTransactions = sortBy(\n pickBy(transactionsToFilter, (transaction) => {\n if (filterToCurrentNetwork && transaction.chainId !== chainId) {\n return false;\n }\n // iterate over the predicateMethods keys to check if the transaction\n // matches the searchCriteria\n for (const [key, predicate] of Object.entries(predicateMethods)) {\n // We return false early as soon as we know that one of the specified\n // search criteria do not match the transaction. This prevents\n // needlessly checking all criteria when we already know the criteria\n // are not fully satisfied. We check both txParams and the base\n // object as predicate keys can be either.\n if (key in transaction.txParams) {\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (predicate((transaction.txParams as any)[key]) === false) {\n return false;\n }\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } else if (predicate((transaction as any)[key]) === false) {\n return false;\n }\n }\n\n return true;\n }),\n 'time',\n );\n if (limit !== undefined) {\n // We need to have all transactions of a given nonce in order to display\n // necessary details in the UI. We use the size of this set to determine\n // whether we have reached the limit provided, thus ensuring that all\n // transactions of nonces we include will be sent to the UI.\n const nonces = new Set();\n const txs = [];\n // By default, the transaction list we filter from is sorted by time ASC.\n // To ensure that filtered results prefers the newest transactions we\n // iterate from right to left, inserting transactions into front of a new\n // array. The original order is preserved, but we ensure that newest txs\n // are preferred.\n for (let i = filteredTransactions.length - 1; i > -1; i--) {\n const txMeta = filteredTransactions[i];\n const { nonce } = txMeta.txParams;\n if (!nonces.has(nonce)) {\n if (nonces.size < limit) {\n nonces.add(nonce);\n } else {\n continue;\n }\n }\n // Push transaction into the beginning of our array to ensure the\n // original order is preserved.\n txs.unshift(txMeta);\n }\n return txs;\n }\n return filteredTransactions;\n }\n\n async estimateGasFee({\n transactionParams,\n chainId,\n networkClientId: requestNetworkClientId,\n }: {\n transactionParams: TransactionParams;\n chainId?: Hex;\n networkClientId?: NetworkClientId;\n }): Promise {\n const networkClientId = this.#getNetworkClientId({\n networkClientId: requestNetworkClientId,\n chainId,\n });\n\n const transactionMeta = {\n txParams: transactionParams,\n chainId,\n networkClientId,\n } as TransactionMeta;\n\n // Guaranteed as the default gas fee flow matches all transactions.\n const gasFeeFlow = getGasFeeFlow(\n transactionMeta,\n this.gasFeeFlows,\n ) as GasFeeFlow;\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n chainId,\n });\n\n const gasFeeControllerData = await this.getGasFeeEstimates({\n networkClientId,\n });\n\n return gasFeeFlow.getGasFees({\n ethQuery,\n gasFeeControllerData,\n transactionMeta,\n });\n }\n\n /**\n * Determine the layer 1 gas fee for the given transaction parameters.\n *\n * @param request - The request object.\n * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.\n * @param request.chainId - The ID of the chain where the transaction will be executed.\n * @param request.networkClientId - The ID of a specific network client to process the transaction.\n */\n async getLayer1GasFee({\n transactionParams,\n chainId,\n networkClientId,\n }: {\n transactionParams: TransactionParams;\n chainId?: Hex;\n networkClientId?: NetworkClientId;\n }): Promise {\n const provider = this.#multichainTrackingHelper.getProvider({\n networkClientId,\n chainId,\n });\n\n return await getTransactionLayer1GasFee({\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n provider,\n transactionMeta: {\n txParams: transactionParams,\n chainId,\n } as TransactionMeta,\n });\n }\n\n private async signExternalTransaction(\n chainId: Hex,\n transactionParams: TransactionParams,\n ): Promise {\n if (!this.sign) {\n throw new Error('No sign method defined.');\n }\n\n const normalizedTransactionParams =\n normalizeTransactionParams(transactionParams);\n const type = isEIP1559Transaction(normalizedTransactionParams)\n ? TransactionEnvelopeType.feeMarket\n : TransactionEnvelopeType.legacy;\n const updatedTransactionParams = {\n ...normalizedTransactionParams,\n type,\n gasLimit: normalizedTransactionParams.gas,\n chainId,\n };\n\n const { from } = updatedTransactionParams;\n const common = this.getCommonConfiguration(chainId);\n const unsignedTransaction = TransactionFactory.fromTxData(\n updatedTransactionParams,\n { common },\n );\n const signedTransaction = await this.sign(unsignedTransaction, from);\n\n const rawTransaction = bufferToHex(signedTransaction.serialize());\n return rawTransaction;\n }\n\n /**\n * Removes unapproved transactions from state.\n */\n clearUnapprovedTransactions() {\n const transactions = this.state.transactions.filter(\n ({ status }) => status !== TransactionStatus.unapproved,\n );\n this.update((state) => {\n state.transactions = this.trimTransactionsForState(transactions);\n });\n }\n\n /**\n * Stop the signing process for a specific transaction.\n * Throws an error causing the transaction status to be set to failed.\n * @param transactionId - The ID of the transaction to stop signing.\n */\n abortTransactionSigning(transactionId: string) {\n const transactionMeta = this.getTransaction(transactionId);\n\n if (!transactionMeta) {\n throw new Error(`Cannot abort signing as no transaction metadata found`);\n }\n\n const abortCallback = this.signAbortCallbacks.get(transactionId);\n\n if (!abortCallback) {\n throw new Error(\n `Cannot abort signing as transaction is not waiting for signing`,\n );\n }\n\n abortCallback();\n\n this.signAbortCallbacks.delete(transactionId);\n }\n\n private addMetadata(transactionMeta: TransactionMeta) {\n this.update((state) => {\n state.transactions = this.trimTransactionsForState([\n ...state.transactions,\n transactionMeta,\n ]);\n });\n }\n\n private async updateGasProperties(transactionMeta: TransactionMeta) {\n const isEIP1559Compatible =\n (await this.getEIP1559Compatibility(transactionMeta.networkClientId)) &&\n transactionMeta.txParams.type !== TransactionEnvelopeType.legacy;\n\n const { networkClientId, chainId } = transactionMeta;\n\n const isCustomNetwork = this.#isCustomNetwork(networkClientId);\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId,\n chainId,\n });\n\n const provider = this.#multichainTrackingHelper.getProvider({\n networkClientId,\n chainId,\n });\n\n await updateGas({\n ethQuery,\n chainId,\n isCustomNetwork,\n txMeta: transactionMeta,\n });\n\n await updateGasFees({\n eip1559: isEIP1559Compatible,\n ethQuery,\n gasFeeFlows: this.gasFeeFlows,\n getGasFeeEstimates: this.getGasFeeEstimates,\n getSavedGasFees: this.getSavedGasFees.bind(this),\n txMeta: transactionMeta,\n });\n\n await updateTransactionLayer1GasFee({\n layer1GasFeeFlows: this.layer1GasFeeFlows,\n provider,\n transactionMeta,\n });\n }\n\n private onBootCleanup() {\n this.submitApprovedTransactions();\n }\n\n /**\n * Force submit approved transactions for all chains.\n */\n private submitApprovedTransactions() {\n const approvedTransactions = this.state.transactions.filter(\n (transaction) => transaction.status === TransactionStatus.approved,\n );\n\n for (const transactionMeta of approvedTransactions) {\n if (this.beforeApproveOnInit(transactionMeta)) {\n this.approveTransaction(transactionMeta.id).catch((error) => {\n /* istanbul ignore next */\n console.error('Error while submitting persisted transaction', error);\n });\n }\n }\n }\n\n private async processApproval(\n transactionMeta: TransactionMeta,\n {\n isExisting = false,\n requireApproval,\n shouldShowRequest = true,\n actionId,\n }: {\n isExisting?: boolean;\n requireApproval?: boolean | undefined;\n shouldShowRequest?: boolean;\n actionId?: string;\n },\n ): Promise {\n const transactionId = transactionMeta.id;\n let resultCallbacks: AcceptResultCallbacks | undefined;\n const { meta, isCompleted } = this.isTransactionCompleted(transactionId);\n const finishedPromise = isCompleted\n ? Promise.resolve(meta)\n : this.waitForTransactionFinished(transactionId);\n\n if (meta && !isExisting && !isCompleted) {\n try {\n if (requireApproval !== false) {\n const acceptResult = await this.requestApproval(transactionMeta, {\n shouldShowRequest,\n });\n resultCallbacks = acceptResult.resultCallbacks;\n\n const approvalValue = acceptResult.value as\n | {\n txMeta?: TransactionMeta;\n }\n | undefined;\n\n const updatedTransaction = approvalValue?.txMeta;\n\n if (updatedTransaction) {\n log('Updating transaction with approval data', {\n customNonce: updatedTransaction.customNonceValue,\n params: updatedTransaction.txParams,\n });\n\n this.updateTransaction(\n updatedTransaction,\n 'TransactionController#processApproval - Updated with approval data',\n );\n }\n }\n\n const { isCompleted: isTxCompleted } =\n this.isTransactionCompleted(transactionId);\n\n if (!isTxCompleted) {\n const approvalResult = await this.approveTransaction(transactionId);\n if (\n approvalResult === ApprovalState.SkippedViaBeforePublishHook &&\n resultCallbacks\n ) {\n resultCallbacks.success();\n }\n const updatedTransactionMeta = this.getTransaction(\n transactionId,\n ) as TransactionMeta;\n this.messagingSystem.publish(\n `${controllerName}:transactionApproved`,\n {\n transactionMeta: updatedTransactionMeta,\n actionId,\n },\n );\n }\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const { isCompleted: isTxCompleted } =\n this.isTransactionCompleted(transactionId);\n if (!isTxCompleted) {\n if (error?.code === errorCodes.provider.userRejectedRequest) {\n this.cancelTransaction(transactionId, actionId);\n\n throw providerErrors.userRejectedRequest(\n 'MetaMask Tx Signature: User denied transaction signature.',\n );\n } else {\n this.failTransaction(meta, error, actionId);\n }\n }\n }\n }\n\n const finalMeta = await finishedPromise;\n\n switch (finalMeta?.status) {\n case TransactionStatus.failed:\n resultCallbacks?.error(finalMeta.error);\n throw rpcErrors.internal(finalMeta.error.message);\n\n case TransactionStatus.submitted:\n resultCallbacks?.success();\n return finalMeta.hash as string;\n\n default:\n const internalError = rpcErrors.internal(\n `MetaMask Tx Signature: Unknown problem: ${JSON.stringify(\n finalMeta || transactionId,\n )}`,\n );\n\n resultCallbacks?.error(internalError);\n throw internalError;\n }\n }\n\n /**\n * Approves a transaction and updates it's status in state. If this is not a\n * retry transaction, a nonce will be generated. The transaction is signed\n * using the sign configuration property, then published to the blockchain.\n * A `:finished` hub event is fired after success or failure.\n *\n * @param transactionId - The ID of the transaction to approve.\n */\n private async approveTransaction(transactionId: string) {\n const cleanupTasks = new Array<() => void>();\n cleanupTasks.push(await this.mutex.acquire());\n\n let transactionMeta = this.getTransactionOrThrow(transactionId);\n\n try {\n if (!this.sign) {\n this.failTransaction(\n transactionMeta,\n new Error('No sign method defined.'),\n );\n return ApprovalState.NotApproved;\n } else if (!transactionMeta.chainId) {\n this.failTransaction(transactionMeta, new Error('No chainId defined.'));\n return ApprovalState.NotApproved;\n }\n\n if (this.approvingTransactionIds.has(transactionId)) {\n log('Skipping approval as signing in progress', transactionId);\n return ApprovalState.NotApproved;\n }\n this.approvingTransactionIds.add(transactionId);\n cleanupTasks.push(() =>\n this.approvingTransactionIds.delete(transactionId),\n );\n\n const [nonce, releaseNonce] = await getNextNonce(\n transactionMeta,\n (address: string) =>\n this.#multichainTrackingHelper.getNonceLock(\n address,\n transactionMeta.networkClientId,\n ),\n );\n\n // must set transaction to submitted/failed before releasing lock\n releaseNonce && cleanupTasks.push(releaseNonce);\n\n transactionMeta = this.#updateTransactionInternal(\n {\n transactionId,\n note: 'TransactionController#approveTransaction - Transaction approved',\n },\n (draftTxMeta) => {\n const { txParams, chainId } = draftTxMeta;\n\n draftTxMeta.status = TransactionStatus.approved;\n draftTxMeta.txParams = {\n ...txParams,\n nonce,\n chainId,\n gasLimit: txParams.gas,\n ...(isEIP1559Transaction(txParams) && {\n type: TransactionEnvelopeType.feeMarket,\n }),\n };\n },\n );\n\n this.onTransactionStatusChange(transactionMeta);\n\n const rawTx = await this.signTransaction(\n transactionMeta,\n transactionMeta.txParams,\n );\n\n if (!this.beforePublish(transactionMeta)) {\n log('Skipping publishing transaction based on hook');\n this.messagingSystem.publish(\n `${controllerName}:transactionPublishingSkipped`,\n transactionMeta,\n );\n return ApprovalState.SkippedViaBeforePublishHook;\n }\n\n if (!rawTx) {\n return ApprovalState.NotApproved;\n }\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n\n let preTxBalance: string | undefined;\n const shouldUpdatePreTxBalance =\n transactionMeta.type === TransactionType.swap;\n\n if (shouldUpdatePreTxBalance) {\n log('Determining pre-transaction balance');\n\n preTxBalance = await query(ethQuery, 'getBalance', [\n transactionMeta.txParams.from,\n ]);\n }\n\n log('Publishing transaction', transactionMeta.txParams);\n\n let { transactionHash: hash } = await this.publish(\n transactionMeta,\n rawTx,\n );\n\n if (hash === undefined) {\n hash = await this.publishTransaction(ethQuery, rawTx);\n }\n\n log('Publish successful', hash);\n\n transactionMeta = this.#updateTransactionInternal(\n {\n transactionId,\n note: 'TransactionController#approveTransaction - Transaction submitted',\n },\n (draftTxMeta) => {\n draftTxMeta.hash = hash;\n draftTxMeta.status = TransactionStatus.submitted;\n draftTxMeta.submittedTime = new Date().getTime();\n if (shouldUpdatePreTxBalance) {\n draftTxMeta.preTxBalance = preTxBalance;\n log('Updated pre-transaction balance', preTxBalance);\n }\n },\n );\n\n this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {\n transactionMeta,\n });\n\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n transactionMeta,\n );\n this.#internalEvents.emit(`${transactionId}:finished`, transactionMeta);\n\n this.onTransactionStatusChange(transactionMeta);\n return ApprovalState.Approved;\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n this.failTransaction(transactionMeta, error);\n return ApprovalState.NotApproved;\n } finally {\n cleanupTasks.forEach((task) => task());\n }\n }\n\n private async publishTransaction(\n ethQuery: EthQuery,\n rawTransaction: string,\n ): Promise {\n return await query(ethQuery, 'sendRawTransaction', [rawTransaction]);\n }\n\n /**\n * Cancels a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param actionId - The actionId passed from UI\n */\n private cancelTransaction(transactionId: string, actionId?: string) {\n const transactionMeta = this.state.transactions.find(\n ({ id }) => id === transactionId,\n );\n if (!transactionMeta) {\n return;\n }\n this.update((state) => {\n const transactions = state.transactions.filter(\n ({ id }) => id !== transactionId,\n );\n state.transactions = this.trimTransactionsForState(transactions);\n });\n const updatedTransactionMeta = {\n ...transactionMeta,\n status: TransactionStatus.rejected as const,\n };\n this.messagingSystem.publish(\n `${controllerName}:transactionFinished`,\n updatedTransactionMeta,\n );\n this.#internalEvents.emit(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `${transactionMeta.id}:finished`,\n updatedTransactionMeta,\n );\n this.messagingSystem.publish(`${controllerName}:transactionRejected`, {\n transactionMeta: updatedTransactionMeta,\n actionId,\n });\n this.onTransactionStatusChange(updatedTransactionMeta);\n }\n\n /**\n * Trim the amount of transactions that are set on the state. Checks\n * if the length of the tx history is longer then desired persistence\n * limit and then if it is removes the oldest confirmed or rejected tx.\n * Pending or unapproved transactions will not be removed by this\n * operation. For safety of presenting a fully functional transaction UI\n * representation, this function will not break apart transactions with the\n * same nonce, created on the same day, per network. Not accounting for\n * transactions of the same nonce, same day and network combo can result in\n * confusing or broken experiences in the UI.\n *\n * @param transactions - The transactions to be applied to the state.\n * @returns The trimmed list of transactions.\n */\n private trimTransactionsForState(\n transactions: TransactionMeta[],\n ): TransactionMeta[] {\n const nonceNetworkSet = new Set();\n\n const txsToKeep = [...transactions]\n .sort((a, b) => (a.time > b.time ? -1 : 1)) // Descending time order\n .filter((tx) => {\n const { chainId, status, txParams, time } = tx;\n\n if (txParams) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n const key = `${String(txParams.nonce)}-${convertHexToDecimal(\n chainId,\n )}-${new Date(time).toDateString()}`;\n\n if (nonceNetworkSet.has(key)) {\n return true;\n } else if (\n nonceNetworkSet.size < this.#transactionHistoryLimit ||\n !this.isFinalState(status)\n ) {\n nonceNetworkSet.add(key);\n return true;\n }\n }\n\n return false;\n });\n\n txsToKeep.reverse(); // Ascending time order\n return txsToKeep;\n }\n\n /**\n * Determines if the transaction is in a final state.\n *\n * @param status - The transaction status.\n * @returns Whether the transaction is in a final state.\n */\n private isFinalState(status: TransactionStatus): boolean {\n return (\n status === TransactionStatus.rejected ||\n status === TransactionStatus.confirmed ||\n status === TransactionStatus.failed\n );\n }\n\n /**\n * Whether the transaction has at least completed all local processing.\n *\n * @param status - The transaction status.\n * @returns Whether the transaction is in a final state.\n */\n private isLocalFinalState(status: TransactionStatus): boolean {\n return [\n TransactionStatus.confirmed,\n TransactionStatus.failed,\n TransactionStatus.rejected,\n TransactionStatus.submitted,\n ].includes(status);\n }\n\n private async requestApproval(\n txMeta: TransactionMeta,\n { shouldShowRequest }: { shouldShowRequest: boolean },\n ): Promise {\n const id = this.getApprovalId(txMeta);\n const { origin } = txMeta;\n const type = ApprovalType.Transaction;\n const requestData = { txId: txMeta.id };\n\n return (await this.messagingSystem.call(\n 'ApprovalController:addRequest',\n {\n id,\n origin: origin || ORIGIN_METAMASK,\n type,\n requestData,\n expectsResult: true,\n },\n shouldShowRequest,\n )) as Promise;\n }\n\n private getTransaction(\n transactionId: string,\n ): Readonly | undefined {\n const { transactions } = this.state;\n return transactions.find(({ id }) => id === transactionId);\n }\n\n private getTransactionOrThrow(\n transactionId: string,\n errorMessagePrefix = 'TransactionController',\n ): Readonly {\n const txMeta = this.getTransaction(transactionId);\n if (!txMeta) {\n throw new Error(\n `${errorMessagePrefix}: No transaction found with id ${transactionId}`,\n );\n }\n return txMeta;\n }\n\n private getApprovalId(txMeta: TransactionMeta) {\n return String(txMeta.id);\n }\n\n private isTransactionCompleted(transactionId: string): {\n meta?: TransactionMeta;\n isCompleted: boolean;\n } {\n const transaction = this.getTransaction(transactionId);\n\n if (!transaction) {\n return { meta: undefined, isCompleted: false };\n }\n\n const isCompleted = this.isLocalFinalState(transaction.status);\n\n return { meta: transaction, isCompleted };\n }\n\n private getChainId(networkClientId?: NetworkClientId): Hex {\n const globalChainId = this.#getGlobalChainId();\n const globalNetworkClientId = this.#getGlobalNetworkClientId();\n\n if (!networkClientId || networkClientId === globalNetworkClientId) {\n return globalChainId;\n }\n\n return this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n networkClientId,\n ).configuration.chainId;\n }\n\n private prepareUnsignedEthTx(\n chainId: Hex,\n txParams: TransactionParams,\n ): TypedTransaction {\n return TransactionFactory.fromTxData(txParams, {\n freeze: false,\n common: this.getCommonConfiguration(chainId),\n });\n }\n\n /**\n * `@ethereumjs/tx` uses `@ethereumjs/common` as a configuration tool for\n * specifying which chain, network, hardfork and EIPs to support for\n * a transaction. By referencing this configuration, and analyzing the fields\n * specified in txParams, @ethereumjs/tx is able to determine which EIP-2718\n * transaction type to use.\n *\n * @param chainId - The chainId to use for the configuration.\n * @returns common configuration object\n */\n private getCommonConfiguration(chainId: Hex): Common {\n const customChainParams: Partial = {\n chainId: parseInt(chainId, 16),\n defaultHardfork: HARDFORK,\n };\n\n return Common.custom(customChainParams);\n }\n\n private onIncomingTransactions({\n added,\n updated,\n }: {\n added: TransactionMeta[];\n updated: TransactionMeta[];\n }) {\n this.update((state) => {\n const { transactions: currentTransactions } = state;\n const updatedTransactions = [\n ...added,\n ...currentTransactions.map((originalTransaction) => {\n const updatedTransaction = updated.find(\n ({ hash }) => hash === originalTransaction.hash,\n );\n\n return updatedTransaction ?? originalTransaction;\n }),\n ];\n\n state.transactions = this.trimTransactionsForState(updatedTransactions);\n });\n }\n\n private onUpdatedLastFetchedBlockNumbers({\n lastFetchedBlockNumbers,\n blockNumber,\n }: {\n lastFetchedBlockNumbers: {\n [key: string]: number;\n };\n blockNumber: number;\n }) {\n this.update((state) => {\n state.lastFetchedBlockNumbers = lastFetchedBlockNumbers;\n });\n this.messagingSystem.publish(\n `${controllerName}:incomingTransactionBlockReceived`,\n blockNumber,\n );\n }\n\n private generateDappSuggestedGasFees(\n txParams: TransactionParams,\n origin?: string,\n ): DappSuggestedGasFees | undefined {\n if (!origin || origin === ORIGIN_METAMASK) {\n return undefined;\n }\n\n const { gasPrice, maxFeePerGas, maxPriorityFeePerGas, gas } = txParams;\n\n if (\n gasPrice === undefined &&\n maxFeePerGas === undefined &&\n maxPriorityFeePerGas === undefined &&\n gas === undefined\n ) {\n return undefined;\n }\n\n const dappSuggestedGasFees: DappSuggestedGasFees = {};\n\n if (gasPrice !== undefined) {\n dappSuggestedGasFees.gasPrice = gasPrice;\n } else if (\n maxFeePerGas !== undefined ||\n maxPriorityFeePerGas !== undefined\n ) {\n dappSuggestedGasFees.maxFeePerGas = maxFeePerGas;\n dappSuggestedGasFees.maxPriorityFeePerGas = maxPriorityFeePerGas;\n }\n\n if (gas !== undefined) {\n dappSuggestedGasFees.gas = gas;\n }\n\n return dappSuggestedGasFees;\n }\n\n /**\n * Validates and adds external provided transaction to state.\n *\n * @param transactionMeta - Nominated external transaction to be added to state.\n * @returns The new transaction.\n */\n private addExternalTransaction(transactionMeta: TransactionMeta) {\n const { chainId } = transactionMeta;\n const { transactions } = this.state;\n const fromAddress = transactionMeta?.txParams?.from;\n const sameFromAndNetworkTransactions = transactions.filter(\n (transaction) =>\n transaction.txParams.from === fromAddress &&\n transaction.chainId === chainId,\n );\n const confirmedTxs = sameFromAndNetworkTransactions.filter(\n (transaction) => transaction.status === TransactionStatus.confirmed,\n );\n const pendingTxs = sameFromAndNetworkTransactions.filter(\n (transaction) => transaction.status === TransactionStatus.submitted,\n );\n\n validateConfirmedExternalTransaction(\n transactionMeta,\n confirmedTxs,\n pendingTxs,\n );\n\n // Make sure provided external transaction has non empty history array\n const newTransactionMeta =\n (transactionMeta.history ?? []).length === 0 && !this.isHistoryDisabled\n ? addInitialHistorySnapshot(transactionMeta)\n : transactionMeta;\n\n this.update((state) => {\n state.transactions = this.trimTransactionsForState([\n ...state.transactions,\n newTransactionMeta,\n ]);\n });\n\n return newTransactionMeta;\n }\n\n /**\n * Sets other txMeta statuses to dropped if the txMeta that has been confirmed has other transactions\n * in the transactions have the same nonce.\n *\n * @param transactionId - Used to identify original transaction.\n */\n private markNonceDuplicatesDropped(transactionId: string) {\n const transactionMeta = this.getTransaction(transactionId);\n if (!transactionMeta) {\n return;\n }\n const nonce = transactionMeta.txParams?.nonce;\n const from = transactionMeta.txParams?.from;\n const { chainId } = transactionMeta;\n\n const sameNonceTransactions = this.state.transactions.filter(\n (transaction) =>\n transaction.id !== transactionId &&\n transaction.txParams.from === from &&\n transaction.txParams.nonce === nonce &&\n transaction.chainId === chainId &&\n transaction.type !== TransactionType.incoming,\n );\n const sameNonceTransactionIds = sameNonceTransactions.map(\n (transaction) => transaction.id,\n );\n\n if (sameNonceTransactions.length === 0) {\n return;\n }\n\n this.update((state) => {\n for (const transaction of state.transactions) {\n if (sameNonceTransactionIds.includes(transaction.id)) {\n transaction.replacedBy = transactionMeta?.hash;\n transaction.replacedById = transactionMeta?.id;\n }\n }\n });\n\n for (const transaction of this.state.transactions) {\n if (\n sameNonceTransactionIds.includes(transaction.id) &&\n transaction.status !== TransactionStatus.failed\n ) {\n this.setTransactionStatusDropped(transaction);\n }\n }\n }\n\n /**\n * Method to set transaction status to dropped.\n *\n * @param transactionMeta - TransactionMeta of transaction to be marked as dropped.\n */\n private setTransactionStatusDropped(transactionMeta: TransactionMeta) {\n const updatedTransactionMeta = {\n ...transactionMeta,\n status: TransactionStatus.dropped as const,\n };\n this.messagingSystem.publish(`${controllerName}:transactionDropped`, {\n transactionMeta: updatedTransactionMeta,\n });\n this.updateTransaction(\n updatedTransactionMeta,\n 'TransactionController#setTransactionStatusDropped - Transaction dropped',\n );\n this.onTransactionStatusChange(updatedTransactionMeta);\n }\n\n /**\n * Get transaction with provided actionId.\n *\n * @param actionId - Unique ID to prevent duplicate requests\n * @returns the filtered transaction\n */\n private getTransactionWithActionId(actionId?: string) {\n return this.state.transactions.find(\n (transaction) => actionId && transaction.actionId === actionId,\n );\n }\n\n private async waitForTransactionFinished(\n transactionId: string,\n ): Promise {\n return new Promise((resolve) => {\n this.#internalEvents.once(`${transactionId}:finished`, (txMeta) => {\n resolve(txMeta);\n });\n });\n }\n\n /**\n * Updates the r, s, and v properties of a TransactionMeta object\n * with values from a signed transaction.\n *\n * @param transactionMeta - The TransactionMeta object to update.\n * @param signedTx - The encompassing type for all transaction types containing r, s, and v values.\n * @returns The updated TransactionMeta object.\n */\n private updateTransactionMetaRSV(\n transactionMeta: TransactionMeta,\n signedTx: TypedTransaction,\n ): TransactionMeta {\n const transactionMetaWithRsv = cloneDeep(transactionMeta);\n\n for (const key of ['r', 's', 'v'] as const) {\n const value = signedTx[key];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n transactionMetaWithRsv[key] = add0x(value.toString(16));\n }\n\n return transactionMetaWithRsv;\n }\n\n private async getEIP1559Compatibility(networkClientId?: NetworkClientId) {\n const currentNetworkIsEIP1559Compatible =\n await this.getCurrentNetworkEIP1559Compatibility(networkClientId);\n\n const currentAccountIsEIP1559Compatible =\n await this.getCurrentAccountEIP1559Compatibility();\n\n return (\n currentNetworkIsEIP1559Compatible && currentAccountIsEIP1559Compatible\n );\n }\n\n private async signTransaction(\n transactionMeta: TransactionMeta,\n txParams: TransactionParams,\n ): Promise {\n log('Signing transaction', txParams);\n\n const unsignedEthTx = this.prepareUnsignedEthTx(\n transactionMeta.chainId,\n txParams,\n );\n\n this.approvingTransactionIds.add(transactionMeta.id);\n\n const signedTx = await new Promise((resolve, reject) => {\n this.sign?.(\n unsignedEthTx,\n txParams.from,\n ...this.getAdditionalSignArguments(transactionMeta),\n ).then(resolve, reject);\n\n this.signAbortCallbacks.set(transactionMeta.id, () =>\n reject(new Error('Signing aborted by user')),\n );\n });\n\n this.signAbortCallbacks.delete(transactionMeta.id);\n\n if (!signedTx) {\n log('Skipping signed status as no signed transaction');\n return undefined;\n }\n\n const transactionMetaFromHook = cloneDeep(transactionMeta);\n if (!this.afterSign(transactionMetaFromHook, signedTx)) {\n this.updateTransaction(\n transactionMetaFromHook,\n 'TransactionController#signTransaction - Update after sign',\n );\n\n log('Skipping signed status based on hook');\n\n return undefined;\n }\n\n const transactionMetaWithRsv = {\n ...this.updateTransactionMetaRSV(transactionMetaFromHook, signedTx),\n status: TransactionStatus.signed as const,\n };\n\n this.updateTransaction(\n transactionMetaWithRsv,\n 'TransactionController#approveTransaction - Transaction signed',\n );\n\n this.onTransactionStatusChange(transactionMetaWithRsv);\n\n const rawTx = bufferToHex(signedTx.serialize());\n\n const transactionMetaWithRawTx = merge({}, transactionMetaWithRsv, {\n rawTx,\n });\n\n this.updateTransaction(\n transactionMetaWithRawTx,\n 'TransactionController#approveTransaction - RawTransaction added',\n );\n\n return rawTx;\n }\n\n private onTransactionStatusChange(transactionMeta: TransactionMeta) {\n this.messagingSystem.publish(`${controllerName}:transactionStatusUpdated`, {\n transactionMeta,\n });\n }\n\n private getNonceTrackerTransactions(\n status: TransactionStatus,\n address: string,\n chainId: string = this.getChainId(),\n ) {\n return getAndFormatTransactionsForNonceTracker(\n chainId,\n address,\n status,\n this.state.transactions,\n );\n }\n\n private onConfirmedTransaction(transactionMeta: TransactionMeta) {\n log('Processing confirmed transaction', transactionMeta.id);\n\n this.markNonceDuplicatesDropped(transactionMeta.id);\n\n this.messagingSystem.publish(\n `${controllerName}:transactionConfirmed`,\n transactionMeta,\n );\n\n this.onTransactionStatusChange(transactionMeta);\n\n // Intentional given potential duration of process.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updatePostBalance(transactionMeta);\n }\n\n private async updatePostBalance(transactionMeta: TransactionMeta) {\n try {\n if (transactionMeta.type !== TransactionType.swap) {\n return;\n }\n\n const ethQuery = this.#multichainTrackingHelper.getEthQuery({\n networkClientId: transactionMeta.networkClientId,\n chainId: transactionMeta.chainId,\n });\n const { updatedTransactionMeta, approvalTransactionMeta } =\n await updatePostTransactionBalance(transactionMeta, {\n ethQuery,\n getTransaction: this.getTransaction.bind(this),\n updateTransaction: this.updateTransaction.bind(this),\n });\n\n this.messagingSystem.publish(\n `${controllerName}:postTransactionBalanceUpdated`,\n {\n transactionMeta: updatedTransactionMeta,\n approvalTransactionMeta,\n },\n );\n } catch (error) {\n /* istanbul ignore next */\n log('Error while updating post transaction balance', error);\n }\n }\n\n #createNonceTracker({\n provider,\n blockTracker,\n chainId,\n }: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }): NonceTracker {\n return new NonceTracker({\n // TODO: Fix types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n provider: provider as any,\n // @ts-expect-error TODO: Fix types\n blockTracker,\n getPendingTransactions: this.#getNonceTrackerPendingTransactions.bind(\n this,\n chainId,\n ),\n getConfirmedTransactions: this.getNonceTrackerTransactions.bind(\n this,\n TransactionStatus.confirmed,\n ),\n });\n }\n\n #createIncomingTransactionHelper({\n blockTracker,\n etherscanRemoteTransactionSource,\n chainId,\n }: {\n blockTracker: BlockTracker;\n etherscanRemoteTransactionSource: EtherscanRemoteTransactionSource;\n chainId?: Hex;\n }): IncomingTransactionHelper {\n const incomingTransactionHelper = new IncomingTransactionHelper({\n blockTracker,\n getCurrentAccount: () => this.#getSelectedAccount(),\n getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers,\n getChainId: chainId ? () => chainId : this.getChainId.bind(this),\n isEnabled: this.#incomingTransactionOptions.isEnabled,\n queryEntireHistory: this.#incomingTransactionOptions.queryEntireHistory,\n remoteTransactionSource: etherscanRemoteTransactionSource,\n transactionLimit: this.#transactionHistoryLimit,\n updateTransactions: this.#incomingTransactionOptions.updateTransactions,\n });\n\n this.#addIncomingTransactionHelperListeners(incomingTransactionHelper);\n\n return incomingTransactionHelper;\n }\n\n #createPendingTransactionTracker({\n provider,\n blockTracker,\n chainId,\n }: {\n provider: Provider;\n blockTracker: BlockTracker;\n chainId?: Hex;\n }): PendingTransactionTracker {\n const ethQuery = new EthQuery(provider);\n const getChainId = chainId ? () => chainId : this.getChainId.bind(this);\n\n const pendingTransactionTracker = new PendingTransactionTracker({\n approveTransaction: async (transactionId: string) => {\n await this.approveTransaction(transactionId);\n },\n blockTracker,\n getChainId,\n getEthQuery: () => ethQuery,\n getTransactions: () => this.state.transactions,\n isResubmitEnabled: this.#pendingTransactionOptions.isResubmitEnabled,\n getGlobalLock: () =>\n this.#multichainTrackingHelper.acquireNonceLockForChainIdKey({\n chainId: getChainId(),\n }),\n publishTransaction: this.publishTransaction.bind(this),\n hooks: {\n beforeCheckPendingTransaction:\n this.beforeCheckPendingTransaction.bind(this),\n beforePublish: this.beforePublish.bind(this),\n },\n });\n\n this.#addPendingTransactionTrackerListeners(pendingTransactionTracker);\n\n return pendingTransactionTracker;\n }\n\n #checkForPendingTransactionAndStartPolling = () => {\n // PendingTransactionTracker reads state through its getTransactions hook\n this.pendingTransactionTracker.startIfPendingTransactions();\n this.#multichainTrackingHelper.checkForPendingTransactionAndStartPolling();\n };\n\n #stopAllTracking() {\n this.pendingTransactionTracker.stop();\n this.#removePendingTransactionTrackerListeners(\n this.pendingTransactionTracker,\n );\n this.incomingTransactionHelper.stop();\n this.#removeIncomingTransactionHelperListeners(\n this.incomingTransactionHelper,\n );\n\n this.#multichainTrackingHelper.stopAllTracking();\n }\n\n #removeIncomingTransactionHelperListeners(\n incomingTransactionHelper: IncomingTransactionHelper,\n ) {\n incomingTransactionHelper.hub.removeAllListeners('transactions');\n incomingTransactionHelper.hub.removeAllListeners(\n 'updatedLastFetchedBlockNumbers',\n );\n }\n\n #addIncomingTransactionHelperListeners(\n incomingTransactionHelper: IncomingTransactionHelper,\n ) {\n incomingTransactionHelper.hub.on(\n 'transactions',\n this.onIncomingTransactions.bind(this),\n );\n incomingTransactionHelper.hub.on(\n 'updatedLastFetchedBlockNumbers',\n this.onUpdatedLastFetchedBlockNumbers.bind(this),\n );\n }\n\n #removePendingTransactionTrackerListeners(\n pendingTransactionTracker: PendingTransactionTracker,\n ) {\n pendingTransactionTracker.hub.removeAllListeners('transaction-confirmed');\n pendingTransactionTracker.hub.removeAllListeners('transaction-dropped');\n pendingTransactionTracker.hub.removeAllListeners('transaction-failed');\n pendingTransactionTracker.hub.removeAllListeners('transaction-updated');\n }\n\n #addPendingTransactionTrackerListeners(\n pendingTransactionTracker: PendingTransactionTracker,\n ) {\n pendingTransactionTracker.hub.on(\n 'transaction-confirmed',\n this.onConfirmedTransaction.bind(this),\n );\n\n pendingTransactionTracker.hub.on(\n 'transaction-dropped',\n this.setTransactionStatusDropped.bind(this),\n );\n\n pendingTransactionTracker.hub.on(\n 'transaction-failed',\n this.failTransaction.bind(this),\n );\n\n pendingTransactionTracker.hub.on(\n 'transaction-updated',\n this.updateTransaction.bind(this),\n );\n }\n\n #getNonceTrackerPendingTransactions(\n chainId: string | undefined,\n address: string,\n ) {\n const standardPendingTransactions = this.getNonceTrackerTransactions(\n TransactionStatus.submitted,\n address,\n chainId,\n );\n\n const externalPendingTransactions = this.getExternalPendingTransactions(\n address,\n chainId,\n );\n return [...standardPendingTransactions, ...externalPendingTransactions];\n }\n\n private async publishTransactionForRetry(\n ethQuery: EthQuery,\n rawTx: string,\n transactionMeta: TransactionMeta,\n ): Promise {\n try {\n const hash = await this.publishTransaction(ethQuery, rawTx);\n return hash;\n } catch (error: unknown) {\n if (this.isTransactionAlreadyConfirmedError(error as Error)) {\n await this.pendingTransactionTracker.forceCheckTransaction(\n transactionMeta,\n );\n throw new Error('Previous transaction is already confirmed');\n }\n throw error;\n }\n }\n\n /**\n * Ensures that error is a nonce issue\n *\n * @param error - The error to check\n * @returns Whether or not the error is a nonce issue\n */\n // TODO: Replace `any` with type\n // Some networks are returning original error in the data field\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private isTransactionAlreadyConfirmedError(error: any): boolean {\n return (\n error?.message?.includes('nonce too low') ||\n error?.data?.message?.includes('nonce too low')\n );\n }\n\n #getGasFeeFlows(): GasFeeFlow[] {\n if (this.#testGasFeeFlows) {\n return [new TestGasFeeFlow()];\n }\n\n return [new LineaGasFeeFlow(), new DefaultGasFeeFlow()];\n }\n\n #getLayer1GasFeeFlows(): Layer1GasFeeFlow[] {\n return [new OptimismLayer1GasFeeFlow(), new ScrollLayer1GasFeeFlow()];\n }\n\n #updateTransactionInternal(\n {\n transactionId,\n note,\n skipHistory,\n }: { transactionId: string; note?: string; skipHistory?: boolean },\n callback: (transactionMeta: TransactionMeta) => TransactionMeta | void,\n ): Readonly {\n let updatedTransactionParams: (keyof TransactionParams)[] = [];\n\n this.update((state) => {\n const index = state.transactions.findIndex(\n ({ id }) => id === transactionId,\n );\n\n let transactionMeta = state.transactions[index];\n\n // eslint-disable-next-line n/callback-return\n transactionMeta = callback(transactionMeta) ?? transactionMeta;\n\n transactionMeta.txParams = normalizeTransactionParams(\n transactionMeta.txParams,\n );\n\n validateTxParams(transactionMeta.txParams);\n\n updatedTransactionParams =\n this.#checkIfTransactionParamsUpdated(transactionMeta);\n\n const shouldSkipHistory = this.isHistoryDisabled || skipHistory;\n\n if (!shouldSkipHistory) {\n transactionMeta = updateTransactionHistory(\n transactionMeta,\n note ?? 'Transaction updated',\n );\n }\n state.transactions[index] = transactionMeta;\n });\n\n const transactionMeta = this.getTransaction(\n transactionId,\n ) as TransactionMeta;\n\n if (updatedTransactionParams.length > 0) {\n this.#onTransactionParamsUpdated(\n transactionMeta,\n updatedTransactionParams,\n );\n }\n\n return transactionMeta;\n }\n\n #checkIfTransactionParamsUpdated(newTransactionMeta: TransactionMeta) {\n const { id: transactionId, txParams: newParams } = newTransactionMeta;\n\n const originalParams = this.getTransaction(transactionId)?.txParams;\n\n if (!originalParams || isEqual(originalParams, newParams)) {\n return [];\n }\n\n const params = Object.keys(newParams) as (keyof TransactionParams)[];\n\n const updatedProperties = params.filter(\n (param) => newParams[param] !== originalParams[param],\n );\n\n log(\n 'Transaction parameters have been updated',\n transactionId,\n updatedProperties,\n originalParams,\n newParams,\n );\n\n return updatedProperties;\n }\n\n #onTransactionParamsUpdated(\n transactionMeta: TransactionMeta,\n updatedParams: (keyof TransactionParams)[],\n ) {\n if (\n (['to', 'value', 'data'] as const).some((param) =>\n updatedParams.includes(param),\n )\n ) {\n log('Updating simulation data due to transaction parameter update');\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.#updateSimulationData(transactionMeta);\n }\n }\n\n async #updateSimulationData(transactionMeta: TransactionMeta) {\n const { id: transactionId, chainId, txParams } = transactionMeta;\n const { from, to, value, data } = txParams;\n\n let simulationData: SimulationData = {\n error: {\n code: SimulationErrorCode.Disabled,\n message: 'Simulation disabled',\n },\n tokenBalanceChanges: [],\n };\n\n if (this.#isSimulationEnabled()) {\n this.#updateTransactionInternal(\n { transactionId, skipHistory: true },\n (txMeta) => {\n txMeta.simulationData = undefined;\n },\n );\n\n simulationData = await getSimulationData({\n chainId,\n from: from as Hex,\n to: to as Hex,\n value: value as Hex,\n data: data as Hex,\n });\n }\n\n const finalTransactionMeta = this.getTransaction(transactionId);\n\n /* istanbul ignore if */\n if (!finalTransactionMeta) {\n log(\n 'Cannot update simulation data as transaction not found',\n transactionId,\n simulationData,\n );\n\n return;\n }\n\n this.#updateTransactionInternal(\n {\n transactionId,\n note: 'TransactionController#updateSimulationData - Update simulation data',\n },\n (txMeta) => {\n txMeta.simulationData = simulationData;\n },\n );\n\n log('Updated simulation data', transactionId, simulationData);\n }\n\n #onGasFeePollerTransactionUpdate({\n transactionId,\n gasFeeEstimates,\n gasFeeEstimatesLoaded,\n layer1GasFee,\n }: {\n transactionId: string;\n gasFeeEstimates?: GasFeeEstimates;\n gasFeeEstimatesLoaded?: boolean;\n layer1GasFee?: Hex;\n }) {\n this.#updateTransactionInternal(\n { transactionId, skipHistory: true },\n (txMeta) => {\n if (gasFeeEstimates) {\n txMeta.gasFeeEstimates = gasFeeEstimates;\n }\n\n if (gasFeeEstimatesLoaded !== undefined) {\n txMeta.gasFeeEstimatesLoaded = gasFeeEstimatesLoaded;\n }\n\n if (layer1GasFee) {\n txMeta.layer1GasFee = layer1GasFee;\n }\n },\n );\n }\n\n #getNetworkClientId({\n networkClientId: requestNetworkClientId,\n chainId,\n }: {\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n }) {\n const globalChainId = this.#getGlobalChainId();\n const globalNetworkClientId = this.#getGlobalNetworkClientId();\n\n if (requestNetworkClientId) {\n return requestNetworkClientId;\n }\n\n if (!chainId || chainId === globalChainId) {\n return globalNetworkClientId;\n }\n\n return this.messagingSystem.call(\n `NetworkController:findNetworkClientIdByChainId`,\n chainId,\n );\n }\n\n #getGlobalNetworkClientId() {\n return this.getNetworkState().selectedNetworkClientId;\n }\n\n #getGlobalChainId() {\n return this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n this.getNetworkState().selectedNetworkClientId,\n ).configuration.chainId;\n }\n\n #isCustomNetwork(networkClientId?: NetworkClientId) {\n const globalNetworkClientId = this.#getGlobalNetworkClientId();\n\n if (!networkClientId || networkClientId === globalNetworkClientId) {\n return !isInfuraNetworkType(\n this.getNetworkState().selectedNetworkClientId,\n );\n }\n\n return (\n this.messagingSystem.call(\n `NetworkController:getNetworkClientById`,\n networkClientId,\n ).configuration.type === NetworkClientType.Custom\n );\n }\n\n #getSelectedAccount() {\n return this.messagingSystem.call('AccountsController:getSelectedAccount');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,UAAU,cAAgC;AAEnD,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAY5B,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,cAAc;AAerB,SAAS,yBAAyB;AAKlC,SAAS,oBAAoB;AAC7B,SAAS,YAAY,WAAW,sBAAsB;AAEtD,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,WAAW,WAAW,OAAO,QAAQ,QAAQ,eAAe;AACrE,SAAS,MAAM,cAAc;AA+E7B,IAAM,WAAW;AAAA,EACf,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,YAAY;AAAA,IACV,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,yBAAyB;AAAA,IACvB,SAAS;AAAA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gBAAgB;AAAA,IAC1B;AAAA,IACA;AAAA,EACF;AACF;AAEA;AAAA,8BAAyB,WAAG;AAC1B,SAAO,KAAK,gBAAgB,EAAE;AAChC;AAEA;AAAA,sBAAiB,WAAG;AAClB,SAAO,KAAK,gBAAgB;AAAA,IAC1B;AAAA,IACA,KAAK,gBAAgB,EAAE;AAAA,EACzB,EAAE,cAAc;AAClB;AAEA;AAAA,qBAAgB,SAAC,iBAAmC;AAClD,QAAM,wBAAwB,sBAAK,wDAAL;AAE9B,MAAI,CAAC,mBAAmB,oBAAoB,uBAAuB;AACjE,WAAO,CAAC;AAAA,MACN,KAAK,gBAAgB,EAAE;AAAA,IACzB;AAAA,EACF;AAEA,SACE,KAAK,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,EACF,EAAE,cAAc,SAAS,kBAAkB;AAE/C;AAEA;AAAA,wBAAmB,WAAG;AACpB,SAAO,KAAK,gBAAgB,KAAK,uCAAuC;AAC1E;","names":["ApprovalState","transactionMeta"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-ULD4JC3Q.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-ULD4JC3Q.js.map +deleted file mode 100644 +index d2b47f8..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-ULD4JC3Q.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/helpers/PendingTransactionTracker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,aAAa;AAMtB,OAAO,kBAAkB;AACzB,SAAS,WAAW,aAAa;AAUjC,IAAM,sBAAsB;AAE5B,IAAM,yBAAyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AAEjC,IAAM,2BAA2B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAhCpE;AA8DO,IAAM,4BAAN,MAAgC;AA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IACxD;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEM;AAAA,gCAA2B,eAAC,SAAkC;AAClE,SAAO,MAAM,MAAM,mBAAK,cAAL,YAAqB,uBAAuB,CAAC,OAAO,CAAC;AAC1E;AAEA;AAAA,iCAA4B,WAAsB;AAChD,QAAM,iBAAiB,mBAAK,aAAL;AAEvB,SAAO,mBAAK,kBAAL,WAAwB;AAAA,IAC7B,CAAC,OAAO,GAAG,YAAY;AAAA,EACzB;AACF","sourcesContent":["import { query } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type {\n BlockTracker,\n NetworkClientId,\n} from '@metamask/network-controller';\nimport EventEmitter from 'events';\nimport { cloneDeep, merge } from 'lodash';\n\nimport { createModuleLogger, projectLogger } from '../logger';\nimport type { TransactionMeta, TransactionReceipt } from '../types';\nimport { TransactionStatus, TransactionType } from '../types';\n\n/**\n * We wait this many blocks before emitting a 'transaction-dropped' event\n * This is because we could be talking to a node that is out of sync\n */\nconst DROPPED_BLOCK_COUNT = 3;\n\nconst RECEIPT_STATUS_SUCCESS = '0x1';\nconst RECEIPT_STATUS_FAILURE = '0x0';\nconst MAX_RETRY_BLOCK_DISTANCE = 50;\n\nconst KNOWN_TRANSACTION_ERRORS = [\n 'replacement transaction underpriced',\n 'known transaction',\n 'gas price too low to replace',\n 'transaction with the same hash was already imported',\n 'gateway timeout',\n 'nonce too low',\n];\n\nconst log = createModuleLogger(projectLogger, 'pending-transactions');\n\ntype SuccessfulTransactionReceipt = TransactionReceipt & {\n blockNumber: string;\n blockHash: string;\n};\n\ntype Events = {\n 'transaction-confirmed': [txMeta: TransactionMeta];\n 'transaction-dropped': [txMeta: TransactionMeta];\n 'transaction-failed': [txMeta: TransactionMeta, error: Error];\n 'transaction-updated': [txMeta: TransactionMeta, note: string];\n};\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface PendingTransactionTrackerEventEmitter extends EventEmitter {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n on(\n eventName: T,\n listener: (...args: Events[T]) => void,\n ): this;\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n emit(eventName: T, ...args: Events[T]): boolean;\n}\n\nexport class PendingTransactionTracker {\n hub: PendingTransactionTrackerEventEmitter;\n\n #approveTransaction: (transactionId: string) => Promise;\n\n #blockTracker: BlockTracker;\n\n #droppedBlockCountByHash: Map;\n\n #getChainId: () => string;\n\n #getEthQuery: (networkClientId?: NetworkClientId) => EthQuery;\n\n #getTransactions: () => TransactionMeta[];\n\n #isResubmitEnabled: () => boolean;\n\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #listener: any;\n\n #getGlobalLock: () => Promise<() => void>;\n\n #publishTransaction: (ethQuery: EthQuery, rawTx: string) => Promise;\n\n #running: boolean;\n\n #beforeCheckPendingTransaction: (transactionMeta: TransactionMeta) => boolean;\n\n #beforePublish: (transactionMeta: TransactionMeta) => boolean;\n\n constructor({\n approveTransaction,\n blockTracker,\n getChainId,\n getEthQuery,\n getTransactions,\n isResubmitEnabled,\n getGlobalLock,\n publishTransaction,\n hooks,\n }: {\n approveTransaction: (transactionId: string) => Promise;\n blockTracker: BlockTracker;\n getChainId: () => string;\n getEthQuery: (networkClientId?: NetworkClientId) => EthQuery;\n getTransactions: () => TransactionMeta[];\n isResubmitEnabled?: () => boolean;\n getGlobalLock: () => Promise<() => void>;\n publishTransaction: (ethQuery: EthQuery, rawTx: string) => Promise;\n hooks?: {\n beforeCheckPendingTransaction?: (\n transactionMeta: TransactionMeta,\n ) => boolean;\n beforePublish?: (transactionMeta: TransactionMeta) => boolean;\n };\n }) {\n this.hub = new EventEmitter() as PendingTransactionTrackerEventEmitter;\n\n this.#approveTransaction = approveTransaction;\n this.#blockTracker = blockTracker;\n this.#droppedBlockCountByHash = new Map();\n this.#getChainId = getChainId;\n this.#getEthQuery = getEthQuery;\n this.#getTransactions = getTransactions;\n this.#isResubmitEnabled = isResubmitEnabled ?? (() => true);\n this.#listener = this.#onLatestBlock.bind(this);\n this.#getGlobalLock = getGlobalLock;\n this.#publishTransaction = publishTransaction;\n this.#running = false;\n this.#beforePublish = hooks?.beforePublish ?? (() => true);\n this.#beforeCheckPendingTransaction =\n hooks?.beforeCheckPendingTransaction ?? (() => true);\n }\n\n startIfPendingTransactions = () => {\n const pendingTransactions = this.#getPendingTransactions();\n\n if (pendingTransactions.length) {\n this.#start();\n } else {\n this.stop();\n }\n };\n\n /**\n * Force checks the network if the given transaction is confirmed and updates it's status.\n *\n * @param txMeta - The transaction to check\n */\n async forceCheckTransaction(txMeta: TransactionMeta) {\n const releaseLock = await this.#getGlobalLock();\n\n try {\n await this.#checkTransaction(txMeta);\n } catch (error) {\n /* istanbul ignore next */\n log('Failed to check transaction', error);\n } finally {\n releaseLock();\n }\n }\n\n #start() {\n if (this.#running) {\n return;\n }\n\n this.#blockTracker.on('latest', this.#listener);\n this.#running = true;\n\n log('Started polling');\n }\n\n stop() {\n if (!this.#running) {\n return;\n }\n\n this.#blockTracker.removeListener('latest', this.#listener);\n this.#running = false;\n\n log('Stopped polling');\n }\n\n async #onLatestBlock(latestBlockNumber: string) {\n const releaseLock = await this.#getGlobalLock();\n\n try {\n await this.#checkTransactions();\n } catch (error) {\n /* istanbul ignore next */\n log('Failed to check transactions', error);\n } finally {\n releaseLock();\n }\n\n try {\n await this.#resubmitTransactions(latestBlockNumber);\n } catch (error) {\n /* istanbul ignore next */\n log('Failed to resubmit transactions', error);\n }\n }\n\n async #checkTransactions() {\n log('Checking transactions');\n\n const pendingTransactions = this.#getPendingTransactions();\n\n if (!pendingTransactions.length) {\n log('No pending transactions to check');\n return;\n }\n\n log('Found pending transactions to check', {\n count: pendingTransactions.length,\n ids: pendingTransactions.map((tx) => tx.id),\n });\n\n await Promise.all(\n pendingTransactions.map((tx) => this.#checkTransaction(tx)),\n );\n }\n\n async #resubmitTransactions(latestBlockNumber: string) {\n if (!this.#isResubmitEnabled() || !this.#running) {\n return;\n }\n\n log('Resubmitting transactions');\n\n const pendingTransactions = this.#getPendingTransactions();\n\n if (!pendingTransactions.length) {\n log('No pending transactions to resubmit');\n return;\n }\n\n log('Found pending transactions to resubmit', {\n count: pendingTransactions.length,\n ids: pendingTransactions.map((tx) => tx.id),\n });\n\n for (const txMeta of pendingTransactions) {\n try {\n await this.#resubmitTransaction(txMeta, latestBlockNumber);\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n /* istanbul ignore next */\n const errorMessage =\n error.value?.message?.toLowerCase() || error.message.toLowerCase();\n\n if (this.#isKnownTransactionError(errorMessage)) {\n log('Ignoring known transaction error', errorMessage);\n return;\n }\n\n this.#warnTransaction(\n txMeta,\n error.message,\n 'There was an error when resubmitting this transaction.',\n );\n }\n }\n }\n\n #isKnownTransactionError(errorMessage: string) {\n return KNOWN_TRANSACTION_ERRORS.some((knownError) =>\n errorMessage.includes(knownError),\n );\n }\n\n async #resubmitTransaction(\n txMeta: TransactionMeta,\n latestBlockNumber: string,\n ) {\n if (!this.#isResubmitDue(txMeta, latestBlockNumber)) {\n return;\n }\n\n const { rawTx } = txMeta;\n\n if (!this.#beforePublish(txMeta)) {\n return;\n }\n\n if (!rawTx?.length) {\n log('Approving transaction as no raw value');\n await this.#approveTransaction(txMeta.id);\n return;\n }\n\n const ethQuery = this.#getEthQuery(txMeta.networkClientId);\n await this.#publishTransaction(ethQuery, rawTx);\n\n const retryCount = (txMeta.retryCount ?? 0) + 1;\n\n this.#updateTransaction(\n merge({}, txMeta, { retryCount }),\n 'PendingTransactionTracker:transaction-retry - Retry count increased',\n );\n }\n\n #isResubmitDue(txMeta: TransactionMeta, latestBlockNumber: string): boolean {\n const txMetaWithFirstRetryBlockNumber = cloneDeep(txMeta);\n\n if (!txMetaWithFirstRetryBlockNumber.firstRetryBlockNumber) {\n txMetaWithFirstRetryBlockNumber.firstRetryBlockNumber = latestBlockNumber;\n\n this.#updateTransaction(\n txMetaWithFirstRetryBlockNumber,\n 'PendingTransactionTracker:#isResubmitDue - First retry block number set',\n );\n }\n\n const { firstRetryBlockNumber } = txMetaWithFirstRetryBlockNumber;\n\n const blocksSinceFirstRetry =\n Number.parseInt(latestBlockNumber, 16) -\n Number.parseInt(firstRetryBlockNumber, 16);\n\n const retryCount = txMeta.retryCount || 0;\n\n // Exponential backoff to limit retries at publishing\n // Capped at ~15 minutes between retries\n const requiredBlocksSinceFirstRetry = Math.min(\n MAX_RETRY_BLOCK_DISTANCE,\n Math.pow(2, retryCount),\n );\n\n return blocksSinceFirstRetry >= requiredBlocksSinceFirstRetry;\n }\n\n async #checkTransaction(txMeta: TransactionMeta) {\n const { hash, id } = txMeta;\n\n if (!hash && this.#beforeCheckPendingTransaction(txMeta)) {\n const error = new Error(\n 'We had an error while submitting this transaction, please try again.',\n );\n\n error.name = 'NoTxHashError';\n\n this.#failTransaction(txMeta, error);\n\n return;\n }\n\n if (this.#isNonceTaken(txMeta)) {\n log('Nonce already taken', id);\n this.#dropTransaction(txMeta);\n return;\n }\n\n try {\n const receipt = await this.#getTransactionReceipt(hash);\n const isSuccess = receipt?.status === RECEIPT_STATUS_SUCCESS;\n const isFailure = receipt?.status === RECEIPT_STATUS_FAILURE;\n\n if (isFailure) {\n log('Transaction receipt has failed status');\n\n this.#failTransaction(\n txMeta,\n new Error('Transaction dropped or replaced'),\n );\n\n return;\n }\n\n const { blockNumber, blockHash } = receipt || {};\n\n if (isSuccess && blockNumber && blockHash) {\n await this.#onTransactionConfirmed(txMeta, {\n ...receipt,\n blockNumber,\n blockHash,\n });\n\n return;\n }\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n log('Failed to check transaction', id, error);\n\n this.#warnTransaction(\n txMeta,\n error.message,\n 'There was a problem loading this transaction.',\n );\n\n return;\n }\n\n if (await this.#isTransactionDropped(txMeta)) {\n this.#dropTransaction(txMeta);\n }\n }\n\n async #onTransactionConfirmed(\n txMeta: TransactionMeta,\n receipt: SuccessfulTransactionReceipt,\n ) {\n const { id } = txMeta;\n const { blockHash } = receipt;\n\n log('Transaction confirmed', id);\n\n const { baseFeePerGas, timestamp: blockTimestamp } =\n await this.#getBlockByHash(blockHash, false);\n\n const updatedTxMeta = cloneDeep(txMeta);\n updatedTxMeta.baseFeePerGas = baseFeePerGas;\n updatedTxMeta.blockTimestamp = blockTimestamp;\n updatedTxMeta.status = TransactionStatus.confirmed;\n updatedTxMeta.txParams = {\n ...updatedTxMeta.txParams,\n gasUsed: receipt.gasUsed,\n };\n updatedTxMeta.txReceipt = receipt;\n updatedTxMeta.verifiedOnBlockchain = true;\n\n this.#updateTransaction(\n updatedTxMeta,\n 'PendingTransactionTracker:#onTransactionConfirmed - Transaction confirmed',\n );\n\n this.hub.emit('transaction-confirmed', updatedTxMeta);\n }\n\n async #isTransactionDropped(txMeta: TransactionMeta) {\n const {\n hash,\n id,\n txParams: { nonce, from },\n } = txMeta;\n\n /* istanbul ignore next */\n if (!nonce || !hash) {\n return false;\n }\n\n const networkNextNonceHex = await this.#getNetworkTransactionCount(from);\n const networkNextNonceNumber = parseInt(networkNextNonceHex, 16);\n const nonceNumber = parseInt(nonce, 16);\n\n if (nonceNumber >= networkNextNonceNumber) {\n return false;\n }\n\n let droppedBlockCount = this.#droppedBlockCountByHash.get(hash);\n\n if (droppedBlockCount === undefined) {\n droppedBlockCount = 0;\n this.#droppedBlockCountByHash.set(hash, droppedBlockCount);\n }\n\n if (droppedBlockCount < DROPPED_BLOCK_COUNT) {\n log('Incrementing dropped block count', { id, droppedBlockCount });\n this.#droppedBlockCountByHash.set(hash, droppedBlockCount + 1);\n return false;\n }\n\n log('Hit dropped block count', id);\n\n this.#droppedBlockCountByHash.delete(hash);\n return true;\n }\n\n #isNonceTaken(txMeta: TransactionMeta): boolean {\n const { id, txParams } = txMeta;\n\n return this.#getCurrentChainTransactions().some(\n (tx) =>\n tx.id !== id &&\n tx.txParams.from === txParams.from &&\n tx.status === TransactionStatus.confirmed &&\n tx.txParams.nonce === txParams.nonce &&\n tx.type !== TransactionType.incoming,\n );\n }\n\n #getPendingTransactions(): TransactionMeta[] {\n return this.#getCurrentChainTransactions().filter(\n (tx) =>\n tx.status === TransactionStatus.submitted &&\n !tx.verifiedOnBlockchain &&\n !tx.isUserOperation,\n );\n }\n\n #warnTransaction(txMeta: TransactionMeta, error: string, message: string) {\n this.#updateTransaction(\n {\n ...txMeta,\n warning: { error, message },\n },\n 'PendingTransactionTracker:#warnTransaction - Warning added',\n );\n }\n\n #failTransaction(txMeta: TransactionMeta, error: Error) {\n log('Transaction failed', txMeta.id, error);\n this.hub.emit('transaction-failed', txMeta, error);\n }\n\n #dropTransaction(txMeta: TransactionMeta) {\n log('Transaction dropped', txMeta.id);\n this.hub.emit('transaction-dropped', txMeta);\n }\n\n #updateTransaction(txMeta: TransactionMeta, note: string) {\n this.hub.emit('transaction-updated', txMeta, note);\n }\n\n async #getTransactionReceipt(\n txHash?: string,\n ): Promise {\n return await query(this.#getEthQuery(), 'getTransactionReceipt', [txHash]);\n }\n\n async #getBlockByHash(\n blockHash: string,\n includeTransactionDetails: boolean,\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Promise {\n return await query(this.#getEthQuery(), 'getBlockByHash', [\n blockHash,\n includeTransactionDetails,\n ]);\n }\n\n async #getNetworkTransactionCount(address: string): Promise {\n return await query(this.#getEthQuery(), 'getTransactionCount', [address]);\n }\n\n #getCurrentChainTransactions(): TransactionMeta[] {\n const currentChainId = this.#getChainId();\n\n return this.#getTransactions().filter(\n (tx) => tx.chainId === currentChainId,\n );\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-UQQWZT6C.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-UQQWZT6C.mjs.map +deleted file mode 100644 +index bfaab44..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-UQQWZT6C.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/logger.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nexport const projectLogger = createProjectLogger('transaction-controller');\n\nexport const incomingTransactionsLogger = createModuleLogger(\n projectLogger,\n 'incoming-transactions',\n);\n\nexport { createModuleLogger };\n"],"mappings":";AAEA,SAAS,qBAAqB,0BAA0B;AAEjD,IAAM,gBAAgB,oBAAoB,wBAAwB;AAElE,IAAM,6BAA6B;AAAA,EACxC;AAAA,EACA;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-VXNPVIYL.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-UUBV6ROF.mjs +similarity index 99% +rename from node_modules/@metamask/transaction-controller/dist/chunk-VXNPVIYL.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-UUBV6ROF.mjs +index 6c9ad0e..e5b1c5b 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-VXNPVIYL.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-UUBV6ROF.mjs +@@ -3,7 +3,7 @@ import { + } from "./chunk-GNAL5HC2.mjs"; + import { + getGasFeeFlow +-} from "./chunk-JXXTNVU4.mjs"; ++} from "./chunk-GRMANXAN.mjs"; + import { + projectLogger + } from "./chunk-UQQWZT6C.mjs"; +@@ -223,4 +223,4 @@ export { + updateGasFees, + gweiDecimalToWeiHex + }; +-//# sourceMappingURL=chunk-VXNPVIYL.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-UUBV6ROF.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-V72C4MCR.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-V72C4MCR.js.map +deleted file mode 100644 +index 76f62ea..0000000 +--- a/node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AA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,CAAC,aAAa,eAAe;AACtC;AAEA,eAAe,iBAAiB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAAuC;AACrC,QAAM;AAAA,IACJ,UAAU,EAAE,IAAI,KAAK;AAAA,EACvB,IAAI;AAEJ,MAAI,mBAAmB,CAAC,MAAM,MAAM;AAClC,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,MAAM,QAAQ,UAAU,EAAE;AAEvC,SAAO,CAAC,QAAQ,SAAS;AAC3B;AAEA,eAAe,QACb,UACA,SAC6B;AAC7B,SAAO,MAAM,MAAM,UAAU,WAAW,CAAC,OAAO,CAAC;AACnD;AAEA,eAAe,eACb,UAC+C;AAC/C,SAAO,MAAM,MAAM,UAAU,oBAAoB,CAAC,UAAU,KAAK,CAAC;AACpE","sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n\nimport {\n BNToHex,\n fractionBN,\n hexToBN,\n query,\n} from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type { Hex } from '@metamask/utils';\nimport { add0x, createModuleLogger } from '@metamask/utils';\n\nimport { GAS_BUFFER_CHAIN_OVERRIDES } from '../constants';\nimport { projectLogger } from '../logger';\nimport type { TransactionMeta, TransactionParams } from '../types';\n\nexport type UpdateGasRequest = {\n ethQuery: EthQuery;\n isCustomNetwork: boolean;\n chainId: Hex;\n txMeta: TransactionMeta;\n};\n\nexport const log = createModuleLogger(projectLogger, 'gas');\n\nexport const FIXED_GAS = '0x5208';\nexport const DEFAULT_GAS_MULTIPLIER = 1.5;\n\nexport async function updateGas(request: UpdateGasRequest) {\n const { txMeta } = request;\n const initialParams = { ...txMeta.txParams };\n\n const [gas, simulationFails] = await getGas(request);\n\n txMeta.txParams.gas = gas;\n txMeta.simulationFails = simulationFails;\n\n if (!initialParams.gas) {\n txMeta.originalGasEstimate = txMeta.txParams.gas;\n }\n\n if (!txMeta.defaultGasEstimates) {\n txMeta.defaultGasEstimates = {};\n }\n\n txMeta.defaultGasEstimates.gas = txMeta.txParams.gas;\n}\n\nexport async function estimateGas(\n txParams: TransactionParams,\n ethQuery: EthQuery,\n) {\n const request = { ...txParams };\n const { data, value } = request;\n\n const { gasLimit: gasLimitHex, number: blockNumber } = await getLatestBlock(\n ethQuery,\n );\n\n const gasLimitBN = hexToBN(gasLimitHex);\n\n request.data = data ? add0x(data) : data;\n request.gas = BNToHex(fractionBN(gasLimitBN, 19, 20));\n request.value = value || '0x0';\n\n let estimatedGas = request.gas;\n let simulationFails;\n\n try {\n estimatedGas = await query(ethQuery, 'estimateGas', [request]);\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n simulationFails = {\n reason: error.message,\n errorKey: error.errorKey,\n debug: {\n blockNumber,\n blockGasLimit: gasLimitHex,\n },\n };\n\n log('Estimation failed', { ...simulationFails, fallback: estimateGas });\n }\n\n return {\n blockGasLimit: gasLimitHex,\n estimatedGas,\n simulationFails,\n };\n}\n\nexport function addGasBuffer(\n estimatedGas: string,\n blockGasLimit: string,\n multiplier: number,\n) {\n const estimatedGasBN = hexToBN(estimatedGas);\n const maxGasBN = hexToBN(blockGasLimit).muln(0.9);\n const paddedGasBN = estimatedGasBN.muln(multiplier);\n\n if (estimatedGasBN.gt(maxGasBN)) {\n const estimatedGasHex = add0x(estimatedGas);\n log('Using estimated value', estimatedGasHex);\n return estimatedGasHex;\n }\n\n if (paddedGasBN.lt(maxGasBN)) {\n const paddedHex = add0x(BNToHex(paddedGasBN));\n log('Using padded estimate', paddedHex, multiplier);\n return paddedHex;\n }\n\n const maxHex = add0x(BNToHex(maxGasBN));\n log('Using 90% of block gas limit', maxHex);\n return maxHex;\n}\n\nasync function getGas(\n request: UpdateGasRequest,\n): Promise<[string, TransactionMeta['simulationFails']?]> {\n const { isCustomNetwork, chainId, txMeta } = request;\n\n if (txMeta.txParams.gas) {\n log('Using value from request', txMeta.txParams.gas);\n return [txMeta.txParams.gas];\n }\n\n if (await requiresFixedGas(request)) {\n log('Using fixed value', FIXED_GAS);\n return [FIXED_GAS];\n }\n\n const { blockGasLimit, estimatedGas, simulationFails } = await estimateGas(\n txMeta.txParams,\n request.ethQuery,\n );\n\n if (isCustomNetwork) {\n log('Using original estimate as custom network');\n return [estimatedGas, simulationFails];\n }\n\n const bufferMultiplier =\n GAS_BUFFER_CHAIN_OVERRIDES[\n chainId as keyof typeof GAS_BUFFER_CHAIN_OVERRIDES\n ] ?? DEFAULT_GAS_MULTIPLIER;\n\n const bufferedGas = addGasBuffer(\n estimatedGas,\n blockGasLimit,\n bufferMultiplier,\n );\n\n return [bufferedGas, simulationFails];\n}\n\nasync function requiresFixedGas({\n ethQuery,\n txMeta,\n isCustomNetwork,\n}: UpdateGasRequest): Promise {\n const {\n txParams: { to, data },\n } = txMeta;\n\n if (isCustomNetwork || !to || data) {\n return false;\n }\n\n const code = await getCode(ethQuery, to);\n\n return !code || code === '0x';\n}\n\nasync function getCode(\n ethQuery: EthQuery,\n address: string,\n): Promise {\n return await query(ethQuery, 'getCode', [address]);\n}\n\nasync function getLatestBlock(\n ethQuery: EthQuery,\n): Promise<{ gasLimit: string; number: string }> {\n return await query(ethQuery, 'getBlockByNumber', ['latest', false]);\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-VEVVBHP3.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-VEVVBHP3.mjs.map +deleted file mode 100644 +index 0881f0f..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-VEVVBHP3.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/OptimismLayer1GasFeeFlow.ts"],"sourcesContent":["import { type Hex } from '@metamask/utils';\n\nimport { CHAIN_IDS } from '../constants';\nimport type { TransactionMeta } from '../types';\nimport { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow';\n\nconst OPTIMISM_STACK_CHAIN_IDS: Hex[] = [\n CHAIN_IDS.OPTIMISM,\n CHAIN_IDS.OPTIMISM_TESTNET,\n CHAIN_IDS.BASE,\n CHAIN_IDS.BASE_TESTNET,\n CHAIN_IDS.OPBNB,\n CHAIN_IDS.OPBNB_TESTNET,\n CHAIN_IDS.ZORA,\n];\n\n// BlockExplorer link: https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000f#code\nconst OPTIMISM_GAS_PRICE_ORACLE_ADDRESS =\n '0x420000000000000000000000000000000000000F';\n\n/**\n * Optimism layer 1 gas fee flow that obtains gas fee estimate using an oracle contract.\n */\nexport class OptimismLayer1GasFeeFlow extends OracleLayer1GasFeeFlow {\n constructor() {\n super(OPTIMISM_GAS_PRICE_ORACLE_ADDRESS);\n }\n\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return OPTIMISM_STACK_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n}\n"],"mappings":";;;;;;;;AAMA,IAAM,2BAAkC;AAAA,EACtC,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGA,IAAM,oCACJ;AAKK,IAAM,2BAAN,cAAuC,uBAAuB;AAAA,EACnE,cAAc;AACZ,UAAM,iCAAiC;AAAA,EACzC;AAAA,EAEA,mBAAmB,iBAA2C;AAC5D,WAAO,yBAAyB,SAAS,gBAAgB,OAAO;AAAA,EAClE;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-AYTU4HU5.js b/node_modules/@metamask/transaction-controller/dist/chunk-VWDGWDFV.js +similarity index 99% +rename from node_modules/@metamask/transaction-controller/dist/chunk-AYTU4HU5.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-VWDGWDFV.js +index ebfda25..a7ee1a4 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-AYTU4HU5.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-VWDGWDFV.js +@@ -89,4 +89,4 @@ var SimulationErrorCode = /* @__PURE__ */ ((SimulationErrorCode2) => { + + + exports.TransactionStatus = TransactionStatus; exports.WalletDevice = WalletDevice; exports.TransactionType = TransactionType; exports.TransactionEnvelopeType = TransactionEnvelopeType; exports.UserFeeLevel = UserFeeLevel; exports.GasFeeEstimateLevel = GasFeeEstimateLevel; exports.GasFeeEstimateType = GasFeeEstimateType; exports.SimulationTokenStandard = SimulationTokenStandard; exports.SimulationErrorCode = SimulationErrorCode; +-//# sourceMappingURL=chunk-AYTU4HU5.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-VWDGWDFV.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-VXNPVIYL.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-VXNPVIYL.mjs.map +deleted file mode 100644 +index 1380bb8..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-VXNPVIYL.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/gas-fees.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n\nimport {\n ORIGIN_METAMASK,\n gweiDecToWEIBN,\n query,\n toHex,\n} from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type {\n FetchGasFeeEstimateOptions,\n GasFeeState,\n} from '@metamask/gas-fee-controller';\nimport type { Hex } from '@metamask/utils';\nimport { add0x, createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type {\n SavedGasFees,\n TransactionParams,\n TransactionMeta,\n TransactionType,\n GasFeeFlow,\n} from '../types';\nimport { GasFeeEstimateType, UserFeeLevel } from '../types';\nimport { getGasFeeFlow } from './gas-flow';\nimport { SWAP_TRANSACTION_TYPES } from './swaps';\n\nexport type UpdateGasFeesRequest = {\n eip1559: boolean;\n ethQuery: EthQuery;\n gasFeeFlows: GasFeeFlow[];\n getGasFeeEstimates: (\n options: FetchGasFeeEstimateOptions,\n ) => Promise;\n getSavedGasFees: (chainId: Hex) => SavedGasFees | undefined;\n txMeta: TransactionMeta;\n};\n\nexport type GetGasFeeRequest = UpdateGasFeesRequest & {\n initialParams: TransactionParams;\n savedGasFees?: SavedGasFees;\n suggestedGasFees: SuggestedGasFees;\n};\n\ntype SuggestedGasFees = {\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n gasPrice?: string;\n};\n\nconst log = createModuleLogger(projectLogger, 'gas-fees');\n\nexport async function updateGasFees(request: UpdateGasFeesRequest) {\n const { txMeta } = request;\n const initialParams = { ...txMeta.txParams };\n\n const isSwap = SWAP_TRANSACTION_TYPES.includes(\n txMeta.type as TransactionType,\n );\n const savedGasFees = isSwap\n ? undefined\n : request.getSavedGasFees(txMeta.chainId);\n\n const suggestedGasFees = await getSuggestedGasFees(request);\n\n log('Suggested gas fees', suggestedGasFees);\n\n const getGasFeeRequest: GetGasFeeRequest = {\n ...request,\n initialParams,\n savedGasFees,\n suggestedGasFees,\n };\n\n txMeta.txParams.maxFeePerGas = getMaxFeePerGas(getGasFeeRequest);\n\n txMeta.txParams.maxPriorityFeePerGas =\n getMaxPriorityFeePerGas(getGasFeeRequest);\n\n txMeta.txParams.gasPrice = getGasPrice(getGasFeeRequest);\n txMeta.userFeeLevel = getUserFeeLevel(getGasFeeRequest);\n\n log('Updated gas fee properties', {\n maxFeePerGas: txMeta.txParams.maxFeePerGas,\n maxPriorityFeePerGas: txMeta.txParams.maxPriorityFeePerGas,\n gasPrice: txMeta.txParams.gasPrice,\n });\n\n if (txMeta.txParams.maxFeePerGas || txMeta.txParams.maxPriorityFeePerGas) {\n delete txMeta.txParams.gasPrice;\n }\n\n if (txMeta.txParams.gasPrice) {\n delete txMeta.txParams.maxFeePerGas;\n delete txMeta.txParams.maxPriorityFeePerGas;\n }\n\n updateDefaultGasEstimates(txMeta);\n}\n\nexport function gweiDecimalToWeiHex(value: string) {\n return toHex(gweiDecToWEIBN(value));\n}\n\nfunction getMaxFeePerGas(request: GetGasFeeRequest): string | undefined {\n const { savedGasFees, eip1559, initialParams, suggestedGasFees } = request;\n\n if (!eip1559) {\n return undefined;\n }\n\n if (savedGasFees) {\n const maxFeePerGas = gweiDecimalToWeiHex(savedGasFees.maxBaseFee as string);\n log('Using maxFeePerGas from savedGasFees', maxFeePerGas);\n return maxFeePerGas;\n }\n\n if (initialParams.maxFeePerGas) {\n log('Using maxFeePerGas from request', initialParams.maxFeePerGas);\n return initialParams.maxFeePerGas;\n }\n\n if (initialParams.gasPrice && !initialParams.maxPriorityFeePerGas) {\n log(\n 'Setting maxFeePerGas to gasPrice from request',\n initialParams.gasPrice,\n );\n return initialParams.gasPrice;\n }\n\n if (suggestedGasFees.maxFeePerGas) {\n log('Using suggested maxFeePerGas', suggestedGasFees.maxFeePerGas);\n return suggestedGasFees.maxFeePerGas;\n }\n\n if (suggestedGasFees.gasPrice) {\n log(\n 'Setting maxFeePerGas to suggested gasPrice',\n suggestedGasFees.gasPrice,\n );\n return suggestedGasFees.gasPrice;\n }\n\n log('maxFeePerGas not set');\n return undefined;\n}\n\nfunction getMaxPriorityFeePerGas(\n request: GetGasFeeRequest,\n): string | undefined {\n const { eip1559, initialParams, savedGasFees, suggestedGasFees, txMeta } =\n request;\n\n if (!eip1559) {\n return undefined;\n }\n\n if (savedGasFees) {\n const maxPriorityFeePerGas = gweiDecimalToWeiHex(savedGasFees.priorityFee);\n log(\n 'Using maxPriorityFeePerGas from savedGasFees.priorityFee',\n maxPriorityFeePerGas,\n );\n return maxPriorityFeePerGas;\n }\n\n if (initialParams.maxPriorityFeePerGas) {\n log(\n 'Using maxPriorityFeePerGas from request',\n initialParams.maxPriorityFeePerGas,\n );\n return initialParams.maxPriorityFeePerGas;\n }\n\n if (initialParams.gasPrice && !initialParams.maxFeePerGas) {\n log(\n 'Setting maxPriorityFeePerGas to gasPrice from request',\n initialParams.gasPrice,\n );\n return initialParams.gasPrice;\n }\n\n if (suggestedGasFees.maxPriorityFeePerGas) {\n log(\n 'Using suggested maxPriorityFeePerGas',\n suggestedGasFees.maxPriorityFeePerGas,\n );\n return suggestedGasFees.maxPriorityFeePerGas;\n }\n\n if (txMeta.txParams.maxFeePerGas) {\n log(\n 'Setting maxPriorityFeePerGas to maxFeePerGas',\n txMeta.txParams.maxFeePerGas,\n );\n return txMeta.txParams.maxFeePerGas;\n }\n\n log('maxPriorityFeePerGas not set');\n return undefined;\n}\n\nfunction getGasPrice(request: GetGasFeeRequest): string | undefined {\n const { eip1559, initialParams, suggestedGasFees } = request;\n\n if (eip1559) {\n return undefined;\n }\n\n if (initialParams.gasPrice) {\n log('Using gasPrice from request', initialParams.gasPrice);\n return initialParams.gasPrice;\n }\n\n if (suggestedGasFees.maxFeePerGas) {\n log('Using suggested maxFeePerGas', suggestedGasFees.maxFeePerGas);\n return suggestedGasFees.maxFeePerGas;\n }\n\n if (suggestedGasFees.gasPrice) {\n log('Using suggested gasPrice', suggestedGasFees.gasPrice);\n return suggestedGasFees.gasPrice;\n }\n\n log('gasPrice not set');\n return undefined;\n}\n\nfunction getUserFeeLevel(request: GetGasFeeRequest): UserFeeLevel | undefined {\n const { eip1559, initialParams, savedGasFees, suggestedGasFees, txMeta } =\n request;\n\n if (!eip1559) {\n return undefined;\n }\n\n if (savedGasFees) {\n return UserFeeLevel.CUSTOM;\n }\n\n if (\n !initialParams.maxFeePerGas &&\n !initialParams.maxPriorityFeePerGas &&\n initialParams.gasPrice\n ) {\n return txMeta.origin === ORIGIN_METAMASK\n ? UserFeeLevel.CUSTOM\n : UserFeeLevel.DAPP_SUGGESTED;\n }\n\n if (\n !initialParams.maxFeePerGas &&\n !initialParams.maxPriorityFeePerGas &&\n suggestedGasFees.maxFeePerGas &&\n suggestedGasFees.maxPriorityFeePerGas\n ) {\n return UserFeeLevel.MEDIUM;\n }\n\n if (txMeta.origin === ORIGIN_METAMASK) {\n return UserFeeLevel.MEDIUM;\n }\n\n return UserFeeLevel.DAPP_SUGGESTED;\n}\n\nfunction updateDefaultGasEstimates(txMeta: TransactionMeta) {\n if (!txMeta.defaultGasEstimates) {\n txMeta.defaultGasEstimates = {};\n }\n\n txMeta.defaultGasEstimates.maxFeePerGas = txMeta.txParams.maxFeePerGas;\n\n txMeta.defaultGasEstimates.maxPriorityFeePerGas =\n txMeta.txParams.maxPriorityFeePerGas;\n\n txMeta.defaultGasEstimates.gasPrice = txMeta.txParams.gasPrice;\n txMeta.defaultGasEstimates.estimateType = txMeta.userFeeLevel;\n}\n\nasync function getSuggestedGasFees(\n request: UpdateGasFeesRequest,\n): Promise {\n const { eip1559, ethQuery, gasFeeFlows, getGasFeeEstimates, txMeta } =\n request;\n\n const { networkClientId } = txMeta;\n\n if (\n (!eip1559 && txMeta.txParams.gasPrice) ||\n (eip1559 &&\n txMeta.txParams.maxFeePerGas &&\n txMeta.txParams.maxPriorityFeePerGas)\n ) {\n return {};\n }\n\n const gasFeeFlow = getGasFeeFlow(txMeta, gasFeeFlows) as GasFeeFlow;\n\n try {\n const gasFeeControllerData = await getGasFeeEstimates({ networkClientId });\n\n const response = await gasFeeFlow.getGasFees({\n ethQuery,\n gasFeeControllerData,\n transactionMeta: txMeta,\n });\n\n const gasFeeEstimateType = response.estimates?.type;\n\n switch (gasFeeEstimateType) {\n case GasFeeEstimateType.FeeMarket:\n return response.estimates.medium;\n case GasFeeEstimateType.Legacy:\n return {\n gasPrice: response.estimates.medium,\n };\n case GasFeeEstimateType.GasPrice:\n return { gasPrice: response.estimates.gasPrice };\n default:\n throw new Error(\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Unsupported gas fee estimate type returned from flow: ${gasFeeEstimateType}`,\n );\n }\n } catch (error) {\n log('Failed to get suggested gas fees', error);\n }\n\n const gasPriceDecimal = (await query(ethQuery, 'gasPrice')) as number;\n\n const gasPrice = gasPriceDecimal\n ? add0x(gasPriceDecimal.toString(16))\n : undefined;\n\n return { gasPrice };\n}\n"],"mappings":";;;;;;;;;;;AAEA;A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AAC,WAAW,OAAO,SAAS,YAC5B,WACC,OAAO,SAAS,gBAChB,OAAO,SAAS,sBAClB;AACA,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,aAAa,cAAc,QAAQ,WAAW;AAEpD,MAAI;AACF,UAAM,uBAAuB,MAAM,mBAAmB,EAAE,gBAAgB,CAAC;AAEzE,UAAM,WAAW,MAAM,WAAW,WAAW;AAAA,MAC3C;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,IACnB,CAAC;AAED,UAAM,qBAAqB,SAAS,WAAW;AAE/C,YAAQ,oBAAoB;AAAA,MAC1B;AACE,eAAO,SAAS,UAAU;AAAA,MAC5B;AACE,eAAO;AAAA,UACL,UAAU,SAAS,UAAU;AAAA,QAC/B;AAAA,MACF;AACE,eAAO,EAAE,UAAU,SAAS,UAAU,SAAS;AAAA,MACjD;AACE,cAAM,IAAI;AAAA;AAAA;AAAA,UAGR,yDAAyD,kBAAkB;AAAA,QAC7E;AAAA,IACJ;AAAA,EACF,SAAS,OAAO;AACd,QAAI,oCAAoC,KAAK;AAAA,EAC/C;AAEA,QAAM,kBAAmB,MAAM,MAAM,UAAU,UAAU;AAEzD,QAAM,WAAW,kBACb,MAAM,gBAAgB,SAAS,EAAE,CAAC,IAClC;AAEJ,SAAO,EAAE,SAAS;AACpB;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-WR5F34OW.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-WR5F34OW.js.map +deleted file mode 100644 +index a5a36e3..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-WR5F34OW.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/ScrollLayer1GasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;AAMA,IAAM,mBAA0B,CAAC,UAAU,QAAQ,UAAU,cAAc;AAG3E,IAAM,kCACJ;AAKK,IAAM,yBAAN,cAAqC,uBAAuB;AAAA,EACjE,cAAc;AACZ,UAAM,iCAAiC,IAAI;AAAA,EAC7C;AAAA,EAEA,mBAAmB,iBAA2C;AAC5D,WAAO,iBAAiB,SAAS,gBAAgB,OAAO;AAAA,EAC1D;AACF","sourcesContent":["import { type Hex } from '@metamask/utils';\n\nimport { CHAIN_IDS } from '../constants';\nimport type { TransactionMeta } from '../types';\nimport { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow';\n\nconst SCROLL_CHAIN_IDS: Hex[] = [CHAIN_IDS.SCROLL, CHAIN_IDS.SCROLL_SEPOLIA];\n\n// BlockExplorer link: https://scrollscan.com/address/0x5300000000000000000000000000000000000002#code\nconst SCROLL_GAS_PRICE_ORACLE_ADDRESS =\n '0x5300000000000000000000000000000000000002';\n\n/**\n * Scroll layer 1 gas fee flow that obtains gas fee estimate using an oracle contract.\n */\nexport class ScrollLayer1GasFeeFlow extends OracleLayer1GasFeeFlow {\n constructor() {\n super(SCROLL_GAS_PRICE_ORACLE_ADDRESS, true);\n }\n\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return SCROLL_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-C3WC4OJ3.js b/node_modules/@metamask/transaction-controller/dist/chunk-XGCT4DDW.js +similarity index 97% +rename from node_modules/@metamask/transaction-controller/dist/chunk-C3WC4OJ3.js +rename to node_modules/@metamask/transaction-controller/dist/chunk-XGCT4DDW.js +index 90936a0..75f4356 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-C3WC4OJ3.js ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-XGCT4DDW.js +@@ -3,7 +3,7 @@ + var _chunkQH2H4W3Njs = require('./chunk-QH2H4W3N.js'); + + +-var _chunk76FONEDAjs = require('./chunk-76FONEDA.js'); ++var _chunkOEMCU4FYjs = require('./chunk-OEMCU4FY.js'); + + + var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js'); +@@ -186,7 +186,7 @@ async function getSuggestedGasFees(request) { + if (!eip1559 && txMeta.txParams.gasPrice || eip1559 && txMeta.txParams.maxFeePerGas && txMeta.txParams.maxPriorityFeePerGas) { + return {}; + } +- const gasFeeFlow = _chunk76FONEDAjs.getGasFeeFlow.call(void 0, txMeta, gasFeeFlows); ++ const gasFeeFlow = _chunkOEMCU4FYjs.getGasFeeFlow.call(void 0, txMeta, gasFeeFlows); + try { + const gasFeeControllerData = await getGasFeeEstimates({ networkClientId }); + const response = await gasFeeFlow.getGasFees({ +@@ -223,4 +223,4 @@ async function getSuggestedGasFees(request) { + + + exports.updateGasFees = updateGasFees; exports.gweiDecimalToWeiHex = gweiDecimalToWeiHex; +-//# sourceMappingURL=chunk-C3WC4OJ3.js.map +\ No newline at end of file ++//# sourceMappingURL=chunk-XGCT4DDW.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-XGRAHX6T.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-XGRAHX6T.mjs.map +deleted file mode 100644 +index 1d80dc6..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-XGRAHX6T.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/history.ts"],"sourcesContent":["import jsonDiffer from 'fast-json-patch';\nimport { cloneDeep, merge } from 'lodash';\n\nimport type {\n TransactionHistory,\n TransactionHistoryEntry,\n TransactionMeta,\n} from '../types';\n\n/**\n * Build a new version of the provided transaction with an initial history\n * entry, which is just a snapshot of the transaction.\n *\n * @param transactionMeta - TransactionMeta to add initial history snapshot to.\n * @returns A copy of `transactionMeta` with a new `history` property.\n */\nexport function addInitialHistorySnapshot(\n transactionMeta: TransactionMeta,\n): TransactionMeta {\n const snapshot = snapshotFromTransactionMeta(transactionMeta);\n return merge({}, transactionMeta, { history: [snapshot] });\n}\n\n/**\n * Builds a new version of the transaction with a new history entry if\n * it has a `history` property, or just returns the transaction.\n *\n * @param transactionMeta - TransactionMeta to add history entry to.\n * @param note - Note to add to history entry.\n * @returns A copy of `transactionMeta` with a new `history` entry if it has an\n * existing non-empty `history` array.\n */\nexport function updateTransactionHistory(\n transactionMeta: TransactionMeta,\n note: string,\n): TransactionMeta {\n if (!transactionMeta.history) {\n return transactionMeta;\n }\n\n const currentState = snapshotFromTransactionMeta(transactionMeta);\n const previousState = replayHistory(transactionMeta.history);\n const historyEntry = generateHistoryEntry(previousState, currentState, note);\n\n if (historyEntry.length > 0) {\n return merge({}, transactionMeta, {\n history: [...transactionMeta.history, historyEntry],\n });\n }\n return transactionMeta;\n}\n\n/**\n * Generates a history entry from the previous and new transaction metadata.\n *\n * @param previousState - The previous transaction metadata.\n * @param currentState - The new transaction metadata.\n * @param note - A note for the transaction metada update.\n * @returns An array of history operation.\n */\nfunction generateHistoryEntry(\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n previousState: any,\n currentState: TransactionMeta,\n note: string,\n): TransactionHistoryEntry {\n const historyOperationsEntry = jsonDiffer.compare(\n previousState,\n currentState,\n ) as TransactionHistoryEntry;\n // Add a note to the first operation, since it breaks if we append it to the entry\n if (historyOperationsEntry[0]) {\n if (note) {\n historyOperationsEntry[0].note = note;\n }\n historyOperationsEntry[0].timestamp = Date.now();\n }\n return historyOperationsEntry;\n}\n\n/**\n * Recovers previous transactionMeta from passed history array.\n *\n * @param transactionHistory - The transaction metadata to replay.\n * @returns The transaction metadata.\n */\nfunction replayHistory(\n transactionHistory: TransactionHistory,\n): TransactionMeta {\n const shortHistory = cloneDeep(transactionHistory);\n return shortHistory.reduce(\n // TODO: Replace `any` with type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (val, entry: any) => jsonDiffer.applyPatch(val, entry).newDocument,\n ) as TransactionMeta;\n}\n\n/**\n * Clone the transaction meta data without the history property.\n *\n * @param transactionMeta - The transaction metadata to snapshot.\n * @returns A deep clone of transaction metadata without history property.\n */\nfunction snapshotFromTransactionMeta(\n transactionMeta: TransactionMeta,\n): TransactionMeta {\n const snapshot = { ...transactionMeta };\n delete snapshot.history;\n return cloneDeep(snapshot);\n}\n"],"mappings":";AAAA,OAAO,gBAAgB;AACvB,SAAS,WAAW,aAAa;AAe1B,SAAS,0BACd,iBACiB;AACjB,QAAM,WAAW,4BAA4B,eAAe;AAC5D,SAAO,MAAM,CAAC,GAAG,iBAAiB,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC3D;AAWO,SAAS,yBACd,iBACA,MACiB;AACjB,MAAI,CAAC,gBAAgB,SAAS;AAC5B,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,4BAA4B,eAAe;AAChE,QAAM,gBAAgB,cAAc,gBAAgB,OAAO;AAC3D,QAAM,eAAe,qBAAqB,eAAe,cAAc,IAAI;AAE3E,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,MAAM,CAAC,GAAG,iBAAiB;AAAA,MAChC,SAAS,CAAC,GAAG,gBAAgB,SAAS,YAAY;AAAA,IACpD,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAUA,SAAS,qBAGP,eACA,cACA,MACyB;AACzB,QAAM,yBAAyB,WAAW;AAAA,IACxC;AAAA,IACA;AAAA,EACF;AAEA,MAAI,uBAAuB,CAAC,GAAG;AAC7B,QAAI,MAAM;AACR,6BAAuB,CAAC,EAAE,OAAO;AAAA,IACnC;AACA,2BAAuB,CAAC,EAAE,YAAY,KAAK,IAAI;AAAA,EACjD;AACA,SAAO;AACT;AAQA,SAAS,cACP,oBACiB;AACjB,QAAM,eAAe,UAAU,kBAAkB;AACjD,SAAO,aAAa;AAAA;AAAA;AAAA,IAGlB,CAAC,KAAK,UAAe,WAAW,WAAW,KAAK,KAAK,EAAE;AAAA,EACzD;AACF;AAQA,SAAS,4BACP,iBACiB;AACjB,QAAM,WAAW,EAAE,GAAG,gBAAgB;AACtC,SAAO,SAAS;AAChB,SAAO,UAAU,QAAQ;AAC3B;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-XUI43LEZ.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-XUI43LEZ.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-XUI43LEZ.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-UKV5HIMT.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-XVQU7RNY.mjs +similarity index 97% +rename from node_modules/@metamask/transaction-controller/dist/chunk-UKV5HIMT.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-XVQU7RNY.mjs +index 17eb6a6..a0cda1b 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-UKV5HIMT.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-XVQU7RNY.mjs +@@ -38,7 +38,7 @@ import { + } from "./chunk-FMRLPVFZ.mjs"; + import { + GasFeePoller +-} from "./chunk-SFFTNB2X.mjs"; ++} from "./chunk-TKS27C32.mjs"; + import { + getTransactionLayer1GasFee, + updateTransactionLayer1GasFee +@@ -54,13 +54,13 @@ import { + } from "./chunk-EKJXGERC.mjs"; + import { + LineaGasFeeFlow +-} from "./chunk-UHG2LLVV.mjs"; ++} from "./chunk-XW5Y6OXZ.mjs"; + import { + DefaultGasFeeFlow +-} from "./chunk-H2KZOK3J.mjs"; ++} from "./chunk-JQDBXSCG.mjs"; + import { + updateGasFees +-} from "./chunk-VXNPVIYL.mjs"; ++} from "./chunk-UUBV6ROF.mjs"; + import { + updatePostTransactionBalance, + updateSwapsTransaction +@@ -79,7 +79,7 @@ import { + } from "./chunk-Q56I5ONX.mjs"; + import { + getGasFeeFlow +-} from "./chunk-JXXTNVU4.mjs"; ++} from "./chunk-GRMANXAN.mjs"; + import { + projectLogger + } from "./chunk-UQQWZT6C.mjs"; +@@ -124,9 +124,14 @@ var metadata = { + lastFetchedBlockNumbers: { + persist: true, + anonymous: false ++ }, ++ submitHistory: { ++ persist: true, ++ anonymous: false + } + }; + var HARDFORK = Hardfork.London; ++var SUBMIT_HISTORY_LIMIT = 100; + var CANCEL_RATE = 1.1; + var SPEED_UP_RATE = 1.1; + var controllerName = "TransactionController"; +@@ -140,10 +145,11 @@ function getDefaultTransactionControllerState() { + return { + methodData: {}, + transactions: [], +- lastFetchedBlockNumbers: {} ++ lastFetchedBlockNumbers: {}, ++ submitHistory: [] + }; + } +-var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _testGasFeeFlows, _multichainTrackingHelper, _createNonceTracker, createNonceTracker_fn, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn, _createPendingTransactionTracker, createPendingTransactionTracker_fn, _checkForPendingTransactionAndStartPolling, _stopAllTracking, stopAllTracking_fn, _removeIncomingTransactionHelperListeners, removeIncomingTransactionHelperListeners_fn, _addIncomingTransactionHelperListeners, addIncomingTransactionHelperListeners_fn, _removePendingTransactionTrackerListeners, removePendingTransactionTrackerListeners_fn, _addPendingTransactionTrackerListeners, addPendingTransactionTrackerListeners_fn, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn, _getGasFeeFlows, getGasFeeFlows_fn, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn, _updateTransactionInternal, updateTransactionInternal_fn, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn, _updateSimulationData, updateSimulationData_fn, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn, _getNetworkClientId, getNetworkClientId_fn, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn, _getGlobalChainId, getGlobalChainId_fn, _isCustomNetwork, isCustomNetwork_fn, _getSelectedAccount, getSelectedAccount_fn; ++var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _testGasFeeFlows, _multichainTrackingHelper, _createNonceTracker, createNonceTracker_fn, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn, _createPendingTransactionTracker, createPendingTransactionTracker_fn, _checkForPendingTransactionAndStartPolling, _stopAllTracking, stopAllTracking_fn, _removeIncomingTransactionHelperListeners, removeIncomingTransactionHelperListeners_fn, _addIncomingTransactionHelperListeners, addIncomingTransactionHelperListeners_fn, _removePendingTransactionTrackerListeners, removePendingTransactionTrackerListeners_fn, _addPendingTransactionTrackerListeners, addPendingTransactionTrackerListeners_fn, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn, _getGasFeeFlows, getGasFeeFlows_fn, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn, _updateTransactionInternal, updateTransactionInternal_fn, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn, _updateSimulationData, updateSimulationData_fn, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn, _getNetworkClientId, getNetworkClientId_fn, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn, _getGlobalChainId, getGlobalChainId_fn, _isCustomNetwork, isCustomNetwork_fn, _getSelectedAccount, getSelectedAccount_fn, _updateSubmitHistory, updateSubmitHistory_fn; + var TransactionController = class extends BaseController { + /** + * Constructs a TransactionController. +@@ -232,6 +238,7 @@ var TransactionController = class extends BaseController { + __privateAdd(this, _getGlobalChainId); + __privateAdd(this, _isCustomNetwork); + __privateAdd(this, _getSelectedAccount); ++ __privateAdd(this, _updateSubmitHistory); + __privateAdd(this, _internalEvents, new EventEmitter()); + this.approvingTransactionIds = /* @__PURE__ */ new Set(); + this.mutex = new Mutex(); +@@ -669,7 +676,9 @@ var TransactionController = class extends BaseController { + const hash = await this.publishTransactionForRetry( + ethQuery, + rawTx, +- transactionMeta ++ newTxParams, ++ transactionMeta, ++ "cancel" + ); + const cancelTransactionMeta = { + actionId, +@@ -787,7 +796,9 @@ var TransactionController = class extends BaseController { + const hash = await this.publishTransactionForRetry( + ethQuery, + rawTx, +- transactionMeta ++ txParams, ++ transactionMeta, ++ ORIGIN_METAMASK + ); + const baseTransactionMeta = { + ...transactionMetaWithRsv, +@@ -1717,7 +1728,13 @@ var TransactionController = class extends BaseController { + rawTx + ); + if (hash === void 0) { +- hash = await this.publishTransaction(ethQuery, rawTx); ++ hash = await this.publishTransaction( ++ ethQuery, ++ rawTx, ++ transactionMeta.txParams, ++ transactionMeta.chainId, ++ transactionMeta.origin ++ ); + } + projectLogger("Publish successful", hash); + transactionMeta = __privateMethod(this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { +@@ -1749,8 +1766,12 @@ var TransactionController = class extends BaseController { + cleanupTasks.forEach((task) => task()); + } + } +- async publishTransaction(ethQuery, rawTransaction) { +- return await query(ethQuery, "sendRawTransaction", [rawTransaction]); ++ async publishTransaction(ethQuery, rawTransaction, transaction, chainId, origin) { ++ const transactionHash = await query(ethQuery, "sendRawTransaction", [ ++ rawTransaction ++ ]); ++ __privateMethod(this, _updateSubmitHistory, updateSubmitHistory_fn).call(this, rawTransaction, transactionHash, transaction, chainId, origin); ++ return transactionHash; + } + /** + * Cancels a transaction based on its ID by setting its status to "rejected" +@@ -2204,10 +2225,15 @@ var TransactionController = class extends BaseController { + projectLogger("Error while updating post transaction balance", error); + } + } +- async publishTransactionForRetry(ethQuery, rawTx, transactionMeta) { ++ async publishTransactionForRetry(ethQuery, rawTx, params, transactionMeta, origin) { + try { +- const hash = await this.publishTransaction(ethQuery, rawTx); +- return hash; ++ return await this.publishTransaction( ++ ethQuery, ++ rawTx, ++ params, ++ transactionMeta.chainId, ++ origin ++ ); + } catch (error) { + if (this.isTransactionAlreadyConfirmedError(error)) { + await this.pendingTransactionTracker.forceCheckTransaction( +@@ -2270,6 +2296,7 @@ createIncomingTransactionHelper_fn = function({ + blockTracker, + getCurrentAccount: () => __privateMethod(this, _getSelectedAccount, getSelectedAccount_fn).call(this), + getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers, ++ getLocalTransactions: () => this.state.transactions, + getChainId: chainId ? () => chainId : this.getChainId.bind(this), + isEnabled: __privateGet(this, _incomingTransactionOptions).isEnabled, + queryEntireHistory: __privateGet(this, _incomingTransactionOptions).queryEntireHistory, +@@ -2300,7 +2327,7 @@ createPendingTransactionTracker_fn = function({ + getGlobalLock: () => __privateGet(this, _multichainTrackingHelper).acquireNonceLockForChainIdKey({ + chainId: getChainId() + }), +- publishTransaction: this.publishTransaction.bind(this), ++ publishTransaction: (_ethQuery, rawTx) => query(_ethQuery, "sendRawTransaction", [rawTx]), + hooks: { + beforeCheckPendingTransaction: this.beforeCheckPendingTransaction.bind(this), + beforePublish: this.beforePublish.bind(this) +@@ -2555,6 +2582,32 @@ _getSelectedAccount = new WeakSet(); + getSelectedAccount_fn = function() { + return this.messagingSystem.call("AccountsController:getSelectedAccount"); + }; ++_updateSubmitHistory = new WeakSet(); ++updateSubmitHistory_fn = function(rawTransaction, hash, transaction, chainId, origin) { ++ const { networkConfigurations, selectedNetworkClientId } = this.getNetworkState(); ++ const networkConfiguration = networkConfigurations[selectedNetworkClientId]; ++ const networkUrl = networkConfiguration?.rpcUrl; ++ const networkType = networkConfiguration?.nickname || selectedNetworkClientId; ++ const submitHistoryEntry = { ++ chainId, ++ hash, ++ networkType, ++ networkUrl, ++ origin, ++ time: Date.now(), ++ transaction, ++ rawTransaction ++ }; ++ projectLogger("Updating submit history", submitHistoryEntry); ++ this.update((state) => { ++ const { submitHistory: currentSubmitHistory } = state; ++ const newSubmitHistory = [submitHistoryEntry, ...currentSubmitHistory]; ++ if (newSubmitHistory.length > SUBMIT_HISTORY_LIMIT) { ++ newSubmitHistory.pop(); ++ } ++ state.submitHistory = newSubmitHistory; ++ }); ++}; + + export { + HARDFORK, +@@ -2563,4 +2616,4 @@ export { + ApprovalState, + TransactionController + }; +-//# sourceMappingURL=chunk-UKV5HIMT.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-XVQU7RNY.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-XVYXRCRL.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-XVYXRCRL.js.map +deleted file mode 100644 +index c9da047..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-XVYXRCRL.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/utils/etherscan.ts"],"names":[],"mappings":";;;;;;;;AAAA,SAAS,mBAAmB;AAmF5B,eAAsB,2BAA2B;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEE;AACA,SAAO,MAAM,kBAAkB,UAAU;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAYA,eAAsB,gCAAgC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEE;AACA,SAAO,MAAM,kBAAkB,WAAW;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAeA,eAAe,kBACb,QACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAM0C;AAC1C,QAAM,YAAY;AAAA,IAChB,QAAQ;AAAA,IACR;AAAA,IACA,YAAY,WAAW,SAAS;AAAA,IAChC,QAAQ,OAAO,SAAS;AAAA,IACxB,MAAM;AAAA,EACR;AAEA,QAAM,iBAAiB,mBAAmB,SAAS;AAAA,IACjD,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAED,6BAAI,6BAA6B,cAAc;AAE/C,QAAM,WAAY,MAAM;AAAA,IACtB;AAAA,EACF;AAEA,SAAO;AACT;AASA,SAAS,mBACP,SACA,WACQ;AACR,QAAM,SAAS,oBAAoB,OAAO;AAC1C,MAAI,MAAM,GAAG,MAAM;AAEnB,aAAW,YAAY,OAAO,KAAK,SAAS,GAAG;AAC7C,UAAM,QAAQ,UAAU,QAAQ;AAEhC,QAAI,CAAC,OAAO;AACV;AAAA,IACF;AAEA,WAAO,GAAG,QAAQ,IAAI,KAAK;AAAA,EAC7B;AAEA,SAAO;AAEP,SAAO;AACT;AAQO,SAAS,oBAAoB,SAAc;AAEhD,QAAM,cAAc,6BAA6B,OAAO;AAExD,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,6CAA6C,OAAO,EAAE;AAAA,EACxE;AAIA,SAAO,WAAW,YAAY,SAAS,IAAI,YAAY,MAAM;AAC/D","sourcesContent":["import { handleFetch } from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport { ETHERSCAN_SUPPORTED_NETWORKS } from '../constants';\nimport { incomingTransactionsLogger as log } from '../logger';\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionMetaBase {\n blockNumber: string;\n blockHash: string;\n confirmations: string;\n contractAddress: string;\n cumulativeGasUsed: string;\n from: string;\n gas: string;\n gasPrice: string;\n gasUsed: string;\n hash: string;\n nonce: string;\n timeStamp: string;\n to: string;\n transactionIndex: string;\n value: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionMeta extends EtherscanTransactionMetaBase {\n functionName: string;\n input: string;\n isError: string;\n methodId: string;\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n txreceipt_status: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTokenTransactionMeta\n extends EtherscanTransactionMetaBase {\n tokenDecimal: string;\n tokenName: string;\n tokenSymbol: string;\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionResponse<\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n T extends EtherscanTransactionMetaBase,\n> {\n status: '0' | '1';\n message?: string;\n result: string | T[];\n}\n\n// This interface was created before this ESLint rule was added.\n// Convert to a `type` in a future major version.\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface EtherscanTransactionRequest {\n address: string;\n chainId: Hex;\n fromBlock?: number;\n limit?: number;\n}\n\n/**\n * Retrieves transaction data from Etherscan.\n *\n * @param request - Configuration required to fetch transactions.\n * @param request.address - Address to retrieve transactions for.\n * @param request.chainId - Current chain ID used to determine subdomain and domain.\n * @param request.fromBlock - Block number to start fetching transactions from.\n * @param request.limit - Number of transactions to retrieve.\n * @returns An Etherscan response object containing the request status and an array of token transaction data.\n */\nexport async function fetchEtherscanTransactions({\n address,\n chainId,\n fromBlock,\n limit,\n}: EtherscanTransactionRequest): Promise<\n EtherscanTransactionResponse\n> {\n return await fetchTransactions('txlist', {\n address,\n chainId,\n fromBlock,\n limit,\n });\n}\n\n/**\n * Retrieves token transaction data from Etherscan.\n *\n * @param request - Configuration required to fetch token transactions.\n * @param request.address - Address to retrieve token transactions for.\n * @param request.chainId - Current chain ID used to determine subdomain and domain.\n * @param request.fromBlock - Block number to start fetching token transactions from.\n * @param request.limit - Number of token transactions to retrieve.\n * @returns An Etherscan response object containing the request status and an array of token transaction data.\n */\nexport async function fetchEtherscanTokenTransactions({\n address,\n chainId,\n fromBlock,\n limit,\n}: EtherscanTransactionRequest): Promise<\n EtherscanTransactionResponse\n> {\n return await fetchTransactions('tokentx', {\n address,\n chainId,\n fromBlock,\n limit,\n });\n}\n\n/**\n * Retrieves transaction data from Etherscan from a specific endpoint.\n *\n * @param action - The Etherscan endpoint to use.\n * @param options - Options bag.\n * @param options.address - Address to retrieve transactions for.\n * @param options.chainId - Current chain ID used to determine subdomain and domain.\n * @param options.fromBlock - Block number to start fetching transactions from.\n * @param options.limit - Number of transactions to retrieve.\n * @returns An object containing the request status and an array of transaction data.\n */\n// TODO: Either fix this lint violation or explain why it's necessary to ignore.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nasync function fetchTransactions(\n action: string,\n {\n address,\n chainId,\n fromBlock,\n limit,\n }: {\n address: string;\n chainId: Hex;\n fromBlock?: number;\n limit?: number;\n },\n): Promise> {\n const urlParams = {\n module: 'account',\n address,\n startBlock: fromBlock?.toString(),\n offset: limit?.toString(),\n sort: 'desc',\n };\n\n const etherscanTxUrl = getEtherscanApiUrl(chainId, {\n ...urlParams,\n action,\n });\n\n log('Sending Etherscan request', etherscanTxUrl);\n\n const response = (await handleFetch(\n etherscanTxUrl,\n )) as EtherscanTransactionResponse;\n\n return response;\n}\n\n/**\n * Return a URL that can be used to fetch data from Etherscan.\n *\n * @param chainId - Current chain ID used to determine subdomain and domain.\n * @param urlParams - The parameters used to construct the URL.\n * @returns URL to access Etherscan data.\n */\nfunction getEtherscanApiUrl(\n chainId: Hex,\n urlParams: Record,\n): string {\n const apiUrl = getEtherscanApiHost(chainId);\n let url = `${apiUrl}/api?`;\n\n for (const paramKey of Object.keys(urlParams)) {\n const value = urlParams[paramKey];\n\n if (!value) {\n continue;\n }\n\n url += `${paramKey}=${value}&`;\n }\n\n url += 'tag=latest&page=1';\n\n return url;\n}\n\n/**\n * Return the host url used to fetch data from Etherscan.\n *\n * @param chainId - Current chain ID used to determine subdomain and domain.\n * @returns host URL to access Etherscan data.\n */\nexport function getEtherscanApiHost(chainId: Hex) {\n // @ts-expect-error We account for `chainId` not being a property below\n const networkInfo = ETHERSCAN_SUPPORTED_NETWORKS[chainId];\n\n if (!networkInfo) {\n throw new Error(`Etherscan does not support chain with ID: ${chainId}`);\n }\n\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `https://${networkInfo.subdomain}.${networkInfo.domain}`;\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-UHG2LLVV.mjs b/node_modules/@metamask/transaction-controller/dist/chunk-XW5Y6OXZ.mjs +similarity index 97% +rename from node_modules/@metamask/transaction-controller/dist/chunk-UHG2LLVV.mjs +rename to node_modules/@metamask/transaction-controller/dist/chunk-XW5Y6OXZ.mjs +index 48acf26..7014646 100644 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-UHG2LLVV.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/chunk-XW5Y6OXZ.mjs +@@ -1,12 +1,12 @@ + import { + DefaultGasFeeFlow +-} from "./chunk-H2KZOK3J.mjs"; ++} from "./chunk-JQDBXSCG.mjs"; + import { + projectLogger + } from "./chunk-UQQWZT6C.mjs"; + import { + GasFeeEstimateLevel +-} from "./chunk-6SJYXSF3.mjs"; ++} from "./chunk-UF4IMTUO.mjs"; + import { + __privateAdd, + __privateMethod +@@ -118,4 +118,4 @@ feesToString_fn = function(fees) { + export { + LineaGasFeeFlow + }; +-//# sourceMappingURL=chunk-UHG2LLVV.mjs.map +\ No newline at end of file ++//# sourceMappingURL=chunk-XW5Y6OXZ.mjs.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-YVCX6Z75.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-YVCX6Z75.js.map +deleted file mode 100644 +index eea7ed3..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-YVCX6Z75.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/OracleLayer1GasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AACzB,SAAS,oBAA2C;AAEpD,SAAS,0BAA0B;AACnC,SAAS,YAAY;AAUrB,IAAM,MAAM,mBAAmB,eAAe,4BAA4B;AAE1E,IAAM,YACJ;AAEF,IAAM,uBAAuB;AAAA,EAC3B;AAAA,IACE,QAAQ,CAAC,EAAE,cAAc,SAAS,MAAM,SAAS,MAAM,QAAQ,CA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K,SAAS;AAAA,EAClE;AAEA,SAAO;AACT;AAEA;AAAA,4BAAuB,SACrB,iBAC6B;AAC7B,SAAO;AAAA,IACL,GAAG,KAAK,gBAAgB,UAAU,KAAK;AAAA,IACvC,UAAU,gBAAgB,SAAS;AAAA,EACrC;AACF;AAEA;AAAA,4BAAuB,SAAC,iBAAkC;AACxD,QAAM,UAAU,OAAO,gBAAgB,OAAO;AAE9C,SAAO,OAAO,OAAO;AAAA,IACnB;AAAA,IACA,iBAAiB,SAAS;AAAA,EAC5B,CAAC;AACH","sourcesContent":["import { Common, Hardfork } from '@ethereumjs/common';\nimport { TransactionFactory } from '@ethereumjs/tx';\nimport { Contract } from '@ethersproject/contracts';\nimport { Web3Provider, type ExternalProvider } from '@ethersproject/providers';\nimport type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\nimport { omit } from 'lodash';\n\nimport { projectLogger } from '../logger';\nimport type {\n Layer1GasFeeFlow,\n Layer1GasFeeFlowRequest,\n Layer1GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\n\nconst log = createModuleLogger(projectLogger, 'oracle-layer1-gas-fee-flow');\n\nconst DUMMY_KEY =\n 'abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789';\n\nconst GAS_PRICE_ORACLE_ABI = [\n {\n inputs: [{ internalType: 'bytes', name: '_data', type: 'bytes' }],\n name: 'getL1Fee',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n];\n\n/**\n * Layer 1 gas fee flow that obtains gas fee estimate using an oracle smart contract.\n */\nexport abstract class OracleLayer1GasFeeFlow implements Layer1GasFeeFlow {\n #oracleAddress: Hex;\n\n #signTransaction: boolean;\n\n constructor(oracleAddress: Hex, signTransaction?: boolean) {\n this.#oracleAddress = oracleAddress;\n this.#signTransaction = signTransaction ?? false;\n }\n\n abstract matchesTransaction(transactionMeta: TransactionMeta): boolean;\n\n async getLayer1Fee(\n request: Layer1GasFeeFlowRequest,\n ): Promise {\n try {\n return await this.#getOracleLayer1GasFee(request);\n } catch (error) {\n log('Failed to get oracle layer 1 gas fee', error);\n throw new Error(`Failed to get oracle layer 1 gas fee`);\n }\n }\n\n async #getOracleLayer1GasFee(\n request: Layer1GasFeeFlowRequest,\n ): Promise {\n const { provider, transactionMeta } = request;\n\n const contract = new Contract(\n this.#oracleAddress,\n GAS_PRICE_ORACLE_ABI,\n // Network controller provider type is incompatible with ethers provider\n new Web3Provider(provider as unknown as ExternalProvider),\n );\n\n const serializedTransaction = this.#buildUnserializedTransaction(\n transactionMeta,\n this.#signTransaction,\n ).serialize();\n\n const result = await contract.getL1Fee(serializedTransaction);\n\n if (result === undefined) {\n throw new Error('No value returned from oracle contract');\n }\n\n return {\n layer1Fee: result.toHexString(),\n };\n }\n\n #buildUnserializedTransaction(\n transactionMeta: TransactionMeta,\n sign: boolean,\n ) {\n const txParams = this.#buildTransactionParams(transactionMeta);\n const common = this.#buildTransactionCommon(transactionMeta);\n\n let unserializedTransaction = TransactionFactory.fromTxData(txParams, {\n common,\n });\n\n if (sign) {\n const keyBuffer = Buffer.from(DUMMY_KEY, 'hex');\n unserializedTransaction = unserializedTransaction.sign(keyBuffer);\n }\n\n return unserializedTransaction;\n }\n\n #buildTransactionParams(\n transactionMeta: TransactionMeta,\n ): TransactionMeta['txParams'] {\n return {\n ...omit(transactionMeta.txParams, 'gas'),\n gasLimit: transactionMeta.txParams.gas,\n };\n }\n\n #buildTransactionCommon(transactionMeta: TransactionMeta) {\n const chainId = Number(transactionMeta.chainId);\n\n return Common.custom({\n chainId,\n defaultHardfork: Hardfork.London,\n });\n }\n}\n"]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-Z4BLTVTB.js.map b/node_modules/@metamask/transaction-controller/dist/chunk-Z4BLTVTB.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-Z4BLTVTB.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/chunk-Z4GV3YQQ.mjs.map b/node_modules/@metamask/transaction-controller/dist/chunk-Z4GV3YQQ.mjs.map +deleted file mode 100644 +index 6c9acc5..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/chunk-Z4GV3YQQ.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":["../src/gas-flows/ScrollLayer1GasFeeFlow.ts"],"sourcesContent":["import { type Hex } from '@metamask/utils';\n\nimport { CHAIN_IDS } from '../constants';\nimport type { TransactionMeta } from '../types';\nimport { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow';\n\nconst SCROLL_CHAIN_IDS: Hex[] = [CHAIN_IDS.SCROLL, CHAIN_IDS.SCROLL_SEPOLIA];\n\n// BlockExplorer link: https://scrollscan.com/address/0x5300000000000000000000000000000000000002#code\nconst SCROLL_GAS_PRICE_ORACLE_ADDRESS =\n '0x5300000000000000000000000000000000000002';\n\n/**\n * Scroll layer 1 gas fee flow that obtains gas fee estimate using an oracle contract.\n */\nexport class ScrollLayer1GasFeeFlow extends OracleLayer1GasFeeFlow {\n constructor() {\n super(SCROLL_GAS_PRICE_ORACLE_ADDRESS, true);\n }\n\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return SCROLL_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n}\n"],"mappings":";;;;;;;;AAMA,IAAM,mBAA0B,CAAC,UAAU,QAAQ,UAAU,cAAc;AAG3E,IAAM,kCACJ;AAKK,IAAM,yBAAN,cAAqC,uBAAuB;AAAA,EACjE,cAAc;AACZ,UAAM,iCAAiC,IAAI;AAAA,EAC7C;AAAA,EAEA,mBAAmB,iBAA2C;AAC5D,WAAO,iBAAiB,SAAS,gBAAgB,OAAO;AAAA,EAC1D;AACF;","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/constants.js.map b/node_modules/@metamask/transaction-controller/dist/constants.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/constants.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/constants.mjs.map b/node_modules/@metamask/transaction-controller/dist/constants.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/constants.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/errors.js b/node_modules/@metamask/transaction-controller/dist/errors.js +index 8b748b2..5843852 100644 +--- a/node_modules/@metamask/transaction-controller/dist/errors.js ++++ b/node_modules/@metamask/transaction-controller/dist/errors.js +@@ -4,7 +4,7 @@ + + + var _chunkHMOSP33Fjs = require('./chunk-HMOSP33F.js'); +-require('./chunk-AYTU4HU5.js'); ++require('./chunk-VWDGWDFV.js'); + require('./chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/errors.js.map b/node_modules/@metamask/transaction-controller/dist/errors.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/errors.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/errors.mjs b/node_modules/@metamask/transaction-controller/dist/errors.mjs +index ec9b63b..89ec00c 100644 +--- a/node_modules/@metamask/transaction-controller/dist/errors.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/errors.mjs +@@ -4,7 +4,7 @@ import { + SimulationInvalidResponseError, + SimulationRevertedError + } from "./chunk-HQSNKCXI.mjs"; +-import "./chunk-6SJYXSF3.mjs"; ++import "./chunk-UF4IMTUO.mjs"; + import "./chunk-XUI43LEZ.mjs"; + export { + SimulationChainNotSupportedError, +diff --git a/node_modules/@metamask/transaction-controller/dist/errors.mjs.map b/node_modules/@metamask/transaction-controller/dist/errors.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/errors.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js +index 3bdd160..0e79b75 100644 +--- a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js ++++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.js +@@ -1,15 +1,15 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +-var _chunkQTKXIDGEjs = require('../chunk-QTKXIDGE.js'); +-require('../chunk-C3WC4OJ3.js'); ++var _chunk5G4OGDYPjs = require('../chunk-5G4OGDYP.js'); ++require('../chunk-XGCT4DDW.js'); + require('../chunk-QH2H4W3N.js'); + require('../chunk-OZ6UB42C.js'); +-require('../chunk-76FONEDA.js'); ++require('../chunk-OEMCU4FY.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +-exports.DefaultGasFeeFlow = _chunkQTKXIDGEjs.DefaultGasFeeFlow; ++exports.DefaultGasFeeFlow = _chunk5G4OGDYPjs.DefaultGasFeeFlow; + //# sourceMappingURL=DefaultGasFeeFlow.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.mjs b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.mjs +index 5a924af..b17c715 100644 +--- a/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/DefaultGasFeeFlow.mjs +@@ -1,13 +1,13 @@ + import { + DefaultGasFeeFlow +-} from "../chunk-H2KZOK3J.mjs"; +-import "../chunk-VXNPVIYL.mjs"; ++} from "../chunk-JQDBXSCG.mjs"; ++import "../chunk-UUBV6ROF.mjs"; + import "../chunk-GNAL5HC2.mjs"; + import "../chunk-Q56I5ONX.mjs"; +-import "../chunk-JXXTNVU4.mjs"; ++import "../chunk-GRMANXAN.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + DefaultGasFeeFlow +diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js +index 752de8c..b71538f 100644 +--- a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js ++++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.js +@@ -1,16 +1,16 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +-var _chunkARZHJFVGjs = require('../chunk-ARZHJFVG.js'); +-require('../chunk-QTKXIDGE.js'); +-require('../chunk-C3WC4OJ3.js'); ++var _chunk4SXPHQZRjs = require('../chunk-4SXPHQZR.js'); ++require('../chunk-5G4OGDYP.js'); ++require('../chunk-XGCT4DDW.js'); + require('../chunk-QH2H4W3N.js'); + require('../chunk-OZ6UB42C.js'); +-require('../chunk-76FONEDA.js'); ++require('../chunk-OEMCU4FY.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +-exports.LineaGasFeeFlow = _chunkARZHJFVGjs.LineaGasFeeFlow; ++exports.LineaGasFeeFlow = _chunk4SXPHQZRjs.LineaGasFeeFlow; + //# sourceMappingURL=LineaGasFeeFlow.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.mjs b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.mjs +index 9ab8e8b..e276834 100644 +--- a/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/LineaGasFeeFlow.mjs +@@ -1,14 +1,14 @@ + import { + LineaGasFeeFlow +-} from "../chunk-UHG2LLVV.mjs"; +-import "../chunk-H2KZOK3J.mjs"; +-import "../chunk-VXNPVIYL.mjs"; ++} from "../chunk-XW5Y6OXZ.mjs"; ++import "../chunk-JQDBXSCG.mjs"; ++import "../chunk-UUBV6ROF.mjs"; + import "../chunk-GNAL5HC2.mjs"; + import "../chunk-Q56I5ONX.mjs"; +-import "../chunk-JXXTNVU4.mjs"; ++import "../chunk-GRMANXAN.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + LineaGasFeeFlow +diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.js b/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.js +index e3c4153..437854c 100644 +--- a/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.js ++++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.js +@@ -1,7 +1,7 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + var _chunkTJMQEH57js = require('../chunk-TJMQEH57.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.mjs b/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.mjs +index ba49f8e..6ba56b1 100644 +--- a/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/gas-flows/TestGasFeeFlow.mjs +@@ -1,7 +1,7 @@ + import { + TestGasFeeFlow + } from "../chunk-FMRLPVFZ.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + TestGasFeeFlow +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.js b/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.js +index 3dd45d8..36f66df 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.js ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.js +@@ -4,7 +4,7 @@ var _chunk7NMV2NPMjs = require('../chunk-7NMV2NPM.js'); + require('../chunk-XVYXRCRL.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.mjs b/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.mjs +index fbda172..76ab459 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/EtherscanRemoteTransactionSource.mjs +@@ -4,7 +4,7 @@ import { + import "../chunk-EGQCE3FK.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + EtherscanRemoteTransactionSource +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js +index 6c196cd..8aac4d7 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.js +@@ -1,12 +1,12 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +-var _chunk2EU6346Vjs = require('../chunk-2EU6346V.js'); ++var _chunk5ITD3JI5js = require('../chunk-5ITD3JI5.js'); + require('../chunk-2XKEAKQG.js'); +-require('../chunk-76FONEDA.js'); ++require('../chunk-OEMCU4FY.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +-exports.GasFeePoller = _chunk2EU6346Vjs.GasFeePoller; ++exports.GasFeePoller = _chunk5ITD3JI5js.GasFeePoller; + //# sourceMappingURL=GasFeePoller.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.mjs b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.mjs +index 6989a3a..f6a58b4 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/GasFeePoller.mjs +@@ -1,10 +1,10 @@ + import { + GasFeePoller +-} from "../chunk-SFFTNB2X.mjs"; ++} from "../chunk-TKS27C32.mjs"; + import "../chunk-NOHEXQ7Y.mjs"; +-import "../chunk-JXXTNVU4.mjs"; ++import "../chunk-GRMANXAN.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + GasFeePoller +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.js b/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.js +index e7a0bad..f8d03c7 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.js ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.js +@@ -5,7 +5,7 @@ require('../chunk-7NMV2NPM.js'); + require('../chunk-XVYXRCRL.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.mjs b/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.mjs +index 59b4c85..6c377b9 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/MultichainTrackingHelper.mjs +@@ -5,7 +5,7 @@ import "../chunk-EKJXGERC.mjs"; + import "../chunk-EGQCE3FK.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + MultichainTrackingHelper +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.js b/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.js +index 339a778..746b155 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.js ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.js +@@ -2,7 +2,7 @@ + + var _chunkULD4JC3Qjs = require('../chunk-ULD4JC3Q.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.mjs b/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.mjs +index e942405..bc9f84e 100644 +--- a/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/helpers/PendingTransactionTracker.mjs +@@ -2,7 +2,7 @@ import { + PendingTransactionTracker + } from "../chunk-6B5BEO3R.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + PendingTransactionTracker +diff --git a/node_modules/@metamask/transaction-controller/dist/index.js b/node_modules/@metamask/transaction-controller/dist/index.js +index 16f7e96..40e00ea 100644 +--- a/node_modules/@metamask/transaction-controller/dist/index.js ++++ b/node_modules/@metamask/transaction-controller/dist/index.js +@@ -2,7 +2,8 @@ + + + +-var _chunkS7Q622ISjs = require('./chunk-S7Q622IS.js'); ++ ++var _chunk4M5OIUIUjs = require('./chunk-4M5OIUIU.js'); + require('./chunk-PRUNMTRD.js'); + require('./chunk-74W7X6BE.js'); + require('./chunk-KT6UAKBB.js'); +@@ -18,16 +19,16 @@ require('./chunk-NYKRCWBG.js'); + require('./chunk-WR5F34OW.js'); + require('./chunk-YVCX6Z75.js'); + require('./chunk-TJMQEH57.js'); +-require('./chunk-2EU6346V.js'); ++require('./chunk-5ITD3JI5.js'); + require('./chunk-2XKEAKQG.js'); + require('./chunk-RHDPOIS4.js'); + require('./chunk-6OLJWLKK.js'); + require('./chunk-7NMV2NPM.js'); + require('./chunk-XVYXRCRL.js'); + require('./chunk-HMOSP33F.js'); +-require('./chunk-ARZHJFVG.js'); +-require('./chunk-QTKXIDGE.js'); +-require('./chunk-C3WC4OJ3.js'); ++require('./chunk-4SXPHQZR.js'); ++require('./chunk-5G4OGDYP.js'); ++require('./chunk-XGCT4DDW.js'); + require('./chunk-QH2H4W3N.js'); + + +@@ -35,8 +36,11 @@ require('./chunk-QH2H4W3N.js'); + var _chunkOZ6UB42Cjs = require('./chunk-OZ6UB42C.js'); + + +-var _chunk76FONEDAjs = require('./chunk-76FONEDA.js'); +-require('./chunk-UGN7PBON.js'); ++var _chunkOEMCU4FYjs = require('./chunk-OEMCU4FY.js'); ++ ++ ++ ++var _chunkUGN7PBONjs = require('./chunk-UGN7PBON.js'); + require('./chunk-S6VGOPUY.js'); + + +@@ -48,7 +52,7 @@ require('./chunk-S6VGOPUY.js'); + + + +-var _chunkAYTU4HU5js = require('./chunk-AYTU4HU5.js'); ++var _chunkVWDGWDFVjs = require('./chunk-VWDGWDFV.js'); + require('./chunk-Z4BLTVTB.js'); + + +@@ -67,5 +71,8 @@ require('./chunk-Z4BLTVTB.js'); + + + +-exports.CANCEL_RATE = _chunkS7Q622ISjs.CANCEL_RATE; exports.GasFeeEstimateLevel = _chunkAYTU4HU5js.GasFeeEstimateLevel; exports.GasFeeEstimateType = _chunkAYTU4HU5js.GasFeeEstimateType; exports.HARDFORK = _chunkS7Q622ISjs.HARDFORK; exports.SimulationErrorCode = _chunkAYTU4HU5js.SimulationErrorCode; exports.SimulationTokenStandard = _chunkAYTU4HU5js.SimulationTokenStandard; exports.TransactionController = _chunkS7Q622ISjs.TransactionController; exports.TransactionEnvelopeType = _chunkAYTU4HU5js.TransactionEnvelopeType; exports.TransactionStatus = _chunkAYTU4HU5js.TransactionStatus; exports.TransactionType = _chunkAYTU4HU5js.TransactionType; exports.UserFeeLevel = _chunkAYTU4HU5js.UserFeeLevel; exports.WalletDevice = _chunkAYTU4HU5js.WalletDevice; exports.determineTransactionType = _chunkSD6CWFDFjs.determineTransactionType; exports.isEIP1559Transaction = _chunkOZ6UB42Cjs.isEIP1559Transaction; exports.mergeGasFeeEstimates = _chunk76FONEDAjs.mergeGasFeeEstimates; exports.normalizeTransactionParams = _chunkOZ6UB42Cjs.normalizeTransactionParams; ++ ++ ++ ++exports.CANCEL_RATE = _chunk4M5OIUIUjs.CANCEL_RATE; exports.CHAIN_IDS = _chunkUGN7PBONjs.CHAIN_IDS; exports.ETHERSCAN_SUPPORTED_NETWORKS = _chunkUGN7PBONjs.ETHERSCAN_SUPPORTED_NETWORKS; exports.GasFeeEstimateLevel = _chunkVWDGWDFVjs.GasFeeEstimateLevel; exports.GasFeeEstimateType = _chunkVWDGWDFVjs.GasFeeEstimateType; exports.HARDFORK = _chunk4M5OIUIUjs.HARDFORK; exports.SPEED_UP_RATE = _chunk4M5OIUIUjs.SPEED_UP_RATE; exports.SimulationErrorCode = _chunkVWDGWDFVjs.SimulationErrorCode; exports.SimulationTokenStandard = _chunkVWDGWDFVjs.SimulationTokenStandard; exports.TransactionController = _chunk4M5OIUIUjs.TransactionController; exports.TransactionEnvelopeType = _chunkVWDGWDFVjs.TransactionEnvelopeType; exports.TransactionStatus = _chunkVWDGWDFVjs.TransactionStatus; exports.TransactionType = _chunkVWDGWDFVjs.TransactionType; exports.UserFeeLevel = _chunkVWDGWDFVjs.UserFeeLevel; exports.WalletDevice = _chunkVWDGWDFVjs.WalletDevice; exports.determineTransactionType = _chunkSD6CWFDFjs.determineTransactionType; exports.isEIP1559Transaction = _chunkOZ6UB42Cjs.isEIP1559Transaction; exports.mergeGasFeeEstimates = _chunkOEMCU4FYjs.mergeGasFeeEstimates; exports.normalizeTransactionParams = _chunkOZ6UB42Cjs.normalizeTransactionParams; + //# sourceMappingURL=index.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/index.js.map b/node_modules/@metamask/transaction-controller/dist/index.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/index.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/index.mjs b/node_modules/@metamask/transaction-controller/dist/index.mjs +index edca04b..9893a52 100644 +--- a/node_modules/@metamask/transaction-controller/dist/index.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/index.mjs +@@ -1,8 +1,9 @@ + import { + CANCEL_RATE, + HARDFORK, ++ SPEED_UP_RATE, + TransactionController +-} from "./chunk-UKV5HIMT.mjs"; ++} from "./chunk-XVQU7RNY.mjs"; + import "./chunk-6DDVVUJC.mjs"; + import "./chunk-EVL6KODQ.mjs"; + import "./chunk-K4KOSAGM.mjs"; +@@ -18,16 +19,16 @@ import "./chunk-VEVVBHP3.mjs"; + import "./chunk-Z4GV3YQQ.mjs"; + import "./chunk-FG74Z3F5.mjs"; + import "./chunk-FMRLPVFZ.mjs"; +-import "./chunk-SFFTNB2X.mjs"; ++import "./chunk-TKS27C32.mjs"; + import "./chunk-NOHEXQ7Y.mjs"; + import "./chunk-3ZV5YEUV.mjs"; + import "./chunk-4V4XIPCI.mjs"; + import "./chunk-EKJXGERC.mjs"; + import "./chunk-EGQCE3FK.mjs"; + import "./chunk-HQSNKCXI.mjs"; +-import "./chunk-UHG2LLVV.mjs"; +-import "./chunk-H2KZOK3J.mjs"; +-import "./chunk-VXNPVIYL.mjs"; ++import "./chunk-XW5Y6OXZ.mjs"; ++import "./chunk-JQDBXSCG.mjs"; ++import "./chunk-UUBV6ROF.mjs"; + import "./chunk-GNAL5HC2.mjs"; + import { + isEIP1559Transaction, +@@ -35,8 +36,11 @@ import { + } from "./chunk-Q56I5ONX.mjs"; + import { + mergeGasFeeEstimates +-} from "./chunk-JXXTNVU4.mjs"; +-import "./chunk-O6ZZVIFH.mjs"; ++} from "./chunk-GRMANXAN.mjs"; ++import { ++ CHAIN_IDS, ++ ETHERSCAN_SUPPORTED_NETWORKS ++} from "./chunk-O6ZZVIFH.mjs"; + import "./chunk-UQQWZT6C.mjs"; + import { + GasFeeEstimateLevel, +@@ -48,13 +52,16 @@ import { + TransactionType, + UserFeeLevel, + WalletDevice +-} from "./chunk-6SJYXSF3.mjs"; ++} from "./chunk-UF4IMTUO.mjs"; + import "./chunk-XUI43LEZ.mjs"; + export { + CANCEL_RATE, ++ CHAIN_IDS, ++ ETHERSCAN_SUPPORTED_NETWORKS, + GasFeeEstimateLevel, + GasFeeEstimateType, + HARDFORK, ++ SPEED_UP_RATE, + SimulationErrorCode, + SimulationTokenStandard, + TransactionController, +diff --git a/node_modules/@metamask/transaction-controller/dist/index.mjs.map b/node_modules/@metamask/transaction-controller/dist/index.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/index.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/logger.js.map b/node_modules/@metamask/transaction-controller/dist/logger.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/logger.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/logger.mjs.map b/node_modules/@metamask/transaction-controller/dist/logger.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/logger.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/tsconfig.build.tsbuildinfo b/node_modules/@metamask/transaction-controller/dist/tsconfig.build.tsbuildinfo +index 21fa115..a06d27a 100644 +--- a/node_modules/@metamask/transaction-controller/dist/tsconfig.build.tsbuildinfo ++++ b/node_modules/@metamask/transaction-controller/dist/tsconfig.build.tsbuildinfo +@@ -1 +1 @@ +-{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../types/eth-ens-namehash.d.ts","../../../types/ethereum-ens-network-map.d.ts","../../../types/ethjs-query.d.ts","../../../types/global.d.ts","../../../types/single-call-balance-checker-abi.d.ts","../../../types/@metamask/contract-metadata.d.ts","../../../types/@metamask/eth-hd-keyring.d.ts","../../../types/@metamask/eth-simple-keyring.d.ts","../../../types/@metamask/ethjs-provider-http.d.ts","../../../types/@metamask/ethjs-unit.d.ts","../../../types/@metamask/metamask-eth-abis.d.ts","../../../types/eth-json-rpc-infura/src/createProvider.d.ts","../../../types/eth-phishing-detect/src/config.json.d.ts","../../../types/eth-phishing-detect/src/detector.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@ethereumjs/common/dist/enums.d.ts","../../../node_modules/@ethereumjs/common/dist/types.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@ethereumjs/util/dist/constants.d.ts","../../../node_modules/@ethereumjs/util/dist/units.d.ts","../../../node_modules/@ethereumjs/util/dist/address.d.ts","../../../node_modules/@ethereumjs/util/dist/bytes.d.ts","../../../node_modules/@ethereumjs/util/dist/types.d.ts","../../../node_modules/@ethereumjs/util/dist/account.d.ts","../../../node_modules/@ethereumjs/util/dist/withdrawal.d.ts","../../../node_modules/@ethereumjs/util/dist/signature.d.ts","../../../node_modules/@ethereumjs/util/dist/encoding.d.ts","../../../node_modules/@ethereumjs/util/dist/asyncEventEmitter.d.ts","../../../node_modules/@ethereumjs/util/dist/internal.d.ts","../../../node_modules/@ethereumjs/util/dist/lock.d.ts","../../../node_modules/@ethereumjs/util/dist/provider.d.ts","../../../node_modules/@ethereumjs/util/dist/index.d.ts","../../../node_modules/@ethereumjs/common/dist/common.d.ts","../../../node_modules/@ethereumjs/common/dist/utils.d.ts","../../../node_modules/@ethereumjs/common/dist/index.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip2930Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/legacyTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/types.d.ts","../../../node_modules/@ethereumjs/tx/dist/baseTransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip1559Transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/transactionFactory.d.ts","../../../node_modules/@ethereumjs/tx/dist/index.d.ts","../../base-controller/dist/types/BaseControllerV1.d.ts","../../../node_modules/superstruct/dist/error.d.ts","../../../node_modules/superstruct/dist/utils.d.ts","../../../node_modules/superstruct/dist/struct.d.ts","../../../node_modules/superstruct/dist/structs/coercions.d.ts","../../../node_modules/superstruct/dist/structs/refinements.d.ts","../../../node_modules/superstruct/dist/structs/types.d.ts","../../../node_modules/superstruct/dist/structs/utilities.d.ts","../../../node_modules/superstruct/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/types/assert.d.ts","../../../node_modules/@metamask/utils/dist/types/base64.d.ts","../../../node_modules/@metamask/utils/dist/types/hex.d.ts","../../../node_modules/@metamask/utils/dist/types/bytes.d.ts","../../../node_modules/@metamask/utils/dist/types/caip-types.d.ts","../../../node_modules/@metamask/utils/dist/types/checksum.d.ts","../../../node_modules/@metamask/utils/dist/types/coercers.d.ts","../../../node_modules/@metamask/utils/dist/types/collections.d.ts","../../../node_modules/@metamask/utils/dist/types/encryption-types.d.ts","../../../node_modules/@metamask/utils/dist/types/errors.d.ts","../../../node_modules/@metamask/utils/dist/types/json.d.ts","../../../node_modules/@metamask/utils/dist/types/keyring.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@metamask/utils/dist/types/logging.d.ts","../../../node_modules/@metamask/utils/dist/types/misc.d.ts","../../../node_modules/@metamask/utils/dist/types/number.d.ts","../../../node_modules/@metamask/utils/dist/types/opaque.d.ts","../../../node_modules/@metamask/utils/dist/types/promise.d.ts","../../../node_modules/@metamask/utils/dist/types/time.d.ts","../../../node_modules/@metamask/utils/dist/types/transaction-types.d.ts","../../../node_modules/@metamask/utils/dist/types/versions.d.ts","../../../node_modules/@metamask/utils/dist/types/index.d.ts","../../../node_modules/immer/dist/utils/env.d.ts","../../../node_modules/immer/dist/utils/errors.d.ts","../../../node_modules/immer/dist/types/types-external.d.ts","../../../node_modules/immer/dist/types/types-internal.d.ts","../../../node_modules/immer/dist/utils/common.d.ts","../../../node_modules/immer/dist/utils/plugins.d.ts","../../../node_modules/immer/dist/core/scope.d.ts","../../../node_modules/immer/dist/core/finalize.d.ts","../../../node_modules/immer/dist/core/proxy.d.ts","../../../node_modules/immer/dist/core/immerClass.d.ts","../../../node_modules/immer/dist/core/current.d.ts","../../../node_modules/immer/dist/internal.d.ts","../../../node_modules/immer/dist/plugins/es5.d.ts","../../../node_modules/immer/dist/plugins/patches.d.ts","../../../node_modules/immer/dist/plugins/mapset.d.ts","../../../node_modules/immer/dist/plugins/all.d.ts","../../../node_modules/immer/dist/immer.d.ts","../../base-controller/dist/types/RestrictedControllerMessenger.d.ts","../../base-controller/dist/types/ControllerMessenger.d.ts","../../base-controller/dist/types/BaseControllerV2.d.ts","../../base-controller/dist/types/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/account.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/balance.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/caip.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/export.d.ts","../../../node_modules/@metamask/keyring-api/dist/superstruct.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/request.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/response.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/keyring.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/btc/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/btc/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/contexts.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/erc4337/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/erc4337/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/utils.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/events.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/api.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/eth/EthKeyring.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/eth/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/events.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/rpc.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/JsonRpcRequest.d.ts","../../../node_modules/@metamask/keyring-api/dist/KeyringClient.d.ts","../../../node_modules/@metamask/safe-event-emitter/dist/cjs/index.d.ts","../../json-rpc-engine/dist/types/JsonRpcEngine.d.ts","../../json-rpc-engine/dist/types/createAsyncMiddleware.d.ts","../../json-rpc-engine/dist/types/createScaffoldMiddleware.d.ts","../../json-rpc-engine/dist/types/getUniqueId.d.ts","../../json-rpc-engine/dist/types/idRemapMiddleware.d.ts","../../json-rpc-engine/dist/types/mergeMiddleware.d.ts","../../json-rpc-engine/dist/types/index.d.ts","../../../node_modules/@metamask/providers/dist/types/utils.d.ts","../../../node_modules/@metamask/providers/dist/types/BaseProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/EIP6963.d.ts","../../../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../../../node_modules/@types/readable-stream/index.d.ts","../../../node_modules/@metamask/providers/dist/types/StreamProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/extension-provider/createExternalExtensionProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/MetaMaskInpageProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/initializeInpageProvider.d.ts","../../../node_modules/@metamask/providers/dist/types/shimWeb3.d.ts","../../../node_modules/@metamask/providers/dist/types/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/KeyringSnapRpcClient.d.ts","../../../node_modules/@metamask/keyring-api/dist/rpc-handler.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/utils.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/classes.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/errors.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/error-constants.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/errors.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/error-wrappers.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/errors.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/helpers.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/structs.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/create-interface.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/dialog.d.ts","../../../node_modules/@metamask/key-tree/dist/constants.d.cts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/modular.d.ts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/utils.d.ts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/curve.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519Bip32.d.cts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/weierstrass.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/secp256k1.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/curve.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/index.d.cts","../../../node_modules/@metamask/key-tree/dist/utils.d.cts","../../../node_modules/@metamask/key-tree/dist/BIP44CoinTypeNode.d.cts","../../../node_modules/@metamask/key-tree/dist/SLIP10Node.d.cts","../../../node_modules/@metamask/key-tree/dist/BIP44Node.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip32.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip39.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/cip3.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/slip10.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/index.d.cts","../../../node_modules/@metamask/key-tree/dist/index.d.cts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/caip.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/permissions.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-bip32-entropy.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-bip32-public-key.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-bip44-entropy.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-client-status.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-entropy.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-file.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/component.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Address.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Box.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Copyable.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Divider.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/Button.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/Option.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/Dropdown.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/Input.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/Field.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/Form.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/formatting/Bold.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/formatting/Italic.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/formatting/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Heading.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Image.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Link.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Text.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Value.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Row.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/Spinner.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/jsx-runtime.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/jsx-dev-runtime.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/validation.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/nodes.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/address.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/copyable.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/divider.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/heading.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/image.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/panel.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/spinner.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/text.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/row.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/button.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/input.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/form.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/component.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/interface.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-interface-state.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-locale.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/snap.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-snaps.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/invoke-snap.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/invoke-keyring.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/manage-accounts.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/manage-state.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/notify.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/request-snaps.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/update-interface.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/methods.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/provider.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/global.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/images.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/cronjob.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/home-page.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/keyring.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/lifecycle.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/name-lookup.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/rpc-request.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/transaction.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/signature.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/user-input.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/jsx.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/svg.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/error-wrappers.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/images.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/snap-utils.d.ts","../../../node_modules/@metamask/keyring-api/dist/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/patchCBOR.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/lib/DataItem.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/lib/cbor-sync.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/lib/index.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/ur.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/urEncoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/fountainEncoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/fountainDecoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/urDecoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/RegistryType.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/RegistryItem.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoCoinInfo.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/PathComponent.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoKeypath.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/types.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoHDKey.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoECKey.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/Bytes.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/MultiKey.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/ScriptExpression.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoOutput.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoPSBT.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/CryptoAccount.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/Decoder/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/CryptoMultiAccounts.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/errors/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/DerivationSchema.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/KeyDerivation.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/QRHardwareCall.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/utils.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/EthSignRequest.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/EthSignature.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/ETHNFTItem.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/utlis.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/index.d.ts","../../../node_modules/@keystonehq/base-eth-keyring/dist/InteractionProvider.d.ts","../../../node_modules/@keystonehq/base-eth-keyring/dist/BaseKeyring.d.ts","../../../node_modules/@keystonehq/base-eth-keyring/dist/index.d.ts","../../../node_modules/@metamask/obs-store/dist/ObservableStore.d.ts","../../../node_modules/@metamask/obs-store/dist/asStream.d.ts","../../../node_modules/@metamask/obs-store/dist/ComposedStore.d.ts","../../../node_modules/@metamask/obs-store/dist/MergedStore.d.ts","../../../node_modules/@metamask/obs-store/dist/transform.d.ts","../../../node_modules/@metamask/obs-store/dist/index.d.ts","../../../node_modules/@keystonehq/metamask-airgapped-keyring/dist/MetaMaskInteractionProvider.d.ts","../../../node_modules/@keystonehq/metamask-airgapped-keyring/dist/MetaMaskKeyring.d.ts","../../../node_modules/@keystonehq/metamask-airgapped-keyring/dist/index.d.ts","../../../node_modules/@metamask/browser-passworder/dist/index.d.ts","../../message-manager/dist/types/AbstractMessageManager.d.ts","../../controller-utils/dist/types/types.d.ts","../../controller-utils/dist/types/constants.d.ts","../../../node_modules/@metamask/eth-query/index.d.ts","../../../node_modules/@types/bn.js/index.d.ts","../../controller-utils/dist/types/util.d.ts","../../../node_modules/@spruceid/siwe-parser/dist/abnf.d.ts","../../../node_modules/@spruceid/siwe-parser/dist/utils.d.ts","../../../node_modules/@spruceid/siwe-parser/dist/parsers.d.ts","../../controller-utils/dist/types/siwe.d.ts","../../controller-utils/dist/types/index.d.ts","../../message-manager/dist/types/PersonalMessageManager.d.ts","../../message-manager/dist/types/TypedMessageManager.d.ts","../../message-manager/dist/types/EncryptionPublicKeyManager.d.ts","../../message-manager/dist/types/DecryptMessageManager.d.ts","../../message-manager/dist/types/index.d.ts","../../keyring-controller/dist/types/KeyringController.d.ts","../../keyring-controller/dist/types/index.d.ts","../../../node_modules/@metamask/object-multiplex/dist/Substream.d.ts","../../../node_modules/@metamask/object-multiplex/dist/ObjectMultiplex.d.ts","../../../node_modules/@metamask/object-multiplex/dist/index.d.ts","../../../node_modules/@metamask/post-message-stream/dist/utils.d.ts","../../../node_modules/@metamask/post-message-stream/dist/BasePostMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/window/WindowPostMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/WebWorker/WebWorkerPostMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/WebWorker/WebWorkerParentPostMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-process/ProcessParentMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-process/ProcessMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-thread/ThreadParentMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-thread/ThreadMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/runtime/BrowserRuntimePostMessageStream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/array.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/auxiliary-files.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/virtual-file/VirtualFile.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/virtual-file/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/base64.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/bytes.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/caveats.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/checksum.d.ts","../../../node_modules/cron-parser/types/common.d.ts","../../../node_modules/cron-parser/types/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/cronjob.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/deep-clone.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/default-endowments.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/derivation-paths.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/entropy.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/errors.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/handler-types.d.ts","../../../node_modules/@metamask/snaps-sdk/jsx.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/handlers.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/iframe.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/json.d.ts","../../../node_modules/nanoid/index.d.ts","../../approval-controller/dist/types/ApprovalController.d.ts","../../approval-controller/dist/types/errors.d.ts","../../approval-controller/dist/types/index.d.ts","../../../node_modules/@types/deep-freeze-strict/index.d.ts","../../permission-controller/src/permission-middleware.ts","../../permission-controller/src/SubjectMetadataController.ts","../../permission-controller/src/utils.ts","../../permission-controller/src/PermissionController.ts","../../permission-controller/src/Permission.ts","../../permission-controller/src/errors.ts","../../permission-controller/src/Caveat.ts","../../permission-controller/src/rpc-methods/getPermissions.ts","../../permission-controller/src/rpc-methods/requestPermissions.ts","../../permission-controller/src/rpc-methods/revokePermissions.ts","../../permission-controller/src/rpc-methods/index.ts","../../permission-controller/src/index.ts","../../../node_modules/@metamask/snaps-utils/dist/types/json-rpc.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/structs.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/manifest/validation.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/manifest/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/localization.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/logging.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/namespace.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/path.d.ts","../../../node_modules/@metamask/snaps-registry/dist/verify.d.ts","../../../node_modules/@metamask/snaps-registry/dist/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/types.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/snaps.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/strings.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/ui.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/validation.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/versions.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/Timer.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/ExecutionService.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/AbstractExecutionService.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/ProxyPostMessageStream.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/iframe/IframeExecutionService.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/iframe/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/proxy/ProxyExecutionService.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/offscreen/OffscreenExecutionService.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/offscreen/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/webworker/WebWorkerExecutionService.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/webworker/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/npm.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/location.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/http.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/local.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/index.d.ts","../../../node_modules/@xstate/fsm/lib/types.d.ts","../../../node_modules/@xstate/fsm/lib/index.d.ts","../../../node_modules/@types/punycode/index.d.ts","../../../node_modules/fastest-levenshtein/mod.d.ts","../../phishing-controller/src/utils.ts","../../phishing-controller/src/PhishingDetector.ts","../../phishing-controller/src/PhishingController.ts","../../phishing-controller/src/index.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/interface/SnapInterfaceController.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/interface/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/types/encryptor.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/types/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/registry/registry.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/registry/json.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/registry/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/SnapController.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/selectors.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/utils.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/cronjob/CronjobController.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/cronjob/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/index.d.ts","../../accounts-controller/dist/types/AccountsController.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../accounts-controller/dist/types/utils.d.ts","../../accounts-controller/dist/types/index.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/types.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/createEventEmitterProxy.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/createSwappableProxy.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/index.d.ts","../../../node_modules/loglevel/index.d.ts","../../network-controller/dist/types/constants.d.ts","../../eth-json-rpc-provider/dist/types/safe-event-emitter-provider.d.ts","../../eth-json-rpc-provider/dist/types/provider-from-engine.d.ts","../../eth-json-rpc-provider/dist/types/provider-from-middleware.d.ts","../../eth-json-rpc-provider/dist/types/index.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/BlockTracker.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/PollingBlockTracker.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/SubscribeBlockTracker.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/index.d.ts","../../network-controller/dist/types/types.d.ts","../../network-controller/dist/types/create-auto-managed-network-client.d.ts","../../network-controller/dist/types/NetworkController.d.ts","../../network-controller/dist/types/create-network-client.d.ts","../../network-controller/dist/types/index.d.ts","../../polling-controller/dist/types/types.d.ts","../../polling-controller/dist/types/BlockTrackerPollingController.d.ts","../../polling-controller/dist/types/StaticIntervalPollingController.d.ts","../../polling-controller/dist/types/index.d.ts","../../gas-fee-controller/dist/types/GasFeeController.d.ts","../../gas-fee-controller/dist/types/index.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/MutexInterface.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/Mutex.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/SemaphoreInterface.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/Semaphore.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/withTimeout.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/tryAcquire.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/errors.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/index.d.ts","../../../node_modules/@metamask/nonce-tracker/dist/NonceTracker.d.ts","../../../node_modules/@metamask/nonce-tracker/dist/index.d.ts","../../../node_modules/async-mutex/lib/MutexInterface.d.ts","../../../node_modules/async-mutex/lib/Mutex.d.ts","../../../node_modules/async-mutex/lib/SemaphoreInterface.d.ts","../../../node_modules/async-mutex/lib/Semaphore.d.ts","../../../node_modules/async-mutex/lib/withTimeout.d.ts","../../../node_modules/async-mutex/lib/tryAcquire.d.ts","../../../node_modules/async-mutex/lib/errors.d.ts","../../../node_modules/async-mutex/lib/index.d.ts","../../../node_modules/eth-method-registry/dist/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../src/logger.ts","../../../node_modules/fast-json-patch/module/helpers.d.ts","../../../node_modules/fast-json-patch/module/core.d.ts","../../../node_modules/fast-json-patch/module/duplex.d.ts","../../../node_modules/fast-json-patch/index.d.ts","../src/types.ts","../src/utils/gas-flow.ts","../src/constants.ts","../src/utils/utils.ts","../src/utils/swaps.ts","../src/utils/gas-fees.ts","../src/gas-flows/DefaultGasFeeFlow.ts","../src/gas-flows/LineaGasFeeFlow.ts","../../../node_modules/@ethersproject/bytes/lib/index.d.ts","../../../node_modules/@ethersproject/bignumber/lib/bignumber.d.ts","../../../node_modules/@ethersproject/bignumber/lib/fixednumber.d.ts","../../../node_modules/@ethersproject/bignumber/lib/index.d.ts","../../../node_modules/@ethersproject/abi/lib/fragments.d.ts","../../../node_modules/@ethersproject/abi/lib/coders/abstract-coder.d.ts","../../../node_modules/@ethersproject/abi/lib/abi-coder.d.ts","../../../node_modules/@ethersproject/properties/lib/index.d.ts","../../../node_modules/@ethersproject/abi/lib/interface.d.ts","../../../node_modules/@ethersproject/abi/lib/index.d.ts","../../../node_modules/@ethersproject/networks/lib/types.d.ts","../../../node_modules/@ethersproject/networks/lib/index.d.ts","../../../node_modules/@ethersproject/transactions/lib/index.d.ts","../../../node_modules/@ethersproject/web/lib/index.d.ts","../../../node_modules/@ethersproject/abstract-provider/lib/index.d.ts","../../../node_modules/@ethersproject/abstract-signer/lib/index.d.ts","../../../node_modules/@ethersproject/contracts/lib/index.d.ts","../../../node_modules/@ethersproject/providers/lib/formatter.d.ts","../../../node_modules/@ethersproject/providers/lib/base-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/json-rpc-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/websocket-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/url-json-rpc-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/alchemy-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/ankr-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/cloudflare-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/etherscan-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/fallback-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/ipc-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/infura-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/json-rpc-batch-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/nodesmith-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/pocket-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/web3-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/index.d.ts","../src/gas-flows/OracleLayer1GasFeeFlow.ts","../src/gas-flows/OptimismLayer1GasFeeFlow.ts","../src/gas-flows/ScrollLayer1GasFeeFlow.ts","../src/gas-flows/TestGasFeeFlow.ts","../src/utils/etherscan.ts","../src/helpers/EtherscanRemoteTransactionSource.ts","../src/utils/layer1-gas-fee-flow.ts","../src/helpers/GasFeePoller.ts","../src/helpers/IncomingTransactionHelper.ts","../src/helpers/PendingTransactionTracker.ts","../src/helpers/MultichainTrackingHelper.ts","../src/utils/external-transactions.ts","../src/utils/gas.ts","../src/utils/history.ts","../src/utils/nonce.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/abiERC20.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/abiERC721.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/abiERC1155.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/fiatTokenV2.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/index.d.ts","../src/errors.ts","../src/utils/simulation-api.ts","../src/utils/simulation.ts","../src/utils/transaction-type.ts","../src/utils/validation.ts","../src/TransactionController.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../node_modules/pretty-format/build/types.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/diffLines.d.ts","../../../node_modules/jest-diff/build/printDiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/jest-when/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/pbkdf2/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/secp256k1/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"70bbfaec021ac4a0c805374225b55d70887f987df8b8dd7711d79464bb7b4385","869089d60b67219f63e6aca810284c89bae1b384b5cbc7ce64e53d82ad223ed5","fe8f00e1ffe6c8069f2568844debb342a661980c30e52b132f002b93f66de47e",{"version":"f31113ac9492fdd6e78bf6151b338c92e5b1837be426ef4aa0648ce82d13b518","affectsGlobalScope":true},"62a0875a0397b35a2364f1d401c0ce17975dfa4d47bf6844de858ae04da349f9","ee7491d0318d1fafcba97d5b72b450eb52671570f7a4ecd9e8898d40eaae9472","e3e7d217d89b380c1f34395eadc9289542851b0f0a64007dfe1fb7cf7423d24e","fd79909e93b4d50fd0ed9f3d39ddf8ba0653290bac25c295aac49f6befbd081b","345a9cc2945406f53051cd0e9b51f82e1e53929848eab046fdda91ee8aa7da31","9debe2de883da37a914e5e784a7be54c201b8f1d783822ad6f443ff409a5ea21","dee5d5c5440cda1f3668f11809a5503c30db0476ad117dd450f7ba5a45300e8f","f5e396c1424c391078c866d6f84afe0b4d2f7f85a160b9c756cd63b5b1775d93","5caa6f4fff16066d377d4e254f6c34c16540da3809cd66cd626a303bc33c419f","730d055528bdf12c8524870bb33d237991be9084c57634e56e5d8075f6605e02","5b3cd03ae354ea96eff1f74d7c410fe4852e6382227e8b0ecf87ab5e3a5bbcd4","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"056097110efd16869ec118cedb44ecbac9a019576eee808d61304ca6d5cb2cbe","affectsGlobalScope":true},"f51b4042a3ac86f1f707500a9768f88d0b0c1fc3f3e45a73333283dea720cdc6",{"version":"6fb8358e10ed92a7f515b7d79da3904c955a3ffd4e14aa9df6f0ea113041f1cf","affectsGlobalScope":true},"45c831238c6dac21c72da5f335747736a56a3847192bf03c84b958a7e9ec93e2","661a11d16ad2e3543a77c53bcd4017ee9a450f47ab7def3ab493a86eae4d550c",{"version":"8cdc646cec7819581ef343b83855b1bfe4fe674f2c84f4fb8dc90d82fb56bd3a","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","9dd56225cc2d8cb8fe5ceb0043ff386987637e12fecc6078896058a99deae284","2375ed4b439215aa3b6d0c6fd175c78a4384b30cb43cbadaecbf0a18954c98cb","7693b90b3075deaccafd5efb467bf9f2b747a3075be888652ef73e64396d8628","41231da15bb5e3e806a8395bd15c7befd2ec90f9f4e3c9d0ae1356bccb76dbb0","fccfef201d057cb407fa515311bd608549bab6c7b8adcf8f2df31f5d3b796478",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},"5f20d20b7607174caf1a6da9141aeb9f2142159ae2410ca30c7a0fccd1d19c99",{"version":"464762c6213566d072f1ced5e8e9a954785ec5e53883b7397198abb5ef5b8f71","affectsGlobalScope":true},"6387920dc3e18927335b086deec75bf8e50f879a5e273d32ee7bb7a55ba50572","9bba37424094688c4663c177a1379b229f919b8912889a472f32fdc5f08ddb4d","29a4be13b3a30d3e66667b75c58ec61fb2df8fa0422534fdee3cfb30c5dbf450","83366d901beda79d6eb37aaaf6ca248dcd88946302b2a7d975590783be51e88e","bf268a0aea37ad4ae3b7a9b58559190b6fc01ea16a31e35cd05817a0a60f895a","43ec77c369473e92e2ecebf0554a0fdaa9c256644a6070f28228dfcceec77351",{"version":"d7dad6db394a3d9f7b49755e4b610fbf8ed6eb0c9810ae5f1a119f6b5d76de45","affectsGlobalScope":true},"95ed02bacb4502c985b69742ec82a4576d4ff4a6620ecc91593f611d502ae546","bf755525c4e6f85a970b98c4755d98e8aa1b6dbd83a5d8fcc57d3d497351b936","dd67d2b5e4e8a182a38de8e69fb736945eaa4588e0909c14e01a14bd3cc1fd1e",{"version":"28084e15b63e6211769db2fe646d8bc5c4c6776321e0deffe2d12eefd52cb6b9","affectsGlobalScope":true},{"version":"aed37dabf86c99d6c8508700576ecede86688397bc12523541858705a0c737c2","affectsGlobalScope":true},"cc6ef5733d4ea6d2e06310a32dffd2c16418b467c5033d49cecc4f3a25de7497","94768454c3348b6ebe48e45fbad8c92e2bb7af4a35243edbe2b90823d0bd7f9a","0be79b3ff0f16b6c2f9bc8c4cc7097ea417d8d67f8267f7e1eec8e32b548c2ff","1c61ffa3a71b77363b30d19832c269ef62fba787f5610cac7254728d3b69ab2e","84da3c28344e621fd1d591f2c09e9595292d2b70018da28a553268ac122597d4","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","6e191fea1db6e9e4fa828259cf489e820ec9170effff57fb081a2f3295db4722","aed943465fbce1efe49ee16b5ea409050f15cd8eaf116f6fadb64ef0772e7d95","70d08483a67bf7050dbedace398ef3fee9f436fcd60517c97c4c1e22e3c6f3e8","c40fdf7b2e18df49ce0568e37f0292c12807a0748be79e272745e7216bed2606",{"version":"e933de8143e1d12dd51d89b398760fd5a9081896be366dad88a922d0b29f3c69","affectsGlobalScope":true},"4e228e78c1e9b0a75c70588d59288f63a6258e8b1fe4a67b0c53fe03461421d9","b38d55d08708c2410a3039687db70b4a5bfa69fc4845617c313b5a10d9c5c637","205d50c24359ead003dc537b9b65d2a64208dfdffe368f403cf9e0357831db9e","1265fddcd0c68be9d2a3b29805d0280484c961264dd95e0b675f7bd91f777e78",{"version":"a05e2d784c9be7051c4ac87a407c66d2106e23490c18c038bbd0712bde7602fd","affectsGlobalScope":true},{"version":"df90b9d0e9980762da8daf8adf6ffa0c853e76bfd269c377be0d07a9ad87acd2","affectsGlobalScope":true},"cf434b5c04792f62d6f4bdd5e2c8673f36e638e910333c172614d5def9b17f98","1d65d4798df9c2df008884035c41d3e67731f29db5ecb64cd7378797c7c53a2f","0faee6b555890a1cb106e2adc5d3ffd89545b1da894d474e9d436596d654998f","c6c01ea1c42508edf11a36d13b70f6e35774f74355ba5d358354d4a77cc67ea1","867f95abf1df444aab146b19847391fc2f922a55f6a970a27ed8226766cee29f",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b0297b09e607bec9698cac7cf55463d6731406efb1161ee4d448293b47397c84","175323e2a79a6076e0bada8a390d535a3ea817158bf1b1f46e31efca9028a0a2","7a10053aadc19335532a4d02756db4865974fd69bea5439ddcc5bfdf062d9476","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","aed9e712a9b168345362e8f3a949f16c99ca1e05d21328f05735dfdbb24414ef","b04fe6922ed3db93afdbd49cdda8576aa75f744592fceea96fb0d5f32158c4f5","ed8d6c8de90fc2a4faaebc28e91f2469928738efd5208fb75ade0fa607e892b7","d7c52b198d680fe65b1a8d1b001f0173ffa2536ca2e7082431d726ce1f6714cd","c07f251e1c4e415a838e5498380b55cfea94f3513229de292d2aa85ae52fc3e9","0ed401424892d6bf294a5374efe512d6951b54a71e5dd0290c55b6d0d915f6f7","b945be6da6a3616ef3a250bfe223362b1c7c6872e775b0c4d82a1bf7a28ff902","beea49237dd7c7110fabf3c7509919c9cb9da841d847c53cac162dc3479e2f87","0f45f8a529c450d8f394106cc622bff79e44a1716e1ac9c3cc68b43f7ecf65ee","c624ce90b04c27ce4f318ba6330d39bde3d4e306f0f497ce78d4bda5ab8e22ca","9b8253aa5cb2c82d505f72afdbf96e83b15cc6b9a6f4fadbbbab46210d5f1977","86a8f52e4b1ac49155e889376bcfa8528a634c90c27fec65aa0e949f77b740c5","aab5dd41c1e2316cc0b42a7dd15684f8582d5a1d16c0516276a2a8a7d0fecd9c","59948226626ee210045296ba1fc6cb0fe748d1ff613204e08e7157ab6862dee7","ec3e54d8b713c170fdc8110a7e4a6a97513a7ab6b05ac9e1100cb064d2bb7349","43beb30ecb39a603fde4376554887310b0699f25f7f39c5c91e3147b51bb3a26","666b77d7f06f49da114b090a399abbfa66d5b6c01a3fd9dc4f063a52ace28507","31997714a93fbc570f52d47d6a8ebfb021a34a68ea9ba58bbb69cdec9565657e","6032e4262822160128e644de3fc4410bcd7517c2f137525fd2623d2bb23cb0d3","8bd5c9b1016629c144fd228983395b9dbf0676a576716bc3d316cab612c33cd5","2ed90bd3925b23aed8f859ffd0e885250be0424ca2b57e9866dabef152e1d6b7","93f6bd17d92dab9db7897e1430a5aeaa03bcf51623156213d8397710367a76ce","3f62b770a42e8c47c7008726f95aa383e69d97e85e680d237b99fcb0ee601dd8","5b84cfe78028c35c3bb89c042f18bf08d09da11e82d275c378ae4d07d8477e6c","75b22c74010ba649de1a1676a4c4b8b5bb4294fecd05089e2094429b16d7840c","5615ccf831db2ffc82145243081ebdb60ea8e1005ee8f975d1c0c1401a9c894e","38682ed3630bb6ecdace80d5a9adc811fc20a419f1940446e306c3a020d083b9","cc182e6e4f691cd6f7bf7cb491247a4c7818f9f1cb2db1d45c65ff906e3f741b","a50599c08934a62f11657bdbe0dc929ab66da1b1f09974408fd9a33ec1bb8060","5a20e7d6c630b91be15e9b837853173829d00273197481dc8d3e94df61105a71","8d478048d71cc16f806d4b71b252ecb67c7444ccf4f4b09b29a312712184f859","e0eda929c6b9b628cdeb0e54cd3582cb97e64f28aab34612fc1431c545899584","9df4662ca3dbc2522bc115833ee04faa1afbb4e249a85ef4a0a09c621346bd08","b25d9065cf1c1f537a140bbc508e953ed2262f77134574c432d206ff36f4bdbf","1b103313097041aa9cd705a682c652f08613cb5cf8663321061c0902f845e81c","68ccec8662818911d8a12b8ed028bc5729fb4f1d34793c4701265ba60bc73cf4","5f85b8b79dc4d36af672c035b2beb71545de63a5d60bccbeee64c260941672ab","b3d48529ae61dc27d0bfbfa2cb3e0dff8189644bd155bdf5df1e8e14669f7043","40fe4b689225816b31fe5794c0fbf3534568819709e40295ead998a2bc1ab237","f65b5e33b9ad545a1eebbd6afe857314725ad42aaf069913e33f928ab3e4990a","fb6f2a87beb7fb1f4c2b762d0c76a9459fc91f557231569b0ee21399e22aa13d","31c858dc85996fac4b7fa944e1016d5c72f514930a72357ab5001097bf6511c7","3de30a871b3340be8b679c52aa12f90dd1c8c60874517be58968fdbcc4d79445","6fd985bd31eaf77542625306fb0404d32bff978990f0a06428e5f0b9a3b58109","980d21b0081cbf81774083b1e3a46f4bbdcd2b68858df0f66d7fad9c82bc34bc","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","b17f3bb7d8333479c7e45e5f3d876761b9bca58f97594eca3f6a944fd825e632","3c1f1236cce6d6e0c4e2c1b4371e6f72d7c14842ecd76a98ed0748ee5730c8f3","6d7f58d5ea72d7834946fd7104a734dc7d40661be8b2e1eaced1ddce3268ebaf","4c26222991e6c97d5a8f541d4f2c67585eda9e8b33cf9f52931b098045236e88","277983d414aa99d78655186c3ee1e1c38c302e336aff1d77b47fcdc39d8273fe","47383b45796d525a4039cd22d2840ac55a1ff03a43d027f7f867ba7314a9cf53","6548773b3abbc18de29176c2141f766d4e437e40596ee480447abf83575445ad","6ddd27af0436ce59dd4c1896e2bfdb2bdb2529847d078b83ce67a144dff05491","816264799aef3fd5a09a3b6c25217d5ec26a9dfc7465eac7d6073bcdc7d88f3f","4df0891b133884cd9ed752d31c7d0ec0a09234e9ed5394abffd3c660761598db","b603b62d3dcd31ef757dc7339b4fa8acdbca318b0fb9ac485f9a1351955615f9","e642bd47b75ad6b53cbf0dfd7ddfa0f120bd10193f0c58ec37d87b59bf604aca","be90b24d2ee6f875ce3aaa482e7c41a54278856b03d04212681c4032df62baf9","78f5ff400b3cb37e7b90eef1ff311253ed31c8cb66505e9828fad099bffde021","372c47090e1131305d163469a895ff2938f33fa73aad988df31cd31743f9efb6","71c67dc6987bdbd5599353f90009ff825dd7db0450ef9a0aee5bb0c574d18512","6f12403b5eca6ae7ca8e3efe3eeb9c683b06ce3e3844ccfd04098d83cd7e4957","282c535df88175d64d9df4550d2fd1176fd940c1c6822f1e7584003237f179d3","c3a4752cf103e4c6034d5bd449c8f9d5e7b352d22a5f8f9a41a8efb11646f9c2","11a9e38611ac3c77c74240c58b6bd64a0032128b29354e999650f1de1e034b1c","4ed103ca6fff9cb244f7c4b86d1eb28ce8069c32db720784329946731badb5bb","d738f282842970e058672663311c6875482ee36607c88b98ffb6604fba99cb2a","ec859cd8226aa623e41bbb47c249a55ee16dc1b8647359585244d57d3a5ed0c7","8891c6e959d253a66434ff5dc9ae46058fb3493e84b4ca39f710ef2d350656b1","c4463cf02535444dcbc3e67ecd29f1972490f74e49957d6fd4282a1013796ba6","0cb0a957ff02de0b25fd0f3f37130ca7f22d1e0dea256569c714c1f73c6791f8","2f5075dc512d51786b1ba3b1696565641dfaae3ac854f5f13d61fa12ef81a47e","ca3353cc82b1981f0d25d71d7432d583a6ef882ccdea82d65fbe49af37be51cb","50679a8e27aacf72f8c40bcab15d7ef5e83494089b4726b83eec4554344d5cdc","45351e0d51780b6f4088277a4457b9879506ee2720a887de232df0f1efcb33d8","e2d6963e7bf7186e30b7a4c9859aba4e96eda6d1be537e5b1a43bdddc7e9dc8f","10afdd7bba6ec9b7f95a4b419b2dbb64245fea4a61bbe7d68e2f841b414f7312","413121b26b3bd9f7fea237f15f564ee2b95bcd0cceec1b1621075375ccc0c0e0","d2af215963d01cef397ce8fa2f7ad08ee8beffdd39fe14b96021ddf26554b59f","2fc9848431d0f5e2b49bb312aaf07dd2d5a34300a2ced60200a2da49e6a82b43","c5ee2b685431ea2b9aacd9bb9e15cac1ecfa5c448972b188432313354d47c848","3e69be1137d88eb0730332aed359caedea4a27903da15dbe6a1615fa11206807","2283d079c3945b6e5ca8b9355311a213e03b74bffc65a3234c3c141a0a795700","f47272f05bd57f4356abc81232bded724d13e54f0fd801e0fb93a58237db1829","07ae8e9890f49ef6ebe629e339ac590025606a1e96754965bbb2bf889199ced2","d5c19655468e29f60c871b21e73af8ebc653f736e7123ade916f22c4a5f80ce5","6a8649609161e2794b383ba275b0a6cb4a072dde7b954648f83dc6cdf1bfe4a8","601d4a40a69c782addaf84185d4547568ec072095ab9976610d89922d1291f8b","d5c19655468e29f60c871b21e73af8ebc653f736e7123ade916f22c4a5f80ce5","b5c9c8c4a2cd1cb9f76d849fb472d475c3cebdd48306414a4a19bd11d82c4055","b61e6a808f5f50873ac03f35d5a38fa8d4dd23a24f80ab69df1a032e8c71562d","c8be9283a381044a392a0687af5d98d3f51cbada2320b1801a82c948b6e39499","85052c71d72b9b017c88179f57a464d66e22619c7acd7d83b117a79cf1608979","502cd7c30fe21e2c36b62913d0cb5d20affc8779b3ad40881b26d90a22de3aaa","6d3101b183ea67ef606b93fe42127f30b2db5ac3b72c34ca9d6d8b00eb85d0f6","f5d7a36ff056cc314b0f61c89a03c4c36a24183b246e61d958e75e86521304cd","ff30e8237e23dde68041b5f09526ee86835b12c5d8b6421c1153093fdbeb9438","f516fc1e77e5ffd71fbe705b679797c3c5eb76bf76a88549e6316a29f3e197f7","b5b1110565ac688b660a893654a6c1bce6747f3aa6f847001a8a5ff4412394ba","3a971ea3e36685b96f24fbd53a94ad8dc061711b84e51fde4cf201f7041e618d","9b6c162d20e2ad4abdcff61a24082564ac59e63092220618162aef6e440c9228","7804ff981554ba1a0592481072806fc39dc1484791beda43eb7a60e16e70a360","fcc8beef29f39f09b1d9c9f99c42f9fed605ab1c28d2a630185f732b9ba53763","d6e6620a30d582182acc3f0a992a0c311adc589f111096aea11ab83fc09a5ccc","6213b8f686f56beab22b59a0f468590fd3a4c5fa931236a017efeca91d7c9584","c451cec9a588b1f105a5ea2c6063d4fca112b9d70105cacdadda0e1ef67e9379","cb047832dc68f5a2c41c62c5e95ddcacbae3a8b034d40cd15319a8cb7f25104a","980336ccdfc3c08f3c3b201aa6662e6016e20f15847f8465b68f3e8e67b4665c","5a3493939995f46ff3d9073cd534fb8961c3bf4e08c71db27066ff03d906dea8","8f333214062532989f190aed5f99c62eb820722e41956e8229e17cd246fbdd10","d1f010c19eb9c8190bd0859fa3b6f4975543b912b8b85e20bbb0b5bfbdf4d2b3","de4ccc96cef3f97fab148640799abb32a24b567a902a8233913f98481e3131bf",{"version":"801934aa449fe6df584bccdcc5d5b9280295cb7ac84918b6014fc5086e6f9ff6","affectsGlobalScope":true},"5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","f07a137bbe2de7a122c37bfea00e761975fb264c49f18003d398d71b3fb35a5f","6af760fb9ea02dc807c5053d8aee86389c4fce72fbb26af7b9568cac6c4710d5","c62c4ba5e910b4523f7e7adf4a55ec45c2bac99d9d8e9b0fe0c2a800a6f641b9","92131434f876fdd6fcbc40bd54a9d7500c66974362b16bd42641f990468587f4","8cf023c0bd57992fdd2ce6a7030a1874f49c8edc62eaffa9bfffcf18d2a2a1a2","8ea8f3040e38fb50d7dc3653f3b8a0dbb5244e82111576f99ce096bdc0fbf94c","48ed788ad126545a6156fcc37cd3bcf17de18a3e3fe6b6ef62cfb8140d1a45a2","63c271a745f628ffd4bd7ad0a63b021c362c9bd6bf8b18441a7162892395a214","8d3457e6c7c5cb890729fb60cb8db18f261226a3ea3ff6a4db4b84ea78313ace","9f9e5bae412fa5909fae636d6733aee27a108cc2ed5b13980611016336774d3c","662fe197bba64bd3f17ee118058cd2d0d2dbe33d7c0c865fd6365d90bfc44e1e","030519c351f800551cac2658038804969ca4584d2c0175a710602ac234ca1340","0278a6939ca83cd040b08ff8c5fc7838b6693ddc52f22526bf158e6b10e0246c","c2d6206e5ba4fd3063b01218c2b3b997afc1cfbeb49fcee991fa8595842ce53d","6a8096993458a3d71229031aa7415974eb5b47b320213e29660adfb519d6a3f4","cb7996a1af5b1d276483cd0c9b9de6540eff021abc90a720511ff4464519a2ff","9df6ec68878d65bc690ea3a33ce3ef5aa8254c36bc5f8346c0c2fd1f3b88a35c","a4fad04c4acc8a4b195cbbccef4c55019104753d547d5c94441643ccc89108a0","0244c23ea642361f7c192c1f0cfff9c12cfa5f51f9b155edd5c0a89fef308d34","c7298e68632ab03155f6de963d3d09cc4a5874c28a81524f56c667d8a052e538","3c69a83bde847af6fc3a53e1bb6b13cd06d38a27a142814b8dacc374f3b93284","5b46f7113f54565e7ffc83f2b474f557a1f54c7e5946769d5be220454656be73","fb58035d39c5759283cb73cfb3548aefe370aa3ad4e81fdb4e46f0979eb7669f","1311c325948b2d5576cebc70b1bf968d3446b4630802bef54120daf04ce1f625","d0b3609e8e7afed0fd0570152255458407e67249b94f6603afdfd68599423f21","17f4c5a1d6eaa87ea27eadcdff9085af3190533d98f799dda79a3af6f9a630ea","3e6f734ddf40e2e99ff7fff9568b7d9720663af9a0632c26a352c8d3270a3f0e","ec13f78303abcf550c5569dfae1446b8ceb89050f68ce04491481e72e8122ae2","a3fc57dbaa7f1efb010399ad4ef4fd9b462aa4e93bf74a9a34b099b97ffcc9cb","ffddd7ec6a450b0cb6f2f73f80de1df963ead312d7c81a8440268f34146ecb87","5d6a36ca0087fd6876df654d1b4192f0e402adfde994ad47e5c065da33692f9c","eb157a09c5f543d98644e2a99a785f9e0e91f054f9fecbf1c3e15831ff5d63a7","edd5530e2b1ccdf65093296e40a8634fcb11ecda3c164c31383a8c34cb04bc9d","9dfaf96d090fe8d96143465d85b4837661ae535143eea9ef99cd20df2e66338e","209d45c27e03c1417c42985252de6c25a2ec23abdc199d88e6139c88b93abd11","0ee5cdba58cfde3012bb9ff2e9edcc4e35a651373a2aa2c83ff9eb7df635419a","540f4dca27ea5a232828b6d91e1b2fce2720bdabaa4c1f3fbf59b672cc58bd8a","ba086b99d545ec6c9ff356989f076b5652ea1b09bcc65b87dfc43a5195a2efcc","c85d9776b36166b928ab1488d9224ebf970d41b0a35f09a3ee0b9bee3e698061","683196f606c5dab1c8c4a24a66d26e00f16f2d4b2a5abe25ebedd37d2954f930","9c3a1b01cba1238fb723ce06b6c163ef6c53be755394406782564d5c42c636b2","6e795e6270d39e918c7a0e62ac73793cda06fcf4b3692ee46583e15f5bf57ab8","0e821ef1eb67fa6144ea4de4277d913f5b1982d7407afd5f93754a8239d41554","5c09195ef359ffa9c6bbdb4fefb101d87ede4b9e9c28213faf5b45d102e4c609","80b4d93a4dcc90a12f6f4bb7c6851a8182ae29e556716d0d80b5c012a5ef554a","2556ef9d1820e0b6bbca6dd65a50ea64f525c4d8247ab50dff44c3f0d14a5643","cbd1c836db190d6e3add07165afc228f04e1f6170e1fe3aa5e6fc24a7e9573a3","9b13881feb958237232586d888a10a39d47cdffe3ee34688ed41888fa7baad94","122fe82cf5af80f0b26832b258b537b7dfe3ec28449c301b259ab10204b50d45","c467dada8fea6d60dff8a8be2675f737cacc76e14e50b72daa0f0710376df84b","9cb80bba611c2dd155a446ce424fe4bb1df2129751bc9416b7e42c055d1ddbff","6ee568039016b81ed70292a595ab781ab978cba4243a5fe49507040ee4f7ac8a","043783bebe87efb440183c9ebc8c4fdc1bb92060a5a0f7ce847e30dee7013ac3","e3dc0a97a59dea936b4fb7b1f6f4117b4aac9c86d0cd08b69bab2d0532a8a5e3","5d897601f8a4fe913057019d8211b99b06e3138f625a0cfb601d074f4278271d","a68bb369c4ba8ab43a78f3fad2d3ec130e1418bc946521b9c84e9b336d6e88f1","65f219e6e1f9d27c677a49d41ae7989b83bf6baa56debbeb50d95c3ab21632e2","cfde5d194dd858ad68f910defaed5b0d28730f8bf38359a9265a93ab29bc7bef","c89354ae268153d965011e484150f0c92faa87f3f66507c25b496973178e0400","f20aae41b169cddcbf3fde8ac380443182c8d7225194e788c404d9e11e6dc75d","a6f4816a634bb1ceb513634c1ef7c0535f461ed2565336eed69f6ac2babbe15b","c48566cb13403fca44192b4528e3f2ac993869d39526bd42cd2f2167c0285add","efae20e0c581240c7522e04829da4f0453ca263068596554d4b0e27878c7dfac","3af68ef927788cda7daab34be513fa4508229fdc6e5130d564a0a1ccb3fefafe","bbbd2cbb15a37d5f4dd54ad8c7c537d3df8352117523030fcec7dcbe62a05a58","b50d24ebc117f8805332e7e260e9587f572bb7b2ff0ca1ff6cfafb38015781f3","5cc8b8e18fe7fefab4b3c53a39467b5a0deb4200abae7f063ff0624b9e856c51","8e990781eb0107c25429b1274a31a4f3866a9a46290cce40f354b2a6e71c6c21","608c45069e89c4c8f0ab29f896cc93c6553808072d6304b23611b6c6de3c24bb","22cbabe752781b5f35482af9d1fcf1455cb1ece74e8b84700d4abcb44abe3776","b9ce4613536386a98897f1e3d8f61a851ce6cb34dc3c9db4f2ef5f55f007e9e1","a5d1209c7bf277af86281392d46e12ce3dd6052586053f757fb2e606cc75c0f3","31b5f53e3d57470830e87f9e03c02d4569ac81d4a758fdda75092f9a3f58beba","d765fbab22fd7003a65ed670100362ec1c90d55a772e6773a774135594e7ea41","c1f11d9b42bfb0823d34d93c58df91ffb6690b5a717b7d310d83f258f1784e58","775b207f00d4df5b3b0b536aa696d572cdd2cabe8ea18dd28e8b52f691fa2a55","f75cd30f162c2af5e5aca39c01c1a521bfa034fae523793de872815a3468bc08","0cf1123db73dabd86466a462375a6addae52f58d23030c6033f8aadc23539a36","e29cef4158591ed213b1c2cba8988237b1ff369f7a6ecd8cb8ac0302bad1fba8","5307876e4d0021ea01235eb2f7c24671f3d8b37590f4b446cd132a4e1dc9a335","92550acd737790dc60c4c130e6aac78656dd48a8334a4882f40e7f86bdf7a590","3df821880914f8bb3c8107b1107be75c8ddbe2120a2cefabbaf9b65936b5f4dd","f46ba7c6fa7fcc8b3d57c4618c18db3f4d8bfe1fcab5551d7f6d9a82cf4d6078","078b7043bea0968860374bf4671ed74dd9f6be4e28ab659517d81f74be463c51","68b139ebb9a7f3ee4ded6286d74f978a47968727665120f3bfc560476ce33c4d","56d02c29b2fd39b1b1a1265df291f3f98e6ec3e6119aff9f4cfa44fe888efaa7","2d01884891da6495cb4a2f060e4898209a507e711464c4c1480df85264e863ed","c485c6497f7587314c4c4a59b74850cbca4c0c4bc08146a918cfd237ef821dbb","e9eec004735b1bf7015edf5400aeb914a53132134d230e93786590d904d094cc","080b1aa93227952b4dd74b9d2c6e4f6002eb8403533749116a1c53bb9961c02d","874087eec1d457f6e3baf5ac46c42ea200e55040b394fac667aa3a64c49f5f6c","6e8a5b04a18abb192abc89d7219b9c6f633cb3136777ec808673a65f111ca749","4e7ac7e5dd58a6c29c724728b031669e3068b194b62c2b83f92e76a36cb34dbb","d74d2a92b54f95e47d2b76bd5ee516aab7ae93afb79cd34c6681dd29eb09e72a","747e6326a724bc54f799a466a5b5c4978a601a04a063a5bdabe150af2f25b9e2","b57e22e53b56cca7a57bfcfb234aa6a66f9b9e4c07159d7388f94f17a3eaee2c","e47709ec4d1618ef429648cd8ef967aef2005526b34fcbfac33037add347dc71","b81abb3e47fbbb3af41fa75bada89bbcfa4b0feed9a0d6d4b19ed1ce1033b53c","15b330546e9784461058e5fd6e2346bf272140fa6f0cda34e193ae501d8b17b1","4d8ce72fd080bf9a46bdcc274bcbacccedd66d84e203966b197ac25a96932183","73327e6ae34e3f6591877fb75b451cf620cbbd76ee2b678213a9f793633cd0d3","3f1ba2f69944fa346789db7f60d53c9bec00032de0d797967978dea42e77b941","3f5df31539fee4816b97d4e45b4344fbdaf3ca59f6df941f8d780ee441e92cc1","50aaf44eb4d0e086af13729b3471a0a7dce95ea35ebd21c762ba26e203134b2e","3857c1773b8503c3ca45b7bc09ac89c3930c85ce93021054503f73d5d9101b5c","72702bd07fd6fb3ef64aadbcb909103aadfe71ee76e9fdeb11e0c92693cff6cb","f0dd6f7c9783637655478db7d7caf6becd41a79d54482aa59578ce88ab38e9bf",{"version":"cd756ccdabf433dd02b84d755383e489f14b3c1aede0477783aa04830fd5d695","affectsGlobalScope":true},"a4c88dbecdf8ee0c79f5b7c2bf31cd77e593f5d78384e2b674f67d754a549a9e","9cbdff04326da794ba008c0fc977ab062d1fe3fa2e9759654c72ffbe54b64a7c","aa60f8d20d36116fe05edaab24adee3c275209f71b65e272692cf99daf9489e1","150855f967a6490161d5aeed4cc4adf31fcb8f5dbe54b75799c12b8687fc9cc2","79576487ac18e047e8192fc582ff488ce375fe4df0cb028a17f831cf42b976f2","47ddb601df40bfa01cebdd06ee8b87d0b72aa1259a4ceba3ad3b5cf68130112a","6b6392704ddb3f50e647dbbb716782bdd0cf8ea9cc134aae256a26223e632b47","afc3ad2a50f7f4de908e26fcf467e09ab8528c0e90f91e602b4865d953839228","df90b0c6b1d81851364c4d97fa23b91a993482bcf4a7bed7c7a24aa41632d494","db34610570eed46b8b72bc662a91261200b8578af0ac02781ce7d9aca99bc683","11ee9ab699b4619d217c640d917ca198f58066a86bd58c2917197d62aa6601e0","cf9d589d9e73bf32c8e7a6cae6b4a1cf9bef39e5594072533fdce985581a6ddc","959544feb1ca2df29eec6c500f27ea10f4885df245ebd8418fb4b87914614383","6548ab4b57eb9d092471a04513091673345f2fd95d5b876f600402ea8d603ee0","2793e8c6a023d26f78d6777a6d7f20fae3a9a8169863d46d8d54c73071851232","d0f11e830aa1350a31d9c00a0197243e9711e4882947aef53a96c629f405cb10","6610b9f45f1f71d2b1fb67df49cbcabe3f9e668a1ccb7d8328a51407b259ffb3","abbcc437e0792ab2fe08797ceca1ec85a95ec413c51612313b18ab8e75f690f6","e29d76ef1183ac0edf94b4712b6e51730c447c7e773e75ceb44a720b0c9a9fd9","4ee6dc3424998eede9a2a9b114acaaf7969cdda67baf82ba2c9cf88a8eec0ab1","8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","25139d6a726e0e19d9fc4fa3197367b4a82ec34a08a5ecf23963e142c202c0f3","e3328bffc8eab74665a4fe9c59d6f12f4c8570c3d858497e241eb37efe17dfcf","29389551e426a46421134b55182d6fcf5b143670998bf81db2619c1228235392","c18f7e16982695bdd04e3e183a327d116185f77f1a37b9b2e849d7d93269cd74","2cfb37011989c21dc70b91d521a2d5a4e0f18507f5f536b5dfe504edb15916e8","bb5e02df7aaec7a4ea642639a9963b24b8d9fd6798351f07d8c58616942fbcbf","299a899cb4d061f5d83843ec453e936e9659b2c435746823f90c40eddaef4745","d5610c0fd12870f644b0f42c1bcc4fa2295ac3e3ca01916bdb42c3bdc4c80c36","2c56a8e249b1f45dbdf973100cd37fe2ea68709573cf1fdf2e3052c593be68d8","3553da417ee7b07e388b13bd12a70a1c03e65a6132ba5427fe68f5b362373e6f","612358502042d351c227ba779fdcf6d875d827e424930e60297c533524e50668","d2b5be376ef162aa0c24a826e7dd2d77671a045c085e16d1c1276db4bdccbac7","c4138d8dcccedaff6621e009cf0a54a7bed2a5ad4c509a3513bccc4f417ef939","ad8747fe978dff3e80f4b12b48d37cc8dff11b61d04c035aefbc982ce21201ce","b154f789fd65298e1ba6cbba6944ea892d564c95f3d3700ed85baf8f80748473","c660265aedd7c5b236e2017e53095cb98da66200eb0e8d023b5bf713c36494e8","0efc36bf5c0daca6217fec7063359ccdab8c3a23bb405d25340fae22cf72d74f","5abff0c87d4f9c89715107042d4c73b68ef7a128759f451c8a0fc450cbaaf660","5a03308fbd1af441065149a84c692931bebc7e7735afc23be8684f4e10d3aa06","c787bf4f8f0abbf815cfbd348be41046f2b8f270be24fe7aa8a8fcdd2b7df8c2","e7a5191c663a3228f30104961d548b372e51c5936c01ffc8eddd262bb98d7d7c","43fdc9abe6f8640fda4cdc55a1ee5f666d3fce554277043df925c383137ddf69","f0b09665c9d52de465687fbd3cfb65111d3ffc59ae00c6f42654150f3db05518","72f8c078d06cff690e24ff2b0e118a9de2833dcebf7c53e762dcb505ddf36a68","9705efb0fd901180de84ca4dd11d86f87fd73f99d6a5660a664c048a7487e385","f9b9d0950fdfb90f57e3f045fe73dce7fa6e7921b37622fc12e64fcd90afbd0f","e61b36e7fde608f8bb4b9c973d81556553a715eaef42a181a16ddd7a28da4ac7","03b8389b222af729eae0fb3c33366dcbb1f5a0102ce319bf1d7d5ee987e59fd0","2bf6be7c04db280fdd9b786764f8650c23f9f4d533791cb25a11b25314b76a55","dbb5fc7edd36bfba95cc4dd564e4458276ced30eed18bc05fbda948b3fda8686","c2b556c7cff0dabce2e31cb373ac61c14d8ebc35f1086dff30b39e9ec5357d0d","f958af01131076e8af55d28c4835a51063226ab488ca8738fdee38aeef7d0d33","9f3797b01e3d83d4e4b875699ae984f380ca86aa0a0c9df43ac5bba1cb1f8b7b","752b15ad1b34887adeaa838fc55f5d4ca399026afd266d4ed4db0e3db02eae4e","778331eaea1093451e50be9844bd2b6937c3bb81b0b1ee700624c9774ecfcf2b","0ca0dfc9f657d0822eca9530c7870b22a1d2a5fc48182bdd4d0e6e88e4ad9c35","5c746f034288e6842dd1589b169dcfcc16c5ce5abbd928889ab67aea4fe0b501","92ce6dbbcc135cffd09a58e19fef34bf351391bec92c40d849e4e9997d475769","99e77d092fed72b6b8578d00c7af004f76e98b30ba99f1947535eb4c04a51676","b5ef52a9f9083724decc5d060f0b34e3a480deed71c32d55ca16c214eb4cc928","5d3d7938b2d7d0a9f851276741327c2ae4c013e7eb420fc3f7caed3b79c8f37f","14df6b81e50a035e9e391558cf30a0420d03e2eb42c7db9c57f44b818e5d5179","f100912a3785eed4a3d29c12f5910b101af9353454de5ddba9b4d43456c56dd1","446439eacf81a163fd7dfc53b28f80deca3d13b250d67639739aa25aa4491090","98034cd285344125f7165a3bb68246d38ab35fabe7f6d6a7c8f80407d31f548d","06b4a23064991251512df4edc12341d5bc69a17b942da18372312d383c90eee7","0f898802705f9a534b537f1be6c57265080e0abd6993d935554c255e6d56cc1a","745efa7b6e27b7216cccede166a822b56acc41b10a8090966c8cf2c96239cb83","6ab2a6257ae7bb05559841100c786c845fe465a90be7b904db9096c2fb14696b","6da6c94bdde76f309cf5823d2a4e77894423d51c80e9d6a7a6eb62998db39dbb","5d697a4b315cc5bb3042ae869abffd10c3b0d7b182cda0e4c45d8819937e5796","89b040dec8fcfc1de98827e1f4d4977e6ff5d3302c6790e9f10b54b916e1c742","6ee58aa536dabb19b09bc036f1abe83feb51e13d63b23d30b2d0631a2de99b8f","8aceb205dcc6f814ad99635baf1e40b6e01d06d3fe27b72fd766c6d0b8c0c600","299567f84bfedd1468dca2755a829cb19e607a6811673788807dc8921e211bc9","795d9fb85aad92221504db74dd179b506bd189bba0c104426f7e7bb8a66ffee5","1311bc194e0a69fe61031e852c1c0b439e2a2a3d1d5e2d8ff795499b9f283459","4b7ce19369d7e7fae76720c2c6c7f671bf3fa0f7093edb864f1ac358ca7c456c","c972ef44deca1fa8fab465915ffa00f82e126aacf3dfc8979c03b1b066ce5bb6","30285a1011c6d6b52f3ba3abb0a984be8148c05cdefb8eb6eb562335a3991f35","e0de9f50e80fed1cc161b50e8e68dc056e38df75a4ef667a06b1922e372de169","6a8b31be08b212d1fc96de0ddd1ea49f32382ba712fea24c70bb56447f643f82","19ac6d624e4c18de4584db4bbdbc55387dbe3d19b3c134e50346bdf165658a17","54e3798c2801e8f3bc7a825d3d26c6a80ce763e19e6cb0b714594c430ef72332","70b8333214aadaccda8d38435911d3e3a686e503837dfda6b8c3f8c83e05729b","fe849e916564b8172f31a547395516668f3c122bfe017f82e7140d8dac402208","d42c6e985bdb10a2aaa3dae14d9b0d8589e74a7c2f9475bf543b855bb3c010ba","56c48fb5bb6316dfc27fbad065966b4ddbc38e9a0a1a5060d19b5da405ae7d6e","7091568b9a1b74b699ad09df6c130db712ed089d173a235e301a7a7ee0a4ca44","de33aa2a38affd9e71297ef7ec001a4525502878b09744308fb6518159f77d2d","57476e482c9b4e152bd23d0dc3c29375e48afee0de775674a3c1ea63cb4cf843","3ec4ecf6502ebdb1f3e24c712eb70160c606214ba2e71b4304b5a50fc2e4f293","83f7b6c1dc91deece32c3bee746a43f3616b7cc9f6510764bd53451f6712ff25","c23f2e8772304163fa7e4335be11f3dbdfd720d2209057566b7dfef746ef1862","2a26cb78d3de9708cd656787a663902270c9421ef89188286c3b7ec89b63bb15","e61fda2800677c210116c397dd85079a0956c87fd714826c08b25b10fdd56546","ef7bdfb4f157f9c9b9bd7f5766f0f8e07fac8e7482eec071673f3c9d08082982","d2f2ac1436cbb7c8d122cc7de96521345254e5b36591d9d064d9763de2a7b254","3cd2ba07285d01224f9595924dc7f760c7babb386a6eb825cb551f8d829fe6fa","3ae9770861c2ece5849778e9f15567d95b87df0165c0a5b1312181df19458a56","37b51656ff8302a4556e29c775f311eb9ad813948d2c527405cea041dba3baf3","00abf32ca3af92f8be9ecbc9b63090b4909a756317d791927a83cffd24e9c8ac","cd28efe88fac7a92f3f5cfc7dd3c764f0b31bdaaa061ff044de1639810d6a7da","8b2100d3ba68063b7baf5038f26eefe46543dcebf1e7dbaf46277f24307cefcb","131b7f32092aa78e12fcb2a6db7c71e17f85e076c0635ad8d991b80d10130c19","d1c84af1e6d5fa4a5f4badd45b03b67c9255a675df235a3ec25307a0f5524278","aa4d6dc9282133162a76109d99c5795583276c4fd27284f128d484acf12b0841","3355c4c572f076ad963d95f0e28075b8558e2ab492c84eb94f9e2c48f1c2368b","5638cfd48b0c56bc9ed0c779d53a40b92c9cd9c9d6312e3a21c52542d38094f3","827eb54656695635a6e25543f711f0fe86d1083e5e1c0e84f394ffc122bd3ad7","2309cee540edc190aa607149b673b437cb8807f4e8d921bf7f5a50e6aa8d609c","703509e96cc30dce834ef8188c958c69306473b8a7e5cb3a6f324cee05a1f7bb","900daf04dc607dc3858c0f976d6f9e17b829a07de58d62dc6f730eaf06986075","08e0ac95e650bd4c87145b6ab2257b70c06254bf76a0b9f8a7d60c51fb8ed6b8","4b57ec505a035491c692b89af2c6902c312ec22f8fa9b6dae3e93686659fb7e0","7d796672940d3b2d37f2edea4d7bcf4c7993966286006228cbc8fa35ac92871d","132fd53917ed7f55275faa52c35e4d4d41e9576fea231d12740b723df2bade93","de2ecf9b1d6f60338f7b59b6f593ef77af9abd0e70ba8f2942953d0c6e1850af","cf18e9d003f1d3d1d61a04eb2d1cff3e8a8cf9cd306d0532ea82700069f2fc42","393192a39f26f9247a74ecbaea6668972af8e9125c955d1798234dceca6010f7","27ca878cf70b3030e8403f51ce65949d364fa776d6dae3527f91635a40836672","178e2de7a8702742957ad24deaeddec84a48cd913b5d932b16afd2a707b3e416","a45ee7555d019a67fbe092898d1aef0b1d02a9f6679ab84461ff515b4460d706","29c188a2c660f99f1b4835022e011c4268d7af989d4b7dda33c0a69ca1a777f8","1ed0bf138e87912d741e28333b58cbf814ae863783b3b404d2454cbabb9c5fc0","3452ee7d8ef0b1bbd47b2a56924a1dc3c79dc84a19d212e9dc496f92e4943aa0","8c95f96ccd4be0674944077aec1e4f2cccd515ca06d4327562dd017250e7d3fc","6fe7571c8a80808224648046008d1366ba4e29206ac79ce4c56d6fab3350492b","a98be76d8c257aa9e316bdb305b8c4228f0cf904d4b70547fc2999f3f99b5a01","7419d99dfe020d543c8ee736ab7ec17127d6a2c61c40e5f245c6dbd3fa6eaea4","2495815b16258136f98d91e441f4462f9b694520af86bb8c8373724cdc410096","a64568c16a5821575de4f6280ba1ea4686a1ceecd649fa90ba957c8b1b007013","ac46f284c80582f7c1284eef93f2d1c80add2d3b0e8a4076d6ca3db58d3af747","dee4dbaef83bb1061a44f39a91a59300d3dc02528eb57f748222235dd8e02159","a39c32b055d2e6103e5c49b9aed2d7bb5b06571c98fc31105264d280431bdbd7","618ebb93311695a13844118cdc9a7314dd3a2c6f35092d87f76828cac555ddc9","d36c3d116ce59a3f072c0014f0c020c76e916ba906066ddc4f193f546a43bceb","9bed8447acaa89be63540ec500b165442fcb0de020015175b5a5c66d42a61c4a","f128a2d1209d243ba2f7755c2fc313be2c7569fa0d9b4dc5cc60714fb0cc6634","a17e6861b709149f29a2bd896cee94526df2f06b24a2b60614b56649b5e9aabe","9c79ace686f720f4dd833740f7190e12cdce363362c982c164745527a412ef40","439850ca5075c6db55487b2c7fb27a6051fecbf180eee0809b67bb2783a89813","75d48857bc4216880443a24d985071262bb8b89a9952c77fd430cb0caa21f9bf","33e40cf77499b3d9712db82e15683373925e85817dbe82a24ee0ee6e44bffb70","d5bbd453310990e851908183fbbef9e6e2db8e0c86d97b42b723fd5238f71c81","95e76bed30f6e993e1fcc1b90a4675682e4800ae43403547a775d6e3c7ab2b0f","8b206b995edc6dd849b85c1c56531b9780e3ba75302fd02a2d173f008028707e","97040b190f0daa10cf9a15e51a2fac66b26ddefd7b65998bd6027d1dd67647b7","877c25dfae100e555014e45d1d80364496a0c876201e5dea91a0fd0a6a4ff765","d53f9f96afd41359edeb2d5ad98559f3bfad261391d5aef95320fefb0c6a8742","23d98226adf3be74e1f0470f85e7fd154cd7aa979d60b43190a7437f0d0426eb","639f9321a98b734242a3573764d7f1de5369b0b0b10c768ae37639e8bda5dd03","a42c39d8b7d1b1eccb69c7919ea60dcc2670ea672a0af90b70a730974ec0e9fb","dc5fe5f6b39c3fdfaeba333bcd5f0cc98bb3068797a4d7010f585366f549ddf7","4a3ab8cb278bfd1f18f24cc45a02188b63afa6aef50035df6d79c4638f24059a","e724c9ce92f2a8a31ed260764c5455852a13d292e2a31d26acc6840ec0e83208","40220ba1b091aff0cb20df5467202b62af561b09fcf3b24c22a60066d46f9e62","30abf588759f9e828a94f0c7f031eae094bb668c6dd4d902fa296779267c05c5","bd875d031474860131eadb42300aa57a71527bbb2b239d5b31ab6a9e352c84f0","773bf9af93b5027de9b5b4c779d5cda35f0eb92c7f43a97f2ef3ca081495a191","617f2b4f5115969c7b0f225d4962e6bec1cec7e5c687d84370eba4931b7dd047","59625b1fcc91f2686751fd5b623126f434d7b405bd8d866a555963ce2ac69846","5e0dc1bd24b45c46f2188d2f7f4b67f311610c72b706f963c5bf04c2e1fcc35d","fc69ffd599d3e525aba38f80c7cc2ecd187dbf148287364c75f199c8294a00e6","2ad138be6972de52ed966e6402aa6403af79e9f183486e0a725ffa075a0555fb","480274a4f75a7b3bd5c697a55e1905887b62a928592c0db3c282525fb235ba70","967fb6e86b55db228ab50c81f85f39d6a23a0c15bcfa6e19d255e0952d33a65a","c39e7d32dddfcdaa93b18b99fa430ebb1d6ba366459563d400add22f92e3644b","e3932de252bbe43132ad3226865b2a376ad945dbc1d767540c01b7bddc6477c2","b2f52f3cbd863dc4e690614b5cddbf412dea435d0de099db6d8adfd3cbefcd65","557c93b35f3b58e6844a9b8817559da1e0641f7f08f918e3cd1a8efee126746f","80ad2ae93d57dadac5e377ec6743df5e0211ea30bafd4b648c52366af057bb2b","07f90213b5800a0b43a6d6f309517dcca5afc6ffeb4bed396878a29fc5d6ceb0","bb0e637020f81cb40d16f202c3a783f0e269e29547fb84ca9f187a5ea8556965","462da802b50ac0d94a3c8f7f58a6a0aa08108bfc1394449ea56f1e0f63f5132e","2ccea88888048bbfcacbc9531a5596ea48a3e7dcd0a25f531a81bb717903ba4f","b7eece07762a9a944f097ee05d6f6b642b1e2dd87e6fc1b09600d881e5475377","1916218868966583a3c9f18501ee78929cab8450ebb8076ebd609873c258154d","98ca5ae10ab02fe747a7a53138f43525e0129aa1107892ea4e1fe9c99575809c","9760678d20c9faa0d0e1269806bce578bb76598a4a188a4d3987171263be20c5","21f706150e32f03ecd1714d7a7ac55ce3caadc7c7a2a960ba57cc5d39ad84c9d","6954ec87361b77bb8895426909fecfd154e3fd72a2b82f681c8bb15bc46f2389","da1963f37d566ff9f71bf8ca5c628656bae02fc9509050041547e9c7063cc58f","57e4bed825036f7f1328505bc512af492f28b1b57a48f1ff9b6d90b930041a52","3ef0957915b7719ac58153eaea6ce810ff8688276e570f8938455f3ec7930df7","05e0ad043fdd4e2d4874a97bd716174af64d63e43851c09830c00e819a80d395","2dff0ed1eb2046fbdbc2c13914117e1ff1112e217f90542ea5e7f41e39f0393e","a0ba1e2711c2520189ed980225e7a429b0706a1eabf9113e53f0e72550a1b23d","169b66aee819a4b165c397b832b31691f0be8d35cf8f2ec6364c23ee727b20b8","badb4cfbfc6eca3a038be22c76297bec0b5c1478d8b73d60e8b50725b7dcc15c","21e7e0eddddc112f2b891d1066eac74680291db768d3ef9b908965935380ab98","489e195150979dc291520e6f3289f055516cf342f314931c6b4553aebf2859bb","516efe800aaa0b7504b71f2d7e7e9bed5f28eb6c9c739bfdf237f09c7addea46","10ae729013e6620dc937df5dd7077c34e29ad313a28aa75cec39957640cdc8b0","ac5f95dee5e4787fa7c68a81a052cdfa0e03adec8331d3276389384df36cb849","0aaa321f1f662ec931e55c85867d316d8af16b59337111e22901516a0e1caacb","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","a120dfb4736e6ec4c78f1bff5ff7f977d346152e6b7020659ee1ce4717f6f66f","9eda7b58498bed72dd98ebf1d6f8dd3bf5df5004b2f91c610093bf48f970c615","8e7adb22c0adecf7464861fc58ae3fc617b41ffbd70c97aa8493dc0966a82273","755f3cd1d9c1b564cff090e3b0e29200ae55690a91b87cb9e7a64c2dbeb314d3","d6bb7e0a6877b7856c183bff13d09dd9ae599ea43c6f6b33d3d5f72a830ed460","f1b51ae93c762d7c43f559933cd4842dd870367e8d92e90704ffa685dd5b29a3","4aa7fdc017a0a097c71ada2ca187e1475c987b4f933960c0792eb143997e4709","3f450762fd7c34ed545e738abccb0af6a703572a10521643cf8fc88e3724c99c","c56e9d223c1b5682aba7b1a761897e3b52a96d1a1e557d6a60241f3fa0430098","8516469eb90e723b0eb03df1be098f7e6a4709f6f48fd4532868d20a0a934f6e","d60e9ab369a72d234aac49adbe2900d8ef1408a6ea4db552cf2a48c9d8d6a1bc","0ebb4698803f01e2e7df6acce572fff068f4a20c47221721dafd70a27e372831","03460a54d0e0481d1e11097f66ad43f054bc95efdafe5f81bbc7a82be181af75","ded24ddc7157689a5aa14bd651272ab8cd6e7812da2196a65d8c5e63131cfb23","2cea9689efa8591732096235abe7f084fc29c92badd5b0897a5e876b77e71887","4ed4e504126014fee13aaef5e3fc140f2ff7031ff3a8b5386717905820ea2d09","00e77e0bf106bc1e4f303ab02724df5173506d44acb6c22b4f582a88f22c3250","30d2170e1a718b5035611af55e3618b4ba8f42f0749bb52ee593da6082c4e2ce","f910705a0f7b484f66cc58a71a862984d2ca6f5df8f5a96201f569d564e1c2bd","a3b8b6be7620897d1e481e8650c980a210a138fceb6e710eaf95fd9dd0dfe94a","12c89d0e32758c120a569045f21cf5b77244f86792611ced8de7f86b37e77781","14bd47270e654c8eb3b1489fa8c095912ee62a0a29bb92743393203722347c53","235ac682dd51a0fd9714ea306bfebc6e32ca997aae0695fbc76d29dab5d4be32","bbb0c464f84002efad8c8df37297703738bc457a39bd801e2df05bf45f7a7f26","92cb686a9ca5eb5dd7d5d8d43a3707194c1e91ea07a027b3bcb60b6011b24632","da3ab7396ab4fe390f01091bd0d4c4a4e1e2a15a46d47446d6fb7194897d0f6c","66bbae6120d307ec2021ebd2241b8ad23f832b663e13363ca8b4c8dbc131a4e6","fb14266ae4070bd16db6b071e98887452bc359695c40742e38515a89dbc80a63","4a24d83c0d8f489465c4d38ed9fd87121c8a2cf50c47efe09c2eca93d39fa908","c052e32b9de53cd2596f196a0901801961bd7a31be9fac4ac2f117e4103e3a07","b15cdbb45919bc3b8e6b6f962d65382e85061d70bc26a968604f3dce4ad3a891","d6b58d955981bc1742501b792f1ab9f4cba0c4611f28dcf1c99376c1c33c9f9c","f0b9f6d5db82c3d1679f71b187c4451dbc2875ba734ce416a4804ad47390970a","a5c38939c3e22954a7166d80ab931ac6757283737b000f1e6dc924c6f4402b88","31a863da9da2a3edec16665695bdbc3134e853195f82dafec58e98c8e1bb3119","a00417f73bbba413d1345dd77252ede0bd0c957e37a9cadc9abb4c34cbd0eac1","90d1ad8d2983cb003d6f237b41c56a8f252f72071bbc53576e02b3c96d7ea47a","f3815045e126ec1b9d224782805a915ae01876a1c7d1eb9b3e320ffadbd63535","d07557f21b2ad690bfe37864aa28090bd7d01c7152b77938d92d97c8419c7144","b843ea5227a9873512aa1226b546a7e52ea5e922b89461f8b202a2f2a3f0b013","64b4d440f905da272e0568224ef8d62c5cd730755c6d453043f2e606e060ec5a","d6b58d955981bc1742501b792f1ab9f4cba0c4611f28dcf1c99376c1c33c9f9c","f0b9f6d5db82c3d1679f71b187c4451dbc2875ba734ce416a4804ad47390970a","a5c38939c3e22954a7166d80ab931ac6757283737b000f1e6dc924c6f4402b88","31a863da9da2a3edec16665695bdbc3134e853195f82dafec58e98c8e1bb3119","c0e03327bc548757709a7e2ca3063ca8b46227b5e13cd981ca3483035ef5ac44","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd",{"version":"99e8bb8d262bece129ac203f0c7436a07771e9cf5ba06a308d1b16993606eaf2","signature":"8705a9680ed4afb15edbd7bb9ee24af33060d1165117f293559f3073bf8d0101"},"ebf6e19cb84d78da20d022a95f05e8aef12e56f816a1ee12835a4da40d7b14cf","589357c2f88f1188a0dfc48c4c4cf4d22fac9f654805df5f2789a01b5616b74f","6abe62ec5b9b6a747c1a7687d58ff179cdfb61adee717b6e4882120f7da4399f","5c1301f550be26133f4fd34eadf38815db096ecaf9b75948b444a063097f496d",{"version":"26e64fa5fc9c7fce9daf4131f396fb5012dbdd92fb2e2bcda5aa083a76d18888","signature":"cdca22d444beb7cbe168d11a666b994be4b19c5ed7df1856612ac4dd7c2242fe"},{"version":"34ef3dd636b7074beec81346987a81ac245e1cfd75adf0babc68e6cb6c572ca3","signature":"82065c62b6a8089452cb40191a55299b2d0718ddce833446faa6c01f48f05b29"},{"version":"c1eb1aa5e32fd31d4564bffb458942d8caf500d86388c811cbb853c274e4773a","signature":"a7fe41f597b2631d3fb439d9b3ee32d1606c651a45ce2fa0d170a2614e68d280"},{"version":"327fd9ca522780f73a64e32e400a6c5bcdd89a5e706314d57ff1611bf1a99a0d","signature":"70b3082385b926b4bb0dbcef0b2f444c4f807d312546f27ee248d50b0dfa5877"},{"version":"3b1ea19c2b95501c5d8e87fe4c8044d204c4402a8b48f282bd348f973355f3c5","signature":"01b86f9481ddaf74b65f12e90ae2d5bedbc0e67e64e8cb273c7a1907cc66dbec"},{"version":"897a42f20db3ee955b1cc64506c040b0b1dcebe45d9ba3147e133d110f487f6e","signature":"3089238aed154b07430dd80de65df3115d268f21f1afcd8568a58d65c7827c5f"},{"version":"2d41bac312ef892971b2344a102feb99985e87f79edc18ed2c43ece97703fb91","signature":"2642375958909546f682d51f9c3682f553ae5f919f7b4a77d49262c200bca248"},{"version":"db3db9885deb334e6606785a0bfe7aecdcae172d36a6b4bd55958c756b92ac6c","signature":"79cdba32abf1fd279e588363d3048cb4b3d537a81530d32079cea1df22d66f93"},"1fcb8b15db812281d69a3090d488903f9e93033004aef9d8889ca3ad0753a96f","bdf5a95eb0a2dd1d39805bdf51b46ba012bb9b92b2ddaae16219595bba7678a5","9f794a0e8550a03baff865a3961cc22afbd85bc4ba9672bdda036971928f85f4","66a697d1e4cdbf25cdce4644a8085a8563041fa8c7731d4d9f5e8f22e66ba72c","a0c8e17f4d1ea2704c62d7349bc3b8d9a12e3761b5960cb44144d3f0333b3fcb","3471c0df3d0391e1dffe6e8bf150294531b2b71a2afa5f2b86e52bf84a5db60a","5d4df4de055eddf3187094f938a640f8d96e4c551a47d6686596fdb6ba4c3014","8bc2cad630da1033c1fd8d7df2bffb18af0da6113bd086a8bbec04a2471a1e00","a1059d1bbc8ad46bfe668b8450e7e8002887c4ab987bdb96d6108d8023f8bb8f","5134885e9648e2c6745f8aa1c3e7f5ab3b3617258b3d81ca02de6655ede3d74e","4f1ae3f24125216cf07c5211a3f00d2bb4782d7cc76c0681603f8249f9232ff0","d3fb92a5640f83f7844d60b35317a0f95c27e3658a749d76d218c461ad091668","d1f8bfcd91b284657ef8187c55ace7db91a3c43e642c3f14e54364154932f7e4","f54c92bfcae54f360fe79514746efce4870e4ddabc064e95d406bba291e9f672","175fd7186fa6a70f9db9b270a04a503cae23cf01cb77e3905bac115c38424cf7","c993f7ed1b8e1023c1f2ee5b262dbc3b70b27475674e40a53a58591f9972dacc","c914014ab7c7001178663f29d31a495398234a41219af61f26d7e8e91b46af96","277afd6ab6ec72889e2988e0ddd7d138c1f512e68a1fa4e90eedfd71e2097a51","c0908f85f2b645d375127a3b53a17a65f782e17962d5c1eb68f08b1188acbf15","3fadac5d409cc2f27b1d2f4e7568600f02840205f301c9ae7a3068b46476438b","da6aae64ad559286830fd44c81e3d33303348f184af7db4fde8dd99ae9749407","3633f87c97d359cb55fa7bf0668fb2be8a23342951af6ec2d06e6d0cf7409371","cc3a5427d44fc77ff25e80b3edee4650a51f83de761faf5e633994ecf1ab1b44","b350eda75c6e47299b36002b31d5b220c405c21c365e708989829db013fadbb4","f421882756b6714834ae4687ab1aeadf344a1cc45437d2edffbac020ff3801c1","1d61d6ad832dabafbf63b86c5a79d704f2c8763ada9318e135b17a3cb2d09b32","e5cef5de3e5ad3436d414d20743231e284733b9cf4375dc79eff4fcca4282f99","e624419ba84e33e661e89a28083119ca41f6953dba09a4f82b660684087afe6d","942be430bd0feaced2e3e598273b17e50ea565ec9dac840b580b0b99e1a3cd5c","73350006cec5a0c6b71d53b0b0ddbfb82be96752a9c4e3c904c59e633bc9485e","a7df5c2e9594966c7e0d4a763b13ed5727506d892669df5f7bc9826f539c1d35","258cc5cd6891f6bcbaccefd953997038844e7f65d582cac987ffabf7181bcd4c","00a6db28fc4df6ddf10adbe630d9df620ec13af19039c1869653e60dafa739d2","649324d5abb5464aabe35d86cd0eef16562df811f0971481cee664afa5acbc88",{"version":"628749b6edfc907c32583a77f7dde111642dbfc13265fa566e9a8fa47f224b51","signature":"495944b274165419ec08446dbd612d6276e2c12b92caa1f1e6c645cbc044ef25"},{"version":"e2f7d4348da1a42007547574ec71504de5e9df04d270bcc4c672bec1068257e4","signature":"0d7e153773886e59a74ffe1fac08bef805541411de160b9f3af36f8a6a3c6022"},{"version":"70fa251413c8e1926804d27e8aa01f96bf56141270e8adaeedfeaf0cc7147cef","signature":"2e85c128d27849ff4bd436f75d32d8a64d9013d420f09c82c6eae63cb7131020"},{"version":"334a6eff67fdb6feabbe5a612552a0714c424ccd07abbb096672085e7d43fb4a","signature":"19756a360a54eda2a10138b94b37a87519fd1a27c678a1b82187295e40bbfacd"},{"version":"722e48bdd1c494feabfb081d7d582d4554276abacce92f69128511918c125273","signature":"b195f1ad5886c1600c53bc7296210f9ded9a9a673e01988eecf9f20f48a4d9d5"},{"version":"1b5f109f8e1b74f648bf19b878188928678f443c2b2a21db0861f57d0715ef69","signature":"55310e6719d6bd9462e76cbba6a582712b30a85ee4949b8d98e14e0f46738e78"},{"version":"d184310a8c121c1ed754995dc55f8ca212bb1ef94979f99423dcdc48569b3c51","signature":"99ec28bacd04a3185d90660fe18bae48f33cbb1d50c73c64cae98e67f7c0ca01"},{"version":"48d475a0c6f91f62a89b128923cdec08f1f30a12df0068493f0d9b2774125b01","signature":"6a90b1b75bb0eb776ae223adc1f3f1cc343abf3e68df619933a3248910061290"},{"version":"e581d928f182594fe6aa7c0dd2e0ce02fe65fb53b7d40a59af9c2f171eee6428","signature":"1ac721bca31657133deb33e2ae005d557e8e6e0aa9a466142a2b0388e2e2638c"},{"version":"f18e14371215da28d2375c023017adcbd420314020f2a4ca4e9d9369ca80c1f4","signature":"0aeb9a7ce850134709dee9ecb63c1883e387eb70f960e0510100f4b2bb70caa4"},{"version":"bcc7e1fd0b70240f11846f0c5a284be69834446899b64477371cee7aaca38965","signature":"bab97a4f0736f1c1cd0546f79f993ecf30b34404cf4479a4f39068915880cb1c"},{"version":"6720778d4192df7ececcfd9dfebed8a006c9c44f88fe8b74880ab3ba7e14cce4","signature":"121c82998e23aa414d41a2f08e108074760318a1c11a2a5183b88b0d9be4ef60"},{"version":"e3fe28954899e21bf8a7db496cb4b90313e826bb5ae938d84bc73c3bdaa31cc9","signature":"4e1f22dbfc0754b698f1e291c7c92bf1220834bd5620207084236399cfd02e2d"},{"version":"7f2a2cdf8eecbe353d449055d91c6ee619f90ca3b3a49ba5a44563c44aab5d1a","signature":"8e6165fa13e0d2f40e2403ab20b72804d02c663709a3f7383a320050e893fe8b"},{"version":"a02cb9d0a7363cbbce45fa86bbd7d64615811e30f2a7c47a2718fcf53f20eae7","signature":"9af2721670eb3402e476cd827256d4af7ab1d6db57f1615cbef18c75164df9e5"},"14c94f7888c75007a94132f03caef0f6b58bcb136c2994213fd2d3b99f3d7f85","4695042a55a75a6c62dc57f2efe60ef3c7bbe19adedb5081f6e51dd664bbc3f7","b006ad8d854471e7a270bd8918508090961bdc1cfe77ed51f13f471fe682acac","310901df1081433ff7c3b7918496cabb92ded208b04294d3d2bd35acae2de836","c8646410cd2a6bf05eb7e7a51c881776410d07fd5d8f75092a2c815c9c6fda52",{"version":"127604bb56d364ecc35cbb4927ba7c53f552353fc7913b07a4f5cc957210aabd","signature":"973a1e0a155ab26d66226ff9d64a36cf61227e9240b21cabdc67df29847a6599"},{"version":"dcea5769c8b69d7b7a5ee6ffd4d22260e47d53d22990e91d504cbdc0c0120c14","signature":"16c51743932253da5b661b0a5068eb1423a6f020f62e6783ce8ac5259cff10f2"},{"version":"67be5e00299e02d108b294758dcc0218da9f2a2823dea61d708ddbe705771ae5","signature":"05fe3dec4dc02961a8959758da54c6ff9d32a232183041163d4d52cc6bf39015"},{"version":"e2e5ebf01c7004f157b8c750fdddb9f227fbf3119a87297e3a014db04c3f0887","signature":"fc6fe9c667e291d0bbdc904c921d2c1d385175f8c135d9e549298c96265acaec"},{"version":"6b0da45d7a1027dd4a9b14ac009b018761e8851c84a9e54ecc1be9086f0516c6","signature":"38fd30580198d072da98f6dbcb7535f47359ca91ffe57e3b9bfd1961a3b209ab"},{"version":"b75a82fbc994a947805538c6652361c50c70f121e173c9ae62b190b8936790e0","signature":"0e92b9a9c01325fa2e1bc7574a0ff68328f69f8db609be2156a4c3da5ce493df"},{"version":"4c408d170f00539f8957a9cfce1d7f3e4a2d36651dbf4b16337a7af5c568d7e5","signature":"a0c04e7f7ac63b60e113ff0a7ad4fbf9214babb1db0572641709a5859710e27c"},"4489c6a9fde8934733aa7df6f7911461ee6e9e4ad092736bd416f6b2cc20b2c6","2c8e55457aaf4902941dfdba4061935922e8ee6e120539c9801cd7b400fae050","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","bc3cba7b0af2d52e7425299aee518db479d44004eff6fbbd206d1ee7e5ec3fb5","afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"ccfd8774cd9b929f63ff7dcf657977eb0652e3547f1fcac1b3a1dc5db22d4d58","affectsGlobalScope":true},"d92dc90fecd2552db74d8dc3c6fb4db9145b2aa0efe2c127236ba035969068d4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","254d9fb8c872d73d34594be8a200fd7311dbfa10a4116bfc465fba408052f2b3","d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","d8f7109e14f20eb735225a62fd3f8366da1a8349e90331cdad57f4b04caf6c5a","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","9d92b037978bb9525bc4b673ebddd443277542e010c0aef019c03a170ccdaa73","ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","ae271d475b632ce7b03fea6d9cf6da72439e57a109672671cbc79f54e1386938"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":true,"module":1,"outDir":"./types","rootDir":"../src","sourceMap":true,"strict":true,"target":7},"fileIdsList":[[668],[73,109,110,111,126],[110,111,127,128],[109,110],[109,126,129,132],[109,129,132,133],[130,131,132,134,135],[109,132],[109,126,129,130,131,134],[109,117],[109],[73,109],[61,109],[113,114,115,116,117,118,119,120,121,122,123,124,125],[109,115,116],[109,115,117],[607,611,612],[607,610],[610],[611,613,615],[607,610,611,612,613,614],[607,610,614,618,619,620],[607,610,614,621],[607],[607,608],[608,609],[607,610,616,619,621,622],[617],[618,620,624,627,628],[618,620,628],[109,610,614,618,619,621,624],[618,628],[618,621,625],[610,619,621],[618,621,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639],[618,626],[109,626],[607,614,618,619,620,621,622,625],[618,620,624,626],[618,625,626],[109,136,393,394],[393],[394,395],[109,388],[388,389,390,391,392],[109,360,367,368],[109,360,367,368,388],[109,360,367,368,372],[109,360,367,368,369,371,372],[109,360,367,368,370],[109,360,367,368,373,374,376,377],[366,388],[358,367,368,373,374],[360,366,367],[109,360,367,368,373],[109,360,367,368,371],[109,360,367,368,384],[109,360,367,368,385],[112,357,360,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387],[358],[358,359],[73,109,393,396,402],[396,403],[403,404],[217],[217,546,547],[547,548,549],[250,259,260,263],[250,259,262],[250,259,261,263],[251,254,255,257],[251,252,253],[254,255,257,258],[251,252,256],[262,268],[250,259,262,268],[259,262,268],[259,262,264,265,266,267],[250,259,260,261,262,263,268],[250,259],[251],[145,168,194],[168,198,215],[168,215,216,235],[145,168],[145],[190,191,192,193,195,196,197],[168,190,191,192,193,195,196],[199],[202],[145,194],[203,204,205],[198],[194,198,200,201,206,207,214,216,236,237,355],[168,201,206],[209],[208,210,211,212,213],[145,168,194,198],[168,207,354],[139,145],[656,657,658,659],[550,569],[570],[562],[564],[562,563,564,565,566,567,568],[562,564],[109,229,425],[109,229,426],[426],[397],[109,229,397],[397,398,399,400,401],[109,229],[229,428],[229,429],[229,428,429],[428,429,430,431,432,433,434,435,436,437],[62,109,229,428,429],[106,109,229,428,429],[168,217,224,225],[226],[109,168,226,229,230],[109,168,217,224,226,229],[230],[225,226,227,230,231,232,233,234],[109,227,229,232],[225,232],[168,224],[168,238],[238,239],[238,239,240,241],[168],[189,354,476,493,494,507,532],[530],[168,505,520,528,529,531],[189,354,456,518],[519],[109,224,229,427,438,493,494,495,507],[168,189,493,507],[168,438],[438,496],[498],[495,496,497,499,502,504],[496,500,505],[501],[438,496,497],[496,497],[503],[168,185,189,354,463,476,486,493,494,505,507,510,512,520,522,525],[510,525,526,527],[493,507],[506,507,508,509],[493,507,508],[168,493,506,507],[168,493,507],[523,524],[168,189,486,523],[168,354,486],[521],[168,354,476,493,494,507,528],[145,168,485],[109,168,243],[168,351],[320],[168,243,320,348,351,352,353],[109,168,242,243],[244,245,246,247,349,350],[139,145,348],[139,145,246],[278],[278,292],[278,279,294,296,297],[278,292,295],[278,284],[278,283,285,286],[278,283,287],[283,284,285,286,287,288],[290,291],[279,280,281,282,289,292,293,294,295,296,297,298,299],[278,300,301,302,303],[145,278,300,351],[335],[348],[338,339,340,341,342,343,344,345,346],[168,270],[320,344,351],[270,348,351],[145,321],[270,271,321,324,334,335,336,347],[145,168,304,320],[348,351],[269,271],[271],[351],[321],[168,324],[248,249,272,273,274,275,276,277,322,323,325,326,327,328,329,330,331,332,333],[168,326],[248,249,272,273,274,275,276,277,322,323,325,326,327,328,329,330,331,332,351],[168,269,270],[235,334],[168,271],[318],[145,305],[306,307,308,309,310,311,312,313,314,315,316,317],[305,318,319],[304],[354],[442],[441],[145,168,448],[269],[168,242,354],[145,354,455,456],[439,440,442,443,444,445,446,449,450,451,452,453,454,455,457,458,459,477,478,480,481,482,483,484,487,488,489,490,491,492],[145,168,476],[145,168,354,442,480],[159],[479],[145,168,269,354,478],[145,354,478],[145,354,476,479,481,486,487],[145,168,442,445,457,480,481],[354,456],[487],[537],[537,538,539],[148],[145,148],[146,147,148,149,150,151,152,153,154,155,156,157,160,161,162,163,164,165,166,167],[139,145,146],[136,148,154,156],[148,149],[145,163],[109,363],[361,362,365],[361,364],[109,361],[413,414],[668,669,670,671,672],[668,670],[158],[674,675,676],[74,109],[679],[680],[691],[685,690],[581,583,584,585,586,587,588,589,590,591,592,593],[581,582,584,585,586,587,588,589,590,591,592,593],[582,583,584,585,586,587,588,589,590,591,592,593],[581,582,583,585,586,587,588,589,590,591,592,593],[581,582,583,584,586,587,588,589,590,591,592,593],[581,582,583,584,585,587,588,589,590,591,592,593],[581,582,583,584,585,586,588,589,590,591,592,593],[581,582,583,584,585,586,587,589,590,591,592,593],[581,582,583,584,585,586,587,588,590,591,592,593],[581,582,583,584,585,586,587,588,589,591,592,593],[581,582,583,584,585,586,587,588,589,590,592,593],[581,582,583,584,585,586,587,588,589,590,591,593],[581,582,583,584,585,586,587,588,589,590,591,592],[57],[60],[61,66,93],[62,73,74,81,90,101],[62,63,73,81],[64,102],[65,66,74,82],[66,90,98],[67,69,73,81],[68],[69,70],[73],[72,73],[60,73],[73,74,75,90,101],[73,74,75,90],[73,76,81,90,101],[73,74,76,77,81,90,98,101],[76,78,90,98,101],[57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],[73,79],[80,101,106],[69,73,81,90],[82],[83],[60,84],[85,100,106],[86],[87],[73,88],[88,89,102,104],[61,73,90,91,92],[61,90,92],[90,91],[93],[94],[73,96,97],[96,97],[66,81,90,98],[99],[81,100],[61,76,87,101],[66,102],[90,103],[104],[105],[61,66,73,75,84,90,101,104,106],[90,107],[109,228],[699,738],[699,723,738],[738],[699],[699,724,738],[699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737],[724,738],[739],[742],[511],[572],[574],[572,573,574,575,576,577,578],[572,574],[447],[595,596,597],[595],[596],[180],[180,181,182,183,184],[169,170,171,172,173,174,175,176,177,178,179],[683,686],[683,686,687,688],[685],[682,689],[684],[138,140,141,142,143,144],[138,139],[140],[139,140],[138,140],[168,189,356,424,532],[533,535],[424,534],[168,189,242],[461,462],[168,185,186,187],[186],[187],[137,186,187,188],[408],[408,409,412,416],[415],[168,410,411],[543,544,545],[224,543],[168,224,543],[168,217,224],[168,189,555,559],[560],[168,217],[168,218],[218,219,220,221,222,223],[136,168,185,189,356,405,406,422],[423],[73,109,168,189],[407],[407,417],[407,418,419,420,421],[168,189,410,417,540,541,542,551,552],[551],[542,551,553,554],[168,417,546,550],[168,468,469,470],[168,189,417,460,466,468,471],[168,185,189,242,417,460,463,464,465,466,467,469,470,471],[168,189,468],[242,468,469,471],[466,467,468,469,470,471,475],[168,224,468,470,476],[168,224,467,468,469],[472,473,474],[168,224,417,467,469,470],[168,224,467,469,470],[168,224,469,471],[189,417,513,515,516],[514,515],[517],[516,517],[168,189,555,556],[109,168,189,555,556],[556,557,558],[168,555],[73,126,129,136,168,189,242,410,417,463,534,536,555,561,571,579,580,593,594,599,600,602,603,604,605,606,642,643,644,646,647,648,649,650,651,652,653,654,655,663,664,665],[168,599],[168,561,594,599,604],[168,410,411,417,594,599,605],[168,599,601,641],[129,136,168,593,594,599,623,640],[168,417,599],[168,411,417,534,579,594,599,601,645],[73,168,410,555,561,594,599,600,647],[73,168,536,555,579,594,599],[168,410,555,571,579,594,646,649,650],[73,410,417,555,593,594,599],[599,600,602,645,664,666],[136,168,410,555,561,598],[168,417,594,601],[242,599],[168,410,417,561,594,599,600,603],[417,561,599],[168,410,417,594,599,601],[593,598,599],[168,555,594,599],[417,571,594,599],[168,417,594,661],[53,168,417,594,599,601,616,661,662],[410,417,593,594,599,601,602,666],[53,410,417,599,616],[168,417,599,666],[53,242,417,599,602,616],[129,136,168,189,463,536,555,561,571,599,649],[599],[599,641],[73,168,555,561,599],[73,168,536,555,599],[168,410,555,571,646,649,650],[73,410,555,599],[159,168],[168,410,561,599],[561,599],[159,168,410,599],[168,555,599],[571,599],[168,599,616,662],[410,599,666],[410,599],[599,666]],"referencedMap":[[670,1],[127,2],[129,3],[111,4],[133,5],[134,6],[130,6],[136,7],[131,6],[135,8],[132,9],[118,10],[115,11],[122,12],[116,10],[113,13],[126,14],[120,11],[117,15],[119,16],[613,17],[612,18],[611,19],[616,20],[615,21],[621,22],[622,23],[608,24],[609,25],[610,26],[623,27],[618,28],[629,29],[630,30],[625,31],[631,32],[632,33],[633,33],[624,34],[640,35],[635,29],[634,36],[636,37],[626,38],[637,32],[638,30],[628,39],[639,36],[627,40],[619,18],[395,41],[394,42],[396,43],[391,44],[389,44],[390,44],[393,45],[375,46],[380,47],[369,46],[374,48],[373,49],[371,50],[378,51],[379,46],[381,52],[376,53],[368,54],[382,55],[384,56],[385,57],[386,58],[388,59],[359,60],[360,61],[403,62],[404,63],[405,64],[547,65],[548,66],[549,66],[550,67],[261,68],[263,69],[262,70],[258,71],[254,72],[255,72],[259,73],[257,74],[264,75],[265,76],[266,77],[268,78],[267,75],[269,79],[260,80],[253,81],[256,72],[215,82],[216,83],[236,84],[190,85],[191,86],[192,86],[193,85],[198,87],[197,88],[195,82],[196,85],[200,89],[199,85],[203,90],[202,91],[206,92],[204,85],[205,93],[356,94],[208,82],[209,95],[210,96],[211,82],[214,97],[213,98],[237,83],[355,99],[194,100],[660,101],[570,102],[571,103],[563,104],[565,105],[569,106],[567,107],[566,107],[426,108],[425,109],[427,110],[399,111],[400,111],[397,65],[398,112],[402,113],[401,114],[429,115],[432,116],[431,117],[438,118],[434,117],[433,119],[436,117],[435,120],[437,116],[430,116],[226,121],[227,122],[232,123],[230,124],[231,125],[235,126],[233,127],[234,128],[225,129],[239,130],[240,131],[242,132],[238,133],[217,12],[530,134],[531,135],[532,136],[519,137],[520,138],[496,139],[495,140],[497,141],[498,142],[499,143],[505,144],[501,145],[502,146],[500,147],[503,148],[504,149],[526,150],[528,151],[508,152],[510,153],[509,154],[507,155],[506,156],[525,157],[524,158],[523,159],[527,152],[521,133],[522,160],[529,161],[486,162],[485,85],[352,163],[243,164],[353,165],[354,166],[244,167],[245,133],[246,133],[351,168],[349,169],[247,170],[278,133],[279,171],[280,171],[281,171],[282,171],[293,171],[294,171],[295,172],[298,173],[299,171],[296,174],[297,171],[283,171],[285,175],[287,176],[288,177],[286,171],[284,171],[289,178],[290,171],[291,171],[292,179],[300,180],[304,181],[302,171],[301,171],[303,182],[336,183],[338,133],[339,184],[347,185],[340,133],[342,186],[343,133],[345,187],[344,188],[346,189],[348,190],[321,191],[248,184],[249,192],[272,193],[273,194],[274,193],[276,133],[277,195],[322,196],[325,197],[334,198],[327,199],[326,133],[328,133],[329,164],[333,200],[330,195],[331,197],[332,184],[271,201],[335,202],[324,203],[319,204],[306,205],[315,205],[307,205],[308,205],[317,205],[309,205],[310,205],[318,206],[316,205],[311,205],[314,205],[312,205],[313,205],[320,207],[305,86],[456,208],[440,209],[443,210],[444,211],[446,210],[449,212],[452,213],[454,214],[457,215],[493,216],[477,217],[459,133],[481,218],[482,219],[480,220],[479,221],[483,222],[488,223],[478,100],[487,224],[490,225],[491,226],[492,133],[442,211],[538,227],[539,227],[540,228],[146,86],[147,86],[149,229],[150,86],[151,86],[152,230],[148,86],[168,231],[156,232],[157,233],[160,219],[166,234],[167,235],[364,236],[363,11],[366,237],[361,11],[365,238],[362,239],[415,240],[673,241],[669,1],[671,242],[672,1],[411,11],[159,243],[677,244],[678,245],[680,246],[681,247],[692,248],[691,249],[582,250],[583,251],[581,252],[584,253],[585,254],[586,255],[587,256],[588,257],[589,258],[590,259],[591,260],[592,261],[593,262],[57,263],[58,263],[60,264],[61,265],[62,266],[63,267],[64,268],[65,269],[66,270],[67,271],[68,272],[69,273],[70,273],[71,274],[72,275],[73,276],[74,277],[75,278],[76,279],[77,280],[78,281],[109,282],[79,283],[80,284],[81,285],[82,286],[83,287],[84,288],[85,289],[86,290],[87,291],[88,292],[89,293],[90,294],[92,295],[91,296],[93,297],[94,298],[96,299],[97,300],[98,301],[99,302],[100,303],[101,304],[102,305],[103,306],[104,307],[105,308],[106,309],[107,310],[696,11],[229,311],[698,11],[723,312],[724,313],[699,314],[702,314],[721,312],[722,312],[712,312],[711,315],[709,312],[704,312],[717,312],[715,312],[719,312],[703,312],[716,312],[720,312],[705,312],[706,312],[718,312],[700,312],[707,312],[708,312],[710,312],[714,312],[725,316],[713,312],[701,312],[738,317],[732,316],[734,318],[733,316],[726,316],[727,316],[729,316],[731,316],[735,318],[736,318],[728,318],[730,318],[740,319],[743,320],[512,321],[573,322],[575,323],[579,324],[577,325],[576,325],[448,326],[598,327],[596,328],[597,329],[176,330],[178,330],[177,330],[175,330],[185,331],[180,332],[171,330],[172,330],[173,330],[174,330],[687,333],[689,334],[688,333],[686,335],[690,336],[685,337],[145,338],[140,339],[141,340],[142,340],[143,341],[144,341],[139,342],[533,343],[536,344],[535,345],[461,346],[463,347],[188,348],[187,349],[186,350],[189,351],[409,352],[417,353],[416,354],[412,355],[546,356],[544,357],[545,358],[543,359],[560,360],[561,361],[218,362],[219,363],[220,363],[222,363],[224,364],[223,363],[423,365],[424,366],[407,367],[421,368],[420,368],[418,369],[419,368],[422,370],[553,371],[552,372],[554,372],[555,373],[551,374],[471,375],[469,376],[468,377],[466,378],[470,379],[476,380],[465,381],[472,382],[475,383],[473,384],[474,385],[467,386],[517,387],[516,388],[518,389],[515,390],[557,391],[558,392],[559,393],[556,394],[666,395],[661,396],[605,397],[606,398],[642,399],[641,400],[643,399],[644,401],[646,402],[648,403],[649,404],[651,405],[650,406],[667,407],[594,133],[599,408],[645,409],[652,410],[604,411],[600,412],[653,413],[654,414],[647,415],[655,416],[662,417],[663,418],[603,419],[664,420],[602,421],[665,422]],"exportedModulesMap":[[670,1],[127,2],[129,3],[111,4],[133,5],[134,6],[130,6],[136,7],[131,6],[135,8],[132,9],[118,10],[115,11],[122,12],[116,10],[113,13],[126,14],[120,11],[117,15],[119,16],[613,17],[612,18],[611,19],[616,20],[615,21],[621,22],[622,23],[608,24],[609,25],[610,26],[623,27],[618,28],[629,29],[630,30],[625,31],[631,32],[632,33],[633,33],[624,34],[640,35],[635,29],[634,36],[636,37],[626,38],[637,32],[638,30],[628,39],[639,36],[627,40],[619,18],[395,41],[394,42],[396,43],[391,44],[389,44],[390,44],[393,45],[375,46],[380,47],[369,46],[374,48],[373,49],[371,50],[378,51],[379,46],[381,52],[376,53],[368,54],[382,55],[384,56],[385,57],[386,58],[388,59],[359,60],[360,61],[403,62],[404,63],[405,64],[547,65],[548,66],[549,66],[550,67],[261,68],[263,69],[262,70],[258,71],[254,72],[255,72],[259,73],[257,74],[264,75],[265,76],[266,77],[268,78],[267,75],[269,79],[260,80],[253,81],[256,72],[215,82],[216,83],[236,84],[190,85],[191,86],[192,86],[193,85],[198,87],[197,88],[195,82],[196,85],[200,89],[199,85],[203,90],[202,91],[206,92],[204,85],[205,93],[356,94],[208,82],[209,95],[210,96],[211,82],[214,97],[213,98],[237,83],[355,99],[194,100],[660,101],[570,102],[571,103],[563,104],[565,105],[569,106],[567,107],[566,107],[426,108],[425,109],[427,110],[399,111],[400,111],[397,65],[398,112],[402,113],[401,114],[429,115],[432,116],[431,117],[438,118],[434,117],[433,119],[436,117],[435,120],[437,116],[430,116],[226,121],[227,122],[232,123],[230,124],[231,125],[235,126],[233,127],[234,128],[225,129],[239,130],[240,131],[242,132],[238,133],[217,12],[530,134],[531,135],[532,136],[519,137],[520,138],[496,139],[495,140],[497,141],[498,142],[499,143],[505,144],[501,145],[502,146],[500,147],[503,148],[504,149],[526,150],[528,151],[508,152],[510,153],[509,154],[507,155],[506,156],[525,157],[524,158],[523,159],[527,152],[521,133],[522,160],[529,161],[486,162],[485,85],[352,163],[243,164],[353,165],[354,166],[244,167],[245,133],[246,133],[351,168],[349,169],[247,170],[278,133],[279,171],[280,171],[281,171],[282,171],[293,171],[294,171],[295,172],[298,173],[299,171],[296,174],[297,171],[283,171],[285,175],[287,176],[288,177],[286,171],[284,171],[289,178],[290,171],[291,171],[292,179],[300,180],[304,181],[302,171],[301,171],[303,182],[336,183],[338,133],[339,184],[347,185],[340,133],[342,186],[343,133],[345,187],[344,188],[346,189],[348,190],[321,191],[248,184],[249,192],[272,193],[273,194],[274,193],[276,133],[277,195],[322,196],[325,197],[334,198],[327,199],[326,133],[328,133],[329,164],[333,200],[330,195],[331,197],[332,184],[271,201],[335,202],[324,203],[319,204],[306,205],[315,205],[307,205],[308,205],[317,205],[309,205],[310,205],[318,206],[316,205],[311,205],[314,205],[312,205],[313,205],[320,207],[305,86],[456,208],[440,209],[443,210],[444,211],[446,210],[449,212],[452,213],[454,214],[457,215],[493,216],[477,217],[459,133],[481,218],[482,219],[480,220],[479,221],[483,222],[488,223],[478,100],[487,224],[490,225],[491,226],[492,133],[442,211],[538,227],[539,227],[540,228],[146,86],[147,86],[149,229],[150,86],[151,86],[152,230],[148,86],[168,231],[156,232],[157,233],[160,219],[166,234],[167,235],[364,236],[363,11],[366,237],[361,11],[365,238],[362,239],[415,240],[673,241],[669,1],[671,242],[672,1],[411,11],[159,243],[677,244],[678,245],[680,246],[681,247],[692,248],[691,249],[582,250],[583,251],[581,252],[584,253],[585,254],[586,255],[587,256],[588,257],[589,258],[590,259],[591,260],[592,261],[593,262],[57,263],[58,263],[60,264],[61,265],[62,266],[63,267],[64,268],[65,269],[66,270],[67,271],[68,272],[69,273],[70,273],[71,274],[72,275],[73,276],[74,277],[75,278],[76,279],[77,280],[78,281],[109,282],[79,283],[80,284],[81,285],[82,286],[83,287],[84,288],[85,289],[86,290],[87,291],[88,292],[89,293],[90,294],[92,295],[91,296],[93,297],[94,298],[96,299],[97,300],[98,301],[99,302],[100,303],[101,304],[102,305],[103,306],[104,307],[105,308],[106,309],[107,310],[696,11],[229,311],[698,11],[723,312],[724,313],[699,314],[702,314],[721,312],[722,312],[712,312],[711,315],[709,312],[704,312],[717,312],[715,312],[719,312],[703,312],[716,312],[720,312],[705,312],[706,312],[718,312],[700,312],[707,312],[708,312],[710,312],[714,312],[725,316],[713,312],[701,312],[738,317],[732,316],[734,318],[733,316],[726,316],[727,316],[729,316],[731,316],[735,318],[736,318],[728,318],[730,318],[740,319],[743,320],[512,321],[573,322],[575,323],[579,324],[577,325],[576,325],[448,326],[598,327],[596,328],[597,329],[176,330],[178,330],[177,330],[175,330],[185,331],[180,332],[171,330],[172,330],[173,330],[174,330],[687,333],[689,334],[688,333],[686,335],[690,336],[685,337],[145,338],[140,339],[141,340],[142,340],[143,341],[144,341],[139,342],[533,343],[536,344],[535,345],[461,346],[463,347],[188,348],[187,349],[186,350],[189,351],[409,352],[417,353],[416,354],[412,355],[546,356],[544,357],[545,358],[543,359],[560,360],[561,361],[218,362],[219,363],[220,363],[222,363],[224,364],[223,363],[423,365],[424,366],[407,367],[421,368],[420,368],[418,369],[419,368],[422,370],[553,371],[552,372],[554,372],[555,373],[551,374],[471,375],[469,376],[468,377],[466,378],[470,379],[476,380],[465,381],[472,382],[475,383],[473,384],[474,385],[467,386],[517,387],[516,388],[518,389],[515,390],[557,391],[558,392],[559,393],[556,394],[666,423],[661,133],[605,424],[606,424],[642,425],[641,396],[643,425],[644,424],[646,396],[648,426],[649,427],[651,428],[650,429],[667,407],[594,430],[599,408],[645,133],[652,424],[604,431],[600,432],[653,433],[654,424],[647,434],[655,435],[662,133],[663,436],[603,437],[664,438],[602,439],[665,424]],"semanticDiagnosticsPerFile":[670,668,127,110,129,111,128,133,134,130,136,131,135,132,118,115,122,116,113,121,126,123,124,125,120,117,114,119,613,612,611,616,615,621,622,608,609,610,607,623,618,617,614,629,630,625,631,632,633,624,640,635,634,636,626,637,638,628,639,627,619,620,395,394,396,391,389,390,393,392,375,380,369,374,373,371,378,379,381,376,370,368,367,377,383,382,384,385,386,388,358,359,360,357,372,387,403,404,405,406,547,548,549,550,410,261,263,262,250,258,254,255,259,257,264,265,266,268,267,269,260,253,251,252,256,215,216,236,190,191,192,193,198,197,195,196,200,199,201,203,202,206,204,205,207,356,208,209,210,211,214,212,213,237,355,194,658,656,657,659,660,570,571,563,562,565,564,568,569,567,566,426,425,427,399,400,397,398,402,401,429,432,431,438,434,433,436,435,437,428,430,226,227,232,230,231,235,233,234,225,239,241,240,242,238,217,530,531,532,519,520,496,495,497,498,499,505,501,502,500,503,504,526,494,528,508,510,509,507,506,525,524,523,527,521,522,529,486,485,352,243,353,354,244,245,246,351,349,247,350,278,279,280,281,282,293,294,295,298,299,296,297,283,285,287,288,286,284,289,290,291,292,300,304,302,301,303,270,336,338,339,347,340,341,342,343,345,344,346,337,348,321,248,249,272,273,274,275,276,277,322,323,325,334,327,326,328,329,333,330,331,332,271,335,324,319,306,315,307,308,317,309,310,318,316,311,314,312,313,320,305,456,439,440,443,444,445,446,449,450,451,452,453,454,455,457,458,493,477,459,481,482,480,479,483,484,488,489,478,487,490,491,492,441,442,538,539,540,537,146,147,149,150,151,152,153,154,155,148,168,156,157,160,161,162,163,164,165,166,167,364,363,366,361,365,362,413,415,414,673,669,671,672,411,159,464,674,677,675,678,679,680,681,692,691,676,693,582,583,581,584,585,586,587,588,589,590,591,592,593,694,158,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,59,108,76,77,78,109,79,80,81,82,83,84,85,86,87,88,89,90,92,91,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,695,696,697,513,229,228,698,723,724,699,702,721,722,712,711,709,704,717,715,719,703,716,720,705,706,718,700,707,708,710,714,725,713,701,738,737,732,734,733,726,727,729,731,735,736,728,730,740,739,741,534,742,743,512,511,573,572,575,574,578,579,577,576,112,682,447,448,580,598,596,597,595,514,179,176,178,177,175,185,180,184,181,183,182,171,172,173,169,170,174,683,687,689,688,686,690,541,460,685,684,138,145,140,141,142,143,144,139,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,533,536,535,461,462,463,137,188,187,186,189,409,417,416,408,412,546,544,545,543,560,561,218,219,220,221,222,224,223,423,424,407,421,420,418,419,422,553,542,552,554,555,551,471,469,468,466,470,476,465,472,475,473,474,467,517,516,518,515,557,558,559,556,666,601,661,605,606,642,641,643,644,646,648,649,651,650,667,594,599,645,652,604,600,653,654,647,655,662,663,603,664,602,665,48,49,50,51,52,53,43,54,55,56,44,45,46,47],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.9.5"} +\ No newline at end of file ++{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../types/eth-ens-namehash.d.ts","../../../types/ethereum-ens-network-map.d.ts","../../../types/ethjs-query.d.ts","../../../types/global.d.ts","../../../types/single-call-balance-checker-abi.d.ts","../../../types/@metamask/contract-metadata.d.ts","../../../types/@metamask/eth-hd-keyring.d.ts","../../../types/@metamask/eth-simple-keyring.d.ts","../../../types/@metamask/ethjs-provider-http.d.ts","../../../types/@metamask/ethjs-unit.d.ts","../../../types/@metamask/metamask-eth-abis.d.ts","../../../types/eth-json-rpc-infura/src/createprovider.d.ts","../../../types/eth-phishing-detect/src/config.json.d.ts","../../../types/eth-phishing-detect/src/detector.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@ethereumjs/common/dist/enums.d.ts","../../../node_modules/@ethereumjs/common/dist/types.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@ethereumjs/util/dist/constants.d.ts","../../../node_modules/@ethereumjs/util/dist/units.d.ts","../../../node_modules/@ethereumjs/util/dist/address.d.ts","../../../node_modules/@ethereumjs/util/dist/bytes.d.ts","../../../node_modules/@ethereumjs/util/dist/types.d.ts","../../../node_modules/@ethereumjs/util/dist/account.d.ts","../../../node_modules/@ethereumjs/util/dist/withdrawal.d.ts","../../../node_modules/@ethereumjs/util/dist/signature.d.ts","../../../node_modules/@ethereumjs/util/dist/encoding.d.ts","../../../node_modules/@ethereumjs/util/dist/asynceventemitter.d.ts","../../../node_modules/@ethereumjs/util/dist/internal.d.ts","../../../node_modules/@ethereumjs/util/dist/lock.d.ts","../../../node_modules/@ethereumjs/util/dist/provider.d.ts","../../../node_modules/@ethereumjs/util/dist/index.d.ts","../../../node_modules/@ethereumjs/common/dist/common.d.ts","../../../node_modules/@ethereumjs/common/dist/utils.d.ts","../../../node_modules/@ethereumjs/common/dist/index.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip2930transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/legacytransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/types.d.ts","../../../node_modules/@ethereumjs/tx/dist/basetransaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/eip1559transaction.d.ts","../../../node_modules/@ethereumjs/tx/dist/transactionfactory.d.ts","../../../node_modules/@ethereumjs/tx/dist/index.d.ts","../../base-controller/dist/types/basecontrollerv1.d.ts","../../../node_modules/superstruct/dist/error.d.ts","../../../node_modules/superstruct/dist/utils.d.ts","../../../node_modules/superstruct/dist/struct.d.ts","../../../node_modules/superstruct/dist/structs/coercions.d.ts","../../../node_modules/superstruct/dist/structs/refinements.d.ts","../../../node_modules/superstruct/dist/structs/types.d.ts","../../../node_modules/superstruct/dist/structs/utilities.d.ts","../../../node_modules/superstruct/dist/index.d.ts","../../../node_modules/@metamask/utils/dist/types/assert.d.ts","../../../node_modules/@metamask/utils/dist/types/base64.d.ts","../../../node_modules/@metamask/utils/dist/types/hex.d.ts","../../../node_modules/@metamask/utils/dist/types/bytes.d.ts","../../../node_modules/@metamask/utils/dist/types/caip-types.d.ts","../../../node_modules/@metamask/utils/dist/types/checksum.d.ts","../../../node_modules/@metamask/utils/dist/types/coercers.d.ts","../../../node_modules/@metamask/utils/dist/types/collections.d.ts","../../../node_modules/@metamask/utils/dist/types/encryption-types.d.ts","../../../node_modules/@metamask/utils/dist/types/errors.d.ts","../../../node_modules/@metamask/utils/dist/types/json.d.ts","../../../node_modules/@metamask/utils/dist/types/keyring.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@metamask/utils/dist/types/logging.d.ts","../../../node_modules/@metamask/utils/dist/types/misc.d.ts","../../../node_modules/@metamask/utils/dist/types/number.d.ts","../../../node_modules/@metamask/utils/dist/types/opaque.d.ts","../../../node_modules/@metamask/utils/dist/types/promise.d.ts","../../../node_modules/@metamask/utils/dist/types/time.d.ts","../../../node_modules/@metamask/utils/dist/types/transaction-types.d.ts","../../../node_modules/@metamask/utils/dist/types/versions.d.ts","../../../node_modules/@metamask/utils/dist/types/index.d.ts","../../../node_modules/immer/dist/utils/env.d.ts","../../../node_modules/immer/dist/utils/errors.d.ts","../../../node_modules/immer/dist/types/types-external.d.ts","../../../node_modules/immer/dist/types/types-internal.d.ts","../../../node_modules/immer/dist/utils/common.d.ts","../../../node_modules/immer/dist/utils/plugins.d.ts","../../../node_modules/immer/dist/core/scope.d.ts","../../../node_modules/immer/dist/core/finalize.d.ts","../../../node_modules/immer/dist/core/proxy.d.ts","../../../node_modules/immer/dist/core/immerclass.d.ts","../../../node_modules/immer/dist/core/current.d.ts","../../../node_modules/immer/dist/internal.d.ts","../../../node_modules/immer/dist/plugins/es5.d.ts","../../../node_modules/immer/dist/plugins/patches.d.ts","../../../node_modules/immer/dist/plugins/mapset.d.ts","../../../node_modules/immer/dist/plugins/all.d.ts","../../../node_modules/immer/dist/immer.d.ts","../../base-controller/dist/types/restrictedcontrollermessenger.d.ts","../../base-controller/dist/types/controllermessenger.d.ts","../../base-controller/dist/types/basecontrollerv2.d.ts","../../base-controller/dist/types/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/account.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/balance.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/caip.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/export.d.ts","../../../node_modules/@metamask/keyring-api/dist/superstruct.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/request.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/response.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/keyring.d.ts","../../../node_modules/@metamask/keyring-api/dist/api/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/btc/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/btc/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/contexts.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/erc4337/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/erc4337/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/utils.d.ts","../../../node_modules/@metamask/keyring-api/dist/eth/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/events.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/api.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/eth/ethkeyring.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/eth/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/events.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/rpc.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/types.d.ts","../../../node_modules/@metamask/keyring-api/dist/internal/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/jsonrpcrequest.d.ts","../../../node_modules/@metamask/keyring-api/dist/keyringclient.d.ts","../../../node_modules/@metamask/safe-event-emitter/dist/cjs/index.d.ts","../../json-rpc-engine/dist/types/jsonrpcengine.d.ts","../../json-rpc-engine/dist/types/createasyncmiddleware.d.ts","../../json-rpc-engine/dist/types/createscaffoldmiddleware.d.ts","../../json-rpc-engine/dist/types/getuniqueid.d.ts","../../json-rpc-engine/dist/types/idremapmiddleware.d.ts","../../json-rpc-engine/dist/types/mergemiddleware.d.ts","../../json-rpc-engine/dist/types/index.d.ts","../../../node_modules/@metamask/providers/dist/types/utils.d.ts","../../../node_modules/@metamask/providers/dist/types/baseprovider.d.ts","../../../node_modules/@metamask/providers/dist/types/eip6963.d.ts","../../../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../../../node_modules/@types/readable-stream/index.d.ts","../../../node_modules/@metamask/providers/dist/types/streamprovider.d.ts","../../../node_modules/@metamask/providers/dist/types/extension-provider/createexternalextensionprovider.d.ts","../../../node_modules/@metamask/providers/dist/types/metamaskinpageprovider.d.ts","../../../node_modules/@metamask/providers/dist/types/initializeinpageprovider.d.ts","../../../node_modules/@metamask/providers/dist/types/shimweb3.d.ts","../../../node_modules/@metamask/providers/dist/types/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/keyringsnaprpcclient.d.ts","../../../node_modules/@metamask/keyring-api/dist/rpc-handler.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/utils.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/classes.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/errors.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/error-constants.d.ts","../../../node_modules/@metamask/rpc-errors/dist/types/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/errors.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/error-wrappers.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/errors.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/helpers.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/structs.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/create-interface.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/dialog.d.ts","../../../node_modules/@metamask/key-tree/dist/constants.d.cts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/modular.d.ts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/utils.d.ts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/curve.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/ed25519bip32.d.cts","../../../node_modules/@metamask/key-tree/node_modules/@noble/curves/abstract/weierstrass.d.ts","../../../node_modules/@metamask/key-tree/dist/curves/secp256k1.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/curve.d.cts","../../../node_modules/@metamask/key-tree/dist/curves/index.d.cts","../../../node_modules/@metamask/key-tree/dist/utils.d.cts","../../../node_modules/@metamask/key-tree/dist/bip44cointypenode.d.cts","../../../node_modules/@metamask/key-tree/dist/slip10node.d.cts","../../../node_modules/@metamask/key-tree/dist/bip44node.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip32.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/bip39.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/cip3.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/slip10.d.cts","../../../node_modules/@metamask/key-tree/dist/derivers/index.d.cts","../../../node_modules/@metamask/key-tree/dist/index.d.cts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/caip.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/permissions.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-bip32-entropy.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-bip32-public-key.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-bip44-entropy.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-client-status.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-entropy.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-file.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/component.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/address.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/box.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/copyable.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/divider.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/button.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/option.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/dropdown.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/input.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/field.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/form.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/form/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/formatting/bold.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/formatting/italic.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/formatting/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/heading.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/image.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/link.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/text.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/value.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/row.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/spinner.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/components/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/jsx-runtime.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/jsx-dev-runtime.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/validation.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/jsx/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/nodes.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/address.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/copyable.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/divider.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/heading.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/image.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/panel.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/spinner.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/text.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/row.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/button.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/input.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/form.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/components/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/component.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/ui/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/interface.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-interface-state.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-locale.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/snap.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/get-snaps.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/invoke-snap.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/invoke-keyring.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/manage-accounts.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/manage-state.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/notify.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/request-snaps.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/update-interface.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/methods.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/methods/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/provider.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/global.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/images.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/cronjob.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/home-page.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/keyring.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/lifecycle.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/name-lookup.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/rpc-request.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/transaction.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/signature.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/user-input.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/handlers/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/types/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/jsx.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/svg.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/internals/index.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/error-wrappers.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/images.d.ts","../../../node_modules/@metamask/snaps-sdk/dist/types/index.d.ts","../../../node_modules/@metamask/keyring-api/dist/snap-utils.d.ts","../../../node_modules/@metamask/keyring-api/dist/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/patchcbor.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/lib/dataitem.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/lib/cbor-sync.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/lib/index.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/ur.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/urencoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/fountainencoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/fountaindecoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/urdecoder.d.ts","../../../node_modules/@ngraveio/bc-ur/dist/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/registrytype.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/registryitem.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptocoininfo.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/pathcomponent.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptokeypath.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/types.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptohdkey.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptoeckey.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/bytes.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/multikey.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/scriptexpression.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptooutput.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptopsbt.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/cryptoaccount.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/decoder/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/cryptomultiaccounts.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/errors/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/derivationschema.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/keyderivation.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/extended/qrhardwarecall.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/utils.d.ts","../../../node_modules/@keystonehq/bc-ur-registry/dist/index.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/ethsignrequest.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/ethsignature.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/ethnftitem.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/utlis.d.ts","../../../node_modules/@keystonehq/bc-ur-registry-eth/dist/index.d.ts","../../../node_modules/@keystonehq/base-eth-keyring/dist/interactionprovider.d.ts","../../../node_modules/@keystonehq/base-eth-keyring/dist/basekeyring.d.ts","../../../node_modules/@keystonehq/base-eth-keyring/dist/index.d.ts","../../../node_modules/@metamask/obs-store/dist/observablestore.d.ts","../../../node_modules/@metamask/obs-store/dist/asstream.d.ts","../../../node_modules/@metamask/obs-store/dist/composedstore.d.ts","../../../node_modules/@metamask/obs-store/dist/mergedstore.d.ts","../../../node_modules/@metamask/obs-store/dist/transform.d.ts","../../../node_modules/@metamask/obs-store/dist/index.d.ts","../../../node_modules/@keystonehq/metamask-airgapped-keyring/dist/metamaskinteractionprovider.d.ts","../../../node_modules/@keystonehq/metamask-airgapped-keyring/dist/metamaskkeyring.d.ts","../../../node_modules/@keystonehq/metamask-airgapped-keyring/dist/index.d.ts","../../../node_modules/@metamask/browser-passworder/dist/index.d.ts","../../message-manager/dist/types/abstractmessagemanager.d.ts","../../controller-utils/dist/types/types.d.ts","../../controller-utils/dist/types/constants.d.ts","../../../node_modules/@metamask/eth-query/index.d.ts","../../../node_modules/@types/bn.js/index.d.ts","../../controller-utils/dist/types/util.d.ts","../../../node_modules/@spruceid/siwe-parser/dist/abnf.d.ts","../../../node_modules/@spruceid/siwe-parser/dist/utils.d.ts","../../../node_modules/@spruceid/siwe-parser/dist/parsers.d.ts","../../controller-utils/dist/types/siwe.d.ts","../../controller-utils/dist/types/index.d.ts","../../message-manager/dist/types/personalmessagemanager.d.ts","../../message-manager/dist/types/typedmessagemanager.d.ts","../../message-manager/dist/types/encryptionpublickeymanager.d.ts","../../message-manager/dist/types/decryptmessagemanager.d.ts","../../message-manager/dist/types/index.d.ts","../../keyring-controller/dist/types/keyringcontroller.d.ts","../../keyring-controller/dist/types/index.d.ts","../../../node_modules/@metamask/object-multiplex/dist/substream.d.ts","../../../node_modules/@metamask/object-multiplex/dist/objectmultiplex.d.ts","../../../node_modules/@metamask/object-multiplex/dist/index.d.ts","../../../node_modules/@metamask/post-message-stream/dist/utils.d.ts","../../../node_modules/@metamask/post-message-stream/dist/basepostmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/window/windowpostmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/webworker/webworkerpostmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/webworker/webworkerparentpostmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-process/processparentmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-process/processmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-thread/threadparentmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/node-thread/threadmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/runtime/browserruntimepostmessagestream.d.ts","../../../node_modules/@metamask/post-message-stream/dist/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/array.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/auxiliary-files.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/virtual-file/virtualfile.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/virtual-file/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/base64.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/bytes.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/caveats.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/checksum.d.ts","../../../node_modules/cron-parser/types/common.d.ts","../../../node_modules/cron-parser/types/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/cronjob.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/deep-clone.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/default-endowments.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/derivation-paths.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/entropy.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/errors.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/handler-types.d.ts","../../../node_modules/@metamask/snaps-sdk/jsx.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/handlers.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/iframe.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/json.d.ts","../../../node_modules/nanoid/index.d.ts","../../approval-controller/dist/types/approvalcontroller.d.ts","../../approval-controller/dist/types/errors.d.ts","../../approval-controller/dist/types/index.d.ts","../../../node_modules/@types/deep-freeze-strict/index.d.ts","../../permission-controller/src/permission-middleware.ts","../../permission-controller/src/subjectmetadatacontroller.ts","../../permission-controller/src/utils.ts","../../permission-controller/src/permissioncontroller.ts","../../permission-controller/src/permission.ts","../../permission-controller/src/errors.ts","../../permission-controller/src/caveat.ts","../../permission-controller/src/rpc-methods/getpermissions.ts","../../permission-controller/src/rpc-methods/requestpermissions.ts","../../permission-controller/src/rpc-methods/revokepermissions.ts","../../permission-controller/src/rpc-methods/index.ts","../../permission-controller/src/index.ts","../../../node_modules/@metamask/snaps-utils/dist/types/json-rpc.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/structs.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/manifest/validation.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/manifest/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/localization.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/logging.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/namespace.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/path.d.ts","../../../node_modules/@metamask/snaps-registry/dist/verify.d.ts","../../../node_modules/@metamask/snaps-registry/dist/index.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/types.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/snaps.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/strings.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/ui.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/validation.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/versions.d.ts","../../../node_modules/@metamask/snaps-utils/dist/types/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/timer.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/executionservice.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/abstractexecutionservice.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/proxypostmessagestream.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/iframe/iframeexecutionservice.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/iframe/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/proxy/proxyexecutionservice.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/offscreen/offscreenexecutionservice.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/offscreen/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/webworker/webworkerexecutionservice.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/webworker/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/services/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/npm.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/location.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/http.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/local.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/location/index.d.ts","../../../node_modules/@xstate/fsm/lib/types.d.ts","../../../node_modules/@xstate/fsm/lib/index.d.ts","../../../node_modules/@types/punycode/index.d.ts","../../../node_modules/fastest-levenshtein/mod.d.ts","../../phishing-controller/src/utils.ts","../../phishing-controller/src/phishingdetector.ts","../../phishing-controller/src/phishingcontroller.ts","../../phishing-controller/src/index.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/interface/snapinterfacecontroller.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/interface/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/types/encryptor.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/types/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/registry/registry.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/registry/json.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/registry/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/snapcontroller.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/selectors.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/snaps/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/utils.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/cronjob/cronjobcontroller.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/cronjob/index.d.ts","../../../node_modules/@metamask/snaps-controllers/dist/types/index.d.ts","../../accounts-controller/dist/types/accountscontroller.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../accounts-controller/dist/types/utils.d.ts","../../accounts-controller/dist/types/index.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/types.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/createeventemitterproxy.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/createswappableproxy.d.ts","../../../node_modules/@metamask/swappable-obj-proxy/dist/index.d.ts","../../../node_modules/loglevel/index.d.ts","../../network-controller/dist/types/constants.d.ts","../../eth-json-rpc-provider/dist/types/safe-event-emitter-provider.d.ts","../../eth-json-rpc-provider/dist/types/provider-from-engine.d.ts","../../eth-json-rpc-provider/dist/types/provider-from-middleware.d.ts","../../eth-json-rpc-provider/dist/types/index.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/blocktracker.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/pollingblocktracker.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/subscribeblocktracker.d.ts","../../../node_modules/@metamask/eth-block-tracker/dist/index.d.ts","../../network-controller/dist/types/types.d.ts","../../network-controller/dist/types/create-auto-managed-network-client.d.ts","../../network-controller/dist/types/networkcontroller.d.ts","../../network-controller/dist/types/create-network-client.d.ts","../../network-controller/dist/types/index.d.ts","../../polling-controller/dist/types/types.d.ts","../../polling-controller/dist/types/blocktrackerpollingcontroller.d.ts","../../polling-controller/dist/types/staticintervalpollingcontroller.d.ts","../../polling-controller/dist/types/index.d.ts","../../gas-fee-controller/dist/types/gasfeecontroller.d.ts","../../gas-fee-controller/dist/types/index.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/mutexinterface.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/mutex.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/semaphoreinterface.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/semaphore.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/withtimeout.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/tryacquire.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/errors.d.ts","../../../node_modules/@metamask/nonce-tracker/node_modules/async-mutex/lib/index.d.ts","../../../node_modules/@metamask/nonce-tracker/dist/noncetracker.d.ts","../../../node_modules/@metamask/nonce-tracker/dist/index.d.ts","../../../node_modules/async-mutex/lib/mutexinterface.d.ts","../../../node_modules/async-mutex/lib/mutex.d.ts","../../../node_modules/async-mutex/lib/semaphoreinterface.d.ts","../../../node_modules/async-mutex/lib/semaphore.d.ts","../../../node_modules/async-mutex/lib/withtimeout.d.ts","../../../node_modules/async-mutex/lib/tryacquire.d.ts","../../../node_modules/async-mutex/lib/errors.d.ts","../../../node_modules/async-mutex/lib/index.d.ts","../../../node_modules/eth-method-registry/dist/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../src/logger.ts","../../../node_modules/fast-json-patch/module/helpers.d.ts","../../../node_modules/fast-json-patch/module/core.d.ts","../../../node_modules/fast-json-patch/module/duplex.d.ts","../../../node_modules/fast-json-patch/index.d.ts","../src/types.ts","../src/utils/gas-flow.ts","../src/constants.ts","../src/utils/utils.ts","../src/utils/swaps.ts","../src/utils/gas-fees.ts","../src/gas-flows/defaultgasfeeflow.ts","../src/gas-flows/lineagasfeeflow.ts","../../../node_modules/@ethersproject/bytes/lib/index.d.ts","../../../node_modules/@ethersproject/bignumber/lib/bignumber.d.ts","../../../node_modules/@ethersproject/bignumber/lib/fixednumber.d.ts","../../../node_modules/@ethersproject/bignumber/lib/index.d.ts","../../../node_modules/@ethersproject/abi/lib/fragments.d.ts","../../../node_modules/@ethersproject/abi/lib/coders/abstract-coder.d.ts","../../../node_modules/@ethersproject/abi/lib/abi-coder.d.ts","../../../node_modules/@ethersproject/properties/lib/index.d.ts","../../../node_modules/@ethersproject/abi/lib/interface.d.ts","../../../node_modules/@ethersproject/abi/lib/index.d.ts","../../../node_modules/@ethersproject/networks/lib/types.d.ts","../../../node_modules/@ethersproject/networks/lib/index.d.ts","../../../node_modules/@ethersproject/transactions/lib/index.d.ts","../../../node_modules/@ethersproject/web/lib/index.d.ts","../../../node_modules/@ethersproject/abstract-provider/lib/index.d.ts","../../../node_modules/@ethersproject/abstract-signer/lib/index.d.ts","../../../node_modules/@ethersproject/contracts/lib/index.d.ts","../../../node_modules/@ethersproject/providers/lib/formatter.d.ts","../../../node_modules/@ethersproject/providers/lib/base-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/json-rpc-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/websocket-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/url-json-rpc-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/alchemy-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/ankr-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/cloudflare-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/etherscan-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/fallback-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/ipc-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/infura-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/json-rpc-batch-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/nodesmith-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/pocket-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/web3-provider.d.ts","../../../node_modules/@ethersproject/providers/lib/index.d.ts","../src/gas-flows/oraclelayer1gasfeeflow.ts","../src/gas-flows/optimismlayer1gasfeeflow.ts","../src/gas-flows/scrolllayer1gasfeeflow.ts","../src/gas-flows/testgasfeeflow.ts","../src/utils/etherscan.ts","../src/helpers/etherscanremotetransactionsource.ts","../src/utils/layer1-gas-fee-flow.ts","../src/helpers/gasfeepoller.ts","../src/helpers/incomingtransactionhelper.ts","../src/helpers/pendingtransactiontracker.ts","../src/helpers/multichaintrackinghelper.ts","../src/utils/external-transactions.ts","../src/utils/gas.ts","../src/utils/history.ts","../src/utils/nonce.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/abierc20.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/abierc721.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/abierc1155.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/abis/fiattokenv2.d.ts","../../../node_modules/@metamask/metamask-eth-abis/dist/index.d.ts","../src/errors.ts","../src/utils/simulation-api.ts","../src/utils/simulation.ts","../src/utils/transaction-type.ts","../src/utils/validation.ts","../src/transactioncontroller.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/jest-diff/build/cleanupsemantic.d.ts","../../../node_modules/pretty-format/build/types.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/difflines.d.ts","../../../node_modules/jest-diff/build/printdiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/jest-when/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/pbkdf2/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/secp256k1/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"70bbfaec021ac4a0c805374225b55d70887f987df8b8dd7711d79464bb7b4385","869089d60b67219f63e6aca810284c89bae1b384b5cbc7ce64e53d82ad223ed5","fe8f00e1ffe6c8069f2568844debb342a661980c30e52b132f002b93f66de47e",{"version":"f31113ac9492fdd6e78bf6151b338c92e5b1837be426ef4aa0648ce82d13b518","affectsGlobalScope":true},"62a0875a0397b35a2364f1d401c0ce17975dfa4d47bf6844de858ae04da349f9","ee7491d0318d1fafcba97d5b72b450eb52671570f7a4ecd9e8898d40eaae9472","e3e7d217d89b380c1f34395eadc9289542851b0f0a64007dfe1fb7cf7423d24e","fd79909e93b4d50fd0ed9f3d39ddf8ba0653290bac25c295aac49f6befbd081b","345a9cc2945406f53051cd0e9b51f82e1e53929848eab046fdda91ee8aa7da31","9debe2de883da37a914e5e784a7be54c201b8f1d783822ad6f443ff409a5ea21","dee5d5c5440cda1f3668f11809a5503c30db0476ad117dd450f7ba5a45300e8f","f5e396c1424c391078c866d6f84afe0b4d2f7f85a160b9c756cd63b5b1775d93","5caa6f4fff16066d377d4e254f6c34c16540da3809cd66cd626a303bc33c419f","730d055528bdf12c8524870bb33d237991be9084c57634e56e5d8075f6605e02","5b3cd03ae354ea96eff1f74d7c410fe4852e6382227e8b0ecf87ab5e3a5bbcd4","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"056097110efd16869ec118cedb44ecbac9a019576eee808d61304ca6d5cb2cbe","affectsGlobalScope":true},"f51b4042a3ac86f1f707500a9768f88d0b0c1fc3f3e45a73333283dea720cdc6",{"version":"6fb8358e10ed92a7f515b7d79da3904c955a3ffd4e14aa9df6f0ea113041f1cf","affectsGlobalScope":true},"45c831238c6dac21c72da5f335747736a56a3847192bf03c84b958a7e9ec93e2","661a11d16ad2e3543a77c53bcd4017ee9a450f47ab7def3ab493a86eae4d550c",{"version":"8cdc646cec7819581ef343b83855b1bfe4fe674f2c84f4fb8dc90d82fb56bd3a","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","9dd56225cc2d8cb8fe5ceb0043ff386987637e12fecc6078896058a99deae284","2375ed4b439215aa3b6d0c6fd175c78a4384b30cb43cbadaecbf0a18954c98cb","7693b90b3075deaccafd5efb467bf9f2b747a3075be888652ef73e64396d8628","41231da15bb5e3e806a8395bd15c7befd2ec90f9f4e3c9d0ae1356bccb76dbb0","fccfef201d057cb407fa515311bd608549bab6c7b8adcf8f2df31f5d3b796478",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},"5f20d20b7607174caf1a6da9141aeb9f2142159ae2410ca30c7a0fccd1d19c99",{"version":"464762c6213566d072f1ced5e8e9a954785ec5e53883b7397198abb5ef5b8f71","affectsGlobalScope":true},"6387920dc3e18927335b086deec75bf8e50f879a5e273d32ee7bb7a55ba50572","9bba37424094688c4663c177a1379b229f919b8912889a472f32fdc5f08ddb4d","29a4be13b3a30d3e66667b75c58ec61fb2df8fa0422534fdee3cfb30c5dbf450","83366d901beda79d6eb37aaaf6ca248dcd88946302b2a7d975590783be51e88e","bf268a0aea37ad4ae3b7a9b58559190b6fc01ea16a31e35cd05817a0a60f895a","43ec77c369473e92e2ecebf0554a0fdaa9c256644a6070f28228dfcceec77351",{"version":"d7dad6db394a3d9f7b49755e4b610fbf8ed6eb0c9810ae5f1a119f6b5d76de45","affectsGlobalScope":true},"95ed02bacb4502c985b69742ec82a4576d4ff4a6620ecc91593f611d502ae546","bf755525c4e6f85a970b98c4755d98e8aa1b6dbd83a5d8fcc57d3d497351b936","dd67d2b5e4e8a182a38de8e69fb736945eaa4588e0909c14e01a14bd3cc1fd1e",{"version":"28084e15b63e6211769db2fe646d8bc5c4c6776321e0deffe2d12eefd52cb6b9","affectsGlobalScope":true},{"version":"aed37dabf86c99d6c8508700576ecede86688397bc12523541858705a0c737c2","affectsGlobalScope":true},"cc6ef5733d4ea6d2e06310a32dffd2c16418b467c5033d49cecc4f3a25de7497","94768454c3348b6ebe48e45fbad8c92e2bb7af4a35243edbe2b90823d0bd7f9a","0be79b3ff0f16b6c2f9bc8c4cc7097ea417d8d67f8267f7e1eec8e32b548c2ff","1c61ffa3a71b77363b30d19832c269ef62fba787f5610cac7254728d3b69ab2e","84da3c28344e621fd1d591f2c09e9595292d2b70018da28a553268ac122597d4","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","6e191fea1db6e9e4fa828259cf489e820ec9170effff57fb081a2f3295db4722","aed943465fbce1efe49ee16b5ea409050f15cd8eaf116f6fadb64ef0772e7d95","70d08483a67bf7050dbedace398ef3fee9f436fcd60517c97c4c1e22e3c6f3e8","c40fdf7b2e18df49ce0568e37f0292c12807a0748be79e272745e7216bed2606",{"version":"e933de8143e1d12dd51d89b398760fd5a9081896be366dad88a922d0b29f3c69","affectsGlobalScope":true},"4e228e78c1e9b0a75c70588d59288f63a6258e8b1fe4a67b0c53fe03461421d9","b38d55d08708c2410a3039687db70b4a5bfa69fc4845617c313b5a10d9c5c637","205d50c24359ead003dc537b9b65d2a64208dfdffe368f403cf9e0357831db9e","1265fddcd0c68be9d2a3b29805d0280484c961264dd95e0b675f7bd91f777e78",{"version":"a05e2d784c9be7051c4ac87a407c66d2106e23490c18c038bbd0712bde7602fd","affectsGlobalScope":true},{"version":"df90b9d0e9980762da8daf8adf6ffa0c853e76bfd269c377be0d07a9ad87acd2","affectsGlobalScope":true},"cf434b5c04792f62d6f4bdd5e2c8673f36e638e910333c172614d5def9b17f98","1d65d4798df9c2df008884035c41d3e67731f29db5ecb64cd7378797c7c53a2f","0faee6b555890a1cb106e2adc5d3ffd89545b1da894d474e9d436596d654998f","c6c01ea1c42508edf11a36d13b70f6e35774f74355ba5d358354d4a77cc67ea1","867f95abf1df444aab146b19847391fc2f922a55f6a970a27ed8226766cee29f",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b0297b09e607bec9698cac7cf55463d6731406efb1161ee4d448293b47397c84","175323e2a79a6076e0bada8a390d535a3ea817158bf1b1f46e31efca9028a0a2","7a10053aadc19335532a4d02756db4865974fd69bea5439ddcc5bfdf062d9476","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","aed9e712a9b168345362e8f3a949f16c99ca1e05d21328f05735dfdbb24414ef","b04fe6922ed3db93afdbd49cdda8576aa75f744592fceea96fb0d5f32158c4f5","ed8d6c8de90fc2a4faaebc28e91f2469928738efd5208fb75ade0fa607e892b7","d7c52b198d680fe65b1a8d1b001f0173ffa2536ca2e7082431d726ce1f6714cd","c07f251e1c4e415a838e5498380b55cfea94f3513229de292d2aa85ae52fc3e9","0ed401424892d6bf294a5374efe512d6951b54a71e5dd0290c55b6d0d915f6f7","b945be6da6a3616ef3a250bfe223362b1c7c6872e775b0c4d82a1bf7a28ff902","beea49237dd7c7110fabf3c7509919c9cb9da841d847c53cac162dc3479e2f87","0f45f8a529c450d8f394106cc622bff79e44a1716e1ac9c3cc68b43f7ecf65ee","c624ce90b04c27ce4f318ba6330d39bde3d4e306f0f497ce78d4bda5ab8e22ca","9b8253aa5cb2c82d505f72afdbf96e83b15cc6b9a6f4fadbbbab46210d5f1977","86a8f52e4b1ac49155e889376bcfa8528a634c90c27fec65aa0e949f77b740c5","aab5dd41c1e2316cc0b42a7dd15684f8582d5a1d16c0516276a2a8a7d0fecd9c","59948226626ee210045296ba1fc6cb0fe748d1ff613204e08e7157ab6862dee7","ec3e54d8b713c170fdc8110a7e4a6a97513a7ab6b05ac9e1100cb064d2bb7349","43beb30ecb39a603fde4376554887310b0699f25f7f39c5c91e3147b51bb3a26","666b77d7f06f49da114b090a399abbfa66d5b6c01a3fd9dc4f063a52ace28507","31997714a93fbc570f52d47d6a8ebfb021a34a68ea9ba58bbb69cdec9565657e","6032e4262822160128e644de3fc4410bcd7517c2f137525fd2623d2bb23cb0d3","8bd5c9b1016629c144fd228983395b9dbf0676a576716bc3d316cab612c33cd5","2ed90bd3925b23aed8f859ffd0e885250be0424ca2b57e9866dabef152e1d6b7","93f6bd17d92dab9db7897e1430a5aeaa03bcf51623156213d8397710367a76ce","3f62b770a42e8c47c7008726f95aa383e69d97e85e680d237b99fcb0ee601dd8","5b84cfe78028c35c3bb89c042f18bf08d09da11e82d275c378ae4d07d8477e6c","75b22c74010ba649de1a1676a4c4b8b5bb4294fecd05089e2094429b16d7840c","5615ccf831db2ffc82145243081ebdb60ea8e1005ee8f975d1c0c1401a9c894e","38682ed3630bb6ecdace80d5a9adc811fc20a419f1940446e306c3a020d083b9","cc182e6e4f691cd6f7bf7cb491247a4c7818f9f1cb2db1d45c65ff906e3f741b","a50599c08934a62f11657bdbe0dc929ab66da1b1f09974408fd9a33ec1bb8060","5a20e7d6c630b91be15e9b837853173829d00273197481dc8d3e94df61105a71","8d478048d71cc16f806d4b71b252ecb67c7444ccf4f4b09b29a312712184f859","e0eda929c6b9b628cdeb0e54cd3582cb97e64f28aab34612fc1431c545899584","9df4662ca3dbc2522bc115833ee04faa1afbb4e249a85ef4a0a09c621346bd08","b25d9065cf1c1f537a140bbc508e953ed2262f77134574c432d206ff36f4bdbf","1b103313097041aa9cd705a682c652f08613cb5cf8663321061c0902f845e81c","68ccec8662818911d8a12b8ed028bc5729fb4f1d34793c4701265ba60bc73cf4","5f85b8b79dc4d36af672c035b2beb71545de63a5d60bccbeee64c260941672ab","b3d48529ae61dc27d0bfbfa2cb3e0dff8189644bd155bdf5df1e8e14669f7043","40fe4b689225816b31fe5794c0fbf3534568819709e40295ead998a2bc1ab237","f65b5e33b9ad545a1eebbd6afe857314725ad42aaf069913e33f928ab3e4990a","fb6f2a87beb7fb1f4c2b762d0c76a9459fc91f557231569b0ee21399e22aa13d","31c858dc85996fac4b7fa944e1016d5c72f514930a72357ab5001097bf6511c7","3de30a871b3340be8b679c52aa12f90dd1c8c60874517be58968fdbcc4d79445","6fd985bd31eaf77542625306fb0404d32bff978990f0a06428e5f0b9a3b58109","980d21b0081cbf81774083b1e3a46f4bbdcd2b68858df0f66d7fad9c82bc34bc","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","b17f3bb7d8333479c7e45e5f3d876761b9bca58f97594eca3f6a944fd825e632","3c1f1236cce6d6e0c4e2c1b4371e6f72d7c14842ecd76a98ed0748ee5730c8f3","6d7f58d5ea72d7834946fd7104a734dc7d40661be8b2e1eaced1ddce3268ebaf","4c26222991e6c97d5a8f541d4f2c67585eda9e8b33cf9f52931b098045236e88","277983d414aa99d78655186c3ee1e1c38c302e336aff1d77b47fcdc39d8273fe","47383b45796d525a4039cd22d2840ac55a1ff03a43d027f7f867ba7314a9cf53","6548773b3abbc18de29176c2141f766d4e437e40596ee480447abf83575445ad","6ddd27af0436ce59dd4c1896e2bfdb2bdb2529847d078b83ce67a144dff05491","816264799aef3fd5a09a3b6c25217d5ec26a9dfc7465eac7d6073bcdc7d88f3f","4df0891b133884cd9ed752d31c7d0ec0a09234e9ed5394abffd3c660761598db","b603b62d3dcd31ef757dc7339b4fa8acdbca318b0fb9ac485f9a1351955615f9","e642bd47b75ad6b53cbf0dfd7ddfa0f120bd10193f0c58ec37d87b59bf604aca","be90b24d2ee6f875ce3aaa482e7c41a54278856b03d04212681c4032df62baf9","78f5ff400b3cb37e7b90eef1ff311253ed31c8cb66505e9828fad099bffde021","372c47090e1131305d163469a895ff2938f33fa73aad988df31cd31743f9efb6","71c67dc6987bdbd5599353f90009ff825dd7db0450ef9a0aee5bb0c574d18512","6f12403b5eca6ae7ca8e3efe3eeb9c683b06ce3e3844ccfd04098d83cd7e4957","282c535df88175d64d9df4550d2fd1176fd940c1c6822f1e7584003237f179d3","c3a4752cf103e4c6034d5bd449c8f9d5e7b352d22a5f8f9a41a8efb11646f9c2","11a9e38611ac3c77c74240c58b6bd64a0032128b29354e999650f1de1e034b1c","4ed103ca6fff9cb244f7c4b86d1eb28ce8069c32db720784329946731badb5bb","d738f282842970e058672663311c6875482ee36607c88b98ffb6604fba99cb2a","ec859cd8226aa623e41bbb47c249a55ee16dc1b8647359585244d57d3a5ed0c7","8891c6e959d253a66434ff5dc9ae46058fb3493e84b4ca39f710ef2d350656b1","c4463cf02535444dcbc3e67ecd29f1972490f74e49957d6fd4282a1013796ba6","0cb0a957ff02de0b25fd0f3f37130ca7f22d1e0dea256569c714c1f73c6791f8","2f5075dc512d51786b1ba3b1696565641dfaae3ac854f5f13d61fa12ef81a47e","ca3353cc82b1981f0d25d71d7432d583a6ef882ccdea82d65fbe49af37be51cb","50679a8e27aacf72f8c40bcab15d7ef5e83494089b4726b83eec4554344d5cdc","45351e0d51780b6f4088277a4457b9879506ee2720a887de232df0f1efcb33d8","e2d6963e7bf7186e30b7a4c9859aba4e96eda6d1be537e5b1a43bdddc7e9dc8f","10afdd7bba6ec9b7f95a4b419b2dbb64245fea4a61bbe7d68e2f841b414f7312","413121b26b3bd9f7fea237f15f564ee2b95bcd0cceec1b1621075375ccc0c0e0","d2af215963d01cef397ce8fa2f7ad08ee8beffdd39fe14b96021ddf26554b59f","2fc9848431d0f5e2b49bb312aaf07dd2d5a34300a2ced60200a2da49e6a82b43","c5ee2b685431ea2b9aacd9bb9e15cac1ecfa5c448972b188432313354d47c848","3e69be1137d88eb0730332aed359caedea4a27903da15dbe6a1615fa11206807","2283d079c3945b6e5ca8b9355311a213e03b74bffc65a3234c3c141a0a795700","f47272f05bd57f4356abc81232bded724d13e54f0fd801e0fb93a58237db1829","07ae8e9890f49ef6ebe629e339ac590025606a1e96754965bbb2bf889199ced2","d5c19655468e29f60c871b21e73af8ebc653f736e7123ade916f22c4a5f80ce5","6a8649609161e2794b383ba275b0a6cb4a072dde7b954648f83dc6cdf1bfe4a8","601d4a40a69c782addaf84185d4547568ec072095ab9976610d89922d1291f8b","d5c19655468e29f60c871b21e73af8ebc653f736e7123ade916f22c4a5f80ce5","b5c9c8c4a2cd1cb9f76d849fb472d475c3cebdd48306414a4a19bd11d82c4055","b61e6a808f5f50873ac03f35d5a38fa8d4dd23a24f80ab69df1a032e8c71562d","c8be9283a381044a392a0687af5d98d3f51cbada2320b1801a82c948b6e39499","85052c71d72b9b017c88179f57a464d66e22619c7acd7d83b117a79cf1608979","502cd7c30fe21e2c36b62913d0cb5d20affc8779b3ad40881b26d90a22de3aaa","6d3101b183ea67ef606b93fe42127f30b2db5ac3b72c34ca9d6d8b00eb85d0f6","f5d7a36ff056cc314b0f61c89a03c4c36a24183b246e61d958e75e86521304cd","ff30e8237e23dde68041b5f09526ee86835b12c5d8b6421c1153093fdbeb9438","f516fc1e77e5ffd71fbe705b679797c3c5eb76bf76a88549e6316a29f3e197f7","b5b1110565ac688b660a893654a6c1bce6747f3aa6f847001a8a5ff4412394ba","3a971ea3e36685b96f24fbd53a94ad8dc061711b84e51fde4cf201f7041e618d","9b6c162d20e2ad4abdcff61a24082564ac59e63092220618162aef6e440c9228","7804ff981554ba1a0592481072806fc39dc1484791beda43eb7a60e16e70a360","fcc8beef29f39f09b1d9c9f99c42f9fed605ab1c28d2a630185f732b9ba53763","d6e6620a30d582182acc3f0a992a0c311adc589f111096aea11ab83fc09a5ccc","6213b8f686f56beab22b59a0f468590fd3a4c5fa931236a017efeca91d7c9584","c451cec9a588b1f105a5ea2c6063d4fca112b9d70105cacdadda0e1ef67e9379","cb047832dc68f5a2c41c62c5e95ddcacbae3a8b034d40cd15319a8cb7f25104a","980336ccdfc3c08f3c3b201aa6662e6016e20f15847f8465b68f3e8e67b4665c","5a3493939995f46ff3d9073cd534fb8961c3bf4e08c71db27066ff03d906dea8","8f333214062532989f190aed5f99c62eb820722e41956e8229e17cd246fbdd10","d1f010c19eb9c8190bd0859fa3b6f4975543b912b8b85e20bbb0b5bfbdf4d2b3","de4ccc96cef3f97fab148640799abb32a24b567a902a8233913f98481e3131bf",{"version":"801934aa449fe6df584bccdcc5d5b9280295cb7ac84918b6014fc5086e6f9ff6","affectsGlobalScope":true},"5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","f07a137bbe2de7a122c37bfea00e761975fb264c49f18003d398d71b3fb35a5f","6af760fb9ea02dc807c5053d8aee86389c4fce72fbb26af7b9568cac6c4710d5","c62c4ba5e910b4523f7e7adf4a55ec45c2bac99d9d8e9b0fe0c2a800a6f641b9","92131434f876fdd6fcbc40bd54a9d7500c66974362b16bd42641f990468587f4","8cf023c0bd57992fdd2ce6a7030a1874f49c8edc62eaffa9bfffcf18d2a2a1a2","8ea8f3040e38fb50d7dc3653f3b8a0dbb5244e82111576f99ce096bdc0fbf94c","48ed788ad126545a6156fcc37cd3bcf17de18a3e3fe6b6ef62cfb8140d1a45a2","63c271a745f628ffd4bd7ad0a63b021c362c9bd6bf8b18441a7162892395a214","8d3457e6c7c5cb890729fb60cb8db18f261226a3ea3ff6a4db4b84ea78313ace","9f9e5bae412fa5909fae636d6733aee27a108cc2ed5b13980611016336774d3c","662fe197bba64bd3f17ee118058cd2d0d2dbe33d7c0c865fd6365d90bfc44e1e","030519c351f800551cac2658038804969ca4584d2c0175a710602ac234ca1340","0278a6939ca83cd040b08ff8c5fc7838b6693ddc52f22526bf158e6b10e0246c","c2d6206e5ba4fd3063b01218c2b3b997afc1cfbeb49fcee991fa8595842ce53d","6a8096993458a3d71229031aa7415974eb5b47b320213e29660adfb519d6a3f4","cb7996a1af5b1d276483cd0c9b9de6540eff021abc90a720511ff4464519a2ff","9df6ec68878d65bc690ea3a33ce3ef5aa8254c36bc5f8346c0c2fd1f3b88a35c","a4fad04c4acc8a4b195cbbccef4c55019104753d547d5c94441643ccc89108a0","0244c23ea642361f7c192c1f0cfff9c12cfa5f51f9b155edd5c0a89fef308d34","c7298e68632ab03155f6de963d3d09cc4a5874c28a81524f56c667d8a052e538","3c69a83bde847af6fc3a53e1bb6b13cd06d38a27a142814b8dacc374f3b93284","5b46f7113f54565e7ffc83f2b474f557a1f54c7e5946769d5be220454656be73","fb58035d39c5759283cb73cfb3548aefe370aa3ad4e81fdb4e46f0979eb7669f","1311c325948b2d5576cebc70b1bf968d3446b4630802bef54120daf04ce1f625","d0b3609e8e7afed0fd0570152255458407e67249b94f6603afdfd68599423f21","17f4c5a1d6eaa87ea27eadcdff9085af3190533d98f799dda79a3af6f9a630ea","3e6f734ddf40e2e99ff7fff9568b7d9720663af9a0632c26a352c8d3270a3f0e","ec13f78303abcf550c5569dfae1446b8ceb89050f68ce04491481e72e8122ae2","a3fc57dbaa7f1efb010399ad4ef4fd9b462aa4e93bf74a9a34b099b97ffcc9cb","ffddd7ec6a450b0cb6f2f73f80de1df963ead312d7c81a8440268f34146ecb87","5d6a36ca0087fd6876df654d1b4192f0e402adfde994ad47e5c065da33692f9c","eb157a09c5f543d98644e2a99a785f9e0e91f054f9fecbf1c3e15831ff5d63a7","edd5530e2b1ccdf65093296e40a8634fcb11ecda3c164c31383a8c34cb04bc9d","9dfaf96d090fe8d96143465d85b4837661ae535143eea9ef99cd20df2e66338e","209d45c27e03c1417c42985252de6c25a2ec23abdc199d88e6139c88b93abd11","0ee5cdba58cfde3012bb9ff2e9edcc4e35a651373a2aa2c83ff9eb7df635419a","540f4dca27ea5a232828b6d91e1b2fce2720bdabaa4c1f3fbf59b672cc58bd8a","ba086b99d545ec6c9ff356989f076b5652ea1b09bcc65b87dfc43a5195a2efcc","c85d9776b36166b928ab1488d9224ebf970d41b0a35f09a3ee0b9bee3e698061","683196f606c5dab1c8c4a24a66d26e00f16f2d4b2a5abe25ebedd37d2954f930","9c3a1b01cba1238fb723ce06b6c163ef6c53be755394406782564d5c42c636b2","6e795e6270d39e918c7a0e62ac73793cda06fcf4b3692ee46583e15f5bf57ab8","0e821ef1eb67fa6144ea4de4277d913f5b1982d7407afd5f93754a8239d41554","5c09195ef359ffa9c6bbdb4fefb101d87ede4b9e9c28213faf5b45d102e4c609","80b4d93a4dcc90a12f6f4bb7c6851a8182ae29e556716d0d80b5c012a5ef554a","2556ef9d1820e0b6bbca6dd65a50ea64f525c4d8247ab50dff44c3f0d14a5643","cbd1c836db190d6e3add07165afc228f04e1f6170e1fe3aa5e6fc24a7e9573a3","9b13881feb958237232586d888a10a39d47cdffe3ee34688ed41888fa7baad94","122fe82cf5af80f0b26832b258b537b7dfe3ec28449c301b259ab10204b50d45","c467dada8fea6d60dff8a8be2675f737cacc76e14e50b72daa0f0710376df84b","9cb80bba611c2dd155a446ce424fe4bb1df2129751bc9416b7e42c055d1ddbff","6ee568039016b81ed70292a595ab781ab978cba4243a5fe49507040ee4f7ac8a","043783bebe87efb440183c9ebc8c4fdc1bb92060a5a0f7ce847e30dee7013ac3","e3dc0a97a59dea936b4fb7b1f6f4117b4aac9c86d0cd08b69bab2d0532a8a5e3","5d897601f8a4fe913057019d8211b99b06e3138f625a0cfb601d074f4278271d","a68bb369c4ba8ab43a78f3fad2d3ec130e1418bc946521b9c84e9b336d6e88f1","65f219e6e1f9d27c677a49d41ae7989b83bf6baa56debbeb50d95c3ab21632e2","cfde5d194dd858ad68f910defaed5b0d28730f8bf38359a9265a93ab29bc7bef","c89354ae268153d965011e484150f0c92faa87f3f66507c25b496973178e0400","f20aae41b169cddcbf3fde8ac380443182c8d7225194e788c404d9e11e6dc75d","a6f4816a634bb1ceb513634c1ef7c0535f461ed2565336eed69f6ac2babbe15b","c48566cb13403fca44192b4528e3f2ac993869d39526bd42cd2f2167c0285add","efae20e0c581240c7522e04829da4f0453ca263068596554d4b0e27878c7dfac","3af68ef927788cda7daab34be513fa4508229fdc6e5130d564a0a1ccb3fefafe","bbbd2cbb15a37d5f4dd54ad8c7c537d3df8352117523030fcec7dcbe62a05a58","b50d24ebc117f8805332e7e260e9587f572bb7b2ff0ca1ff6cfafb38015781f3","5cc8b8e18fe7fefab4b3c53a39467b5a0deb4200abae7f063ff0624b9e856c51","8e990781eb0107c25429b1274a31a4f3866a9a46290cce40f354b2a6e71c6c21","608c45069e89c4c8f0ab29f896cc93c6553808072d6304b23611b6c6de3c24bb","22cbabe752781b5f35482af9d1fcf1455cb1ece74e8b84700d4abcb44abe3776","b9ce4613536386a98897f1e3d8f61a851ce6cb34dc3c9db4f2ef5f55f007e9e1","a5d1209c7bf277af86281392d46e12ce3dd6052586053f757fb2e606cc75c0f3","31b5f53e3d57470830e87f9e03c02d4569ac81d4a758fdda75092f9a3f58beba","d765fbab22fd7003a65ed670100362ec1c90d55a772e6773a774135594e7ea41","c1f11d9b42bfb0823d34d93c58df91ffb6690b5a717b7d310d83f258f1784e58","775b207f00d4df5b3b0b536aa696d572cdd2cabe8ea18dd28e8b52f691fa2a55","f75cd30f162c2af5e5aca39c01c1a521bfa034fae523793de872815a3468bc08","0cf1123db73dabd86466a462375a6addae52f58d23030c6033f8aadc23539a36","e29cef4158591ed213b1c2cba8988237b1ff369f7a6ecd8cb8ac0302bad1fba8","5307876e4d0021ea01235eb2f7c24671f3d8b37590f4b446cd132a4e1dc9a335","92550acd737790dc60c4c130e6aac78656dd48a8334a4882f40e7f86bdf7a590","3df821880914f8bb3c8107b1107be75c8ddbe2120a2cefabbaf9b65936b5f4dd","f46ba7c6fa7fcc8b3d57c4618c18db3f4d8bfe1fcab5551d7f6d9a82cf4d6078","078b7043bea0968860374bf4671ed74dd9f6be4e28ab659517d81f74be463c51","68b139ebb9a7f3ee4ded6286d74f978a47968727665120f3bfc560476ce33c4d","56d02c29b2fd39b1b1a1265df291f3f98e6ec3e6119aff9f4cfa44fe888efaa7","2d01884891da6495cb4a2f060e4898209a507e711464c4c1480df85264e863ed","c485c6497f7587314c4c4a59b74850cbca4c0c4bc08146a918cfd237ef821dbb","e9eec004735b1bf7015edf5400aeb914a53132134d230e93786590d904d094cc","080b1aa93227952b4dd74b9d2c6e4f6002eb8403533749116a1c53bb9961c02d","874087eec1d457f6e3baf5ac46c42ea200e55040b394fac667aa3a64c49f5f6c","6e8a5b04a18abb192abc89d7219b9c6f633cb3136777ec808673a65f111ca749","4e7ac7e5dd58a6c29c724728b031669e3068b194b62c2b83f92e76a36cb34dbb","d74d2a92b54f95e47d2b76bd5ee516aab7ae93afb79cd34c6681dd29eb09e72a","747e6326a724bc54f799a466a5b5c4978a601a04a063a5bdabe150af2f25b9e2","b57e22e53b56cca7a57bfcfb234aa6a66f9b9e4c07159d7388f94f17a3eaee2c","e47709ec4d1618ef429648cd8ef967aef2005526b34fcbfac33037add347dc71","b81abb3e47fbbb3af41fa75bada89bbcfa4b0feed9a0d6d4b19ed1ce1033b53c","15b330546e9784461058e5fd6e2346bf272140fa6f0cda34e193ae501d8b17b1","4d8ce72fd080bf9a46bdcc274bcbacccedd66d84e203966b197ac25a96932183","73327e6ae34e3f6591877fb75b451cf620cbbd76ee2b678213a9f793633cd0d3","3f1ba2f69944fa346789db7f60d53c9bec00032de0d797967978dea42e77b941","3f5df31539fee4816b97d4e45b4344fbdaf3ca59f6df941f8d780ee441e92cc1","50aaf44eb4d0e086af13729b3471a0a7dce95ea35ebd21c762ba26e203134b2e","3857c1773b8503c3ca45b7bc09ac89c3930c85ce93021054503f73d5d9101b5c","72702bd07fd6fb3ef64aadbcb909103aadfe71ee76e9fdeb11e0c92693cff6cb","f0dd6f7c9783637655478db7d7caf6becd41a79d54482aa59578ce88ab38e9bf",{"version":"cd756ccdabf433dd02b84d755383e489f14b3c1aede0477783aa04830fd5d695","affectsGlobalScope":true},"a4c88dbecdf8ee0c79f5b7c2bf31cd77e593f5d78384e2b674f67d754a549a9e","9cbdff04326da794ba008c0fc977ab062d1fe3fa2e9759654c72ffbe54b64a7c","aa60f8d20d36116fe05edaab24adee3c275209f71b65e272692cf99daf9489e1","150855f967a6490161d5aeed4cc4adf31fcb8f5dbe54b75799c12b8687fc9cc2","79576487ac18e047e8192fc582ff488ce375fe4df0cb028a17f831cf42b976f2","47ddb601df40bfa01cebdd06ee8b87d0b72aa1259a4ceba3ad3b5cf68130112a","6b6392704ddb3f50e647dbbb716782bdd0cf8ea9cc134aae256a26223e632b47","afc3ad2a50f7f4de908e26fcf467e09ab8528c0e90f91e602b4865d953839228","df90b0c6b1d81851364c4d97fa23b91a993482bcf4a7bed7c7a24aa41632d494","db34610570eed46b8b72bc662a91261200b8578af0ac02781ce7d9aca99bc683","11ee9ab699b4619d217c640d917ca198f58066a86bd58c2917197d62aa6601e0","cf9d589d9e73bf32c8e7a6cae6b4a1cf9bef39e5594072533fdce985581a6ddc","959544feb1ca2df29eec6c500f27ea10f4885df245ebd8418fb4b87914614383","6548ab4b57eb9d092471a04513091673345f2fd95d5b876f600402ea8d603ee0","2793e8c6a023d26f78d6777a6d7f20fae3a9a8169863d46d8d54c73071851232","d0f11e830aa1350a31d9c00a0197243e9711e4882947aef53a96c629f405cb10","6610b9f45f1f71d2b1fb67df49cbcabe3f9e668a1ccb7d8328a51407b259ffb3","abbcc437e0792ab2fe08797ceca1ec85a95ec413c51612313b18ab8e75f690f6","e29d76ef1183ac0edf94b4712b6e51730c447c7e773e75ceb44a720b0c9a9fd9","4ee6dc3424998eede9a2a9b114acaaf7969cdda67baf82ba2c9cf88a8eec0ab1","8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","25139d6a726e0e19d9fc4fa3197367b4a82ec34a08a5ecf23963e142c202c0f3","e3328bffc8eab74665a4fe9c59d6f12f4c8570c3d858497e241eb37efe17dfcf","29389551e426a46421134b55182d6fcf5b143670998bf81db2619c1228235392","c18f7e16982695bdd04e3e183a327d116185f77f1a37b9b2e849d7d93269cd74","2cfb37011989c21dc70b91d521a2d5a4e0f18507f5f536b5dfe504edb15916e8","bb5e02df7aaec7a4ea642639a9963b24b8d9fd6798351f07d8c58616942fbcbf","299a899cb4d061f5d83843ec453e936e9659b2c435746823f90c40eddaef4745","d5610c0fd12870f644b0f42c1bcc4fa2295ac3e3ca01916bdb42c3bdc4c80c36","2c56a8e249b1f45dbdf973100cd37fe2ea68709573cf1fdf2e3052c593be68d8","3553da417ee7b07e388b13bd12a70a1c03e65a6132ba5427fe68f5b362373e6f","612358502042d351c227ba779fdcf6d875d827e424930e60297c533524e50668","d2b5be376ef162aa0c24a826e7dd2d77671a045c085e16d1c1276db4bdccbac7","c4138d8dcccedaff6621e009cf0a54a7bed2a5ad4c509a3513bccc4f417ef939","ad8747fe978dff3e80f4b12b48d37cc8dff11b61d04c035aefbc982ce21201ce","b154f789fd65298e1ba6cbba6944ea892d564c95f3d3700ed85baf8f80748473","c660265aedd7c5b236e2017e53095cb98da66200eb0e8d023b5bf713c36494e8","0efc36bf5c0daca6217fec7063359ccdab8c3a23bb405d25340fae22cf72d74f","5abff0c87d4f9c89715107042d4c73b68ef7a128759f451c8a0fc450cbaaf660","5a03308fbd1af441065149a84c692931bebc7e7735afc23be8684f4e10d3aa06","c787bf4f8f0abbf815cfbd348be41046f2b8f270be24fe7aa8a8fcdd2b7df8c2","e7a5191c663a3228f30104961d548b372e51c5936c01ffc8eddd262bb98d7d7c","43fdc9abe6f8640fda4cdc55a1ee5f666d3fce554277043df925c383137ddf69","f0b09665c9d52de465687fbd3cfb65111d3ffc59ae00c6f42654150f3db05518","72f8c078d06cff690e24ff2b0e118a9de2833dcebf7c53e762dcb505ddf36a68","9705efb0fd901180de84ca4dd11d86f87fd73f99d6a5660a664c048a7487e385","f9b9d0950fdfb90f57e3f045fe73dce7fa6e7921b37622fc12e64fcd90afbd0f","e61b36e7fde608f8bb4b9c973d81556553a715eaef42a181a16ddd7a28da4ac7","03b8389b222af729eae0fb3c33366dcbb1f5a0102ce319bf1d7d5ee987e59fd0","2bf6be7c04db280fdd9b786764f8650c23f9f4d533791cb25a11b25314b76a55","dbb5fc7edd36bfba95cc4dd564e4458276ced30eed18bc05fbda948b3fda8686","c2b556c7cff0dabce2e31cb373ac61c14d8ebc35f1086dff30b39e9ec5357d0d","f958af01131076e8af55d28c4835a51063226ab488ca8738fdee38aeef7d0d33","9f3797b01e3d83d4e4b875699ae984f380ca86aa0a0c9df43ac5bba1cb1f8b7b","752b15ad1b34887adeaa838fc55f5d4ca399026afd266d4ed4db0e3db02eae4e","778331eaea1093451e50be9844bd2b6937c3bb81b0b1ee700624c9774ecfcf2b","0ca0dfc9f657d0822eca9530c7870b22a1d2a5fc48182bdd4d0e6e88e4ad9c35","5c746f034288e6842dd1589b169dcfcc16c5ce5abbd928889ab67aea4fe0b501","92ce6dbbcc135cffd09a58e19fef34bf351391bec92c40d849e4e9997d475769","99e77d092fed72b6b8578d00c7af004f76e98b30ba99f1947535eb4c04a51676","b5ef52a9f9083724decc5d060f0b34e3a480deed71c32d55ca16c214eb4cc928","5d3d7938b2d7d0a9f851276741327c2ae4c013e7eb420fc3f7caed3b79c8f37f","14df6b81e50a035e9e391558cf30a0420d03e2eb42c7db9c57f44b818e5d5179","f100912a3785eed4a3d29c12f5910b101af9353454de5ddba9b4d43456c56dd1","446439eacf81a163fd7dfc53b28f80deca3d13b250d67639739aa25aa4491090","98034cd285344125f7165a3bb68246d38ab35fabe7f6d6a7c8f80407d31f548d","06b4a23064991251512df4edc12341d5bc69a17b942da18372312d383c90eee7","0f898802705f9a534b537f1be6c57265080e0abd6993d935554c255e6d56cc1a","745efa7b6e27b7216cccede166a822b56acc41b10a8090966c8cf2c96239cb83","6ab2a6257ae7bb05559841100c786c845fe465a90be7b904db9096c2fb14696b","6da6c94bdde76f309cf5823d2a4e77894423d51c80e9d6a7a6eb62998db39dbb","5d697a4b315cc5bb3042ae869abffd10c3b0d7b182cda0e4c45d8819937e5796","89b040dec8fcfc1de98827e1f4d4977e6ff5d3302c6790e9f10b54b916e1c742","6ee58aa536dabb19b09bc036f1abe83feb51e13d63b23d30b2d0631a2de99b8f","8aceb205dcc6f814ad99635baf1e40b6e01d06d3fe27b72fd766c6d0b8c0c600","299567f84bfedd1468dca2755a829cb19e607a6811673788807dc8921e211bc9","795d9fb85aad92221504db74dd179b506bd189bba0c104426f7e7bb8a66ffee5","1311bc194e0a69fe61031e852c1c0b439e2a2a3d1d5e2d8ff795499b9f283459","4b7ce19369d7e7fae76720c2c6c7f671bf3fa0f7093edb864f1ac358ca7c456c","c972ef44deca1fa8fab465915ffa00f82e126aacf3dfc8979c03b1b066ce5bb6","30285a1011c6d6b52f3ba3abb0a984be8148c05cdefb8eb6eb562335a3991f35","e0de9f50e80fed1cc161b50e8e68dc056e38df75a4ef667a06b1922e372de169","6a8b31be08b212d1fc96de0ddd1ea49f32382ba712fea24c70bb56447f643f82","19ac6d624e4c18de4584db4bbdbc55387dbe3d19b3c134e50346bdf165658a17","54e3798c2801e8f3bc7a825d3d26c6a80ce763e19e6cb0b714594c430ef72332","70b8333214aadaccda8d38435911d3e3a686e503837dfda6b8c3f8c83e05729b","fe849e916564b8172f31a547395516668f3c122bfe017f82e7140d8dac402208","d42c6e985bdb10a2aaa3dae14d9b0d8589e74a7c2f9475bf543b855bb3c010ba","56c48fb5bb6316dfc27fbad065966b4ddbc38e9a0a1a5060d19b5da405ae7d6e","7091568b9a1b74b699ad09df6c130db712ed089d173a235e301a7a7ee0a4ca44","de33aa2a38affd9e71297ef7ec001a4525502878b09744308fb6518159f77d2d","57476e482c9b4e152bd23d0dc3c29375e48afee0de775674a3c1ea63cb4cf843","3ec4ecf6502ebdb1f3e24c712eb70160c606214ba2e71b4304b5a50fc2e4f293","83f7b6c1dc91deece32c3bee746a43f3616b7cc9f6510764bd53451f6712ff25","c23f2e8772304163fa7e4335be11f3dbdfd720d2209057566b7dfef746ef1862","2a26cb78d3de9708cd656787a663902270c9421ef89188286c3b7ec89b63bb15","e61fda2800677c210116c397dd85079a0956c87fd714826c08b25b10fdd56546","ef7bdfb4f157f9c9b9bd7f5766f0f8e07fac8e7482eec071673f3c9d08082982","d2f2ac1436cbb7c8d122cc7de96521345254e5b36591d9d064d9763de2a7b254","3cd2ba07285d01224f9595924dc7f760c7babb386a6eb825cb551f8d829fe6fa","3ae9770861c2ece5849778e9f15567d95b87df0165c0a5b1312181df19458a56","37b51656ff8302a4556e29c775f311eb9ad813948d2c527405cea041dba3baf3","00abf32ca3af92f8be9ecbc9b63090b4909a756317d791927a83cffd24e9c8ac","cd28efe88fac7a92f3f5cfc7dd3c764f0b31bdaaa061ff044de1639810d6a7da","8b2100d3ba68063b7baf5038f26eefe46543dcebf1e7dbaf46277f24307cefcb","131b7f32092aa78e12fcb2a6db7c71e17f85e076c0635ad8d991b80d10130c19","d1c84af1e6d5fa4a5f4badd45b03b67c9255a675df235a3ec25307a0f5524278","aa4d6dc9282133162a76109d99c5795583276c4fd27284f128d484acf12b0841","3355c4c572f076ad963d95f0e28075b8558e2ab492c84eb94f9e2c48f1c2368b","5638cfd48b0c56bc9ed0c779d53a40b92c9cd9c9d6312e3a21c52542d38094f3","827eb54656695635a6e25543f711f0fe86d1083e5e1c0e84f394ffc122bd3ad7","2309cee540edc190aa607149b673b437cb8807f4e8d921bf7f5a50e6aa8d609c","703509e96cc30dce834ef8188c958c69306473b8a7e5cb3a6f324cee05a1f7bb","900daf04dc607dc3858c0f976d6f9e17b829a07de58d62dc6f730eaf06986075","08e0ac95e650bd4c87145b6ab2257b70c06254bf76a0b9f8a7d60c51fb8ed6b8","4b57ec505a035491c692b89af2c6902c312ec22f8fa9b6dae3e93686659fb7e0","7d796672940d3b2d37f2edea4d7bcf4c7993966286006228cbc8fa35ac92871d","132fd53917ed7f55275faa52c35e4d4d41e9576fea231d12740b723df2bade93","de2ecf9b1d6f60338f7b59b6f593ef77af9abd0e70ba8f2942953d0c6e1850af","cf18e9d003f1d3d1d61a04eb2d1cff3e8a8cf9cd306d0532ea82700069f2fc42","393192a39f26f9247a74ecbaea6668972af8e9125c955d1798234dceca6010f7","27ca878cf70b3030e8403f51ce65949d364fa776d6dae3527f91635a40836672","178e2de7a8702742957ad24deaeddec84a48cd913b5d932b16afd2a707b3e416","a45ee7555d019a67fbe092898d1aef0b1d02a9f6679ab84461ff515b4460d706","29c188a2c660f99f1b4835022e011c4268d7af989d4b7dda33c0a69ca1a777f8","1ed0bf138e87912d741e28333b58cbf814ae863783b3b404d2454cbabb9c5fc0","3452ee7d8ef0b1bbd47b2a56924a1dc3c79dc84a19d212e9dc496f92e4943aa0","8c95f96ccd4be0674944077aec1e4f2cccd515ca06d4327562dd017250e7d3fc","6fe7571c8a80808224648046008d1366ba4e29206ac79ce4c56d6fab3350492b","a98be76d8c257aa9e316bdb305b8c4228f0cf904d4b70547fc2999f3f99b5a01","7419d99dfe020d543c8ee736ab7ec17127d6a2c61c40e5f245c6dbd3fa6eaea4","2495815b16258136f98d91e441f4462f9b694520af86bb8c8373724cdc410096","a64568c16a5821575de4f6280ba1ea4686a1ceecd649fa90ba957c8b1b007013","ac46f284c80582f7c1284eef93f2d1c80add2d3b0e8a4076d6ca3db58d3af747","dee4dbaef83bb1061a44f39a91a59300d3dc02528eb57f748222235dd8e02159","a39c32b055d2e6103e5c49b9aed2d7bb5b06571c98fc31105264d280431bdbd7","618ebb93311695a13844118cdc9a7314dd3a2c6f35092d87f76828cac555ddc9","d36c3d116ce59a3f072c0014f0c020c76e916ba906066ddc4f193f546a43bceb","9bed8447acaa89be63540ec500b165442fcb0de020015175b5a5c66d42a61c4a","f128a2d1209d243ba2f7755c2fc313be2c7569fa0d9b4dc5cc60714fb0cc6634","a17e6861b709149f29a2bd896cee94526df2f06b24a2b60614b56649b5e9aabe","9c79ace686f720f4dd833740f7190e12cdce363362c982c164745527a412ef40","439850ca5075c6db55487b2c7fb27a6051fecbf180eee0809b67bb2783a89813","75d48857bc4216880443a24d985071262bb8b89a9952c77fd430cb0caa21f9bf","33e40cf77499b3d9712db82e15683373925e85817dbe82a24ee0ee6e44bffb70","d5bbd453310990e851908183fbbef9e6e2db8e0c86d97b42b723fd5238f71c81","95e76bed30f6e993e1fcc1b90a4675682e4800ae43403547a775d6e3c7ab2b0f","8b206b995edc6dd849b85c1c56531b9780e3ba75302fd02a2d173f008028707e","97040b190f0daa10cf9a15e51a2fac66b26ddefd7b65998bd6027d1dd67647b7","877c25dfae100e555014e45d1d80364496a0c876201e5dea91a0fd0a6a4ff765","d53f9f96afd41359edeb2d5ad98559f3bfad261391d5aef95320fefb0c6a8742","23d98226adf3be74e1f0470f85e7fd154cd7aa979d60b43190a7437f0d0426eb","639f9321a98b734242a3573764d7f1de5369b0b0b10c768ae37639e8bda5dd03","a42c39d8b7d1b1eccb69c7919ea60dcc2670ea672a0af90b70a730974ec0e9fb","dc5fe5f6b39c3fdfaeba333bcd5f0cc98bb3068797a4d7010f585366f549ddf7","4a3ab8cb278bfd1f18f24cc45a02188b63afa6aef50035df6d79c4638f24059a","e724c9ce92f2a8a31ed260764c5455852a13d292e2a31d26acc6840ec0e83208","40220ba1b091aff0cb20df5467202b62af561b09fcf3b24c22a60066d46f9e62","30abf588759f9e828a94f0c7f031eae094bb668c6dd4d902fa296779267c05c5","bd875d031474860131eadb42300aa57a71527bbb2b239d5b31ab6a9e352c84f0","773bf9af93b5027de9b5b4c779d5cda35f0eb92c7f43a97f2ef3ca081495a191","617f2b4f5115969c7b0f225d4962e6bec1cec7e5c687d84370eba4931b7dd047","59625b1fcc91f2686751fd5b623126f434d7b405bd8d866a555963ce2ac69846","5e0dc1bd24b45c46f2188d2f7f4b67f311610c72b706f963c5bf04c2e1fcc35d","fc69ffd599d3e525aba38f80c7cc2ecd187dbf148287364c75f199c8294a00e6","2ad138be6972de52ed966e6402aa6403af79e9f183486e0a725ffa075a0555fb","480274a4f75a7b3bd5c697a55e1905887b62a928592c0db3c282525fb235ba70","967fb6e86b55db228ab50c81f85f39d6a23a0c15bcfa6e19d255e0952d33a65a","c39e7d32dddfcdaa93b18b99fa430ebb1d6ba366459563d400add22f92e3644b","e3932de252bbe43132ad3226865b2a376ad945dbc1d767540c01b7bddc6477c2","b2f52f3cbd863dc4e690614b5cddbf412dea435d0de099db6d8adfd3cbefcd65","557c93b35f3b58e6844a9b8817559da1e0641f7f08f918e3cd1a8efee126746f","80ad2ae93d57dadac5e377ec6743df5e0211ea30bafd4b648c52366af057bb2b","07f90213b5800a0b43a6d6f309517dcca5afc6ffeb4bed396878a29fc5d6ceb0","bb0e637020f81cb40d16f202c3a783f0e269e29547fb84ca9f187a5ea8556965","462da802b50ac0d94a3c8f7f58a6a0aa08108bfc1394449ea56f1e0f63f5132e","2ccea88888048bbfcacbc9531a5596ea48a3e7dcd0a25f531a81bb717903ba4f","b7eece07762a9a944f097ee05d6f6b642b1e2dd87e6fc1b09600d881e5475377","1916218868966583a3c9f18501ee78929cab8450ebb8076ebd609873c258154d","98ca5ae10ab02fe747a7a53138f43525e0129aa1107892ea4e1fe9c99575809c","9760678d20c9faa0d0e1269806bce578bb76598a4a188a4d3987171263be20c5","21f706150e32f03ecd1714d7a7ac55ce3caadc7c7a2a960ba57cc5d39ad84c9d","6954ec87361b77bb8895426909fecfd154e3fd72a2b82f681c8bb15bc46f2389","da1963f37d566ff9f71bf8ca5c628656bae02fc9509050041547e9c7063cc58f","57e4bed825036f7f1328505bc512af492f28b1b57a48f1ff9b6d90b930041a52","3ef0957915b7719ac58153eaea6ce810ff8688276e570f8938455f3ec7930df7","05e0ad043fdd4e2d4874a97bd716174af64d63e43851c09830c00e819a80d395","2dff0ed1eb2046fbdbc2c13914117e1ff1112e217f90542ea5e7f41e39f0393e","a0ba1e2711c2520189ed980225e7a429b0706a1eabf9113e53f0e72550a1b23d","169b66aee819a4b165c397b832b31691f0be8d35cf8f2ec6364c23ee727b20b8","badb4cfbfc6eca3a038be22c76297bec0b5c1478d8b73d60e8b50725b7dcc15c","21e7e0eddddc112f2b891d1066eac74680291db768d3ef9b908965935380ab98","489e195150979dc291520e6f3289f055516cf342f314931c6b4553aebf2859bb","516efe800aaa0b7504b71f2d7e7e9bed5f28eb6c9c739bfdf237f09c7addea46","10ae729013e6620dc937df5dd7077c34e29ad313a28aa75cec39957640cdc8b0","ac5f95dee5e4787fa7c68a81a052cdfa0e03adec8331d3276389384df36cb849","0aaa321f1f662ec931e55c85867d316d8af16b59337111e22901516a0e1caacb","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","a120dfb4736e6ec4c78f1bff5ff7f977d346152e6b7020659ee1ce4717f6f66f","9eda7b58498bed72dd98ebf1d6f8dd3bf5df5004b2f91c610093bf48f970c615","8e7adb22c0adecf7464861fc58ae3fc617b41ffbd70c97aa8493dc0966a82273","755f3cd1d9c1b564cff090e3b0e29200ae55690a91b87cb9e7a64c2dbeb314d3","d6bb7e0a6877b7856c183bff13d09dd9ae599ea43c6f6b33d3d5f72a830ed460","f1b51ae93c762d7c43f559933cd4842dd870367e8d92e90704ffa685dd5b29a3","4aa7fdc017a0a097c71ada2ca187e1475c987b4f933960c0792eb143997e4709","3f450762fd7c34ed545e738abccb0af6a703572a10521643cf8fc88e3724c99c","c56e9d223c1b5682aba7b1a761897e3b52a96d1a1e557d6a60241f3fa0430098","8516469eb90e723b0eb03df1be098f7e6a4709f6f48fd4532868d20a0a934f6e","d60e9ab369a72d234aac49adbe2900d8ef1408a6ea4db552cf2a48c9d8d6a1bc","0ebb4698803f01e2e7df6acce572fff068f4a20c47221721dafd70a27e372831","03460a54d0e0481d1e11097f66ad43f054bc95efdafe5f81bbc7a82be181af75","ded24ddc7157689a5aa14bd651272ab8cd6e7812da2196a65d8c5e63131cfb23","2cea9689efa8591732096235abe7f084fc29c92badd5b0897a5e876b77e71887","4ed4e504126014fee13aaef5e3fc140f2ff7031ff3a8b5386717905820ea2d09","00e77e0bf106bc1e4f303ab02724df5173506d44acb6c22b4f582a88f22c3250","30d2170e1a718b5035611af55e3618b4ba8f42f0749bb52ee593da6082c4e2ce","f910705a0f7b484f66cc58a71a862984d2ca6f5df8f5a96201f569d564e1c2bd","a3b8b6be7620897d1e481e8650c980a210a138fceb6e710eaf95fd9dd0dfe94a","12c89d0e32758c120a569045f21cf5b77244f86792611ced8de7f86b37e77781","14bd47270e654c8eb3b1489fa8c095912ee62a0a29bb92743393203722347c53","235ac682dd51a0fd9714ea306bfebc6e32ca997aae0695fbc76d29dab5d4be32","bbb0c464f84002efad8c8df37297703738bc457a39bd801e2df05bf45f7a7f26","92cb686a9ca5eb5dd7d5d8d43a3707194c1e91ea07a027b3bcb60b6011b24632","da3ab7396ab4fe390f01091bd0d4c4a4e1e2a15a46d47446d6fb7194897d0f6c","66bbae6120d307ec2021ebd2241b8ad23f832b663e13363ca8b4c8dbc131a4e6","fb14266ae4070bd16db6b071e98887452bc359695c40742e38515a89dbc80a63","4a24d83c0d8f489465c4d38ed9fd87121c8a2cf50c47efe09c2eca93d39fa908","c052e32b9de53cd2596f196a0901801961bd7a31be9fac4ac2f117e4103e3a07","b15cdbb45919bc3b8e6b6f962d65382e85061d70bc26a968604f3dce4ad3a891","d6b58d955981bc1742501b792f1ab9f4cba0c4611f28dcf1c99376c1c33c9f9c","f0b9f6d5db82c3d1679f71b187c4451dbc2875ba734ce416a4804ad47390970a","a5c38939c3e22954a7166d80ab931ac6757283737b000f1e6dc924c6f4402b88","31a863da9da2a3edec16665695bdbc3134e853195f82dafec58e98c8e1bb3119","a00417f73bbba413d1345dd77252ede0bd0c957e37a9cadc9abb4c34cbd0eac1","90d1ad8d2983cb003d6f237b41c56a8f252f72071bbc53576e02b3c96d7ea47a","f3815045e126ec1b9d224782805a915ae01876a1c7d1eb9b3e320ffadbd63535","d07557f21b2ad690bfe37864aa28090bd7d01c7152b77938d92d97c8419c7144","b843ea5227a9873512aa1226b546a7e52ea5e922b89461f8b202a2f2a3f0b013","64b4d440f905da272e0568224ef8d62c5cd730755c6d453043f2e606e060ec5a","d6b58d955981bc1742501b792f1ab9f4cba0c4611f28dcf1c99376c1c33c9f9c","f0b9f6d5db82c3d1679f71b187c4451dbc2875ba734ce416a4804ad47390970a","a5c38939c3e22954a7166d80ab931ac6757283737b000f1e6dc924c6f4402b88","31a863da9da2a3edec16665695bdbc3134e853195f82dafec58e98c8e1bb3119","c0e03327bc548757709a7e2ca3063ca8b46227b5e13cd981ca3483035ef5ac44","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd",{"version":"99e8bb8d262bece129ac203f0c7436a07771e9cf5ba06a308d1b16993606eaf2","signature":"8705a9680ed4afb15edbd7bb9ee24af33060d1165117f293559f3073bf8d0101"},"ebf6e19cb84d78da20d022a95f05e8aef12e56f816a1ee12835a4da40d7b14cf","589357c2f88f1188a0dfc48c4c4cf4d22fac9f654805df5f2789a01b5616b74f","6abe62ec5b9b6a747c1a7687d58ff179cdfb61adee717b6e4882120f7da4399f","5c1301f550be26133f4fd34eadf38815db096ecaf9b75948b444a063097f496d",{"version":"5b663c84514a24460dc151a261b81be6d5f8ed75029ef0b737d50e90b4717981","signature":"a4b0b4c9fafa8889d76a29448505145222de506dda54c6c1155106a86e8c1869"},{"version":"34ef3dd636b7074beec81346987a81ac245e1cfd75adf0babc68e6cb6c572ca3","signature":"82065c62b6a8089452cb40191a55299b2d0718ddce833446faa6c01f48f05b29"},{"version":"c1eb1aa5e32fd31d4564bffb458942d8caf500d86388c811cbb853c274e4773a","signature":"a7fe41f597b2631d3fb439d9b3ee32d1606c651a45ce2fa0d170a2614e68d280"},{"version":"327fd9ca522780f73a64e32e400a6c5bcdd89a5e706314d57ff1611bf1a99a0d","signature":"70b3082385b926b4bb0dbcef0b2f444c4f807d312546f27ee248d50b0dfa5877"},{"version":"3b1ea19c2b95501c5d8e87fe4c8044d204c4402a8b48f282bd348f973355f3c5","signature":"01b86f9481ddaf74b65f12e90ae2d5bedbc0e67e64e8cb273c7a1907cc66dbec"},{"version":"897a42f20db3ee955b1cc64506c040b0b1dcebe45d9ba3147e133d110f487f6e","signature":"3089238aed154b07430dd80de65df3115d268f21f1afcd8568a58d65c7827c5f"},{"version":"2d41bac312ef892971b2344a102feb99985e87f79edc18ed2c43ece97703fb91","signature":"2642375958909546f682d51f9c3682f553ae5f919f7b4a77d49262c200bca248"},{"version":"db3db9885deb334e6606785a0bfe7aecdcae172d36a6b4bd55958c756b92ac6c","signature":"79cdba32abf1fd279e588363d3048cb4b3d537a81530d32079cea1df22d66f93"},"1fcb8b15db812281d69a3090d488903f9e93033004aef9d8889ca3ad0753a96f","bdf5a95eb0a2dd1d39805bdf51b46ba012bb9b92b2ddaae16219595bba7678a5","9f794a0e8550a03baff865a3961cc22afbd85bc4ba9672bdda036971928f85f4","66a697d1e4cdbf25cdce4644a8085a8563041fa8c7731d4d9f5e8f22e66ba72c","a0c8e17f4d1ea2704c62d7349bc3b8d9a12e3761b5960cb44144d3f0333b3fcb","3471c0df3d0391e1dffe6e8bf150294531b2b71a2afa5f2b86e52bf84a5db60a","5d4df4de055eddf3187094f938a640f8d96e4c551a47d6686596fdb6ba4c3014","8bc2cad630da1033c1fd8d7df2bffb18af0da6113bd086a8bbec04a2471a1e00","a1059d1bbc8ad46bfe668b8450e7e8002887c4ab987bdb96d6108d8023f8bb8f","5134885e9648e2c6745f8aa1c3e7f5ab3b3617258b3d81ca02de6655ede3d74e","4f1ae3f24125216cf07c5211a3f00d2bb4782d7cc76c0681603f8249f9232ff0","d3fb92a5640f83f7844d60b35317a0f95c27e3658a749d76d218c461ad091668","d1f8bfcd91b284657ef8187c55ace7db91a3c43e642c3f14e54364154932f7e4","f54c92bfcae54f360fe79514746efce4870e4ddabc064e95d406bba291e9f672","175fd7186fa6a70f9db9b270a04a503cae23cf01cb77e3905bac115c38424cf7","c993f7ed1b8e1023c1f2ee5b262dbc3b70b27475674e40a53a58591f9972dacc","c914014ab7c7001178663f29d31a495398234a41219af61f26d7e8e91b46af96","277afd6ab6ec72889e2988e0ddd7d138c1f512e68a1fa4e90eedfd71e2097a51","c0908f85f2b645d375127a3b53a17a65f782e17962d5c1eb68f08b1188acbf15","3fadac5d409cc2f27b1d2f4e7568600f02840205f301c9ae7a3068b46476438b","da6aae64ad559286830fd44c81e3d33303348f184af7db4fde8dd99ae9749407","3633f87c97d359cb55fa7bf0668fb2be8a23342951af6ec2d06e6d0cf7409371","cc3a5427d44fc77ff25e80b3edee4650a51f83de761faf5e633994ecf1ab1b44","b350eda75c6e47299b36002b31d5b220c405c21c365e708989829db013fadbb4","f421882756b6714834ae4687ab1aeadf344a1cc45437d2edffbac020ff3801c1","1d61d6ad832dabafbf63b86c5a79d704f2c8763ada9318e135b17a3cb2d09b32","e5cef5de3e5ad3436d414d20743231e284733b9cf4375dc79eff4fcca4282f99","e624419ba84e33e661e89a28083119ca41f6953dba09a4f82b660684087afe6d","942be430bd0feaced2e3e598273b17e50ea565ec9dac840b580b0b99e1a3cd5c","73350006cec5a0c6b71d53b0b0ddbfb82be96752a9c4e3c904c59e633bc9485e","a7df5c2e9594966c7e0d4a763b13ed5727506d892669df5f7bc9826f539c1d35","258cc5cd6891f6bcbaccefd953997038844e7f65d582cac987ffabf7181bcd4c","00a6db28fc4df6ddf10adbe630d9df620ec13af19039c1869653e60dafa739d2","649324d5abb5464aabe35d86cd0eef16562df811f0971481cee664afa5acbc88",{"version":"628749b6edfc907c32583a77f7dde111642dbfc13265fa566e9a8fa47f224b51","signature":"495944b274165419ec08446dbd612d6276e2c12b92caa1f1e6c645cbc044ef25"},{"version":"e2f7d4348da1a42007547574ec71504de5e9df04d270bcc4c672bec1068257e4","signature":"0d7e153773886e59a74ffe1fac08bef805541411de160b9f3af36f8a6a3c6022"},{"version":"70fa251413c8e1926804d27e8aa01f96bf56141270e8adaeedfeaf0cc7147cef","signature":"2e85c128d27849ff4bd436f75d32d8a64d9013d420f09c82c6eae63cb7131020"},{"version":"334a6eff67fdb6feabbe5a612552a0714c424ccd07abbb096672085e7d43fb4a","signature":"19756a360a54eda2a10138b94b37a87519fd1a27c678a1b82187295e40bbfacd"},{"version":"722e48bdd1c494feabfb081d7d582d4554276abacce92f69128511918c125273","signature":"b195f1ad5886c1600c53bc7296210f9ded9a9a673e01988eecf9f20f48a4d9d5"},{"version":"1b5f109f8e1b74f648bf19b878188928678f443c2b2a21db0861f57d0715ef69","signature":"55310e6719d6bd9462e76cbba6a582712b30a85ee4949b8d98e14e0f46738e78"},{"version":"d184310a8c121c1ed754995dc55f8ca212bb1ef94979f99423dcdc48569b3c51","signature":"99ec28bacd04a3185d90660fe18bae48f33cbb1d50c73c64cae98e67f7c0ca01"},{"version":"48d475a0c6f91f62a89b128923cdec08f1f30a12df0068493f0d9b2774125b01","signature":"6a90b1b75bb0eb776ae223adc1f3f1cc343abf3e68df619933a3248910061290"},{"version":"e581d928f182594fe6aa7c0dd2e0ce02fe65fb53b7d40a59af9c2f171eee6428","signature":"1ac721bca31657133deb33e2ae005d557e8e6e0aa9a466142a2b0388e2e2638c"},{"version":"f18e14371215da28d2375c023017adcbd420314020f2a4ca4e9d9369ca80c1f4","signature":"0aeb9a7ce850134709dee9ecb63c1883e387eb70f960e0510100f4b2bb70caa4"},{"version":"bcc7e1fd0b70240f11846f0c5a284be69834446899b64477371cee7aaca38965","signature":"bab97a4f0736f1c1cd0546f79f993ecf30b34404cf4479a4f39068915880cb1c"},{"version":"6720778d4192df7ececcfd9dfebed8a006c9c44f88fe8b74880ab3ba7e14cce4","signature":"121c82998e23aa414d41a2f08e108074760318a1c11a2a5183b88b0d9be4ef60"},{"version":"e3fe28954899e21bf8a7db496cb4b90313e826bb5ae938d84bc73c3bdaa31cc9","signature":"4e1f22dbfc0754b698f1e291c7c92bf1220834bd5620207084236399cfd02e2d"},{"version":"7f2a2cdf8eecbe353d449055d91c6ee619f90ca3b3a49ba5a44563c44aab5d1a","signature":"8e6165fa13e0d2f40e2403ab20b72804d02c663709a3f7383a320050e893fe8b"},{"version":"a02cb9d0a7363cbbce45fa86bbd7d64615811e30f2a7c47a2718fcf53f20eae7","signature":"9af2721670eb3402e476cd827256d4af7ab1d6db57f1615cbef18c75164df9e5"},"14c94f7888c75007a94132f03caef0f6b58bcb136c2994213fd2d3b99f3d7f85","4695042a55a75a6c62dc57f2efe60ef3c7bbe19adedb5081f6e51dd664bbc3f7","b006ad8d854471e7a270bd8918508090961bdc1cfe77ed51f13f471fe682acac","310901df1081433ff7c3b7918496cabb92ded208b04294d3d2bd35acae2de836","c8646410cd2a6bf05eb7e7a51c881776410d07fd5d8f75092a2c815c9c6fda52",{"version":"127604bb56d364ecc35cbb4927ba7c53f552353fc7913b07a4f5cc957210aabd","signature":"973a1e0a155ab26d66226ff9d64a36cf61227e9240b21cabdc67df29847a6599"},{"version":"dcea5769c8b69d7b7a5ee6ffd4d22260e47d53d22990e91d504cbdc0c0120c14","signature":"16c51743932253da5b661b0a5068eb1423a6f020f62e6783ce8ac5259cff10f2"},{"version":"67be5e00299e02d108b294758dcc0218da9f2a2823dea61d708ddbe705771ae5","signature":"05fe3dec4dc02961a8959758da54c6ff9d32a232183041163d4d52cc6bf39015"},{"version":"e2e5ebf01c7004f157b8c750fdddb9f227fbf3119a87297e3a014db04c3f0887","signature":"fc6fe9c667e291d0bbdc904c921d2c1d385175f8c135d9e549298c96265acaec"},{"version":"6b0da45d7a1027dd4a9b14ac009b018761e8851c84a9e54ecc1be9086f0516c6","signature":"38fd30580198d072da98f6dbcb7535f47359ca91ffe57e3b9bfd1961a3b209ab"},{"version":"fa155617b797acae06d6112d53c8383a2d4701f6e664b2c5782dc8638ea84336","signature":"2ef14937f8d2a8e6e9603499cf139386da410cc7c699e58ce3125ef0419fa815"},{"version":"30894a023b87abcdd14c2e5f372ec72ad6a901bfeaf03641d92064aac397ac6f","signature":"08a9bf13b7fdb54e98360f24721f172380ad8b1ae0e50f15f542c740671aa84c"},"4489c6a9fde8934733aa7df6f7911461ee6e9e4ad092736bd416f6b2cc20b2c6","2c8e55457aaf4902941dfdba4061935922e8ee6e120539c9801cd7b400fae050","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","bc3cba7b0af2d52e7425299aee518db479d44004eff6fbbd206d1ee7e5ec3fb5","afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"ccfd8774cd9b929f63ff7dcf657977eb0652e3547f1fcac1b3a1dc5db22d4d58","affectsGlobalScope":true},"d92dc90fecd2552db74d8dc3c6fb4db9145b2aa0efe2c127236ba035969068d4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","254d9fb8c872d73d34594be8a200fd7311dbfa10a4116bfc465fba408052f2b3","d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","d8f7109e14f20eb735225a62fd3f8366da1a8349e90331cdad57f4b04caf6c5a","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","9d92b037978bb9525bc4b673ebddd443277542e010c0aef019c03a170ccdaa73","ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","ae271d475b632ce7b03fea6d9cf6da72439e57a109672671cbc79f54e1386938"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":true,"module":1,"outDir":"./types","rootDir":"../src","sourceMap":true,"strict":true,"target":7},"fileIdsList":[[668],[73,109,110,111,126],[110,111,127,128],[109,110],[109,126,129,132],[109,129,132,133],[130,131,132,134,135],[109,132],[109,126,129,130,131,134],[109,117],[109],[73,109],[61,109],[113,114,115,116,117,118,119,120,121,122,123,124,125],[109,115,116],[109,115,117],[607,611,612],[607,610],[610],[611,613,615],[607,610,611,612,613,614],[607,610,614,618,619,620],[607,610,614,621],[607],[607,608],[608,609],[607,610,616,619,621,622],[617],[618,620,624,627,628],[618,620,628],[109,610,614,618,619,621,624],[618,628],[618,621,625],[610,619,621],[618,621,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639],[618,626],[109,626],[607,614,618,619,620,621,622,625],[618,620,624,626],[618,625,626],[109,136,393,394],[394,395],[393],[109,388],[388,389,390,391,392],[109,360,367,368],[109,360,367,368,388],[109,360,367,368,372],[109,360,367,368,369,371,372],[109,360,367,368,370],[109,360,367,368,373,374,376,377],[366,388],[109,360,367,368,373],[109,360,367,368,371],[109,360,367,368,384],[109,360,367,368,385],[112,357,360,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387],[358],[358,359],[358,367,368,373,374],[360,366,367],[403,404],[73,109,393,396,402],[396,403],[217],[547,548,549],[217,546,547],[250,259,260,263],[250,259,262],[251,254,255,257],[251,252,253],[254,255,257,258],[251,252,256],[262,268],[250,259,262,268],[259,262,268],[259,262,264,265,266,267],[250,259,260,261,262,263,268],[250,259,261,263],[250,259],[251],[145,168],[145],[190,191,192,193,195,196,197],[168,190,191,192,193,195,196],[145,168,194],[199],[202],[145,194],[203,204,205],[198],[194,198,200,201,206,207,214,216,236,237,355],[168,201,206],[209],[208,210,211,212,213],[145,168,194,198],[168,198,215],[168,215,216,235],[168,207,354],[139,145],[656,657,658,659],[570],[550,569],[562,563,564,565,566,567,568],[562],[564],[562,564],[426],[109,229,425],[109,229,426],[109,229,397],[397],[397,398,399,400,401],[109,229],[229,428],[428,429,430,431,432,433,434,435,436,437],[229,428,429],[62,109,229,428,429],[106,109,229,428,429],[229,429],[168,217,224,225],[226],[230],[225,226,227,230,231,232,233,234],[109,227,229,232],[109,168,226,229,230],[225,232],[109,168,217,224,226,229],[168,224],[168,238],[238,239],[238,239,240,241],[168],[189,354,476,493,494,507,532],[530],[168,505,520,528,529,531],[519],[189,354,456,518],[109,224,229,427,438,493,494,495,507],[168,189,493,507],[438,496],[498],[495,496,497,499,502,504],[501],[496,500,505],[438,496,497],[168,438],[503],[496,497],[510,525,526,527],[493,507],[506,507,508,509],[493,507,508],[168,493,506,507],[168,493,507],[523,524],[168,189,486,523],[168,354,486],[168,185,189,354,463,476,486,493,494,505,507,510,512,520,522,525],[521],[168,354,476,493,494,507,528],[145,168,485],[109,168,243],[168,351],[320],[168,243,320,348,351,352,353],[109,168,242,243],[244,245,246,247,349,350],[139,145,348],[139,145,246],[278],[278,284],[278,283,285,286],[278,283,287],[283,284,285,286,287,288],[290,291],[279,280,281,282,289,292,293,294,295,296,297,298,299],[278,292],[278,279,294,296,297],[278,292,295],[278,300,301,302,303],[145,278,300,351],[335],[348],[338,339,340,341,342,343,344,345,346],[168,270],[320,344,351],[270,348,351],[145,321],[270,271,321,324,334,335,336,347],[145,168,304,320],[348,351],[269,271],[271],[351],[321],[168,324],[248,249,272,273,274,275,276,277,322,323,325,326,327,328,329,330,331,332,333],[168,326],[248,249,272,273,274,275,276,277,322,323,325,326,327,328,329,330,331,332,351],[168,269,270],[235,334],[168,271],[318],[145,305],[306,307,308,309,310,311,312,313,314,315,316,317],[305,318,319],[304],[354],[442],[441],[145,168,448],[269],[168,242,354],[145,354,455,456],[439,440,442,443,444,445,446,449,450,451,452,453,454,455,457,458,459,477,478,480,481,482,483,484,487,488,489,490,491,492],[145,168,476],[145,168,354,442,480],[159],[479],[145,168,269,354,478],[145,354,478],[145,354,476,479,481,486,487],[145,168,442,445,457,480,481],[354,456],[487],[537],[537,538,539],[148],[145,148],[146,147,148,149,150,151,152,153,154,155,156,157,160,161,162,163,164,165,166,167],[139,145,146],[136,148,154,156],[148,149],[145,163],[109,363],[361,362,365],[361,364],[109,361],[413,414],[668,669,670,671,672],[668,670],[158],[674,675,676],[74,109],[679],[680],[691],[685,690],[581,583,584,585,586,587,588,589,590,591,592,593],[581,582,584,585,586,587,588,589,590,591,592,593],[582,583,584,585,586,587,588,589,590,591,592,593],[581,582,583,585,586,587,588,589,590,591,592,593],[581,582,583,584,586,587,588,589,590,591,592,593],[581,582,583,584,585,587,588,589,590,591,592,593],[581,582,583,584,585,586,588,589,590,591,592,593],[581,582,583,584,585,586,587,589,590,591,592,593],[581,582,583,584,585,586,587,588,590,591,592,593],[581,582,583,584,585,586,587,588,589,591,592,593],[581,582,583,584,585,586,587,588,589,590,592,593],[581,582,583,584,585,586,587,588,589,590,591,593],[581,582,583,584,585,586,587,588,589,590,591,592],[57],[60],[61,66,93],[62,73,74,81,90,101],[62,63,73,81],[64,102],[65,66,74,82],[66,90,98],[67,69,73,81],[68],[69,70],[73],[72,73],[60,73],[73,74,75,90,101],[73,74,75,90],[73,76,81,90,101],[73,74,76,77,81,90,98,101],[76,78,90,98,101],[57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],[73,79],[80,101,106],[69,73,81,90],[82],[83],[60,84],[85,100,106],[86],[87],[73,88],[88,89,102,104],[61,73,90,91,92],[61,90,92],[90,91],[93],[94],[73,96,97],[96,97],[66,81,90,98],[99],[81,100],[61,76,87,101],[66,102],[90,103],[104],[105],[61,66,73,75,84,90,101,104,106],[90,107],[109,228],[699,738],[699,723,738],[738],[699],[699,724,738],[699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737],[724,738],[739],[742],[511],[572,573,574,575,576,577,578],[572],[574],[572,574],[447],[595,596,597],[595],[596],[180],[180,181,182,183,184],[169,170,171,172,173,174,175,176,177,178,179],[683,686],[683,686,687,688],[685],[682,689],[684],[138,140,141,142,143,144],[138,139],[140],[139,140],[138,140],[168,189,356,424,532],[533,535],[424,534],[168,189,242],[461,462],[168,185,186,187],[186],[137,186,187,188],[187],[408],[408,409,412,416],[415],[168,410,411],[543,544,545],[224,543],[168,224,543],[168,217,224],[168,189,555,559],[560],[168,218],[218,219,220,221,222,223],[168,217],[423],[136,168,185,189,356,405,406,422],[73,109,168,189],[407],[407,418,419,420,421],[407,417],[551],[542,551,553,554],[168,189,410,417,540,541,542,551,552],[168,417,546,550],[168,468,469,470],[242,468,469,471],[466,467,468,469,470,471,475],[168,224,468,470,476],[168,189,417,460,466,468,471],[168,185,189,242,417,460,463,464,465,466,467,469,470,471],[168,224,467,468,469],[472,473,474],[168,224,417,467,469,470],[168,224,467,469,470],[168,189,468],[168,224,469,471],[517],[189,417,513,515,516],[514,515],[516,517],[168,189,555,556],[556,557,558],[109,168,189,555,556],[168,555],[168,599],[168,561,594,599,604],[168,410,411,417,594,599,605],[168,599,601,641],[129,136,168,593,594,599,623,640],[168,417,599],[168,411,417,534,579,594,599,601,645],[73,168,410,555,561,594,599,600,647],[73,168,536,555,579,594,599],[168,410,555,571,579,594,646,649,650],[73,410,417,555,593,594,599],[599,600,601,602,645,664,666],[73,126,129,136,168,189,242,410,417,463,534,536,555,561,571,579,580,593,594,599,600,602,603,604,605,606,642,643,644,646,647,648,649,650,651,652,653,654,655,663,664,665],[136,168,410,555,561,598],[168,417,594,601],[242,599],[168,410,417,561,594,599,600,603],[417,561,599],[168,410,417,594,599,601],[593,598,599],[168,555,594,599],[417,571,594,599],[168,417,594,661],[53,168,417,594,599,601,616,661,662],[410,417,593,594,599,601,602,666],[53,410,417,599,616],[168,417,599,666],[53,242,417,599,602,616],[599],[599,641],[73,168,555,561,599],[73,168,536,555,599],[168,410,555,571,646,649,650],[73,410,555,599],[159,168],[129,136,168,189,463,536,555,561,571,599,649],[168,410,561,599],[561,599],[159,168,410,599],[168,555,599],[571,599],[168,599,616,662],[410,599,666],[410,599],[599,666]],"referencedMap":[[670,1],[127,2],[129,3],[111,4],[133,5],[134,6],[130,6],[136,7],[131,6],[135,8],[132,9],[118,10],[115,11],[122,12],[116,10],[113,13],[126,14],[120,11],[117,15],[119,16],[613,17],[612,18],[611,19],[616,20],[615,21],[621,22],[622,23],[608,24],[609,25],[610,26],[623,27],[618,28],[629,29],[630,30],[625,31],[631,32],[632,33],[633,33],[624,34],[640,35],[635,29],[634,36],[636,37],[626,38],[637,32],[638,30],[628,39],[639,36],[627,40],[619,18],[395,41],[396,42],[394,43],[391,44],[390,44],[389,44],[393,45],[375,46],[380,47],[369,46],[374,48],[373,49],[371,50],[378,51],[379,46],[381,52],[382,53],[384,54],[385,55],[386,56],[388,57],[359,58],[360,59],[376,60],[368,61],[405,62],[403,63],[404,64],[547,65],[550,66],[548,67],[549,67],[261,68],[263,69],[258,70],[254,71],[255,71],[259,72],[257,73],[264,74],[265,75],[266,76],[268,77],[267,74],[269,78],[262,79],[260,80],[253,81],[256,71],[190,82],[191,83],[192,83],[193,82],[198,84],[197,85],[195,86],[196,82],[200,87],[199,82],[203,88],[202,89],[206,90],[204,82],[205,91],[356,92],[208,86],[209,93],[210,94],[211,86],[214,95],[213,96],[215,86],[216,97],[236,98],[237,97],[355,99],[194,100],[660,101],[571,102],[570,103],[569,104],[563,105],[565,106],[567,107],[566,107],[427,108],[426,109],[425,110],[398,111],[399,112],[402,113],[400,112],[397,65],[401,114],[429,115],[438,116],[434,117],[433,118],[436,117],[435,119],[437,120],[432,120],[431,117],[430,120],[226,121],[227,122],[231,123],[235,124],[233,125],[232,126],[234,127],[230,128],[225,129],[239,130],[240,131],[242,132],[238,133],[217,12],[530,134],[531,135],[532,136],[520,137],[519,138],[496,139],[495,140],[498,141],[499,142],[505,143],[502,144],[501,145],[500,146],[497,147],[504,148],[503,149],[528,150],[508,151],[510,152],[509,153],[507,154],[506,155],[525,156],[524,157],[523,158],[527,151],[526,159],[521,133],[522,160],[529,161],[486,162],[485,82],[352,163],[243,164],[353,165],[354,166],[244,167],[245,133],[246,133],[351,168],[349,169],[247,170],[278,133],[279,171],[280,171],[281,171],[282,171],[283,171],[285,172],[287,173],[288,174],[289,175],[286,171],[284,171],[290,171],[292,176],[291,171],[293,171],[294,171],[300,177],[295,178],[298,179],[299,171],[296,180],[297,171],[304,181],[302,171],[301,171],[303,182],[336,183],[338,133],[339,184],[347,185],[340,133],[342,186],[343,133],[345,187],[344,188],[346,189],[348,190],[321,191],[248,184],[249,192],[272,193],[273,194],[274,193],[276,133],[277,195],[322,196],[325,197],[334,198],[327,199],[326,133],[328,133],[329,164],[333,200],[330,195],[331,197],[332,184],[271,201],[335,202],[324,203],[319,204],[306,205],[315,205],[307,205],[308,205],[317,205],[309,205],[310,205],[318,206],[316,205],[311,205],[314,205],[312,205],[313,205],[320,207],[305,83],[456,208],[440,209],[443,210],[444,211],[446,210],[449,212],[452,213],[454,214],[457,215],[493,216],[477,217],[459,133],[481,218],[482,219],[480,220],[479,221],[483,222],[488,223],[478,100],[487,224],[490,225],[491,226],[492,133],[442,211],[538,227],[539,227],[540,228],[146,83],[147,83],[149,229],[150,83],[151,83],[152,230],[148,83],[168,231],[156,232],[157,233],[160,219],[166,234],[167,235],[364,236],[363,11],[366,237],[361,11],[365,238],[362,239],[415,240],[673,241],[669,1],[671,242],[672,1],[411,11],[159,243],[677,244],[678,245],[680,246],[681,247],[692,248],[691,249],[582,250],[583,251],[581,252],[584,253],[585,254],[586,255],[587,256],[588,257],[589,258],[590,259],[591,260],[592,261],[593,262],[57,263],[58,263],[60,264],[61,265],[62,266],[63,267],[64,268],[65,269],[66,270],[67,271],[68,272],[69,273],[70,273],[71,274],[72,275],[73,276],[74,277],[75,278],[76,279],[77,280],[78,281],[109,282],[79,283],[80,284],[81,285],[82,286],[83,287],[84,288],[85,289],[86,290],[87,291],[88,292],[89,293],[90,294],[92,295],[91,296],[93,297],[94,298],[96,299],[97,300],[98,301],[99,302],[100,303],[101,304],[102,305],[103,306],[104,307],[105,308],[106,309],[107,310],[696,11],[229,311],[698,11],[723,312],[724,313],[699,314],[702,314],[721,312],[722,312],[712,312],[711,315],[709,312],[704,312],[717,312],[715,312],[719,312],[703,312],[716,312],[720,312],[705,312],[706,312],[718,312],[700,312],[707,312],[708,312],[710,312],[714,312],[725,316],[713,312],[701,312],[738,317],[732,316],[734,318],[733,316],[726,316],[727,316],[729,316],[731,316],[735,318],[736,318],[728,318],[730,318],[740,319],[743,320],[512,321],[579,322],[573,323],[575,324],[577,325],[576,325],[448,326],[598,327],[596,328],[597,329],[176,330],[178,330],[177,330],[175,330],[185,331],[180,332],[171,330],[172,330],[173,330],[174,330],[687,333],[689,334],[688,333],[686,335],[690,336],[685,337],[145,338],[140,339],[141,340],[142,340],[143,341],[144,341],[139,342],[533,343],[536,344],[535,345],[461,346],[463,347],[188,348],[187,349],[189,350],[186,351],[409,352],[417,353],[416,354],[412,355],[546,356],[544,357],[545,358],[543,359],[560,360],[561,361],[219,362],[220,362],[222,362],[224,363],[218,364],[223,362],[424,365],[423,366],[407,367],[421,368],[420,368],[422,369],[418,370],[419,368],[552,371],[554,371],[555,372],[553,373],[551,374],[471,375],[470,376],[476,377],[465,378],[469,379],[468,380],[472,381],[475,382],[473,383],[474,384],[466,385],[467,386],[518,387],[517,388],[516,389],[515,390],[557,391],[559,392],[558,393],[556,394],[661,395],[605,396],[606,397],[642,398],[641,399],[643,398],[644,400],[646,401],[648,402],[649,403],[651,404],[650,405],[667,406],[594,133],[666,407],[599,408],[645,409],[652,410],[604,411],[600,412],[653,413],[654,414],[647,415],[655,416],[662,417],[663,418],[603,419],[664,420],[602,421],[665,422]],"exportedModulesMap":[[670,1],[127,2],[129,3],[111,4],[133,5],[134,6],[130,6],[136,7],[131,6],[135,8],[132,9],[118,10],[115,11],[122,12],[116,10],[113,13],[126,14],[120,11],[117,15],[119,16],[613,17],[612,18],[611,19],[616,20],[615,21],[621,22],[622,23],[608,24],[609,25],[610,26],[623,27],[618,28],[629,29],[630,30],[625,31],[631,32],[632,33],[633,33],[624,34],[640,35],[635,29],[634,36],[636,37],[626,38],[637,32],[638,30],[628,39],[639,36],[627,40],[619,18],[395,41],[396,42],[394,43],[391,44],[390,44],[389,44],[393,45],[375,46],[380,47],[369,46],[374,48],[373,49],[371,50],[378,51],[379,46],[381,52],[382,53],[384,54],[385,55],[386,56],[388,57],[359,58],[360,59],[376,60],[368,61],[405,62],[403,63],[404,64],[547,65],[550,66],[548,67],[549,67],[261,68],[263,69],[258,70],[254,71],[255,71],[259,72],[257,73],[264,74],[265,75],[266,76],[268,77],[267,74],[269,78],[262,79],[260,80],[253,81],[256,71],[190,82],[191,83],[192,83],[193,82],[198,84],[197,85],[195,86],[196,82],[200,87],[199,82],[203,88],[202,89],[206,90],[204,82],[205,91],[356,92],[208,86],[209,93],[210,94],[211,86],[214,95],[213,96],[215,86],[216,97],[236,98],[237,97],[355,99],[194,100],[660,101],[571,102],[570,103],[569,104],[563,105],[565,106],[567,107],[566,107],[427,108],[426,109],[425,110],[398,111],[399,112],[402,113],[400,112],[397,65],[401,114],[429,115],[438,116],[434,117],[433,118],[436,117],[435,119],[437,120],[432,120],[431,117],[430,120],[226,121],[227,122],[231,123],[235,124],[233,125],[232,126],[234,127],[230,128],[225,129],[239,130],[240,131],[242,132],[238,133],[217,12],[530,134],[531,135],[532,136],[520,137],[519,138],[496,139],[495,140],[498,141],[499,142],[505,143],[502,144],[501,145],[500,146],[497,147],[504,148],[503,149],[528,150],[508,151],[510,152],[509,153],[507,154],[506,155],[525,156],[524,157],[523,158],[527,151],[526,159],[521,133],[522,160],[529,161],[486,162],[485,82],[352,163],[243,164],[353,165],[354,166],[244,167],[245,133],[246,133],[351,168],[349,169],[247,170],[278,133],[279,171],[280,171],[281,171],[282,171],[283,171],[285,172],[287,173],[288,174],[289,175],[286,171],[284,171],[290,171],[292,176],[291,171],[293,171],[294,171],[300,177],[295,178],[298,179],[299,171],[296,180],[297,171],[304,181],[302,171],[301,171],[303,182],[336,183],[338,133],[339,184],[347,185],[340,133],[342,186],[343,133],[345,187],[344,188],[346,189],[348,190],[321,191],[248,184],[249,192],[272,193],[273,194],[274,193],[276,133],[277,195],[322,196],[325,197],[334,198],[327,199],[326,133],[328,133],[329,164],[333,200],[330,195],[331,197],[332,184],[271,201],[335,202],[324,203],[319,204],[306,205],[315,205],[307,205],[308,205],[317,205],[309,205],[310,205],[318,206],[316,205],[311,205],[314,205],[312,205],[313,205],[320,207],[305,83],[456,208],[440,209],[443,210],[444,211],[446,210],[449,212],[452,213],[454,214],[457,215],[493,216],[477,217],[459,133],[481,218],[482,219],[480,220],[479,221],[483,222],[488,223],[478,100],[487,224],[490,225],[491,226],[492,133],[442,211],[538,227],[539,227],[540,228],[146,83],[147,83],[149,229],[150,83],[151,83],[152,230],[148,83],[168,231],[156,232],[157,233],[160,219],[166,234],[167,235],[364,236],[363,11],[366,237],[361,11],[365,238],[362,239],[415,240],[673,241],[669,1],[671,242],[672,1],[411,11],[159,243],[677,244],[678,245],[680,246],[681,247],[692,248],[691,249],[582,250],[583,251],[581,252],[584,253],[585,254],[586,255],[587,256],[588,257],[589,258],[590,259],[591,260],[592,261],[593,262],[57,263],[58,263],[60,264],[61,265],[62,266],[63,267],[64,268],[65,269],[66,270],[67,271],[68,272],[69,273],[70,273],[71,274],[72,275],[73,276],[74,277],[75,278],[76,279],[77,280],[78,281],[109,282],[79,283],[80,284],[81,285],[82,286],[83,287],[84,288],[85,289],[86,290],[87,291],[88,292],[89,293],[90,294],[92,295],[91,296],[93,297],[94,298],[96,299],[97,300],[98,301],[99,302],[100,303],[101,304],[102,305],[103,306],[104,307],[105,308],[106,309],[107,310],[696,11],[229,311],[698,11],[723,312],[724,313],[699,314],[702,314],[721,312],[722,312],[712,312],[711,315],[709,312],[704,312],[717,312],[715,312],[719,312],[703,312],[716,312],[720,312],[705,312],[706,312],[718,312],[700,312],[707,312],[708,312],[710,312],[714,312],[725,316],[713,312],[701,312],[738,317],[732,316],[734,318],[733,316],[726,316],[727,316],[729,316],[731,316],[735,318],[736,318],[728,318],[730,318],[740,319],[743,320],[512,321],[579,322],[573,323],[575,324],[577,325],[576,325],[448,326],[598,327],[596,328],[597,329],[176,330],[178,330],[177,330],[175,330],[185,331],[180,332],[171,330],[172,330],[173,330],[174,330],[687,333],[689,334],[688,333],[686,335],[690,336],[685,337],[145,338],[140,339],[141,340],[142,340],[143,341],[144,341],[139,342],[533,343],[536,344],[535,345],[461,346],[463,347],[188,348],[187,349],[189,350],[186,351],[409,352],[417,353],[416,354],[412,355],[546,356],[544,357],[545,358],[543,359],[560,360],[561,361],[219,362],[220,362],[222,362],[224,363],[218,364],[223,362],[424,365],[423,366],[407,367],[421,368],[420,368],[422,369],[418,370],[419,368],[552,371],[554,371],[555,372],[553,373],[551,374],[471,375],[470,376],[476,377],[465,378],[469,379],[468,380],[472,381],[475,382],[473,383],[474,384],[466,385],[467,386],[518,387],[517,388],[516,389],[515,390],[557,391],[559,392],[558,393],[556,394],[661,133],[605,423],[606,423],[642,424],[641,395],[643,424],[644,423],[646,395],[648,425],[649,426],[651,427],[650,428],[667,406],[594,429],[666,430],[599,408],[645,133],[652,423],[604,431],[600,432],[653,433],[654,423],[647,434],[655,435],[662,133],[663,436],[603,437],[664,438],[602,439],[665,423]],"semanticDiagnosticsPerFile":[670,668,127,110,129,111,128,133,134,130,136,131,135,132,118,115,122,116,113,121,126,123,124,125,120,117,114,119,613,612,611,616,615,621,622,608,609,610,607,623,618,617,614,629,630,625,631,632,633,624,640,635,634,636,626,637,638,628,639,627,619,620,395,396,394,391,390,389,393,392,375,380,369,374,373,371,378,379,381,383,382,384,385,386,388,359,358,360,376,357,370,368,367,377,372,387,405,403,404,406,547,550,548,549,410,261,263,250,258,254,255,259,257,264,265,266,268,267,269,262,260,253,251,252,256,190,191,192,193,198,197,195,196,200,199,201,203,202,206,204,205,207,356,208,209,210,211,214,212,213,215,216,236,237,355,194,658,656,657,659,660,571,570,568,569,563,562,565,564,567,566,427,426,425,398,399,402,400,397,401,429,438,434,433,436,435,437,428,432,431,430,226,227,231,235,233,232,234,230,225,239,241,240,242,238,217,530,531,532,520,519,496,495,498,499,505,502,501,500,497,504,503,528,508,510,509,507,506,525,524,523,527,526,494,521,522,529,486,485,352,243,353,354,244,245,246,351,349,247,350,278,279,280,281,282,283,285,287,288,289,286,284,290,292,291,293,294,300,295,298,299,296,297,304,302,301,303,270,336,338,339,347,340,341,342,343,345,344,346,337,348,321,248,249,272,273,274,275,276,277,322,323,325,334,327,326,328,329,333,330,331,332,271,335,324,319,306,315,307,308,317,309,310,318,316,311,314,312,313,320,305,456,439,440,443,444,445,446,449,450,451,452,453,454,455,457,458,493,477,459,481,482,480,479,483,484,488,489,478,487,490,491,492,442,441,538,539,540,537,146,147,149,150,151,152,153,154,155,148,168,156,157,160,161,162,163,164,165,166,167,364,363,366,361,365,362,413,415,414,673,669,671,672,411,159,464,674,677,675,678,679,680,681,692,691,676,693,582,583,581,584,585,586,587,588,589,590,591,592,593,694,158,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,59,108,76,77,78,109,79,80,81,82,83,84,85,86,87,88,89,90,92,91,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,695,696,697,513,229,228,698,723,724,699,702,721,722,712,711,709,704,717,715,719,703,716,720,705,706,718,700,707,708,710,714,725,713,701,738,737,732,734,733,726,727,729,731,735,736,728,730,740,739,741,534,742,743,512,511,578,579,573,572,575,574,577,576,112,682,447,448,580,598,596,597,595,514,179,176,178,177,175,185,180,184,181,183,182,171,172,173,169,170,174,683,687,689,688,686,690,541,460,685,684,138,145,140,141,142,143,144,139,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,533,536,535,461,462,463,137,188,187,189,186,409,417,416,408,412,546,544,545,543,560,561,219,220,221,222,224,218,223,424,423,407,421,420,422,418,419,542,552,554,555,553,551,471,470,476,465,469,468,472,475,473,474,466,467,518,517,516,515,557,559,558,556,601,661,605,606,642,641,643,644,646,648,649,651,650,667,594,666,599,645,652,604,600,653,654,647,655,662,663,603,664,602,665,48,49,50,51,52,53,43,54,55,56,44,45,46,47],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.9.5"} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types.js b/node_modules/@metamask/transaction-controller/dist/types.js +index 5e00e89..51e4018 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types.js ++++ b/node_modules/@metamask/transaction-controller/dist/types.js +@@ -8,7 +8,7 @@ + + + +-var _chunkAYTU4HU5js = require('./chunk-AYTU4HU5.js'); ++var _chunkVWDGWDFVjs = require('./chunk-VWDGWDFV.js'); + require('./chunk-Z4BLTVTB.js'); + + +@@ -20,5 +20,5 @@ require('./chunk-Z4BLTVTB.js'); + + + +-exports.GasFeeEstimateLevel = _chunkAYTU4HU5js.GasFeeEstimateLevel; exports.GasFeeEstimateType = _chunkAYTU4HU5js.GasFeeEstimateType; exports.SimulationErrorCode = _chunkAYTU4HU5js.SimulationErrorCode; exports.SimulationTokenStandard = _chunkAYTU4HU5js.SimulationTokenStandard; exports.TransactionEnvelopeType = _chunkAYTU4HU5js.TransactionEnvelopeType; exports.TransactionStatus = _chunkAYTU4HU5js.TransactionStatus; exports.TransactionType = _chunkAYTU4HU5js.TransactionType; exports.UserFeeLevel = _chunkAYTU4HU5js.UserFeeLevel; exports.WalletDevice = _chunkAYTU4HU5js.WalletDevice; ++exports.GasFeeEstimateLevel = _chunkVWDGWDFVjs.GasFeeEstimateLevel; exports.GasFeeEstimateType = _chunkVWDGWDFVjs.GasFeeEstimateType; exports.SimulationErrorCode = _chunkVWDGWDFVjs.SimulationErrorCode; exports.SimulationTokenStandard = _chunkVWDGWDFVjs.SimulationTokenStandard; exports.TransactionEnvelopeType = _chunkVWDGWDFVjs.TransactionEnvelopeType; exports.TransactionStatus = _chunkVWDGWDFVjs.TransactionStatus; exports.TransactionType = _chunkVWDGWDFVjs.TransactionType; exports.UserFeeLevel = _chunkVWDGWDFVjs.UserFeeLevel; exports.WalletDevice = _chunkVWDGWDFVjs.WalletDevice; + //# sourceMappingURL=types.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types.js.map b/node_modules/@metamask/transaction-controller/dist/types.js.map +deleted file mode 100644 +index a464c67..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/types.js.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"names":[],"mappings":""} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types.mjs b/node_modules/@metamask/transaction-controller/dist/types.mjs +index 5141bef..6c9c192 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/types.mjs +@@ -8,7 +8,7 @@ import { + TransactionType, + UserFeeLevel, + WalletDevice +-} from "./chunk-6SJYXSF3.mjs"; ++} from "./chunk-UF4IMTUO.mjs"; + import "./chunk-XUI43LEZ.mjs"; + export { + GasFeeEstimateLevel, +diff --git a/node_modules/@metamask/transaction-controller/dist/types.mjs.map b/node_modules/@metamask/transaction-controller/dist/types.mjs.map +deleted file mode 100644 +index 84c51b2..0000000 +--- a/node_modules/@metamask/transaction-controller/dist/types.mjs.map ++++ /dev/null +@@ -1 +0,0 @@ +-{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts b/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts +index f4c0fa6..ae01c71 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts ++++ b/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts +@@ -9,7 +9,7 @@ import type { BlockTracker, NetworkClientId, NetworkController, NetworkControlle + import type { NonceLock, Transaction as NonceTrackerTransaction } from '@metamask/nonce-tracker'; + import type { Hex } from '@metamask/utils'; + import type { IncomingTransactionOptions } from './helpers/IncomingTransactionHelper'; +-import type { SavedGasFees, SecurityProviderRequest, SendFlowHistoryEntry, TransactionParams, TransactionMeta, TransactionReceipt, WalletDevice, SecurityAlertResponse, GasFeeFlowResponse } from './types'; ++import type { SavedGasFees, SecurityProviderRequest, SendFlowHistoryEntry, TransactionParams, TransactionMeta, TransactionReceipt, WalletDevice, SecurityAlertResponse, GasFeeFlowResponse, SubmitHistoryEntry } from './types'; + import { TransactionType, TransactionStatus } from './types'; + export declare const HARDFORK = Hardfork.London; + /** +@@ -61,6 +61,7 @@ export type TransactionControllerState = { + lastFetchedBlockNumbers: { + [key: string]: number; + }; ++ submitHistory: SubmitHistoryEntry[]; + }; + /** + * Multiplier used to determine a transaction's increased gas fee during cancellation +diff --git a/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts.map b/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts.map +index c2f75bc..9b2c9f0 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts.map ++++ b/node_modules/@metamask/transaction-controller/dist/types/TransactionController.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"TransactionController.d.ts","sourceRoot":"","sources":["../../src/TransactionController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4B,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,KAAK,EACV,0BAA0B,EAC1B,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,iCAAiC,EACjC,YAAY,EACZ,QAAQ,EACR,mDAAmD,EACnD,2CAA2C,EAC5C,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,SAAS,EACT,WAAW,IAAI,uBAAuB,EACvC,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,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IACH,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,sBAAsB;IAwB9B,OAAO,CAAC,gCAAgC;IAkBxC,OAAO,CAAC,4BAA4B;IAsCpC;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAsC9B;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IA4ClC;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAenC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;YAMpB,0BAA0B;IAUxC;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;YAmBlB,uBAAuB;YAYvB,eAAe;IAsE7B,OAAO,CAAC,yBAAyB;IAMjC,OAAO,CAAC,2BAA2B;IAanC,OAAO,CAAC,sBAAsB;YAiBhB,iBAAiB;YAmNjB,0BAA0B;IAmBxC;;;;;OAKG;IAIH,OAAO,CAAC,kCAAkC;CA6P3C"} +\ No newline at end of file ++{"version":3,"file":"TransactionController.d.ts","sourceRoot":"","sources":["../../src/TransactionController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4B,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,KAAK,EACV,0BAA0B,EAC1B,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,iCAAiC,EACjC,YAAY,EACZ,QAAQ,EACR,mDAAmD,EACnD,2CAA2C,EAC5C,MAAM,8BAA8B,CAAC;AAEt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AOtB,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;;OASG;IACH,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,sBAAsB;IAwB9B,OAAO,CAAC,gCAAgC;IAkBxC,OAAO,CAAC,4BAA4B;IAsCpC;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAsC9B;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IA4ClC;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAenC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;YAMpB,0BAA0B;IAUxC;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;YAmBlB,uBAAuB;YAYvB,eAAe;IAsE7B,OAAO,CAAC,yBAAyB;IAMjC,OAAO,CAAC,2BAA2B;IAanC,OAAO,CAAC,sBAAsB;YAiBhB,iBAAiB;YAqNjB,0BAA0B;IA0BxC;;;;;OAKG;IAIH,OAAO,CAAC,kCAAkC;CAyS3C"} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types/index.d.ts b/node_modules/@metamask/transaction-controller/dist/types/index.d.ts +index 2034e20..dec5538 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types/index.d.ts ++++ b/node_modules/@metamask/transaction-controller/dist/types/index.d.ts +@@ -1,9 +1,10 @@ + export type { FeeMarketEIP1559Values, GasPriceValue, MethodData, Result, TransactionControllerActions, TransactionControllerEvents, TransactionControllerGetStateAction, TransactionControllerIncomingTransactionBlockReceivedEvent, TransactionControllerPostTransactionBalanceUpdatedEvent, TransactionControllerSpeedupTransactionAddedEvent, TransactionControllerState, TransactionControllerStateChangeEvent, TransactionControllerTransactionApprovedEvent, TransactionControllerTransactionConfirmedEvent, TransactionControllerTransactionDroppedEvent, TransactionControllerTransactionFailedEvent, TransactionControllerTransactionFinishedEvent, TransactionControllerTransactionNewSwapApprovalEvent, TransactionControllerTransactionNewSwapEvent, TransactionControllerTransactionPublishingSkipped, TransactionControllerTransactionRejectedEvent, TransactionControllerTransactionStatusUpdatedEvent, TransactionControllerTransactionSubmittedEvent, TransactionControllerUnapprovedTransactionAddedEvent, TransactionControllerMessenger, } from './TransactionController'; +-export { HARDFORK, CANCEL_RATE, TransactionController, } from './TransactionController'; ++export { HARDFORK, CANCEL_RATE, SPEED_UP_RATE, TransactionController, } from './TransactionController'; + export type { DappSuggestedGasFees, DefaultGasEstimates, FeeMarketGasFeeEstimateForLevel, FeeMarketGasFeeEstimates, GasFeeEstimates, GasPriceGasFeeEstimates, InferTransactionTypeResult, LegacyGasFeeEstimates, Log, RemoteTransactionSource, RemoteTransactionSourceRequest, SavedGasFees, SecurityAlertResponse, SecurityProviderRequest, SendFlowHistoryEntry, SimulationBalanceChange, SimulationData, SimulationError, SimulationToken, SimulationTokenBalanceChange, TransactionError, TransactionHistory, TransactionHistoryEntry, TransactionMeta, TransactionParams, TransactionReceipt, } from './types'; + export { GasFeeEstimateLevel, GasFeeEstimateType, SimulationErrorCode, SimulationTokenStandard, TransactionEnvelopeType, TransactionStatus, TransactionType, UserFeeLevel, WalletDevice, } from './types'; + export type { EtherscanTransactionMeta } from './utils/etherscan'; + export { determineTransactionType } from './utils/transaction-type'; + export { mergeGasFeeEstimates } from './utils/gas-flow'; + export { isEIP1559Transaction, normalizeTransactionParams, } from './utils/utils'; ++export { CHAIN_IDS, ETHERSCAN_SUPPORTED_NETWORKS } from './constants'; + //# sourceMappingURL=index.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types/index.d.ts.map b/node_modules/@metamask/transaction-controller/dist/types/index.d.ts.map +index 4496e26..bd3b7be 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types/index.d.ts.map ++++ b/node_modules/@metamask/transaction-controller/dist/types/index.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"index.d.ts","sourceRoot":"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BAAoB,EACpB,0BAA0B,GAC3B,MAAM,eAAe,CAAC"} +\ No newline at end of file ++{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,MAAM,EACN,4BAA4B,EAC5B,2BAA2B,EAC3B,mCAAmC,EACnC,0DAA0D,EAC1D,uDAAuD,EACvD,iDAAiD,EACjD,0BAA0B,EAC1B,qCAAqC,EACrC,6CAA6C,EAC7C,8CAA8C,EAC9C,4CAA4C,EAC5C,2CAA2C,EAC3C,6CAA6C,EAC7C,oDAAoD,EACpD,4CAA4C,EAC5C,iDAAiD,EACjD,6CAA6C,EAC7C,kDAAkD,EAClD,8CAA8C,EAC9C,oDAAoD,EACpD,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,QAAQ,EACR,WAAW,EACX,aAAa,EACb,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACxB,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,GAAG,EACH,uBAAuB,EACvB,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,eAAe,EACf,4BAA4B,EAC5B,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types/types.d.ts b/node_modules/@metamask/transaction-controller/dist/types/types.d.ts +index c8a0e83..cf77710 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types/types.d.ts ++++ b/node_modules/@metamask/transaction-controller/dist/types/types.d.ts +@@ -983,5 +983,33 @@ export type SimulationData = { + /** Data concerning a change to the user's token balances. */ + tokenBalanceChanges: SimulationTokenBalanceChange[]; + }; ++/** ++ * Data concerning a successfully submitted transaction. ++ * Used for debugging purposes. ++ */ ++export type SubmitHistoryEntry = { ++ /** The chain ID of the transaction as a hexadecimal string. */ ++ chainId?: Hex; ++ /** The hash of the transaction returned from the RPC provider. */ ++ hash: string; ++ /** True if the entry was generated using the migration and existing transaction metadata. */ ++ migration?: boolean; ++ /** The type of the network where the transaction was submitted. */ ++ networkType?: string; ++ /** ++ * The URL of the network the transaction was submitted to. ++ * A single network URL if it was recorded when submitted. ++ * An array of potential network URLs if it cannot be confirmed since the migration was used. ++ */ ++ networkUrl?: string | string[]; ++ /** The origin of the transaction. */ ++ origin?: string; ++ /** The raw transaction data that was submitted. */ ++ rawTransaction: string; ++ /** When the transaction was submitted. */ ++ time: number; ++ /** The transaction parameters that were submitted. */ ++ transaction: Record; ++}; + export {}; + //# sourceMappingURL=types.d.ts.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/types/types.d.ts.map b/node_modules/@metamask/transaction-controller/dist/types/types.d.ts.map +index 54b97e8..f41d302 100644 +--- a/node_modules/@metamask/transaction-controller/dist/types/types.d.ts.map ++++ b/node_modules/@metamask/transaction-controller/dist/types/types.d.ts.map +@@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kE;AAClE,MAAM,MAAM,4BAA4B,GAAG,eAAe,GACxD,uBAAuB,CAAC;AAE1B,oBAAY,mBAAmB;IAC7B,iBAAiB,wBAAwB;IACzC,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,QAAQ,aAAa;CACtB;AAED,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAC5B,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,KAAK,CAAC,EAAE,eAAe,CAAC;IAExB,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAE9C,6DAA6D;IAC7D,mBAAmB,EAAE,4BAA4B,EAAE,CAAC;CACrD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+DAA+D;IAC/D,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IAEb,6FAA6F;IAC7F,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE/B,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAC;IAEvB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IAEb,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CACnC,CAAC"} +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.js b/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.js +index 9c4875a..1a0766b 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.js +@@ -1,7 +1,7 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + var _chunk7LXE4KHVjs = require('../chunk-7LXE4KHV.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.mjs b/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.mjs +index e688b01..098c25b 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/external-transactions.mjs +@@ -1,7 +1,7 @@ + import { + validateConfirmedExternalTransaction + } from "../chunk-FRKQ3Z2L.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + validateConfirmedExternalTransaction +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.js b/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.js +index 6061d37..2bf9bb1 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.js +@@ -1,16 +1,16 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + +-var _chunkC3WC4OJ3js = require('../chunk-C3WC4OJ3.js'); ++var _chunkXGCT4DDWjs = require('../chunk-XGCT4DDW.js'); + require('../chunk-QH2H4W3N.js'); + require('../chunk-OZ6UB42C.js'); +-require('../chunk-76FONEDA.js'); ++require('../chunk-OEMCU4FY.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + + +-exports.gweiDecimalToWeiHex = _chunkC3WC4OJ3js.gweiDecimalToWeiHex; exports.updateGasFees = _chunkC3WC4OJ3js.updateGasFees; ++exports.gweiDecimalToWeiHex = _chunkXGCT4DDWjs.gweiDecimalToWeiHex; exports.updateGasFees = _chunkXGCT4DDWjs.updateGasFees; + //# sourceMappingURL=gas-fees.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.mjs b/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.mjs +index c98b201..51289d9 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-fees.mjs +@@ -1,13 +1,13 @@ + import { + gweiDecimalToWeiHex, + updateGasFees +-} from "../chunk-VXNPVIYL.mjs"; ++} from "../chunk-UUBV6ROF.mjs"; + import "../chunk-GNAL5HC2.mjs"; + import "../chunk-Q56I5ONX.mjs"; +-import "../chunk-JXXTNVU4.mjs"; ++import "../chunk-GRMANXAN.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + gweiDecimalToWeiHex, +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js +index 3532305..9c44972 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.js +@@ -1,11 +1,11 @@ + "use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + +-var _chunk76FONEDAjs = require('../chunk-76FONEDA.js'); +-require('../chunk-AYTU4HU5.js'); ++var _chunkOEMCU4FYjs = require('../chunk-OEMCU4FY.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + + +-exports.getGasFeeFlow = _chunk76FONEDAjs.getGasFeeFlow; exports.mergeGasFeeEstimates = _chunk76FONEDAjs.mergeGasFeeEstimates; ++exports.getGasFeeFlow = _chunkOEMCU4FYjs.getGasFeeFlow; exports.mergeGasFeeEstimates = _chunkOEMCU4FYjs.mergeGasFeeEstimates; + //# sourceMappingURL=gas-flow.js.map +\ No newline at end of file +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.mjs b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.mjs +index 3e3ab87..a1a99a9 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/gas-flow.mjs +@@ -1,8 +1,8 @@ + import { + getGasFeeFlow, + mergeGasFeeEstimates +-} from "../chunk-JXXTNVU4.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++} from "../chunk-GRMANXAN.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + getGasFeeFlow, +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js +index c4b2f32..89f05c2 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.js +@@ -3,7 +3,7 @@ + var _chunkKT6UAKBBjs = require('../chunk-KT6UAKBB.js'); + require('../chunk-HMOSP33F.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.mjs b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.mjs +index fff3f37..d9856ee 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation-api.mjs +@@ -3,7 +3,7 @@ import { + } from "../chunk-K4KOSAGM.mjs"; + import "../chunk-HQSNKCXI.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + simulateTransactions +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation.js b/node_modules/@metamask/transaction-controller/dist/utils/simulation.js +index 42eb1f4..4e8fa9a 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/simulation.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation.js +@@ -7,7 +7,7 @@ require('../chunk-KT6UAKBB.js'); + require('../chunk-HMOSP33F.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/simulation.mjs b/node_modules/@metamask/transaction-controller/dist/utils/simulation.mjs +index c6d4a22..4d92438 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/simulation.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/simulation.mjs +@@ -7,7 +7,7 @@ import "../chunk-K4KOSAGM.mjs"; + import "../chunk-HQSNKCXI.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + SupportedToken, +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/swaps.js b/node_modules/@metamask/transaction-controller/dist/utils/swaps.js +index 150a63e..6d4a0fc 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/swaps.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/swaps.js +@@ -10,7 +10,7 @@ var _chunkQH2H4W3Njs = require('../chunk-QH2H4W3N.js'); + require('../chunk-OZ6UB42C.js'); + require('../chunk-UGN7PBON.js'); + require('../chunk-S6VGOPUY.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/swaps.mjs b/node_modules/@metamask/transaction-controller/dist/utils/swaps.mjs +index 528aed6..b926981 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/swaps.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/swaps.mjs +@@ -10,7 +10,7 @@ import { + import "../chunk-Q56I5ONX.mjs"; + import "../chunk-O6ZZVIFH.mjs"; + import "../chunk-UQQWZT6C.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + DEFAULT_TOKEN_ADDRESS, +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.js b/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.js +index f0ed984..d990bea 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.js +@@ -2,7 +2,7 @@ + + + var _chunkSD6CWFDFjs = require('../chunk-SD6CWFDF.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.mjs b/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.mjs +index 1a12d1a..f302161 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/transaction-type.mjs +@@ -2,7 +2,7 @@ import { + ESTIMATE_GAS_ERROR, + determineTransactionType + } from "../chunk-KG4UW4K4.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + ESTIMATE_GAS_ERROR, +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/utils.js b/node_modules/@metamask/transaction-controller/dist/utils/utils.js +index 520598f..15d08d3 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/utils.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/utils.js +@@ -13,7 +13,7 @@ + + + var _chunkOZ6UB42Cjs = require('../chunk-OZ6UB42C.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/utils.mjs b/node_modules/@metamask/transaction-controller/dist/utils/utils.mjs +index 5ca1460..d878789 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/utils.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/utils.mjs +@@ -13,7 +13,7 @@ import { + validateIfTransactionUnapproved, + validateMinimumIncrease + } from "../chunk-Q56I5ONX.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + ESTIMATE_GAS_ERROR, +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/validation.js b/node_modules/@metamask/transaction-controller/dist/utils/validation.js +index 0f9b5a5..2ff5376 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/validation.js ++++ b/node_modules/@metamask/transaction-controller/dist/utils/validation.js +@@ -3,7 +3,7 @@ + + var _chunkRXIUMVA5js = require('../chunk-RXIUMVA5.js'); + require('../chunk-OZ6UB42C.js'); +-require('../chunk-AYTU4HU5.js'); ++require('../chunk-VWDGWDFV.js'); + require('../chunk-Z4BLTVTB.js'); + + +diff --git a/node_modules/@metamask/transaction-controller/dist/utils/validation.mjs b/node_modules/@metamask/transaction-controller/dist/utils/validation.mjs +index 4d098e7..9fb2b9b 100644 +--- a/node_modules/@metamask/transaction-controller/dist/utils/validation.mjs ++++ b/node_modules/@metamask/transaction-controller/dist/utils/validation.mjs +@@ -3,7 +3,7 @@ import { + validateTxParams + } from "../chunk-5ZEJT5SN.mjs"; + import "../chunk-Q56I5ONX.mjs"; +-import "../chunk-6SJYXSF3.mjs"; ++import "../chunk-UF4IMTUO.mjs"; + import "../chunk-XUI43LEZ.mjs"; + export { + validateTransactionOrigin, diff --git a/patches/ethjs++ethjs-contract+0.2.2.patch b/patches/ethjs++ethjs-contract+0.2.2.patch deleted file mode 100644 index 2dba8b31c38..00000000000 --- a/patches/ethjs++ethjs-contract+0.2.2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/ethjs/node_modules/ethjs-contract/package.json b/node_modules/ethjs/node_modules/ethjs-contract/package.json -index 8e58ff5..470d00b 100644 ---- a/node_modules/ethjs/node_modules/ethjs-contract/package.json -+++ b/node_modules/ethjs/node_modules/ethjs-contract/package.json -@@ -197,7 +197,7 @@ - "lint-staged": { - "lint:eslint": "*.js" - }, -- "main": "lib/index.js", -+ "main": "src/index.js", - "name": "ethjs-contract", - "pre-commit": "build", - "repository": { diff --git a/patches/ethjs++ethjs-query+0.3.7.patch b/patches/ethjs++ethjs-query+0.3.7.patch deleted file mode 100644 index ab7492e02af..00000000000 --- a/patches/ethjs++ethjs-query+0.3.7.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/ethjs/node_modules/ethjs-query/package.json b/node_modules/ethjs/node_modules/ethjs-query/package.json -index fb82d51..503159c 100644 ---- a/node_modules/ethjs/node_modules/ethjs-query/package.json -+++ b/node_modules/ethjs/node_modules/ethjs-query/package.json -@@ -2,7 +2,7 @@ - "name": "ethjs-query", - "version": "0.3.7", - "description": "A simple query layer for the Ethereum RPC.", -- "main": "lib/index.js", -+ "main": "src/index.js", - "files": [ - "dist", - "internals", diff --git a/patches/ethjs-contract+0.2.3.patch b/patches/ethjs-contract+0.2.3.patch new file mode 100644 index 00000000000..0c16ee54860 --- /dev/null +++ b/patches/ethjs-contract+0.2.3.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/ethjs-contract/package.json b/node_modules/ethjs-contract/package.json +index 8e58ff5..470d00b 100644 +--- a/node_modules/ethjs-contract/package.json ++++ b/node_modules/ethjs-contract/package.json +@@ -197,7 +197,7 @@ + "lint-staged": { + "lint:eslint": "*.js" + }, +- "main": "lib/index.js", ++ "main": "src/index.js", + "name": "ethjs-contract", + "pre-commit": "build", + "repository": { diff --git a/patches/ethjs-query+0.3.8.patch b/patches/ethjs-query+0.3.8.patch new file mode 100644 index 00000000000..e5088845174 --- /dev/null +++ b/patches/ethjs-query+0.3.8.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/ethjs-query/package.json b/node_modules/ethjs-query/package.json +index fb82d51..503159c 100644 +--- a/node_modules/ethjs-query/package.json ++++ b/node_modules/ethjs-query/package.json +@@ -2,7 +2,7 @@ + "name": "ethjs-query", + "version": "0.3.8", + "description": "A simple query layer for the Ethereum RPC.", +- "main": "lib/index.js", ++ "main": "src/index.js", + "files": [ + "dist", + "internals", diff --git a/scripts/patch-approval-controller.sh b/scripts/patch-approval-controller.sh index 1912940ee76..1697e0749b8 100755 --- a/scripts/patch-approval-controller.sh +++ b/scripts/patch-approval-controller.sh @@ -22,13 +22,13 @@ DIST_DIR_MOBILE="$PACKAGE_DIR_MOBILE/dist" PATCH_FILE="patches/@metamask+approval-controller+*.patch" COMMENT_LINE_COUNT=7 -COMMENT='+PATCH GENERATED FROM MetaMask/core branch: patch/mobile-approval-controller-3-5-2\ +COMMENT='+PATCH GENERATED FROM MetaMask/core branch: patch/mobile-approval-controller-7-0-1\ +This patch backports various transaction controller features from the main branch of MetaMask/core\ +Steps to update patch:\ -+* Create a new core branch from: patch/mobile-approval-controller-3-5-2\ ++* Create a new core branch from: patch/mobile-approval-controller-7-0-1\ +* Run "yarn build" in the core monorepo\ +* Run "yarn patch:approval " in the mobile repo\ -+* Once the new patch is merged, add your changes to: patch/mobile-approval-controller-3-5-2' ++* Once the new patch is merged, add your changes to: patch/mobile-approval-controller-7-0-1' COMMENT_DIFF='diff --git a/node_modules/@metamask/approval-controller/dist/.patch.txt b/node_modules/@metamask/approval-controller/dist/.patch.txt\ new file mode 100644\ diff --git a/scripts/patch-transaction-controller.sh b/scripts/patch-transaction-controller.sh index 34b65be6f3a..d4c92cca9ac 100755 --- a/scripts/patch-transaction-controller.sh +++ b/scripts/patch-transaction-controller.sh @@ -20,13 +20,13 @@ DIST_DIR_MOBILE="$PACKAGE_DIR_MOBILE/dist" PATCH_FILE="patches/@metamask+transaction-controller+*.patch" COMMENT_LINE_COUNT=7 -COMMENT='+PATCH GENERATED FROM MetaMask/core branch: patch/mobile-transaction-controller-13-0-0\ +COMMENT='+PATCH GENERATED FROM MetaMask/core branch: patch/mobile-transaction-controller-35-0-0\ +This patch backports various transaction controller features from the main branch of MetaMask/core\ +Steps to update patch:\ -+* Create a new core branch from: patch/mobile-transaction-controller-13-0-0\ ++* Create a new core branch from: patch/mobile-transaction-controller-35-0-0\ +* Run "yarn build" in the core monorepo\ +* Run "yarn patch:tx " in the mobile repo\ -+* Once the new patch is merged, add your changes to: patch/mobile-transaction-controller-13-0-0' ++* Once the new patch is merged, add your changes to: patch/mobile-transaction-controller-35-0-0' COMMENT_DIFF='diff --git a/node_modules/@metamask/transaction-controller/dist/.patch.txt b/node_modules/@metamask/transaction-controller/dist/.patch.txt\ new file mode 100644\ diff --git a/yarn.lock b/yarn.lock index 80315e892b9..8505a41800b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4072,14 +4072,6 @@ resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-7.8.0.tgz#fc32e07746689459c4b049dc581d1dbda5545686" integrity sha512-+70fkgjhVJeJ+nJqnburIM3UAsfvxat1Low9HMPobLbv64FIdB4Nzu5ct3qojNQ58r5sK01tg5UoFIJYslaVrg== -"@metamask/abi-utils@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@metamask/abi-utils/-/abi-utils-1.2.0.tgz#068e1b0f5e423dfae96961e0e5276a7c1babc03a" - integrity sha512-Hf7fnBDM9ptCPDtq/wQffWbw859CdVGMwlpWUEsTH6gLXhXONGrRXHA2piyYPRuia8YYTdJvRC/zSK1/nyLvYg== - dependencies: - "@metamask/utils" "^3.4.1" - superstruct "^1.0.3" - "@metamask/abi-utils@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@metamask/abi-utils/-/abi-utils-2.0.2.tgz#ad394e9cb8a95ac177cad942daadd88a246c0de8" @@ -4105,6 +4097,24 @@ immer "^9.0.6" uuid "^8.3.2" +"@metamask/accounts-controller@^17.2.0": + version "17.2.0" + resolved "https://registry.yarnpkg.com/@metamask/accounts-controller/-/accounts-controller-17.2.0.tgz#b74918444a9d8e6e69b9b761dc58e64aac6b466c" + integrity sha512-hfdfRV7mxxnyG1tri3CatV63WWtwPkUSl0zTz7Mq3psSXqOFr+08f1Elw4sX7pP1V/rCxZKeotoluIjUeu1Q9Q== + dependencies: + "@ethereumjs/util" "^8.1.0" + "@metamask/base-controller" "^6.0.0" + "@metamask/eth-snap-keyring" "^4.3.1" + "@metamask/keyring-api" "^8.0.0" + "@metamask/keyring-controller" "^17.1.0" + "@metamask/snaps-sdk" "^4.2.0" + "@metamask/snaps-utils" "^7.4.0" + "@metamask/utils" "^8.3.0" + deepmerge "^4.2.2" + ethereum-cryptography "^2.1.2" + immer "^9.0.6" + uuid "^8.3.2" + "@metamask/address-book-controller@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@metamask/address-book-controller/-/address-book-controller-4.0.1.tgz#78a841e97b7db0058e6796590eb07444c750d13f" @@ -4114,17 +4124,6 @@ "@metamask/controller-utils" "^9.0.1" "@metamask/utils" "^8.3.0" -"@metamask/approval-controller@^3.5.2": - version "3.5.2" - resolved "https://registry.yarnpkg.com/@metamask/approval-controller/-/approval-controller-3.5.2.tgz#c8ca4578f053d719bff82b0c9fa1939d21978d46" - integrity sha512-5jYMtPexeeNL8m+5Mzhayr1l367MbbBs0Wf+FBeL/xLv6nSNqvvNs/CXfvkqxLDZJKIgBCBPKg7eIu1U6MJ6ag== - dependencies: - "@metamask/base-controller" "^3.2.2" - "@metamask/utils" "^6.2.0" - eth-rpc-errors "^4.0.2" - immer "^9.0.6" - nanoid "^3.1.31" - "@metamask/approval-controller@^6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@metamask/approval-controller/-/approval-controller-6.0.2.tgz#2bae3c293b73e8ecaf8cbba11fbc99c61adb4367" @@ -4135,14 +4134,14 @@ "@metamask/utils" "^8.3.0" nanoid "^3.1.31" -"@metamask/approval-controller@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@metamask/approval-controller/-/approval-controller-7.0.0.tgz#9b872df23c8dcfb30fe3f5f4502850ba350c1ec7" - integrity sha512-8/OogfKqe7IRXqjOVrc2fiiqzmdRKZ/AU2oWQXSl+vMfm3TQkzW9hd9jMpXsypg7qeQQ1OmckzkSJMAynNe4YA== +"@metamask/approval-controller@^7.0.0", "@metamask/approval-controller@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@metamask/approval-controller/-/approval-controller-7.0.1.tgz#a27553a5e1edeee7869c46156c017200fb0e9f9e" + integrity sha512-az4CQrisntgQ3vPMXxAvHY1Yx5KJyclXIUKlN1D5v0SlLa1Juo7Bk1fnfcwujt4BsNco27WYUKYz8kpZXFGMqw== dependencies: - "@metamask/base-controller" "^6.0.0" - "@metamask/rpc-errors" "^6.2.1" - "@metamask/utils" "^8.3.0" + "@metamask/base-controller" "^6.0.1" + "@metamask/rpc-errors" "^6.3.1" + "@metamask/utils" "^9.0.0" nanoid "^3.1.31" "@metamask/assets-controllers@^30.0.0": @@ -4179,7 +4178,7 @@ single-call-balance-checker-abi "^1.0.0" uuid "^8.3.2" -"@metamask/base-controller@^3.0.0", "@metamask/base-controller@^3.2.2", "@metamask/base-controller@^3.2.3": +"@metamask/base-controller@^3.0.0", "@metamask/base-controller@^3.2.3": version "3.2.3" resolved "https://registry.yarnpkg.com/@metamask/base-controller/-/base-controller-3.2.3.tgz#7436a14f6789acf0814952dabaa70ee4fb7d473c" integrity sha512-k66oZe7BOEx0D5N5X8feE/32QlrUTmiEHHAZU/yCac2+VHllJOCEQV/cTeaAtgepnEf8O7SskvYZN+eIjgS99w== @@ -4275,19 +4274,6 @@ eth-ens-namehash "^2.0.8" fast-deep-equal "^3.1.3" -"@metamask/controller-utils@^5.0.1": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-5.0.2.tgz#f6e848d9b80aca7943e1edae927324982305d1f8" - integrity sha512-bHgyPL+Ah6OBOkjWykA1NpTZdpRhoJjCrvuFf8mFxBJLvXE9m/rw9DYp2Rw9WXonMWK17NxwQv/7bKzsGZnjVQ== - dependencies: - "@metamask/eth-query" "^3.0.1" - "@metamask/utils" "^8.1.0" - "@spruceid/siwe-parser" "1.1.3" - eth-ens-namehash "^2.0.8" - ethereumjs-util "^7.0.10" - ethjs-unit "^0.1.6" - fast-deep-equal "^3.1.3" - "@metamask/controller-utils@^8.0.1", "@metamask/controller-utils@^8.0.2", "@metamask/controller-utils@^8.0.4": version "8.0.4" resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-8.0.4.tgz#78a952301ff4b2a501b31865ab0de434c6ea3cd2" @@ -4336,7 +4322,7 @@ resolved "https://registry.yarnpkg.com/@metamask/eslint-plugin-design-tokens/-/eslint-plugin-design-tokens-1.1.0.tgz#c9d4471f04f62bfb307aa261d11b7a674eb27961" integrity sha512-33BJTEl96wXrkNdydNgTnfz3C0XP6/FdYbKzNnM8wT3XeVOkF/EOt8oiY8X4stXlNKDJtKyQchxENgZwS8sl9w== -"@metamask/eth-block-tracker@^9.0.2": +"@metamask/eth-block-tracker@^9.0.2", "@metamask/eth-block-tracker@^9.0.3": version "9.0.3" resolved "https://registry.yarnpkg.com/@metamask/eth-block-tracker/-/eth-block-tracker-9.0.3.tgz#ceebe9bc720a54c3a4749fc09c8f8bb9fe206255" integrity sha512-I29IwdhnSJtk/A05vFsiOV92ADXXtBymXfC0naSvHP9TYNNOryG9y2l0jmnSzBsP3+wefCkHJWEzEwF4YSKogw== @@ -4358,17 +4344,6 @@ "@metamask/utils" "^8.1.0" ethereum-cryptography "^2.1.2" -"@metamask/eth-json-rpc-infura@^8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-infura/-/eth-json-rpc-infura-8.1.1.tgz#e877284634fb0727b347575115c74dc9ddd4400c" - integrity sha512-Ey05VRIMqvF845+pbJeptPm4RrzwHSfmT3QiJfQGWLG4yKdkhvlgOJ7xxYxqbdvPIywA5qCLI7Kszk0gAbWiKA== - dependencies: - "@metamask/eth-json-rpc-provider" "^1.0.0" - "@metamask/utils" "^4.0.0" - eth-rpc-errors "^4.0.3" - json-rpc-engine "^6.1.0" - node-fetch "^2.6.7" - "@metamask/eth-json-rpc-infura@^9.0.0", "@metamask/eth-json-rpc-infura@^9.1.0": version "9.1.0" resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-infura/-/eth-json-rpc-infura-9.1.0.tgz#8e09588ed58f49058615cab7040dcbce4682a292" @@ -4380,21 +4355,6 @@ "@metamask/utils" "^8.1.0" node-fetch "^2.7.0" -"@metamask/eth-json-rpc-middleware@^11.0.2": - version "11.0.2" - resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-11.0.2.tgz#85e6639f5d159a3277d13609dea9f12ebfb5b4e8" - integrity sha512-/HqtuK/6E8sIJmzg0O3Ey5JsgK6O/VbDqg5R9thHFQMi9EtKXnnZFc8Blir7IOQraGVJFiZQIKZMHRTNQRyreg== - dependencies: - "@metamask/eth-json-rpc-provider" "^1.0.0" - "@metamask/eth-sig-util" "^6.0.0" - "@metamask/utils" "^5.0.1" - clone "^2.1.1" - eth-block-tracker "^7.0.1" - eth-rpc-errors "^4.0.3" - json-rpc-engine "^6.1.0" - pify "^3.0.0" - safe-stable-stringify "^2.3.2" - "@metamask/eth-json-rpc-middleware@^12.1.0", "@metamask/eth-json-rpc-middleware@^12.1.1": version "12.1.1" resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-12.1.1.tgz#5b6a19386f420211cb554c637f0927b76dc3167a" @@ -4437,14 +4397,16 @@ "@metamask/safe-event-emitter" "^3.0.0" "@metamask/utils" "^8.3.0" -"@metamask/eth-json-rpc-provider@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-4.0.0.tgz#0ab54548fceda1829f313f2f8ec072ef91cce687" - integrity sha512-HB/I5eNsS67rE5C+px5zASyEuAoK/UFeWe4c4FIm2U4zMo7Y2EED1p10A4zHRHjpctObHdvNDcZQbfu2gHcqsQ== +"@metamask/eth-json-rpc-provider@^4.0.0", "@metamask/eth-json-rpc-provider@^4.1.0": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-4.1.1.tgz#93155567f0c9b48534058bf4d7bde455fe3fe99e" + integrity sha512-lUqKqKG4A88DW1d5LZG/wzAA8p9N9ClA6Jo51EfEOZ6rn3jH+u4DtoPbBKl8ZXYivuFE/36rxus0KcmZpumjhA== dependencies: - "@metamask/json-rpc-engine" "^9.0.0" + "@metamask/json-rpc-engine" "^9.0.1" + "@metamask/rpc-errors" "^6.3.1" "@metamask/safe-event-emitter" "^3.0.0" - "@metamask/utils" "^8.3.0" + "@metamask/utils" "^9.0.0" + uuid "^8.3.2" "@metamask/eth-ledger-bridge-keyring@^4.1.0": version "4.1.0" @@ -4458,14 +4420,6 @@ "@metamask/eth-sig-util" "^7.0.1" hdkey "^2.1.0" -"@metamask/eth-query@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-query/-/eth-query-3.0.1.tgz#3439eb6c7d5ccff1d6a66df1d1802bae0c890444" - integrity sha512-yJ3sVImrR2r95It/Xd9NPnb5lX6ZUmtSxMY2R8nG/yS5QrSiPkJ/898R4+sJg/8EZplmOyZp5fGvjSNNDE/OGQ== - dependencies: - json-rpc-random-id "^1.0.0" - xtend "^4.0.1" - "@metamask/eth-query@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@metamask/eth-query/-/eth-query-4.0.0.tgz#a8c1651b69e298da58628b1c09d31dd504a939b3" @@ -4474,19 +4428,6 @@ json-rpc-random-id "^1.0.0" xtend "^4.0.1" -"@metamask/eth-sig-util@^6.0.0": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-6.0.2.tgz#d81dc87e0cd5a6580010911501976b48821746ad" - integrity sha512-D6IIefM2vS+4GUGGtezdBbkwUYQC4bCosYx/JteUuF0zfe6lyxR4cruA8+2QHoUg7F7edNH1xymYpqYq1BeOkw== - dependencies: - "@ethereumjs/util" "^8.1.0" - "@metamask/abi-utils" "^1.2.0" - "@metamask/utils" "^5.0.2" - ethereum-cryptography "^2.1.2" - ethjs-util "^0.1.6" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.1" - "@metamask/eth-sig-util@^7.0.0", "@metamask/eth-sig-util@^7.0.1", "@metamask/eth-sig-util@^7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-7.0.2.tgz#741de634b0d6ca96ce1ee3d064ac6a27756d8d21" @@ -4510,14 +4451,14 @@ ethereum-cryptography "^2.1.2" randombytes "^2.1.0" -"@metamask/eth-snap-keyring@^4.0.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-snap-keyring/-/eth-snap-keyring-4.2.0.tgz#39864df9696b72978ab99ef4347f7dd5d1c057c4" - integrity sha512-FkkswrPX49GY9YfDhDVyG9yJ0OxtZE7EMTvHZ1Oey05JV5yCfdvngqrtFlngLSFfqNP9/3f8of2PAsw6sxfGXg== +"@metamask/eth-snap-keyring@^4.0.0", "@metamask/eth-snap-keyring@^4.3.1": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-snap-keyring/-/eth-snap-keyring-4.3.1.tgz#f597c7059f499b3cb72ef73b89949231c567d432" + integrity sha512-led5tGBeJUj4DdkMtbbjrbrFGQKKOWfWe7VZ1w99DYKqMv0v/RiJOoxPs8dT6ez7NS9J6SBaWO9i/ly3KMhECg== dependencies: "@ethereumjs/tx" "^4.2.0" "@metamask/eth-sig-util" "^7.0.1" - "@metamask/keyring-api" "^6.2.1" + "@metamask/keyring-api" "^8.0.0" "@metamask/snaps-controllers" "^8.1.1" "@metamask/snaps-sdk" "^4.2.0" "@metamask/snaps-utils" "^7.4.0" @@ -4649,6 +4590,23 @@ bn.js "^5.2.1" uuid "^8.3.2" +"@metamask/gas-fee-controller@^19.0.0": + version "19.0.0" + resolved "https://registry.yarnpkg.com/@metamask/gas-fee-controller/-/gas-fee-controller-19.0.0.tgz#24e8a202bd1c4483cb7ed66ea48e523b261026b2" + integrity sha512-GI5Ncloa5oANTgUjqAUo0FQWQwc41NbWko3n488ymDScatcvPsE3nILFsKxKoGzngkqz9wTgA96K9MKf5gJgrw== + dependencies: + "@metamask/base-controller" "^6.0.0" + "@metamask/controller-utils" "^11.0.0" + "@metamask/eth-query" "^4.0.0" + "@metamask/ethjs-unit" "^0.3.0" + "@metamask/network-controller" "^20.0.0" + "@metamask/polling-controller" "^9.0.0" + "@metamask/utils" "^8.3.0" + "@types/bn.js" "^5.1.5" + "@types/uuid" "^8.3.0" + bn.js "^5.2.1" + uuid "^8.3.2" + "@metamask/json-rpc-engine@^7.0.0", "@metamask/json-rpc-engine@^7.1.1", "@metamask/json-rpc-engine@^7.3.2", "@metamask/json-rpc-engine@^7.3.3": version "7.3.3" resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-7.3.3.tgz#f2b30a2164558014bfcca45db10f5af291d989af" @@ -4667,14 +4625,14 @@ "@metamask/safe-event-emitter" "^3.0.0" "@metamask/utils" "^8.3.0" -"@metamask/json-rpc-engine@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-9.0.0.tgz#41224ee7dae6b58befb883fb643fe56f47682fd4" - integrity sha512-/zVBHbDG2VsJMUxKIcNGwg/f9NbMcJxee1qWRtC5HHmyCv5uqfArxOK6yHpjW02d9ENtrj18uWUtP7/ofSoeoQ== +"@metamask/json-rpc-engine@^9.0.0", "@metamask/json-rpc-engine@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-9.0.1.tgz#202f6b5d24957c4bc949c113c3b60fa134478e11" + integrity sha512-A+iKxI/iMaOKYBcwsGQIaN+LAHOjVdogaGoOe8s52nLQuWmxwAzXIwlvm4RSAM4WG1XnoUPilFoGMHTx+fDteg== dependencies: - "@metamask/rpc-errors" "^6.2.1" + "@metamask/rpc-errors" "^6.3.1" "@metamask/safe-event-emitter" "^3.0.0" - "@metamask/utils" "^8.3.0" + "@metamask/utils" "^9.0.0" "@metamask/json-rpc-middleware-stream@^7.0.1": version "7.0.1" @@ -4707,7 +4665,7 @@ "@noble/hashes" "^1.3.2" "@scure/base" "^1.0.0" -"@metamask/keyring-api@^6.0.0", "@metamask/keyring-api@^6.2.1": +"@metamask/keyring-api@^6.0.0": version "6.2.1" resolved "https://registry.yarnpkg.com/@metamask/keyring-api/-/keyring-api-6.2.1.tgz#10e91b07c6afbf8c18d29169b4ec907adcdc8ccc" integrity sha512-RT2P6RU48/CjZ8pmh8XDZN31APwByzC7l0GeZjuHVO9WKyYhvELYEBcvaID9R8BZ2HZCvHbn/hzj5IxTgDouVQ== @@ -4817,7 +4775,7 @@ "@noble/hashes" "^1.4.0" zod "^3.22.4" -"@metamask/metamask-eth-abis@3.1.1", "@metamask/metamask-eth-abis@^3.0.0", "@metamask/metamask-eth-abis@^3.1.1": +"@metamask/metamask-eth-abis@3.1.1", "@metamask/metamask-eth-abis@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@metamask/metamask-eth-abis/-/metamask-eth-abis-3.1.1.tgz#3de904511115c488809ddee25c470332c03db531" integrity sha512-lRUyWN/GrIFQlT0wq/9gB+4wIV2i0N6yAQlJhfLCT6bVfK5GI5IUDxvCyLTDvxQxaLpNgtBFFzbuY1iVj3UWLA== @@ -4827,26 +4785,6 @@ resolved "https://registry.yarnpkg.com/@metamask/mobile-provider/-/mobile-provider-3.0.0.tgz#8a6a5a0874c8cbe4b468f63dfc57117d207f9595" integrity sha512-XwFJk0rd9lAZR5xS3VC7ypEhD7DvZR2gi2Ch6PHnODIqeS9Te3OdVKK5+jHI4his8v/zs6LWdFdlRtx5/jL96w== -"@metamask/network-controller@^13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-13.0.1.tgz#b8d3cd4abe8e03a8d030409588da6f05461955c5" - integrity sha512-stoS3Dj4b3B8M6dCFs0uE7Zz1Y535yeSUJxJQ12v2t1OlB4JfV5mNL67SJR8h+efR+t336H3EujxevEiW32CVA== - dependencies: - "@metamask/base-controller" "^3.2.2" - "@metamask/controller-utils" "^5.0.1" - "@metamask/eth-json-rpc-infura" "^8.1.1" - "@metamask/eth-json-rpc-middleware" "^11.0.2" - "@metamask/eth-json-rpc-provider" "^1.0.0" - "@metamask/eth-query" "^3.0.1" - "@metamask/swappable-obj-proxy" "^2.1.0" - "@metamask/utils" "^6.2.0" - async-mutex "^0.2.6" - eth-block-tracker "^7.0.1" - eth-rpc-errors "^4.0.2" - immer "^9.0.6" - json-rpc-engine "^6.1.0" - uuid "^8.3.2" - "@metamask/network-controller@^17.0.0", "@metamask/network-controller@^17.1.0": version "17.2.1" resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-17.2.1.tgz#55d846e9e6000f3264e9ac1cc9c5b1493bac335a" @@ -4907,6 +4845,27 @@ immer "^9.0.6" uuid "^8.3.2" +"@metamask/network-controller@^20.0.0": + version "20.0.0" + resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-20.0.0.tgz#a1003a9a78657cfad2afdbbefcef02a1e2d4db71" + integrity sha512-pwFM1B1b4wDa9e1EaEMOXn265hclCoJQL+JmP44PnmGTdNwqnVjLjK0lVIbSSVbR7xgpmp4FhsINjAzUbekSyw== + dependencies: + "@metamask/base-controller" "^6.0.0" + "@metamask/controller-utils" "^11.0.0" + "@metamask/eth-block-tracker" "^9.0.3" + "@metamask/eth-json-rpc-infura" "^9.1.0" + "@metamask/eth-json-rpc-middleware" "^12.1.1" + "@metamask/eth-json-rpc-provider" "^4.1.0" + "@metamask/eth-query" "^4.0.0" + "@metamask/json-rpc-engine" "^9.0.0" + "@metamask/rpc-errors" "^6.2.1" + "@metamask/swappable-obj-proxy" "^2.2.0" + "@metamask/utils" "^8.3.0" + async-mutex "^0.5.0" + immer "^9.0.6" + loglevel "^1.8.1" + uuid "^8.3.2" + "@metamask/nonce-tracker@^5.0.0": version "5.0.0" resolved "https://registry.yarnpkg.com/@metamask/nonce-tracker/-/nonce-tracker-5.0.0.tgz#4f24e4eb7be685ddbf0757df918e807c2961ccc8" @@ -5063,6 +5022,19 @@ fast-json-stable-stringify "^2.1.0" uuid "^8.3.2" +"@metamask/polling-controller@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@metamask/polling-controller/-/polling-controller-9.0.0.tgz#e2cc4cb6db6924ece1566995231f7e2ba0fe92df" + integrity sha512-WHbWORJBU5i/JlJhrkLP0sy91jn72kVl4bFG/p19mguVYFvZU4AwpRyZI8krVxHIGMgU3euOi8uz/M2KL1TZhA== + dependencies: + "@metamask/base-controller" "^6.0.0" + "@metamask/controller-utils" "^11.0.0" + "@metamask/network-controller" "^20.0.0" + "@metamask/utils" "^8.3.0" + "@types/uuid" "^8.3.0" + fast-json-stable-stringify "^2.1.0" + uuid "^8.3.2" + "@metamask/post-message-stream@^8.0.0", "@metamask/post-message-stream@^8.1.0": version "8.1.0" resolved "https://registry.yarnpkg.com/@metamask/post-message-stream/-/post-message-stream-8.1.0.tgz#1139c6411b127b14a7fda43a95d1d33f4affef02" @@ -5200,12 +5172,12 @@ escape-string-regexp "^4.0.0" invariant "2.2.4" -"@metamask/rpc-errors@^6.0.0", "@metamask/rpc-errors@^6.2.1": - version "6.2.1" - resolved "https://registry.yarnpkg.com/@metamask/rpc-errors/-/rpc-errors-6.2.1.tgz#f5daf429ededa7cb83069dc621bd5738fe2a1d80" - integrity sha512-VTgWkjWLzb0nupkFl1duQi9Mk8TGT9rsdnQg6DeRrYEFxtFOh0IF8nAwxM/4GWqDl6uIB06lqUBgUrAVWl62Bw== +"@metamask/rpc-errors@^6.0.0", "@metamask/rpc-errors@^6.2.1", "@metamask/rpc-errors@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@metamask/rpc-errors/-/rpc-errors-6.3.1.tgz#d5bb4740e070c3d87e91717ff4c3c6061a081cab" + integrity sha512-ugDY7cKjF4/yH5LtBaOIKHw/AiGGSAmzptAUEiAEGr/78LwuzcXAxmzEQfSfMIfI+f9Djr8cttq1pRJJKfTuCg== dependencies: - "@metamask/utils" "^8.3.0" + "@metamask/utils" "^9.0.0" fast-safe-stringify "^2.0.6" "@metamask/safe-event-emitter@^2.0.0": @@ -5474,30 +5446,6 @@ resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-8.9.0.tgz#bac680e8f0007b3a11440f7e311674d6457d37ed" integrity sha512-N/WfmdrzJm+xbpuqJsfMrlrAhiNDsllIpwt9gDDeEKDlQAfJnMtT9xvOvBJbXY7zgMdtGZuD+KY64jNKabbuVQ== -"@metamask/transaction-controller@^13.0.0": - version "13.0.0" - resolved "https://registry.yarnpkg.com/@metamask/transaction-controller/-/transaction-controller-13.0.0.tgz#7ad704900199f4bac4c299c6e1c2c26c5e1d0818" - integrity sha512-/ptn2605x42ysDfQcuZKhZ6pwouUOALQDlhLp4o2th8pt28ppMjPleXbbGxyu1qP8Truz49RTPFWTy2THrqiZQ== - dependencies: - "@ethereumjs/common" "^3.2.0" - "@ethereumjs/tx" "^4.2.0" - "@ethersproject/abi" "^5.7.0" - "@metamask/approval-controller" "^3.5.2" - "@metamask/base-controller" "^3.2.2" - "@metamask/controller-utils" "^5.0.1" - "@metamask/eth-query" "^3.0.1" - "@metamask/metamask-eth-abis" "^3.0.0" - "@metamask/network-controller" "^13.0.1" - "@metamask/rpc-errors" "^6.0.0" - "@metamask/utils" "^6.2.0" - async-mutex "^0.2.6" - eth-method-registry "1.1.0" - ethereumjs-util "^7.0.10" - fast-json-patch "^3.1.1" - lodash "^4.17.21" - nonce-tracker "^1.1.0" - uuid "^8.3.2" - "@metamask/transaction-controller@^30.0.0": version "30.0.0" resolved "https://registry.yarnpkg.com/@metamask/transaction-controller/-/transaction-controller-30.0.0.tgz#e7f6a4a150538e3b58e1b6962c44a1e14a68af2e" @@ -5526,27 +5474,36 @@ lodash "^4.17.21" uuid "^8.3.2" -"@metamask/utils@^3.4.1": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-3.6.0.tgz#b218b969a05ca7a8093b5d1670f6625061de707d" - integrity sha512-9cIRrfkWvHblSiNDVXsjivqa9Ak0RYo/1H6tqTqTbAx+oBK2Sva0lWDHxGchOqA7bySGUJKAWSNJvH6gdHZ0gQ== - dependencies: - "@types/debug" "^4.1.7" - debug "^4.3.4" - semver "^7.3.8" - superstruct "^1.0.3" - -"@metamask/utils@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-4.0.0.tgz#9fe302aba111c68168ab088ea2a069247fb2380d" - integrity sha512-BqLx6UWkzTn33ICbzssC4gI7N++dPJAEy/oXJD8LFY02MP0ORwulXMdHT9fQO1i8r/oi0wSMCPxAaT/IYiy8YA== +"@metamask/transaction-controller@^35.0.0": + version "35.0.0" + resolved "https://registry.yarnpkg.com/@metamask/transaction-controller/-/transaction-controller-35.0.0.tgz#28c189c051355540f1e2fb6da1ca300f0a797f2c" + integrity sha512-P+O/PvmUAQerar+EUnJCxGhPKzo/mdq17pN5oixdUaZhy7rbckaVAF3WWtoBrQr0jy1rvX9+3W3TbFWXUqcySQ== dependencies: - "@types/debug" "^4.1.7" - debug "^4.3.4" - semver "^7.3.8" - superstruct "^1.0.3" + "@ethereumjs/common" "^3.2.0" + "@ethereumjs/tx" "^4.2.0" + "@ethereumjs/util" "^8.1.0" + "@ethersproject/abi" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@ethersproject/providers" "^5.7.0" + "@metamask/accounts-controller" "^17.2.0" + "@metamask/approval-controller" "^7.0.0" + "@metamask/base-controller" "^6.0.0" + "@metamask/controller-utils" "^11.0.0" + "@metamask/eth-query" "^4.0.0" + "@metamask/gas-fee-controller" "^19.0.0" + "@metamask/metamask-eth-abis" "^3.1.1" + "@metamask/network-controller" "^20.0.0" + "@metamask/nonce-tracker" "^5.0.0" + "@metamask/rpc-errors" "^6.2.1" + "@metamask/utils" "^8.3.0" + async-mutex "^0.5.0" + bn.js "^5.2.1" + eth-method-registry "^4.0.0" + fast-json-patch "^3.1.1" + lodash "^4.17.21" + uuid "^8.3.2" -"@metamask/utils@^5.0.1", "@metamask/utils@^5.0.2": +"@metamask/utils@^5.0.1": version "5.0.2" resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-5.0.2.tgz#140ba5061d90d9dac0280c19cab101bc18c8857c" integrity sha512-yfmE79bRQtnMzarnKfX7AEJBwFTxvTyw3nBQlu/5rmGXrjAeAMltoGxO62TFurxrQAFMNa/fEjIHNvungZp0+g== @@ -5557,18 +5514,6 @@ semver "^7.3.8" superstruct "^1.0.3" -"@metamask/utils@^6.2.0": - version "6.2.0" - resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-6.2.0.tgz#7e63ad2db33117df6fef89449db3a86dcd6b42b5" - integrity sha512-nM5CujDd4STfwx4ic/gim9G1W9oZcWUGKN4WbAT4waEkqNSIluVmZeHgxUKvdajZ7iCFDnjDLajkD4sP7c/ClQ== - dependencies: - "@ethereumjs/tx" "^4.1.2" - "@noble/hashes" "^1.3.1" - "@types/debug" "^4.1.7" - debug "^4.3.4" - semver "^7.3.8" - superstruct "^1.0.3" - "@metamask/utils@^8.0.0", "@metamask/utils@^8.1.0", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^8.4.0": version "8.4.0" resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-8.4.0.tgz#f44812c96467a4e1b70b2edff6ee89a9caa4e354" @@ -12800,7 +12745,7 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert@^1.4.1, assert@^1.5.0: +assert@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.1.tgz#038ab248e4ff078e7bc2485ba6e6388466c78f76" integrity sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A== @@ -17085,13 +17030,6 @@ eth-json-rpc-middleware@^6.0.0: pify "^3.0.0" safe-event-emitter "^1.0.1" -eth-method-registry@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eth-method-registry/-/eth-method-registry-1.1.0.tgz#3cc01bd23dcf513428d14a0bb19910652cc5cac0" - integrity sha512-jGbbGYd19XJCtoGFtUD2qJYWefKCCbFcu7F/AQ5sJXvqTIVAHnFn3paaV2zhN5t7iyKYp1qxc+ugOky+72xcbg== - dependencies: - ethjs "^0.3.0" - eth-method-registry@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eth-method-registry/-/eth-method-registry-4.0.0.tgz#2c2b78d5711dbd8f2c8f5e2de85a7a05f9769800" @@ -17122,7 +17060,7 @@ eth-rpc-errors@^3.0.0: dependencies: fast-safe-stringify "^2.0.6" -eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3: +eth-rpc-errors@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/eth-rpc-errors/-/eth-rpc-errors-4.0.3.tgz#6ddb6190a4bf360afda82790bb7d9d5e724f423a" integrity sha512-Z3ymjopaoft7JDoxZcEb3pwdGh7yiYMhOwm2doUt6ASXlMavpNlK6Cre0+IMl2VSGyEU9rkiperQhp5iRxn5Pg== @@ -17384,7 +17322,7 @@ ethjs-abi@0.2.0: js-sha3 "0.5.5" number-to-bn "1.7.0" -ethjs-abi@0.2.1, ethjs-abi@^0.2.0: +ethjs-abi@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/ethjs-abi/-/ethjs-abi-0.2.1.tgz#e0a7a93a7e81163a94477bad56ede524ab6de533" integrity sha512-g2AULSDYI6nEJyJaEVEXtTimRY2aPC2fi7ddSy0W+LXvEVL8Fe1y76o43ecbgdUKwZD+xsmEgX1yJr1Ia3r1IA== @@ -17393,16 +17331,6 @@ ethjs-abi@0.2.1, ethjs-abi@^0.2.0: js-sha3 "0.5.5" number-to-bn "1.7.0" -ethjs-contract@0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/ethjs-contract/-/ethjs-contract-0.2.2.tgz#2ed71254cbb4f2b6fafa1db0d4a83870c887b472" - integrity sha512-xxPqEjsULQ/QNWuvX6Ako0PGs5RxALA8N/H3+boLvnaXDFZVGpD7H63H1gBCRTZyYqCldPpVlVHuw/rD45vazw== - dependencies: - ethjs-abi "0.2.0" - ethjs-filter "0.1.8" - ethjs-util "0.1.3" - js-sha3 "0.5.5" - ethjs-contract@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/ethjs-contract/-/ethjs-contract-0.2.3.tgz#f113ced8ed1c9c635b0b7ec71901340b64e8cded" @@ -17468,23 +17396,7 @@ ethjs-format@0.2.7: number-to-bn "1.7.0" strip-hex-prefix "1.0.0" -ethjs-provider-http@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-provider-http/-/ethjs-provider-http-0.1.6.tgz#1ec5d9b4be257ef1d56a500b22a741985e889420" - integrity sha1-HsXZtL4lfvHValALIqdBmF6IlCA= - dependencies: - xhr2 "0.1.3" - -ethjs-query@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/ethjs-query/-/ethjs-query-0.3.7.tgz#597884664e7769c5e314a8f2f7ac6b44aceaff5e" - integrity sha512-TZnKUwfkWjy0SowFdPLtmsytCorHi0i4vvkQn7Jg8rZt33cRzKhuzOwKr/G3vdigCc+ePXOhUGMcJSAPlOG44A== - dependencies: - ethjs-format "0.2.7" - ethjs-rpc "0.2.0" - promise-to-callback "^1.0.0" - -ethjs-query@0.3.8, ethjs-query@^0.3.8: +ethjs-query@0.3.8: version "0.3.8" resolved "https://registry.yarnpkg.com/ethjs-query/-/ethjs-query-0.3.8.tgz#aa5af02887bdd5f3c78b3256d0f22ffd5d357490" integrity sha512-/J5JydqrOzU8O7VBOwZKUWXxHDGr46VqNjBCJgBVNNda+tv7Xc8Y2uJc6aMHHVbeN3YOQ7YRElgIc0q1CI02lQ== @@ -17524,7 +17436,7 @@ ethjs-schema@0.2.1: resolved "https://registry.yarnpkg.com/ethjs-schema/-/ethjs-schema-0.2.1.tgz#47e138920421453617069034684642e26bb310f4" integrity sha512-DXd8lwNrhT9sjsh/Vd2Z+4pfyGxhc0POVnLBUfwk5udtdoBzADyq+sK39dcb48+ZU+2VgtwHxtGWnLnCfmfW5g== -ethjs-unit@0.1.6, ethjs-unit@^0.1.6: +ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= @@ -17540,7 +17452,7 @@ ethjs-util@0.1.3: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" -ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: +ethjs-util@0.1.6, ethjs-util@^0.1.3: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== @@ -17548,22 +17460,6 @@ ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" -ethjs@^0.3.0: - version "0.3.9" - resolved "https://registry.yarnpkg.com/ethjs/-/ethjs-0.3.9.tgz#287e1fe75de8ee1fb73ae2cf6218395398e8f84c" - integrity sha512-gOQzA3tDUjoLpNONSOALJ/rUFtHi5tXl2mholHasF1cvXhoddqi06yU4OJFJu9AGd6n9v9ywzHlYeIKg1t1hdw== - dependencies: - bn.js "4.11.6" - ethjs-abi "0.2.1" - ethjs-contract "0.2.2" - ethjs-filter "0.1.8" - ethjs-provider-http "0.1.6" - ethjs-query "0.3.7" - ethjs-unit "0.1.6" - ethjs-util "0.1.3" - js-sha3 "0.5.5" - number-to-bn "1.7.0" - event-emitter@^0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" @@ -23337,15 +23233,6 @@ noms@0.0.0: inherits "^2.0.1" readable-stream "~1.0.31" -nonce-tracker@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nonce-tracker/-/nonce-tracker-1.1.0.tgz#9a102346dc5ab681e357b61091da16b068ab50ac" - integrity sha512-Cz+ZC+tsVEelWUU9T02PQBmI4o3uYnbIraGIvlpjQtLZvPVaE2DQh7o0wfUK1h7q3qyEeMup4h7giz5E1xIF4w== - dependencies: - assert "^1.4.1" - await-semaphore "^0.1.3" - ethjs-query "^0.3.8" - noop-logger@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" @@ -26977,7 +26864,7 @@ safe-regex-test@^1.0.3: es-errors "^1.3.0" is-regex "^1.1.4" -safe-stable-stringify@^2.1.0, safe-stable-stringify@^2.3.1, safe-stable-stringify@^2.3.2, safe-stable-stringify@^2.4.3: +safe-stable-stringify@^2.1.0, safe-stable-stringify@^2.3.1, safe-stable-stringify@^2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== @@ -28720,11 +28607,6 @@ tunnel@^0.0.6: resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== -tweetnacl-util@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" @@ -30301,11 +30183,6 @@ xcode@^3.0.1: simple-plist "^1.1.0" uuid "^7.0.3" -xhr2@0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.3.tgz#cbfc4759a69b4a888e78cf4f20b051038757bd11" - integrity sha1-y/xHWaabSoiOeM9PILBRA4dXvRE= - xhr2@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.2.1.tgz#4e73adc4f9cfec9cbd2157f73efdce3a5f108a93"