@metamask-previews/transaction-controller 32.0.0-preview-24c396ed → 33.0.0-preview-b09c2ed
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/dist/TransactionController.js +17 -17
- package/dist/TransactionController.mjs +16 -16
- package/dist/{chunk-Q6Q44V4W.js → chunk-3LWN55E6.js} +6 -6
- package/dist/{chunk-RAOYRJ25.js → chunk-3WTSRETF.js} +1 -1
- package/dist/chunk-3WTSRETF.js.map +1 -0
- package/dist/{chunk-Y7ENNK7L.mjs → chunk-3ZV5YEUV.mjs} +6 -5
- package/dist/chunk-3ZV5YEUV.mjs.map +1 -0
- package/dist/{chunk-3ZRHCVVS.js → chunk-4IBBHNWG.js} +7 -5
- package/dist/chunk-4IBBHNWG.js.map +1 -0
- package/dist/{chunk-TG3D7VFK.mjs → chunk-4V4XIPCI.mjs} +2 -2
- package/dist/{chunk-NM6OYEPP.mjs → chunk-5ZEJT5SN.mjs} +6 -2
- package/dist/chunk-5ZEJT5SN.mjs.map +1 -0
- package/dist/{chunk-5YES3V2R.mjs → chunk-6B5BEO3R.mjs} +1 -1
- package/dist/chunk-6B5BEO3R.mjs.map +1 -0
- package/dist/{chunk-3HSNXR5R.js → chunk-6OLJWLKK.js} +3 -3
- package/dist/{chunk-IT3SYNZ6.js → chunk-74W7X6BE.js} +1 -1
- package/dist/chunk-74W7X6BE.js.map +1 -0
- package/dist/{chunk-7MKQDZKY.js → chunk-7KREIKNY.js} +3 -3
- package/dist/{chunk-EQT25RSP.js → chunk-7NMV2NPM.js} +6 -4
- package/dist/chunk-7NMV2NPM.js.map +1 -0
- package/dist/{chunk-CDF4QNJA.mjs → chunk-D6BF3IZK.mjs} +2 -2
- package/dist/{chunk-QZLPYOGC.mjs → chunk-EGQCE3FK.mjs} +1 -1
- package/dist/chunk-EGQCE3FK.mjs.map +1 -0
- package/dist/{chunk-CPMTUMMZ.mjs → chunk-EKJXGERC.mjs} +4 -2
- package/dist/chunk-EKJXGERC.mjs.map +1 -0
- package/dist/{chunk-AHSDUIMT.mjs → chunk-EVL6KODQ.mjs} +1 -1
- package/dist/chunk-EVL6KODQ.mjs.map +1 -0
- package/dist/{chunk-IJ5GUKRO.mjs → chunk-GNAL5HC2.mjs} +2 -2
- package/dist/{chunk-6E6CAV5A.mjs → chunk-K2JC276W.mjs} +39 -26
- package/dist/chunk-K2JC276W.mjs.map +1 -0
- package/dist/{chunk-G5U6ABRU.mjs → chunk-KLDYR4HR.mjs} +5 -3
- package/dist/{chunk-G5U6ABRU.mjs.map → chunk-KLDYR4HR.mjs.map} +1 -1
- package/dist/{chunk-METHOFMG.mjs → chunk-KPP6SU7S.mjs} +1 -1
- package/dist/chunk-KPP6SU7S.mjs.map +1 -0
- package/dist/{chunk-N5ZUH35S.js → chunk-LLXPT2H5.js} +84 -71
- package/dist/chunk-LLXPT2H5.js.map +1 -0
- package/dist/{chunk-NRQUBP3S.mjs → chunk-MILG772S.mjs} +2 -2
- package/dist/{chunk-YXSCBWTU.js → chunk-N6OMDPDK.js} +9 -9
- package/dist/{chunk-YXSCBWTU.js.map → chunk-N6OMDPDK.js.map} +1 -1
- package/dist/{chunk-V6HVF4EN.mjs → chunk-OGK76ZPK.mjs} +3 -3
- package/dist/chunk-OGK76ZPK.mjs.map +1 -0
- package/dist/{chunk-UGFBA4GV.js → chunk-OZ6UB42C.js} +5 -1
- package/dist/chunk-OZ6UB42C.js.map +1 -0
- package/dist/{chunk-J56A7UCK.mjs → chunk-Q56I5ONX.mjs} +5 -1
- package/dist/chunk-Q56I5ONX.mjs.map +1 -0
- package/dist/{chunk-UT4M4XI3.js → chunk-QH2H4W3N.js} +5 -5
- package/dist/{chunk-DTDTOMTB.js → chunk-RHDPOIS4.js} +6 -5
- package/dist/chunk-RHDPOIS4.js.map +1 -0
- package/dist/{chunk-VH47Q6TS.js → chunk-RXIUMVA5.js} +7 -3
- package/dist/chunk-RXIUMVA5.js.map +1 -0
- package/dist/{chunk-5KMU2IAT.js → chunk-ULD4JC3Q.js} +1 -1
- package/dist/chunk-ULD4JC3Q.js.map +1 -0
- package/dist/{chunk-2TUDWNEI.mjs → chunk-UZFDPHQI.mjs} +3 -3
- package/dist/{chunk-DLOQPH4M.js → chunk-V4FONAI2.js} +4 -4
- package/dist/{chunk-FDUCRHYT.js → chunk-XVYXRCRL.js} +1 -1
- package/dist/chunk-XVYXRCRL.js.map +1 -0
- package/dist/errors.js +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.js +7 -7
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +6 -6
- package/dist/gas-flows/LineaGasFeeFlow.js +8 -8
- package/dist/gas-flows/LineaGasFeeFlow.mjs +7 -7
- package/dist/gas-flows/TestGasFeeFlow.js +1 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs +1 -1
- package/dist/helpers/EtherscanRemoteTransactionSource.js +4 -4
- package/dist/helpers/EtherscanRemoteTransactionSource.mjs +3 -3
- package/dist/helpers/GasFeePoller.js +4 -4
- package/dist/helpers/GasFeePoller.mjs +3 -3
- package/dist/helpers/IncomingTransactionHelper.js +2 -2
- package/dist/helpers/IncomingTransactionHelper.mjs +1 -1
- package/dist/helpers/MultichainTrackingHelper.js +5 -5
- package/dist/helpers/MultichainTrackingHelper.mjs +4 -4
- package/dist/helpers/PendingTransactionTracker.js +3 -3
- package/dist/helpers/PendingTransactionTracker.mjs +2 -2
- package/dist/index.js +17 -17
- package/dist/index.mjs +16 -16
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/TransactionController.d.ts +3 -5
- package/dist/types/TransactionController.d.ts.map +1 -1
- package/dist/types/gas-flows/DefaultGasFeeFlow.d.ts.map +1 -1
- package/dist/types/helpers/EtherscanRemoteTransactionSource.d.ts.map +1 -1
- package/dist/types/helpers/IncomingTransactionHelper.d.ts +2 -1
- package/dist/types/helpers/IncomingTransactionHelper.d.ts.map +1 -1
- package/dist/types/helpers/PendingTransactionTracker.d.ts.map +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/etherscan.d.ts.map +1 -1
- package/dist/types/utils/simulation.d.ts.map +1 -1
- package/dist/types/utils/utils.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.mjs +1 -1
- package/dist/utils/etherscan.js +2 -2
- package/dist/utils/etherscan.mjs +1 -1
- package/dist/utils/external-transactions.js +1 -1
- package/dist/utils/external-transactions.mjs +1 -1
- package/dist/utils/gas-fees.js +6 -6
- package/dist/utils/gas-fees.mjs +5 -5
- package/dist/utils/gas-flow.js +3 -3
- package/dist/utils/gas-flow.mjs +2 -2
- package/dist/utils/simulation-api.js +1 -1
- package/dist/utils/simulation-api.mjs +1 -1
- package/dist/utils/simulation.js +3 -3
- package/dist/utils/simulation.mjs +2 -2
- package/dist/utils/swaps.js +4 -4
- package/dist/utils/swaps.mjs +3 -3
- package/dist/utils/transaction-type.js +1 -1
- package/dist/utils/transaction-type.mjs +1 -1
- package/dist/utils/utils.js +3 -3
- package/dist/utils/utils.mjs +2 -2
- package/dist/utils/validation.js +4 -4
- package/dist/utils/validation.mjs +3 -3
- package/package.json +5 -2
- package/dist/chunk-3ZRHCVVS.js.map +0 -1
- package/dist/chunk-5KMU2IAT.js.map +0 -1
- package/dist/chunk-5YES3V2R.mjs.map +0 -1
- package/dist/chunk-6E6CAV5A.mjs.map +0 -1
- package/dist/chunk-AHSDUIMT.mjs.map +0 -1
- package/dist/chunk-CPMTUMMZ.mjs.map +0 -1
- package/dist/chunk-DTDTOMTB.js.map +0 -1
- package/dist/chunk-EQT25RSP.js.map +0 -1
- package/dist/chunk-FDUCRHYT.js.map +0 -1
- package/dist/chunk-IT3SYNZ6.js.map +0 -1
- package/dist/chunk-J56A7UCK.mjs.map +0 -1
- package/dist/chunk-METHOFMG.mjs.map +0 -1
- package/dist/chunk-N5ZUH35S.js.map +0 -1
- package/dist/chunk-NM6OYEPP.mjs.map +0 -1
- package/dist/chunk-QZLPYOGC.mjs.map +0 -1
- package/dist/chunk-RAOYRJ25.js.map +0 -1
- package/dist/chunk-UGFBA4GV.js.map +0 -1
- package/dist/chunk-V6HVF4EN.mjs.map +0 -1
- package/dist/chunk-VH47Q6TS.js.map +0 -1
- package/dist/chunk-Y7ENNK7L.mjs.map +0 -1
- /package/dist/{chunk-Q6Q44V4W.js.map → chunk-3LWN55E6.js.map} +0 -0
- /package/dist/{chunk-TG3D7VFK.mjs.map → chunk-4V4XIPCI.mjs.map} +0 -0
- /package/dist/{chunk-3HSNXR5R.js.map → chunk-6OLJWLKK.js.map} +0 -0
- /package/dist/{chunk-7MKQDZKY.js.map → chunk-7KREIKNY.js.map} +0 -0
- /package/dist/{chunk-CDF4QNJA.mjs.map → chunk-D6BF3IZK.mjs.map} +0 -0
- /package/dist/{chunk-IJ5GUKRO.mjs.map → chunk-GNAL5HC2.mjs.map} +0 -0
- /package/dist/{chunk-NRQUBP3S.mjs.map → chunk-MILG772S.mjs.map} +0 -0
- /package/dist/{chunk-UT4M4XI3.js.map → chunk-QH2H4W3N.js.map} +0 -0
- /package/dist/{chunk-2TUDWNEI.mjs.map → chunk-UZFDPHQI.mjs.map} +0 -0
- /package/dist/{chunk-DLOQPH4M.js.map → chunk-V4FONAI2.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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> = 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<Operation>;\n\n/**\n * Representation of transaction metadata.\n */\nexport type TransactionMeta = TransactionMetaBase &\n (\n | {\n status: Exclude<TransactionStatus, TransactionStatus.failed>;\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<string, any>;\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<string, any>;\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 * 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 // 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 /** @deprecated Determined by the clients using the transaction type. No longer used. */\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 // 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 // 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 // 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 // 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 // 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 // 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 // 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/**\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<TransactionMeta[]>;\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<any>;\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<TransactionMeta>` from Immer to cause TypeScript to error\n // with \"Type instantiation is excessively deep and possibly infinite\". See:\n // <https://github.com/immerjs/immer/issues/839>\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<string, number>;\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<GasFeeFlowResponse>;\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<Layer1GasFeeFlowResponse>;\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"],"mappings":";AAwcO,IAAK,oBAAL,kBAAKA,uBAAL;AAGL,EAAAA,mBAAA,cAAW;AAIX,EAAAA,mBAAA,eAAY;AAGZ,EAAAA,mBAAA,eAAY;AAGZ,EAAAA,mBAAA,aAAU;AAGV,EAAAA,mBAAA,YAAS;AAGT,EAAAA,mBAAA,cAAW;AAGX,EAAAA,mBAAA,YAAS;AAGT,EAAAA,mBAAA,eAAY;AAGZ,EAAAA,mBAAA,gBAAa;AA5BH,SAAAA;AAAA,GAAA;AAkCL,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,EAAAA,iBAAA,WAAQ;AAOR,EAAAA,iBAAA,UAAO;AAOP,EAAAA,iBAAA,iBAAc;AAUd,EAAAA,iBAAA,kBAAe;AAQf,EAAAA,iBAAA,wBAAqB;AAUrB,EAAAA,iBAAA,iCAA8B;AAQ9B,EAAAA,iBAAA,yBAAsB;AAStB,EAAAA,iBAAA,6BAA0B;AAQ1B,EAAAA,iBAAA,kCAA+B;AAO/B,EAAAA,iBAAA,kCAA+B;AA3JrB,SAAAA;AAAA,GAAA;AA6bL,IAAK,0BAAL,kBAAKC,6BAAL;AAML,EAAAA,yBAAA,YAAS;AAST,EAAAA,yBAAA,gBAAa;AAYb,EAAAA,yBAAA,eAAY;AA3BF,SAAAA;AAAA,GAAA;AAiCL,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"]}
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
var _chunkPRUNMTRDjs = require('./chunk-PRUNMTRD.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk74W7X6BEjs = require('./chunk-74W7X6BE.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkSD6CWFDFjs = require('./chunk-SD6CWFDF.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkRXIUMVA5js = require('./chunk-RXIUMVA5.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkULD4JC3Qjs = require('./chunk-ULD4JC3Q.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunk7LXE4KHVjs = require('./chunk-7LXE4KHV.js');
|
|
@@ -38,33 +38,33 @@ var _chunkWR5F34OWjs = require('./chunk-WR5F34OW.js');
|
|
|
38
38
|
var _chunkTJMQEH57js = require('./chunk-TJMQEH57.js');
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunk7KREIKNYjs = require('./chunk-7KREIKNY.js');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
var _chunk2XKEAKQGjs = require('./chunk-2XKEAKQG.js');
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkRHDPOIS4js = require('./chunk-RHDPOIS4.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunk6OLJWLKKjs = require('./chunk-6OLJWLKK.js');
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _chunk7NMV2NPMjs = require('./chunk-7NMV2NPM.js');
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunk3LWN55E6js = require('./chunk-3LWN55E6.js');
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var
|
|
60
|
+
var _chunkN6OMDPDKjs = require('./chunk-N6OMDPDK.js');
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var
|
|
63
|
+
var _chunk4IBBHNWGjs = require('./chunk-4IBBHNWG.js');
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
var
|
|
67
|
+
var _chunkQH2H4W3Njs = require('./chunk-QH2H4W3N.js');
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
@@ -76,10 +76,10 @@ var _chunkUT4M4XI3js = require('./chunk-UT4M4XI3.js');
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
var
|
|
79
|
+
var _chunkOZ6UB42Cjs = require('./chunk-OZ6UB42C.js');
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
var
|
|
82
|
+
var _chunkV4FONAI2js = require('./chunk-V4FONAI2.js');
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -143,7 +143,7 @@ function getDefaultTransactionControllerState() {
|
|
|
143
143
|
lastFetchedBlockNumbers: {}
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
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;
|
|
146
|
+
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;
|
|
147
147
|
var TransactionController = class extends _basecontroller.BaseController {
|
|
148
148
|
/**
|
|
149
149
|
* Constructs a TransactionController.
|
|
@@ -161,7 +161,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
161
161
|
* @param options.getNetworkState - Gets the state of the network controller.
|
|
162
162
|
* @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
163
163
|
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
164
|
-
* @param options.getSelectedAddress - Gets the address of the currently selected account.
|
|
165
164
|
* @param options.incomingTransactions - Configuration options for incoming transaction support.
|
|
166
165
|
* @param options.isMultichainEnabled - Enable multichain support.
|
|
167
166
|
* @param options.isSimulationEnabled - Whether new transactions will be automatically simulated.
|
|
@@ -189,7 +188,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
189
188
|
getNetworkState,
|
|
190
189
|
getPermittedAccounts,
|
|
191
190
|
getSavedGasFees,
|
|
192
|
-
getSelectedAddress,
|
|
193
191
|
incomingTransactions = {},
|
|
194
192
|
isMultichainEnabled = false,
|
|
195
193
|
isSimulationEnabled,
|
|
@@ -233,6 +231,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
233
231
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getGlobalNetworkClientId);
|
|
234
232
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getGlobalChainId);
|
|
235
233
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _isCustomNetwork);
|
|
234
|
+
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getSelectedAccount);
|
|
236
235
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _internalEvents, new (0, _events.EventEmitter)());
|
|
237
236
|
this.approvingTransactionIds = /* @__PURE__ */ new Set();
|
|
238
237
|
this.mutex = new (0, _asyncmutex.Mutex)();
|
|
@@ -259,7 +258,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
259
258
|
this.getCurrentNetworkEIP1559Compatibility = getCurrentNetworkEIP1559Compatibility;
|
|
260
259
|
this.getGasFeeEstimates = getGasFeeEstimates || (() => Promise.resolve({}));
|
|
261
260
|
this.getPermittedAccounts = getPermittedAccounts;
|
|
262
|
-
this.getSelectedAddress = getSelectedAddress;
|
|
263
261
|
this.getExternalPendingTransactions = getExternalPendingTransactions ?? (() => []);
|
|
264
262
|
this.securityProviderRequest = securityProviderRequest;
|
|
265
263
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _incomingTransactionOptions, incomingTransactions);
|
|
@@ -284,7 +282,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
284
282
|
chainId
|
|
285
283
|
);
|
|
286
284
|
};
|
|
287
|
-
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _multichainTrackingHelper, new (0,
|
|
285
|
+
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _multichainTrackingHelper, new (0, _chunk6OLJWLKKjs.MultichainTrackingHelper)({
|
|
288
286
|
isMultichainEnabled,
|
|
289
287
|
provider,
|
|
290
288
|
nonceTracker: this.nonceTracker,
|
|
@@ -310,7 +308,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
310
308
|
}
|
|
311
309
|
}));
|
|
312
310
|
_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).initialize();
|
|
313
|
-
const etherscanRemoteTransactionSource = new (0,
|
|
311
|
+
const etherscanRemoteTransactionSource = new (0, _chunk7NMV2NPMjs.EtherscanRemoteTransactionSource)({
|
|
314
312
|
includeTokenTransfers: incomingTransactions.includeTokenTransfers
|
|
315
313
|
});
|
|
316
314
|
this.incomingTransactionHelper = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn).call(this, {
|
|
@@ -323,7 +321,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
323
321
|
});
|
|
324
322
|
this.gasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGasFeeFlows, getGasFeeFlows_fn).call(this);
|
|
325
323
|
this.layer1GasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn).call(this);
|
|
326
|
-
const gasFeePoller = new (0,
|
|
324
|
+
const gasFeePoller = new (0, _chunk7KREIKNYjs.GasFeePoller)({
|
|
327
325
|
findNetworkClientIdByChainId,
|
|
328
326
|
gasFeeFlows: this.gasFeeFlows,
|
|
329
327
|
getGasFeeControllerEstimates: this.getGasFeeEstimates,
|
|
@@ -358,7 +356,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
358
356
|
}
|
|
359
357
|
failTransaction(transactionMeta, error, actionId) {
|
|
360
358
|
const newTransactionMeta = _lodash.merge.call(void 0, {}, transactionMeta, {
|
|
361
|
-
error:
|
|
359
|
+
error: _chunkOZ6UB42Cjs.normalizeTxError.call(void 0, error),
|
|
362
360
|
status: "failed" /* failed */
|
|
363
361
|
});
|
|
364
362
|
this.messagingSystem.publish(`${controllerName}:transactionFailed`, {
|
|
@@ -456,7 +454,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
456
454
|
networkClientId: requestNetworkClientId
|
|
457
455
|
} = {}) {
|
|
458
456
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Adding transaction", txParams);
|
|
459
|
-
txParams =
|
|
457
|
+
txParams = _chunkOZ6UB42Cjs.normalizeTransactionParams.call(void 0, txParams);
|
|
460
458
|
if (requestNetworkClientId && !_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).has(requestNetworkClientId)) {
|
|
461
459
|
throw new Error(
|
|
462
460
|
"The networkClientId for this transaction could not be found"
|
|
@@ -466,11 +464,11 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
466
464
|
const isEIP1559Compatible = await this.getEIP1559Compatibility(
|
|
467
465
|
networkClientId
|
|
468
466
|
);
|
|
469
|
-
|
|
467
|
+
_chunkRXIUMVA5js.validateTxParams.call(void 0, txParams, isEIP1559Compatible);
|
|
470
468
|
if (origin) {
|
|
471
|
-
await
|
|
469
|
+
await _chunkRXIUMVA5js.validateTransactionOrigin.call(void 0,
|
|
472
470
|
await this.getPermittedAccounts(origin),
|
|
473
|
-
this.
|
|
471
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getSelectedAccount, getSelectedAccount_fn).call(this).address,
|
|
474
472
|
txParams.from,
|
|
475
473
|
origin
|
|
476
474
|
);
|
|
@@ -518,7 +516,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
518
516
|
if (!this.isHistoryDisabled) {
|
|
519
517
|
addedTransactionMeta = _chunkQP75SWIQjs.addInitialHistorySnapshot.call(void 0, addedTransactionMeta);
|
|
520
518
|
}
|
|
521
|
-
addedTransactionMeta =
|
|
519
|
+
addedTransactionMeta = _chunkQH2H4W3Njs.updateSwapsTransaction.call(void 0,
|
|
522
520
|
addedTransactionMeta,
|
|
523
521
|
transactionType,
|
|
524
522
|
swaps,
|
|
@@ -597,8 +595,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
597
595
|
return;
|
|
598
596
|
}
|
|
599
597
|
if (gasValues) {
|
|
600
|
-
gasValues =
|
|
601
|
-
|
|
598
|
+
gasValues = _chunkOZ6UB42Cjs.normalizeGasFeeValues.call(void 0, gasValues);
|
|
599
|
+
_chunkOZ6UB42Cjs.validateGasValues.call(void 0, gasValues);
|
|
602
600
|
}
|
|
603
601
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Creating cancel transaction", transactionId, gasValues);
|
|
604
602
|
const transactionMeta = this.getTransaction(transactionId);
|
|
@@ -608,26 +606,26 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
608
606
|
if (!this.sign) {
|
|
609
607
|
throw new Error("No sign method defined.");
|
|
610
608
|
}
|
|
611
|
-
const minGasPrice =
|
|
609
|
+
const minGasPrice = _chunkOZ6UB42Cjs.getIncreasedPriceFromExisting.call(void 0,
|
|
612
610
|
transactionMeta.txParams.gasPrice,
|
|
613
611
|
CANCEL_RATE
|
|
614
612
|
);
|
|
615
|
-
const gasPriceFromValues =
|
|
616
|
-
const newGasPrice = gasPriceFromValues &&
|
|
613
|
+
const gasPriceFromValues = _chunkOZ6UB42Cjs.isGasPriceValue.call(void 0, gasValues) && gasValues.gasPrice;
|
|
614
|
+
const newGasPrice = gasPriceFromValues && _chunkOZ6UB42Cjs.validateMinimumIncrease.call(void 0, gasPriceFromValues, minGasPrice) || minGasPrice;
|
|
617
615
|
const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;
|
|
618
|
-
const minMaxFeePerGas =
|
|
616
|
+
const minMaxFeePerGas = _chunkOZ6UB42Cjs.getIncreasedPriceFromExisting.call(void 0,
|
|
619
617
|
existingMaxFeePerGas,
|
|
620
618
|
CANCEL_RATE
|
|
621
619
|
);
|
|
622
|
-
const maxFeePerGasValues =
|
|
623
|
-
const newMaxFeePerGas = maxFeePerGasValues &&
|
|
620
|
+
const maxFeePerGasValues = _chunkOZ6UB42Cjs.isFeeMarketEIP1559Values.call(void 0, gasValues) && gasValues.maxFeePerGas;
|
|
621
|
+
const newMaxFeePerGas = maxFeePerGasValues && _chunkOZ6UB42Cjs.validateMinimumIncrease.call(void 0, maxFeePerGasValues, minMaxFeePerGas) || existingMaxFeePerGas && minMaxFeePerGas;
|
|
624
622
|
const existingMaxPriorityFeePerGas = transactionMeta.txParams?.maxPriorityFeePerGas;
|
|
625
|
-
const minMaxPriorityFeePerGas =
|
|
623
|
+
const minMaxPriorityFeePerGas = _chunkOZ6UB42Cjs.getIncreasedPriceFromExisting.call(void 0,
|
|
626
624
|
existingMaxPriorityFeePerGas,
|
|
627
625
|
CANCEL_RATE
|
|
628
626
|
);
|
|
629
|
-
const maxPriorityFeePerGasValues =
|
|
630
|
-
const newMaxPriorityFeePerGas = maxPriorityFeePerGasValues &&
|
|
627
|
+
const maxPriorityFeePerGasValues = _chunkOZ6UB42Cjs.isFeeMarketEIP1559Values.call(void 0, gasValues) && gasValues.maxPriorityFeePerGas;
|
|
628
|
+
const newMaxPriorityFeePerGas = maxPriorityFeePerGasValues && _chunkOZ6UB42Cjs.validateMinimumIncrease.call(void 0,
|
|
631
629
|
maxPriorityFeePerGasValues,
|
|
632
630
|
minMaxPriorityFeePerGas
|
|
633
631
|
) || existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas;
|
|
@@ -721,8 +719,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
721
719
|
return;
|
|
722
720
|
}
|
|
723
721
|
if (gasValues) {
|
|
724
|
-
gasValues =
|
|
725
|
-
|
|
722
|
+
gasValues = _chunkOZ6UB42Cjs.normalizeGasFeeValues.call(void 0, gasValues);
|
|
723
|
+
_chunkOZ6UB42Cjs.validateGasValues.call(void 0, gasValues);
|
|
726
724
|
}
|
|
727
725
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Creating speed up transaction", transactionId, gasValues);
|
|
728
726
|
const transactionMeta = this.getTransaction(transactionId);
|
|
@@ -732,26 +730,26 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
732
730
|
if (!this.sign) {
|
|
733
731
|
throw new Error("No sign method defined.");
|
|
734
732
|
}
|
|
735
|
-
const minGasPrice =
|
|
733
|
+
const minGasPrice = _chunkOZ6UB42Cjs.getIncreasedPriceFromExisting.call(void 0,
|
|
736
734
|
transactionMeta.txParams.gasPrice,
|
|
737
735
|
SPEED_UP_RATE
|
|
738
736
|
);
|
|
739
|
-
const gasPriceFromValues =
|
|
740
|
-
const newGasPrice = gasPriceFromValues &&
|
|
737
|
+
const gasPriceFromValues = _chunkOZ6UB42Cjs.isGasPriceValue.call(void 0, gasValues) && gasValues.gasPrice;
|
|
738
|
+
const newGasPrice = gasPriceFromValues && _chunkOZ6UB42Cjs.validateMinimumIncrease.call(void 0, gasPriceFromValues, minGasPrice) || minGasPrice;
|
|
741
739
|
const existingMaxFeePerGas = transactionMeta.txParams?.maxFeePerGas;
|
|
742
|
-
const minMaxFeePerGas =
|
|
740
|
+
const minMaxFeePerGas = _chunkOZ6UB42Cjs.getIncreasedPriceFromExisting.call(void 0,
|
|
743
741
|
existingMaxFeePerGas,
|
|
744
742
|
SPEED_UP_RATE
|
|
745
743
|
);
|
|
746
|
-
const maxFeePerGasValues =
|
|
747
|
-
const newMaxFeePerGas = maxFeePerGasValues &&
|
|
744
|
+
const maxFeePerGasValues = _chunkOZ6UB42Cjs.isFeeMarketEIP1559Values.call(void 0, gasValues) && gasValues.maxFeePerGas;
|
|
745
|
+
const newMaxFeePerGas = maxFeePerGasValues && _chunkOZ6UB42Cjs.validateMinimumIncrease.call(void 0, maxFeePerGasValues, minMaxFeePerGas) || existingMaxFeePerGas && minMaxFeePerGas;
|
|
748
746
|
const existingMaxPriorityFeePerGas = transactionMeta.txParams?.maxPriorityFeePerGas;
|
|
749
|
-
const minMaxPriorityFeePerGas =
|
|
747
|
+
const minMaxPriorityFeePerGas = _chunkOZ6UB42Cjs.getIncreasedPriceFromExisting.call(void 0,
|
|
750
748
|
existingMaxPriorityFeePerGas,
|
|
751
749
|
SPEED_UP_RATE
|
|
752
750
|
);
|
|
753
|
-
const maxPriorityFeePerGasValues =
|
|
754
|
-
const newMaxPriorityFeePerGas = maxPriorityFeePerGasValues &&
|
|
751
|
+
const maxPriorityFeePerGasValues = _chunkOZ6UB42Cjs.isFeeMarketEIP1559Values.call(void 0, gasValues) && gasValues.maxPriorityFeePerGas;
|
|
752
|
+
const newMaxPriorityFeePerGas = maxPriorityFeePerGasValues && _chunkOZ6UB42Cjs.validateMinimumIncrease.call(void 0,
|
|
755
753
|
maxPriorityFeePerGasValues,
|
|
756
754
|
minMaxPriorityFeePerGas
|
|
757
755
|
) || existingMaxPriorityFeePerGas && minMaxPriorityFeePerGas;
|
|
@@ -876,7 +874,9 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
876
874
|
*/
|
|
877
875
|
updateTransaction(transactionMeta, note) {
|
|
878
876
|
const { id: transactionId } = transactionMeta;
|
|
879
|
-
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, note
|
|
877
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, note }, () => ({
|
|
878
|
+
...transactionMeta
|
|
879
|
+
}));
|
|
880
880
|
}
|
|
881
881
|
/**
|
|
882
882
|
* Update the security alert response for a transaction.
|
|
@@ -989,7 +989,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
989
989
|
`Cannot update send flow history as no transaction metadata found`
|
|
990
990
|
);
|
|
991
991
|
}
|
|
992
|
-
|
|
992
|
+
_chunkOZ6UB42Cjs.validateIfTransactionUnapproved.call(void 0,
|
|
993
993
|
transactionMeta,
|
|
994
994
|
"updateTransactionSendFlowHistory"
|
|
995
995
|
);
|
|
@@ -1043,7 +1043,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1043
1043
|
`Cannot update transaction as no transaction metadata found`
|
|
1044
1044
|
);
|
|
1045
1045
|
}
|
|
1046
|
-
|
|
1046
|
+
_chunkOZ6UB42Cjs.validateIfTransactionUnapproved.call(void 0,
|
|
1047
1047
|
transactionMeta,
|
|
1048
1048
|
"updateTransactionGasFees"
|
|
1049
1049
|
);
|
|
@@ -1094,7 +1094,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1094
1094
|
`Cannot update transaction as no transaction metadata found`
|
|
1095
1095
|
);
|
|
1096
1096
|
}
|
|
1097
|
-
|
|
1097
|
+
_chunkOZ6UB42Cjs.validateIfTransactionUnapproved.call(void 0, transactionMeta, "updatePreviousGasParams");
|
|
1098
1098
|
const transactionPreviousGas = {
|
|
1099
1099
|
previousGas: {
|
|
1100
1100
|
gasLimit,
|
|
@@ -1147,7 +1147,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1147
1147
|
`Cannot update editable params as no transaction metadata found`
|
|
1148
1148
|
);
|
|
1149
1149
|
}
|
|
1150
|
-
|
|
1150
|
+
_chunkOZ6UB42Cjs.validateIfTransactionUnapproved.call(void 0, transactionMeta, "updateEditableParams");
|
|
1151
1151
|
const editableParams = {
|
|
1152
1152
|
txParams: {
|
|
1153
1153
|
data,
|
|
@@ -1282,7 +1282,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1282
1282
|
updatedTransactionMeta.submittedTime = (/* @__PURE__ */ new Date()).getTime();
|
|
1283
1283
|
}
|
|
1284
1284
|
if (updatedTransactionMeta.status === "failed" /* failed */) {
|
|
1285
|
-
updatedTransactionMeta.error =
|
|
1285
|
+
updatedTransactionMeta.error = _chunkOZ6UB42Cjs.normalizeTxError.call(void 0, new Error(errorMessage));
|
|
1286
1286
|
}
|
|
1287
1287
|
this.updateTransaction(
|
|
1288
1288
|
updatedTransactionMeta,
|
|
@@ -1396,7 +1396,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1396
1396
|
chainId,
|
|
1397
1397
|
networkClientId
|
|
1398
1398
|
};
|
|
1399
|
-
const gasFeeFlow =
|
|
1399
|
+
const gasFeeFlow = _chunkV4FONAI2js.getGasFeeFlow.call(void 0,
|
|
1400
1400
|
transactionMeta,
|
|
1401
1401
|
this.gasFeeFlows
|
|
1402
1402
|
);
|
|
@@ -1443,8 +1443,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1443
1443
|
if (!this.sign) {
|
|
1444
1444
|
throw new Error("No sign method defined.");
|
|
1445
1445
|
}
|
|
1446
|
-
const normalizedTransactionParams =
|
|
1447
|
-
const type =
|
|
1446
|
+
const normalizedTransactionParams = _chunkOZ6UB42Cjs.normalizeTransactionParams.call(void 0, transactionParams);
|
|
1447
|
+
const type = _chunkOZ6UB42Cjs.isEIP1559Transaction.call(void 0, normalizedTransactionParams) ? "0x2" /* feeMarket */ : "0x0" /* legacy */;
|
|
1448
1448
|
const updatedTransactionParams = {
|
|
1449
1449
|
...normalizedTransactionParams,
|
|
1450
1450
|
type,
|
|
@@ -1517,7 +1517,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1517
1517
|
isCustomNetwork,
|
|
1518
1518
|
txMeta: transactionMeta
|
|
1519
1519
|
});
|
|
1520
|
-
await
|
|
1520
|
+
await _chunk4IBBHNWGjs.updateGasFees.call(void 0, {
|
|
1521
1521
|
eip1559: isEIP1559Compatible,
|
|
1522
1522
|
ethQuery,
|
|
1523
1523
|
gasFeeFlows: this.gasFeeFlows,
|
|
@@ -1678,7 +1678,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1678
1678
|
nonce,
|
|
1679
1679
|
chainId,
|
|
1680
1680
|
gasLimit: txParams.gas,
|
|
1681
|
-
...
|
|
1681
|
+
..._chunkOZ6UB42Cjs.isEIP1559Transaction.call(void 0, txParams) && {
|
|
1682
1682
|
type: "0x2" /* feeMarket */
|
|
1683
1683
|
}
|
|
1684
1684
|
};
|
|
@@ -1781,6 +1781,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1781
1781
|
updatedTransactionMeta
|
|
1782
1782
|
);
|
|
1783
1783
|
_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _internalEvents).emit(
|
|
1784
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
1785
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
1784
1786
|
`${transactionMeta.id}:finished`,
|
|
1785
1787
|
updatedTransactionMeta
|
|
1786
1788
|
);
|
|
@@ -2186,7 +2188,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
2186
2188
|
networkClientId: transactionMeta.networkClientId,
|
|
2187
2189
|
chainId: transactionMeta.chainId
|
|
2188
2190
|
});
|
|
2189
|
-
const { updatedTransactionMeta, approvalTransactionMeta } = await
|
|
2191
|
+
const { updatedTransactionMeta, approvalTransactionMeta } = await _chunkQH2H4W3Njs.updatePostTransactionBalance.call(void 0, transactionMeta, {
|
|
2190
2192
|
ethQuery,
|
|
2191
2193
|
getTransaction: this.getTransaction.bind(this),
|
|
2192
2194
|
updateTransaction: this.updateTransaction.bind(this)
|
|
@@ -2246,6 +2248,7 @@ createNonceTracker_fn = function({
|
|
|
2246
2248
|
// TODO: Fix types
|
|
2247
2249
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2248
2250
|
provider,
|
|
2251
|
+
// @ts-expect-error TODO: Fix types
|
|
2249
2252
|
blockTracker,
|
|
2250
2253
|
getPendingTransactions: _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn).bind(
|
|
2251
2254
|
this,
|
|
@@ -2263,9 +2266,9 @@ createIncomingTransactionHelper_fn = function({
|
|
|
2263
2266
|
etherscanRemoteTransactionSource,
|
|
2264
2267
|
chainId
|
|
2265
2268
|
}) {
|
|
2266
|
-
const incomingTransactionHelper = new (0,
|
|
2269
|
+
const incomingTransactionHelper = new (0, _chunkRHDPOIS4js.IncomingTransactionHelper)({
|
|
2267
2270
|
blockTracker,
|
|
2268
|
-
getCurrentAccount: this.
|
|
2271
|
+
getCurrentAccount: () => _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getSelectedAccount, getSelectedAccount_fn).call(this),
|
|
2269
2272
|
getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers,
|
|
2270
2273
|
getChainId: chainId ? () => chainId : this.getChainId.bind(this),
|
|
2271
2274
|
isEnabled: _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _incomingTransactionOptions).isEnabled,
|
|
@@ -2285,7 +2288,7 @@ createPendingTransactionTracker_fn = function({
|
|
|
2285
2288
|
}) {
|
|
2286
2289
|
const ethQuery = new (0, _ethquery2.default)(provider);
|
|
2287
2290
|
const getChainId = chainId ? () => chainId : this.getChainId.bind(this);
|
|
2288
|
-
const pendingTransactionTracker = new (0,
|
|
2291
|
+
const pendingTransactionTracker = new (0, _chunkULD4JC3Qjs.PendingTransactionTracker)({
|
|
2289
2292
|
approveTransaction: async (transactionId) => {
|
|
2290
2293
|
await this.approveTransaction(transactionId);
|
|
2291
2294
|
},
|
|
@@ -2377,7 +2380,7 @@ getGasFeeFlows_fn = function() {
|
|
|
2377
2380
|
if (_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _testGasFeeFlows)) {
|
|
2378
2381
|
return [new (0, _chunkTJMQEH57js.TestGasFeeFlow)()];
|
|
2379
2382
|
}
|
|
2380
|
-
return [new (0,
|
|
2383
|
+
return [new (0, _chunk3LWN55E6js.LineaGasFeeFlow)(), new (0, _chunkN6OMDPDKjs.DefaultGasFeeFlow)()];
|
|
2381
2384
|
};
|
|
2382
2385
|
_getLayer1GasFeeFlows = new WeakSet();
|
|
2383
2386
|
getLayer1GasFeeFlows_fn = function() {
|
|
@@ -2396,12 +2399,13 @@ updateTransactionInternal_fn = function({
|
|
|
2396
2399
|
);
|
|
2397
2400
|
let transactionMeta2 = state.transactions[index];
|
|
2398
2401
|
transactionMeta2 = callback(transactionMeta2) ?? transactionMeta2;
|
|
2399
|
-
transactionMeta2.txParams =
|
|
2402
|
+
transactionMeta2.txParams = _chunkOZ6UB42Cjs.normalizeTransactionParams.call(void 0,
|
|
2400
2403
|
transactionMeta2.txParams
|
|
2401
2404
|
);
|
|
2402
|
-
|
|
2405
|
+
_chunkRXIUMVA5js.validateTxParams.call(void 0, transactionMeta2.txParams);
|
|
2403
2406
|
updatedTransactionParams = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn).call(this, transactionMeta2);
|
|
2404
|
-
|
|
2407
|
+
const shouldSkipHistory = this.isHistoryDisabled || skipHistory;
|
|
2408
|
+
if (!shouldSkipHistory) {
|
|
2405
2409
|
transactionMeta2 = _chunkQP75SWIQjs.updateTransactionHistory.call(void 0,
|
|
2406
2410
|
transactionMeta2,
|
|
2407
2411
|
note ?? "Transaction updated"
|
|
@@ -2461,7 +2465,7 @@ updateSimulationData_fn = async function(transactionMeta) {
|
|
|
2461
2465
|
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, skipHistory: true }, (txMeta) => {
|
|
2462
2466
|
txMeta.simulationData = void 0;
|
|
2463
2467
|
});
|
|
2464
|
-
simulationData = await
|
|
2468
|
+
simulationData = await _chunk74W7X6BEjs.getSimulationData.call(void 0, {
|
|
2465
2469
|
chainId,
|
|
2466
2470
|
from,
|
|
2467
2471
|
to,
|
|
@@ -2529,19 +2533,28 @@ getGlobalNetworkClientId_fn = function() {
|
|
|
2529
2533
|
};
|
|
2530
2534
|
_getGlobalChainId = new WeakSet();
|
|
2531
2535
|
getGlobalChainId_fn = function() {
|
|
2532
|
-
return this.
|
|
2536
|
+
return this.messagingSystem.call(
|
|
2537
|
+
`NetworkController:getNetworkClientById`,
|
|
2538
|
+
this.getNetworkState().selectedNetworkClientId
|
|
2539
|
+
).configuration.chainId;
|
|
2533
2540
|
};
|
|
2534
2541
|
_isCustomNetwork = new WeakSet();
|
|
2535
2542
|
isCustomNetwork_fn = function(networkClientId) {
|
|
2536
2543
|
const globalNetworkClientId = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn).call(this);
|
|
2537
2544
|
if (!networkClientId || networkClientId === globalNetworkClientId) {
|
|
2538
|
-
return
|
|
2545
|
+
return !_controllerutils.isInfuraNetworkType.call(void 0,
|
|
2546
|
+
this.getNetworkState().selectedNetworkClientId
|
|
2547
|
+
);
|
|
2539
2548
|
}
|
|
2540
2549
|
return this.messagingSystem.call(
|
|
2541
2550
|
`NetworkController:getNetworkClientById`,
|
|
2542
2551
|
networkClientId
|
|
2543
2552
|
).configuration.type === _networkcontroller.NetworkClientType.Custom;
|
|
2544
2553
|
};
|
|
2554
|
+
_getSelectedAccount = new WeakSet();
|
|
2555
|
+
getSelectedAccount_fn = function() {
|
|
2556
|
+
return this.messagingSystem.call("AccountsController:getSelectedAccount");
|
|
2557
|
+
};
|
|
2545
2558
|
|
|
2546
2559
|
|
|
2547
2560
|
|
|
@@ -2550,4 +2563,4 @@ isCustomNetwork_fn = function(networkClientId) {
|
|
|
2550
2563
|
|
|
2551
2564
|
|
|
2552
2565
|
exports.HARDFORK = HARDFORK; exports.CANCEL_RATE = CANCEL_RATE; exports.SPEED_UP_RATE = SPEED_UP_RATE; exports.ApprovalState = ApprovalState; exports.TransactionController = TransactionController;
|
|
2553
|
-
//# sourceMappingURL=chunk-
|
|
2566
|
+
//# sourceMappingURL=chunk-LLXPT2H5.js.map
|