@metamask/transaction-controller 52.1.0 → 52.3.0
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 +55 -4
- package/dist/TransactionController.cjs +111 -28
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts +33 -5
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts +33 -5
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +114 -31
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/constants.cjs +1 -0
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +1 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +1 -0
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +1 -0
- package/dist/constants.mjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.cjs +1 -3
- package/dist/gas-flows/DefaultGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.d.cts +2 -2
- package/dist/gas-flows/DefaultGasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.d.mts +2 -2
- package/dist/gas-flows/DefaultGasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +1 -3
- package/dist/gas-flows/DefaultGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.cjs +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.d.cts +5 -1
- package/dist/gas-flows/LineaGasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.d.mts +5 -1
- package/dist/gas-flows/LineaGasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.mjs +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts +5 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts +5 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts +5 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts +5 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs +123 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs.map +1 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts +28 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts +28 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs +118 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs.map +1 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts +5 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts +5 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.cjs +1 -1
- package/dist/gas-flows/TestGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.d.cts +2 -2
- package/dist/gas-flows/TestGasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.d.mts +2 -2
- package/dist/gas-flows/TestGasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs +1 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs.map +1 -1
- package/dist/helpers/GasFeePoller.cjs +11 -8
- package/dist/helpers/GasFeePoller.cjs.map +1 -1
- package/dist/helpers/GasFeePoller.d.cts +6 -5
- package/dist/helpers/GasFeePoller.d.cts.map +1 -1
- package/dist/helpers/GasFeePoller.d.mts +6 -5
- package/dist/helpers/GasFeePoller.d.mts.map +1 -1
- package/dist/helpers/GasFeePoller.mjs +11 -8
- package/dist/helpers/GasFeePoller.mjs.map +1 -1
- package/dist/helpers/IncomingTransactionHelper.cjs +2 -1
- package/dist/helpers/IncomingTransactionHelper.cjs.map +1 -1
- package/dist/helpers/IncomingTransactionHelper.d.cts.map +1 -1
- package/dist/helpers/IncomingTransactionHelper.d.mts.map +1 -1
- package/dist/helpers/IncomingTransactionHelper.mjs +2 -1
- package/dist/helpers/IncomingTransactionHelper.mjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.cjs +6 -2
- package/dist/helpers/PendingTransactionTracker.cjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.d.cts +5 -2
- package/dist/helpers/PendingTransactionTracker.d.cts.map +1 -1
- package/dist/helpers/PendingTransactionTracker.d.mts +5 -2
- package/dist/helpers/PendingTransactionTracker.d.mts.map +1 -1
- package/dist/helpers/PendingTransactionTracker.mjs +6 -2
- package/dist/helpers/PendingTransactionTracker.mjs.map +1 -1
- package/dist/helpers/TransactionPoller.cjs +12 -8
- package/dist/helpers/TransactionPoller.cjs.map +1 -1
- package/dist/helpers/TransactionPoller.d.cts +7 -3
- package/dist/helpers/TransactionPoller.d.cts.map +1 -1
- package/dist/helpers/TransactionPoller.d.mts +7 -3
- package/dist/helpers/TransactionPoller.d.mts.map +1 -1
- package/dist/helpers/TransactionPoller.mjs +11 -7
- package/dist/helpers/TransactionPoller.mjs.map +1 -1
- package/dist/hooks/CollectPublishHook.cjs +84 -0
- package/dist/hooks/CollectPublishHook.cjs.map +1 -0
- package/dist/hooks/CollectPublishHook.d.cts +29 -0
- package/dist/hooks/CollectPublishHook.d.cts.map +1 -0
- package/dist/hooks/CollectPublishHook.d.mts +29 -0
- package/dist/hooks/CollectPublishHook.d.mts.map +1 -0
- package/dist/hooks/CollectPublishHook.mjs +80 -0
- package/dist/hooks/CollectPublishHook.mjs.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.cjs +90 -0
- package/dist/hooks/ExtraTransactionsPublishHook.cjs.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.cts +18 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.cts.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.mts +18 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.mts.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.mjs +86 -0
- package/dist/hooks/ExtraTransactionsPublishHook.mjs.map +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +161 -7
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +161 -7
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/batch.cjs +142 -1
- package/dist/utils/batch.cjs.map +1 -1
- package/dist/utils/batch.d.cts +7 -1
- package/dist/utils/batch.d.cts.map +1 -1
- package/dist/utils/batch.d.mts +7 -1
- package/dist/utils/batch.d.mts.map +1 -1
- package/dist/utils/batch.mjs +142 -1
- package/dist/utils/batch.mjs.map +1 -1
- package/dist/utils/eip7702.cjs +12 -0
- package/dist/utils/eip7702.cjs.map +1 -1
- package/dist/utils/eip7702.d.cts.map +1 -1
- package/dist/utils/eip7702.d.mts.map +1 -1
- package/dist/utils/eip7702.mjs +12 -0
- package/dist/utils/eip7702.mjs.map +1 -1
- package/dist/utils/feature-flags.cjs +39 -2
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +49 -0
- package/dist/utils/feature-flags.d.cts.map +1 -1
- package/dist/utils/feature-flags.d.mts +49 -0
- package/dist/utils/feature-flags.d.mts.map +1 -1
- package/dist/utils/feature-flags.mjs +36 -1
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/gas-fees.cjs +21 -3
- package/dist/utils/gas-fees.cjs.map +1 -1
- package/dist/utils/gas-fees.d.cts +14 -0
- package/dist/utils/gas-fees.d.cts.map +1 -1
- package/dist/utils/gas-fees.d.mts +14 -0
- package/dist/utils/gas-fees.d.mts.map +1 -1
- package/dist/utils/gas-fees.mjs +19 -2
- package/dist/utils/gas-fees.mjs.map +1 -1
- package/dist/utils/gas-flow.cjs +3 -2
- package/dist/utils/gas-flow.cjs.map +1 -1
- package/dist/utils/gas-flow.d.cts +3 -1
- package/dist/utils/gas-flow.d.cts.map +1 -1
- package/dist/utils/gas-flow.d.mts +3 -1
- package/dist/utils/gas-flow.d.mts.map +1 -1
- package/dist/utils/gas-flow.mjs +3 -2
- package/dist/utils/gas-flow.mjs.map +1 -1
- package/dist/utils/gas.cjs +7 -3
- package/dist/utils/gas.cjs.map +1 -1
- package/dist/utils/gas.mjs +7 -3
- package/dist/utils/gas.mjs.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.cjs +9 -4
- package/dist/utils/layer1-gas-fee-flow.cjs.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.d.cts +4 -1
- package/dist/utils/layer1-gas-fee-flow.d.cts.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.d.mts +4 -1
- package/dist/utils/layer1-gas-fee-flow.d.mts.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.mjs +9 -4
- package/dist/utils/layer1-gas-fee-flow.mjs.map +1 -1
- package/dist/utils/nonce.cjs +3 -3
- package/dist/utils/nonce.cjs.map +1 -1
- package/dist/utils/nonce.d.cts +2 -2
- package/dist/utils/nonce.d.cts.map +1 -1
- package/dist/utils/nonce.d.mts +2 -2
- package/dist/utils/nonce.d.mts.map +1 -1
- package/dist/utils/nonce.mjs +3 -3
- package/dist/utils/nonce.mjs.map +1 -1
- package/dist/utils/simulation-api.cjs.map +1 -1
- package/dist/utils/simulation-api.d.cts +37 -0
- package/dist/utils/simulation-api.d.cts.map +1 -1
- package/dist/utils/simulation-api.d.mts +37 -0
- package/dist/utils/simulation-api.d.mts.map +1 -1
- package/dist/utils/simulation-api.mjs.map +1 -1
- package/dist/utils/simulation.cjs +63 -9
- package/dist/utils/simulation.cjs.map +1 -1
- package/dist/utils/simulation.d.cts +7 -2
- package/dist/utils/simulation.d.cts.map +1 -1
- package/dist/utils/simulation.d.mts +7 -2
- package/dist/utils/simulation.d.mts.map +1 -1
- package/dist/utils/simulation.mjs +63 -9
- package/dist/utils/simulation.mjs.map +1 -1
- package/dist/utils/utils.cjs +23 -1
- package/dist/utils/utils.cjs.map +1 -1
- package/dist/utils/utils.d.cts +8 -0
- package/dist/utils/utils.d.cts.map +1 -1
- package/dist/utils/utils.d.mts +8 -0
- package/dist/utils/utils.d.mts.map +1 -1
- package/dist/utils/utils.mjs +22 -1
- package/dist/utils/utils.mjs.map +1 -1
- package/package.json +1 -1
package/dist/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ountsController } from '@metamask/accounts-controller';\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 */\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 * Information about a single transaction such as status and block number.\n */\nexport type TransactionMeta = {\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 * ID of the associated transaction batch.\n */\n batchId?: 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 * Address of the sender's current contract code delegation.\n * Introduced in EIP-7702.\n */\n delegationAddress?: Hex;\n\n /**\n * String to indicate what device the transaction was confirmed on.\n */\n deviceConfirmedOn?: WalletDevice;\n\n /**\n * The Network ID as per EIP-155 of the destination chain of a bridge transaction.\n */\n destinationChainId?: Hex;\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 * Error that occurred during the transaction processing.\n */\n error?: TransactionError;\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 /**\n * Whether the transaction is active.\n */\n isActive?: boolean;\n\n /**\n * Whether the transaction is the first time interaction.\n */\n isFirstTimeInteraction?: boolean;\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 * The estimated gas for the transaction without any buffer applied.\n */\n gasLimitNoBuffer?: 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 * 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 * Data for any nested transactions.\n * For example, in an atomic batch transaction via EIP-7702.\n */\n nestedTransactions?: NestedTransactionMetadata[];\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 /** Current status of the transaction. */\n status: TransactionStatus;\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 * 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 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 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 signed = 'signed',\n\n /**\n * The transaction has been submitted to the network and is awaiting confirmation.\n */\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 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 failed = 'failed',\n\n /**\n * The transaction was superseded by another transaction, resulting in its dismissal.\n * This is a final state.\n */\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 rejected = 'rejected',\n\n /**\n * @deprecated This status is no longer used.\n */\n cancelled = 'cancelled',\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 batch transaction that includes multiple nested transactions.\n * Introduced in EIP-7702.\n */\n batch = 'batch',\n\n /**\n * A transaction that bridges tokens to a different chain through Metamask Bridge.\n */\n bridge = 'bridge',\n\n /**\n * Similar to the approve type, a bridge 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 Bridge contract. The first bridge for any token\n * will have an accompanying bridgeApproval transaction.\n */\n bridgeApproval = 'bridgeApproval',\n\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 * Remove the code / delegation from an upgraded EOA.\n * Introduced in EIP-7702.\n */\n revokeDelegation = 'revokeDelegation',\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 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 that claims staking rewards.\n */\n stakingClaim = 'stakingClaim',\n\n /**\n * A transaction that deposits tokens into a staking contract.\n */\n stakingDeposit = 'stakingDeposit',\n\n /**\n * A transaction that unstakes tokens from a staking contract.\n */\n stakingUnstake = 'stakingUnstake',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps.\n */\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 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 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 * Increase the allowance by a given increment\n */\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 * Array of authorizations to set code on EOA accounts.\n * Only supported in `setCode` transactions.\n * Introduced in EIP-7702.\n */\n authorizationList?: AuthorizationList;\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 * Maximum number of units of gas to use for this transaction.\n */\n gas?: string;\n\n /**\n * Maximum number of units of gas to use for this transaction.\n *\n * @deprecated Use `gas` instead.\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 /** Hash of the associated transaction. */\n transactionHash?: Hex;\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 /** Data for the log. */\n data?: Hex;\n\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: Hex;\n\n /**\n * Numerical cache to optimize fetching transactions.\n */\n cache: Record<string, unknown>;\n\n /**\n * Whether to also include incoming token transfers.\n */\n includeTokenTransfers: boolean;\n\n /**\n * Whether to initially query the entire transaction history.\n */\n queryEntireHistory: boolean;\n\n /**\n * Callback to update the cache.\n */\n updateCache(fn: (cache: Record<string, unknown>) => void): void;\n\n /**\n * Whether to also retrieve outgoing transactions.\n */\n updateTransactions: boolean;\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 * @returns Array of chain IDs supported by the remote source.\n */\n getSupportedChains: () => Hex[];\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 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 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 feeMarket = '0x2',\n\n /**\n * Adds code to externally owned accounts according to the signed authorizations\n * in the new `authorizationList` parameter.\n * Introduced in EIP-7702.\n */\n setCode = '0x4',\n}\n\n/**\n * The source of the gas fee parameters on a transaction.\n */\nexport enum UserFeeLevel {\n CUSTOM = 'custom',\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 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 *\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 *\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 *\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 *\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 erc20 = 'erc20',\n erc721 = 'erc721',\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 /** Whether the simulation response changed after a security check triggered a re-simulation. */\n isUpdatedAfterSecurityCheck?: boolean;\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\n/** Gas fee properties for a legacy transaction. */\nexport type GasPriceValue = {\n /** Price per gas for legacy transactions. */\n gasPrice: string;\n};\n\n/** Gas fee properties for an EIP-1559 transaction. */\nexport type FeeMarketEIP1559Values = {\n /** Maximum amount to pay per gas. */\n maxFeePerGas: string;\n\n /** Maximum amount per gas to give to the validator as an incentive. */\n maxPriorityFeePerGas: string;\n};\n\n/**\n * Data concerning a successfully submitted transaction.\n * Used for debugging purposes.\n */\nexport type SubmitHistoryEntry = {\n /** The chain ID of the transaction as a hexadecimal string. */\n chainId?: Hex;\n\n /** The hash of the transaction returned from the RPC provider. */\n hash: string;\n\n /** True if the entry was generated using the migration and existing transaction metadata. */\n migration?: boolean;\n\n /** The type of the network where the transaction was submitted. */\n networkType?: string;\n\n /**\n * The URL of the network the transaction was submitted to.\n * A single network URL if it was recorded when submitted.\n * An array of potential network URLs if it cannot be confirmed since the migration was used.\n */\n networkUrl?: string | string[];\n\n /** The origin of the transaction. */\n origin?: string;\n\n /** The raw transaction data that was submitted. */\n rawTransaction: string;\n\n /** When the transaction was submitted. */\n time: number;\n\n /** The transaction parameters that were submitted. */\n transaction: TransactionParams;\n};\n\nexport type InternalAccount = ReturnType<\n AccountsController['getSelectedAccount']\n>;\n\n/**\n * An authorization to be included in a `setCode` transaction.\n * Specifies code to be added to the authorization signer's EOA account.\n * Introduced in EIP-7702.\n */\nexport type Authorization = {\n /** Address of a smart contract that contains the code to be set. */\n address: Hex;\n\n /**\n * Specific chain the authorization applies to.\n * If not provided, defaults to the chain ID of the transaction.\n */\n chainId?: Hex;\n\n /**\n * Nonce at which the authorization will be valid.\n * If not provided, defaults to the nonce following the transaction's nonce.\n */\n nonce?: Hex;\n\n /** R component of the signature. */\n r?: Hex;\n\n /** S component of the signature. */\n s?: Hex;\n\n /** Y parity generated from the signature. */\n yParity?: Hex;\n};\n\n/**\n * An array of authorizations to be included in a `setCode` transaction.\n * Introduced in EIP-7702.\n */\nexport type AuthorizationList = Authorization[];\n\n/**\n * The parameters of a transaction within an atomic batch.\n */\nexport type BatchTransactionParams = {\n /** Data used to invoke a function on the target smart contract or EOA. */\n data?: Hex;\n\n /** Address of the target contract or EOA. */\n to?: Hex;\n\n /** Native balance to transfer with the transaction. */\n value?: Hex;\n};\n\n/** Metadata for a nested transaction within a standard transaction. */\nexport type NestedTransactionMetadata = BatchTransactionParams & {\n /** Type of the neted transaction. */\n type?: TransactionType;\n};\n\n/**\n * Specification for a single transaction within a batch request.\n */\nexport type TransactionBatchSingleRequest = {\n /** Parameters of the single transaction. */\n params: BatchTransactionParams;\n\n /** Type of the transaction. */\n type?: TransactionType;\n};\n\n/**\n * Request to submit a batch of transactions.\n * Currently only atomic batches are supported via EIP-7702.\n */\nexport type TransactionBatchRequest = {\n batchId?: Hex;\n\n /** Address of the account to submit the transaction batch. */\n from: Hex;\n\n /** ID of the network client to submit the transaction. */\n networkClientId: NetworkClientId;\n\n /** Origin of the request, such as a dApp hostname or `ORIGIN_METAMASK` if internal. */\n origin?: string;\n\n /** Whether an approval request should be created to require confirmation from the user. */\n requireApproval?: boolean;\n\n /** Transactions to be submitted as part of the batch. */\n transactions: TransactionBatchSingleRequest[];\n};\n\n/**\n * Result from submitting a transaction batch.\n */\nexport type TransactionBatchResult = {\n /** ID of the batch to locate related transactions. */\n batchId: Hex;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAufA;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,iBAmDX;AAnDD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,8CAAyB,CAAA;IAEzB;;;OAGG;IACH,0CAAqB,CAAA;IAErB;;;OAGG;IACH,sCAAiB,CAAA;IAEjB;;OAEG;IACH,4CAAuB,CAAA;I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rB,2DAAoC,CAAA;IACpC,4CAAqB,CAAA;AACvB,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B","sourcesContent":["import type { AccessList } from '@ethereumjs/tx';\nimport type { AccountsController } from '@metamask/accounts-controller';\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\nimport type { TransactionControllerMessenger } from './TransactionController';\n\n/**\n * Given a record, ensures that each property matches the `Json` type.\n */\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 * Information about a single transaction such as status and block number.\n */\nexport type TransactionMeta = {\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 * ID of the associated transaction batch.\n */\n batchId?: Hex;\n\n /**\n * Additional transactions that must also be submitted in a batch.\n */\n batchTransactions?: BatchTransactionParams[];\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 * Address of the sender's current contract code delegation.\n * Introduced in EIP-7702.\n */\n delegationAddress?: Hex;\n\n /**\n * String to indicate what device the transaction was confirmed on.\n */\n deviceConfirmedOn?: WalletDevice;\n\n /**\n * The Network ID as per EIP-155 of the destination chain of a bridge transaction.\n */\n destinationChainId?: Hex;\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 * Whether to disable the buffer added to gas limit estimations.\n * Defaults to adding the buffer.\n */\n disableGasBuffer?: boolean;\n\n /**\n * Error that occurred during the transaction processing.\n */\n error?: TransactionError;\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 /** Available tokens that can be used to pay for gas. */\n gasFeeTokens?: GasFeeToken[];\n\n /**\n * Whether the transaction is active.\n */\n isActive?: boolean;\n\n /**\n * Whether the transaction is the first time interaction.\n */\n isFirstTimeInteraction?: boolean;\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 * The estimated gas for the transaction without any buffer applied.\n */\n gasLimitNoBuffer?: 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 * 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 * Data for any nested transactions.\n * For example, in an atomic batch transaction via EIP-7702.\n */\n nestedTransactions?: NestedTransactionMetadata[];\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 * The token address of the selected gas fee token.\n * Corresponds to the `gasFeeTokens` property.\n */\n selectedGasFeeToken?: Hex;\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 /** Current status of the transaction. */\n status: TransactionStatus;\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 * 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 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 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 signed = 'signed',\n\n /**\n * The transaction has been submitted to the network and is awaiting confirmation.\n */\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 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 failed = 'failed',\n\n /**\n * The transaction was superseded by another transaction, resulting in its dismissal.\n * This is a final state.\n */\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 rejected = 'rejected',\n\n /**\n * @deprecated This status is no longer used.\n */\n cancelled = 'cancelled',\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 batch transaction that includes multiple nested transactions.\n * Introduced in EIP-7702.\n */\n batch = 'batch',\n\n /**\n * A transaction that bridges tokens to a different chain through Metamask Bridge.\n */\n bridge = 'bridge',\n\n /**\n * Similar to the approve type, a bridge 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 Bridge contract. The first bridge for any token\n * will have an accompanying bridgeApproval transaction.\n */\n bridgeApproval = 'bridgeApproval',\n\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 * Remove the code / delegation from an upgraded EOA.\n * Introduced in EIP-7702.\n */\n revokeDelegation = 'revokeDelegation',\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 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 that claims staking rewards.\n */\n stakingClaim = 'stakingClaim',\n\n /**\n * A transaction that deposits tokens into a staking contract.\n */\n stakingDeposit = 'stakingDeposit',\n\n /**\n * A transaction that unstakes tokens from a staking contract.\n */\n stakingUnstake = 'stakingUnstake',\n\n /**\n * A transaction swapping one token for another through MetaMask Swaps.\n */\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 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 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 * Increase the allowance by a given increment\n */\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 * Array of authorizations to set code on EOA accounts.\n * Only supported in `setCode` transactions.\n * Introduced in EIP-7702.\n */\n authorizationList?: AuthorizationList;\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 * Maximum number of units of gas to use for this transaction.\n */\n gas?: string;\n\n /**\n * Maximum number of units of gas to use for this transaction.\n *\n * @deprecated Use `gas` instead.\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 /** Hash of the associated transaction. */\n transactionHash?: Hex;\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 /** Data for the log. */\n data?: Hex;\n\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: Hex;\n\n /**\n * Numerical cache to optimize fetching transactions.\n */\n cache: Record<string, unknown>;\n\n /**\n * Whether to also include incoming token transfers.\n */\n includeTokenTransfers: boolean;\n\n /**\n * Whether to initially query the entire transaction history.\n */\n queryEntireHistory: boolean;\n\n /**\n * Callback to update the cache.\n */\n updateCache(fn: (cache: Record<string, unknown>) => void): void;\n\n /**\n * Whether to also retrieve outgoing transactions.\n */\n updateTransactions: boolean;\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 * @returns Array of chain IDs supported by the remote source.\n */\n getSupportedChains: () => Hex[];\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 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 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 feeMarket = '0x2',\n\n /**\n * Adds code to externally owned accounts according to the signed authorizations\n * in the new `authorizationList` parameter.\n * Introduced in EIP-7702.\n */\n setCode = '0x4',\n}\n\n/**\n * The source of the gas fee parameters on a transaction.\n */\nexport enum UserFeeLevel {\n CUSTOM = 'custom',\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 features?: string[];\n providerRequestsCount?: Record<string, number>;\n reason: string;\n result_type: string;\n securityAlertId?: string;\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 messenger instance. */\n messenger: TransactionControllerMessenger;\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 *\n * @param args - The arguments for the matcher function.\n * @param args.transactionMeta - The transaction metadata.\n * @param args.messenger - The messenger instance.\n * @returns Whether the gas fee flow supports the transaction.\n */\n matchesTransaction({\n transactionMeta,\n messenger,\n }: {\n transactionMeta: TransactionMeta;\n messenger: TransactionControllerMessenger;\n }): boolean;\n\n /**\n * Get gas fee estimates for a specific transaction.\n *\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 *\n * @param args - The arguments for the matcher function.\n * @param args.transactionMeta - The transaction metadata.\n * @param args.messenger - The messenger instance.\n * @returns Whether the gas fee flow supports the transaction.\n */\n matchesTransaction({\n transactionMeta,\n messenger,\n }: {\n transactionMeta: TransactionMeta;\n messenger: TransactionControllerMessenger;\n }): boolean;\n\n /**\n * Get layer 1 gas fee estimates for a specific transaction.\n *\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 erc20 = 'erc20',\n erc721 = 'erc721',\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 /** Whether the simulation response changed after a security check triggered a re-simulation. */\n isUpdatedAfterSecurityCheck?: boolean;\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\n/** Gas fee properties for a legacy transaction. */\nexport type GasPriceValue = {\n /** Price per gas for legacy transactions. */\n gasPrice: string;\n};\n\n/** Gas fee properties for an EIP-1559 transaction. */\nexport type FeeMarketEIP1559Values = {\n /** Maximum amount to pay per gas. */\n maxFeePerGas: string;\n\n /** Maximum amount per gas to give to the validator as an incentive. */\n maxPriorityFeePerGas: string;\n};\n\n/**\n * Data concerning a successfully submitted transaction.\n * Used for debugging purposes.\n */\nexport type SubmitHistoryEntry = {\n /** The chain ID of the transaction as a hexadecimal string. */\n chainId?: Hex;\n\n /** The hash of the transaction returned from the RPC provider. */\n hash: string;\n\n /** True if the entry was generated using the migration and existing transaction metadata. */\n migration?: boolean;\n\n /** The type of the network where the transaction was submitted. */\n networkType?: string;\n\n /**\n * The URL of the network the transaction was submitted to.\n * A single network URL if it was recorded when submitted.\n * An array of potential network URLs if it cannot be confirmed since the migration was used.\n */\n networkUrl?: string | string[];\n\n /** The origin of the transaction. */\n origin?: string;\n\n /** The raw transaction data that was submitted. */\n rawTransaction: string;\n\n /** When the transaction was submitted. */\n time: number;\n\n /** The transaction parameters that were submitted. */\n transaction: TransactionParams;\n};\n\nexport type InternalAccount = ReturnType<\n AccountsController['getSelectedAccount']\n>;\n\n/**\n * An authorization to be included in a `setCode` transaction.\n * Specifies code to be added to the authorization signer's EOA account.\n * Introduced in EIP-7702.\n */\nexport type Authorization = {\n /** Address of a smart contract that contains the code to be set. */\n address: Hex;\n\n /**\n * Specific chain the authorization applies to.\n * If not provided, defaults to the chain ID of the transaction.\n */\n chainId?: Hex;\n\n /**\n * Nonce at which the authorization will be valid.\n * If not provided, defaults to the nonce following the transaction's nonce.\n */\n nonce?: Hex;\n\n /** R component of the signature. */\n r?: Hex;\n\n /** S component of the signature. */\n s?: Hex;\n\n /** Y parity generated from the signature. */\n yParity?: Hex;\n};\n\n/**\n * An array of authorizations to be included in a `setCode` transaction.\n * Introduced in EIP-7702.\n */\nexport type AuthorizationList = Authorization[];\n\n/**\n * The parameters of a transaction within an atomic batch.\n */\nexport type BatchTransactionParams = {\n /** Data used to invoke a function on the target smart contract or EOA. */\n data?: Hex;\n\n /**\n * Maximum number of units of gas to use for the transaction.\n * Not supported in EIP-7702 batches.\n */\n gas?: Hex;\n\n /**\n * Maximum amount per gas to pay for the transaction, including the priority fee.\n * Not supported in EIP-7702 batches.\n */\n maxFeePerGas?: Hex;\n\n /**\n * Maximum amount per gas to give to validator as incentive.\n * Not supported in EIP-7702 batches.\n */\n maxPriorityFeePerGas?: Hex;\n\n /** Address of the target contract or EOA. */\n to?: Hex;\n\n /** Native balance to transfer with the transaction. */\n value?: Hex;\n};\n\n/** Metadata for a nested transaction within a standard transaction. */\nexport type NestedTransactionMetadata = BatchTransactionParams & {\n /** Type of the neted transaction. */\n type?: TransactionType;\n};\n\n/**\n * Specification for a single transaction within a batch request.\n */\nexport type TransactionBatchSingleRequest = {\n /** Data if the transaction already exists. */\n existingTransaction?: {\n /** ID of the existing transaction. */\n id: string;\n\n /** Optional callback to be invoked once the transaction is published. */\n onPublish?: (request: {\n /** Hash of the transaction on the network. */\n transactionHash?: string;\n }) => void;\n\n /** Signed transaction data. */\n signedTransaction: Hex;\n };\n\n /** Parameters of the single transaction. */\n params: BatchTransactionParams;\n\n /** Type of the transaction. */\n type?: TransactionType;\n};\n\n/**\n * Request to submit a batch of transactions.\n * Currently only atomic batches are supported via EIP-7702.\n */\nexport type TransactionBatchRequest = {\n batchId?: Hex;\n\n /** Address of the account to submit the transaction batch. */\n from: Hex;\n\n /** ID of the network client to submit the transaction. */\n networkClientId: NetworkClientId;\n\n /** Origin of the request, such as a dApp hostname or `ORIGIN_METAMASK` if internal. */\n origin?: string;\n\n /** Whether an approval request should be created to require confirmation from the user. */\n requireApproval?: boolean;\n\n /** Security alert ID to persist on the transaction. */\n securityAlertId?: string;\n\n /** Transactions to be submitted as part of the batch. */\n transactions: TransactionBatchSingleRequest[];\n\n /**\n * Whether to use the publish batch hook to submit the batch.\n * Defaults to false.\n */\n useHook?: boolean;\n\n /**\n * Callback to trigger security validation in the client.\n *\n * @param request - The JSON-RPC request to validate.\n * @param chainId - The chain ID of the transaction batch.\n */\n validateSecurity?: (\n request: ValidateSecurityRequest,\n chainId: Hex,\n ) => Promise<void>;\n};\n\n/**\n * Result from submitting a transaction batch.\n */\nexport type TransactionBatchResult = {\n /** ID of the batch to locate related transactions. */\n batchId: Hex;\n};\n\n/**\n * Data returned from custom logic to publish a transaction.\n */\nexport type PublishHookResult = {\n /**\n * The hash of the transaction on the network.\n */\n transactionHash?: string;\n};\n\n/**\n * Custom logic to publish a transaction.\n *\n * @param transactionMeta - The metadata of the transaction to publish.\n * @param signedTx - The signed transaction data to publish.\n * @returns The result of the publish operation.\n */\nexport type PublishHook = (\n transactionMeta: TransactionMeta,\n signedTx: string,\n) => Promise<PublishHookResult>;\n\n/** Single transaction in a publish batch hook request. */\nexport type PublishBatchHookTransaction = {\n /** ID of the transaction. */\n id?: string;\n\n /** Parameters of the nested transaction. */\n params: BatchTransactionParams;\n\n /** Signed transaction data to publish. */\n signedTx: Hex;\n};\n\n/**\n * Data required to call a publish batch hook.\n */\nexport type PublishBatchHookRequest = {\n /** Address of the account to submit the transaction batch. */\n from: Hex;\n\n /** ID of the network client associated with the transaction batch. */\n networkClientId: string;\n\n /** Nested transactions to be submitted as part of the batch. */\n transactions: PublishBatchHookTransaction[];\n};\n\n/** Result of calling a publish batch hook. */\nexport type PublishBatchHookResult =\n | {\n /** Result data for each transaction in the batch. */\n results: {\n /** Hash of the transaction on the network. */\n transactionHash: Hex;\n }[];\n }\n | undefined;\n\n/** Custom logic to publish a transaction batch. */\nexport type PublishBatchHook = (\n /** Data required to call the hook. */\n request: PublishBatchHookRequest,\n) => Promise<PublishBatchHookResult>;\n\n/**\n * Request to validate security of a transaction in the client.\n */\nexport type ValidateSecurityRequest = {\n /** JSON-RPC method to validate. */\n method: string;\n\n /** Parameters of the JSON-RPC method to validate. */\n params: unknown[];\n\n /** Optional EIP-7702 delegation to mock for the transaction sender. */\n delegationMock?: Hex;\n};\n\n/** Data required to pay for transaction gas using an ERC-20 token. */\nexport type GasFeeToken = {\n /** Amount needed for the gas fee. */\n amount: Hex;\n\n /** Current token balance of the sender. */\n balance: Hex;\n\n /** Decimals of the token. */\n decimals: number;\n\n /** The corresponding gas limit this token fee would equal. */\n gas: Hex;\n\n /** The corresponding maxFeePerGas this token fee would equal. */\n maxFeePerGas: Hex;\n\n /** The corresponding maxPriorityFeePerGas this token fee would equal. */\n maxPriorityFeePerGas: Hex;\n\n /** Conversion rate of 1 token to native WEI. */\n rateWei: Hex;\n\n /** Account address to send the token to. */\n recipient: Hex;\n\n /** Symbol of the token. */\n symbol: string;\n\n /** Address of the token contract. */\n tokenAddress: Hex;\n};\n"]}
|
package/dist/utils/batch.cjs
CHANGED
|
@@ -8,6 +8,7 @@ const eip7702_1 = require("./eip7702.cjs");
|
|
|
8
8
|
const feature_flags_1 = require("./feature-flags.cjs");
|
|
9
9
|
const validation_1 = require("./validation.cjs");
|
|
10
10
|
const __1 = require("../index.cjs");
|
|
11
|
+
const CollectPublishHook_1 = require("../hooks/CollectPublishHook.cjs");
|
|
11
12
|
const logger_1 = require("../logger.cjs");
|
|
12
13
|
const types_1 = require("../types.cjs");
|
|
13
14
|
const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'batch');
|
|
@@ -25,8 +26,11 @@ async function addTransactionBatch(request) {
|
|
|
25
26
|
request: userRequest,
|
|
26
27
|
sizeLimit,
|
|
27
28
|
});
|
|
28
|
-
const { batchId: batchIdOverride, from, networkClientId, requireApproval, transactions, } = userRequest;
|
|
29
|
+
const { batchId: batchIdOverride, from, networkClientId, requireApproval, securityAlertId, transactions, useHook, validateSecurity, } = userRequest;
|
|
29
30
|
log('Adding', userRequest);
|
|
31
|
+
if (useHook) {
|
|
32
|
+
return await addTransactionBatchWithHook(request);
|
|
33
|
+
}
|
|
30
34
|
const chainId = getChainId(networkClientId);
|
|
31
35
|
const ethQuery = request.getEthQuery(networkClientId);
|
|
32
36
|
const isChainSupported = (0, eip7702_1.doesChainSupportEIP7702)(chainId, messenger);
|
|
@@ -57,13 +61,34 @@ async function addTransactionBatch(request) {
|
|
|
57
61
|
txParams.type = types_1.TransactionEnvelopeType.setCode;
|
|
58
62
|
txParams.authorizationList = [{ address: upgradeContractAddress }];
|
|
59
63
|
}
|
|
64
|
+
if (validateSecurity) {
|
|
65
|
+
const securityRequest = {
|
|
66
|
+
method: 'eth_sendTransaction',
|
|
67
|
+
params: [
|
|
68
|
+
{
|
|
69
|
+
...txParams,
|
|
70
|
+
authorizationList: undefined,
|
|
71
|
+
type: types_1.TransactionEnvelopeType.feeMarket,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
delegationMock: txParams.authorizationList?.[0]?.address,
|
|
75
|
+
};
|
|
76
|
+
log('Security request', securityRequest);
|
|
77
|
+
validateSecurity(securityRequest, chainId).catch((error) => {
|
|
78
|
+
log('Security validation failed', error);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
60
81
|
log('Adding batch transaction', txParams, networkClientId);
|
|
61
82
|
const batchId = batchIdOverride ?? generateBatchId();
|
|
83
|
+
const securityAlertResponse = securityAlertId
|
|
84
|
+
? { securityAlertId }
|
|
85
|
+
: undefined;
|
|
62
86
|
const { result } = await addTransaction(txParams, {
|
|
63
87
|
batchId,
|
|
64
88
|
nestedTransactions,
|
|
65
89
|
networkClientId,
|
|
66
90
|
requireApproval,
|
|
91
|
+
securityAlertResponse,
|
|
67
92
|
type: types_1.TransactionType.batch,
|
|
68
93
|
});
|
|
69
94
|
// Wait for the transaction to be published.
|
|
@@ -124,4 +149,120 @@ async function getNestedTransactionMeta(request, singleRequest, ethQuery) {
|
|
|
124
149
|
type,
|
|
125
150
|
};
|
|
126
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Process a batch transaction using a publish batch hook.
|
|
154
|
+
*
|
|
155
|
+
* @param request - The request object including the user request and necessary callbacks.
|
|
156
|
+
* @returns The batch result object including the batch ID.
|
|
157
|
+
*/
|
|
158
|
+
async function addTransactionBatchWithHook(request) {
|
|
159
|
+
const { publishBatchHook, request: userRequest } = request;
|
|
160
|
+
const { from, networkClientId, transactions: nestedTransactions, } = userRequest;
|
|
161
|
+
log('Adding transaction batch using hook', userRequest);
|
|
162
|
+
if (!publishBatchHook) {
|
|
163
|
+
log('No publish batch hook provided');
|
|
164
|
+
throw new Error('No publish batch hook provided');
|
|
165
|
+
}
|
|
166
|
+
const batchId = generateBatchId();
|
|
167
|
+
const transactionCount = nestedTransactions.length;
|
|
168
|
+
const collectHook = new CollectPublishHook_1.CollectPublishHook(transactionCount);
|
|
169
|
+
const publishHook = collectHook.getHook();
|
|
170
|
+
const hookTransactions = [];
|
|
171
|
+
try {
|
|
172
|
+
for (const nestedTransaction of nestedTransactions) {
|
|
173
|
+
const hookTransaction = await processTransactionWithHook(batchId, nestedTransaction, publishHook, request);
|
|
174
|
+
hookTransactions.push(hookTransaction);
|
|
175
|
+
}
|
|
176
|
+
const { signedTransactions } = await collectHook.ready();
|
|
177
|
+
const transactions = hookTransactions.map((transaction, index) => ({
|
|
178
|
+
...transaction,
|
|
179
|
+
signedTx: signedTransactions[index],
|
|
180
|
+
}));
|
|
181
|
+
log('Calling publish batch hook', { from, networkClientId, transactions });
|
|
182
|
+
const result = await publishBatchHook({
|
|
183
|
+
from,
|
|
184
|
+
networkClientId,
|
|
185
|
+
transactions,
|
|
186
|
+
});
|
|
187
|
+
log('Publish batch hook result', result);
|
|
188
|
+
if (!result) {
|
|
189
|
+
throw new Error('Publish batch hook did not return a result');
|
|
190
|
+
}
|
|
191
|
+
const transactionHashes = result.results.map(({ transactionHash }) => transactionHash);
|
|
192
|
+
collectHook.success(transactionHashes);
|
|
193
|
+
log('Completed batch transaction with hook', transactionHashes);
|
|
194
|
+
return {
|
|
195
|
+
batchId,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
log('Publish batch hook failed', error);
|
|
200
|
+
collectHook.error(error);
|
|
201
|
+
throw error;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Process a single transaction with a publish batch hook.
|
|
206
|
+
*
|
|
207
|
+
* @param batchId - ID of the transaction batch.
|
|
208
|
+
* @param nestedTransaction - The nested transaction request.
|
|
209
|
+
* @param publishHook - The publish hook to use for each transaction.
|
|
210
|
+
* @param request - The request object including the user request and necessary callbacks.
|
|
211
|
+
* @returns The single transaction request to be processed by the publish batch hook.
|
|
212
|
+
*/
|
|
213
|
+
async function processTransactionWithHook(batchId, nestedTransaction, publishHook, request) {
|
|
214
|
+
const { existingTransaction, params } = nestedTransaction;
|
|
215
|
+
const { addTransaction, getTransaction, request: userRequest, updateTransaction, } = request;
|
|
216
|
+
const { from, networkClientId } = userRequest;
|
|
217
|
+
if (existingTransaction) {
|
|
218
|
+
const { id, onPublish, signedTransaction } = existingTransaction;
|
|
219
|
+
const transactionMeta = getTransaction(id);
|
|
220
|
+
updateTransaction({ transactionId: id }, (_transactionMeta) => {
|
|
221
|
+
_transactionMeta.batchId = batchId;
|
|
222
|
+
});
|
|
223
|
+
publishHook(transactionMeta, signedTransaction)
|
|
224
|
+
.then(onPublish)
|
|
225
|
+
.catch(() => {
|
|
226
|
+
// Intentionally empty
|
|
227
|
+
});
|
|
228
|
+
log('Processed existing transaction with hook', {
|
|
229
|
+
id,
|
|
230
|
+
params,
|
|
231
|
+
});
|
|
232
|
+
return {
|
|
233
|
+
id,
|
|
234
|
+
params,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
const { transactionMeta } = await addTransaction({
|
|
238
|
+
...params,
|
|
239
|
+
from,
|
|
240
|
+
}, {
|
|
241
|
+
batchId,
|
|
242
|
+
disableGasBuffer: true,
|
|
243
|
+
networkClientId,
|
|
244
|
+
publishHook,
|
|
245
|
+
requireApproval: false,
|
|
246
|
+
});
|
|
247
|
+
const { id, txParams } = transactionMeta;
|
|
248
|
+
const data = txParams.data;
|
|
249
|
+
const gas = txParams.gas;
|
|
250
|
+
const maxFeePerGas = txParams.maxFeePerGas;
|
|
251
|
+
const maxPriorityFeePerGas = txParams.maxPriorityFeePerGas;
|
|
252
|
+
const to = txParams.to;
|
|
253
|
+
const value = txParams.value;
|
|
254
|
+
const newParams = {
|
|
255
|
+
data,
|
|
256
|
+
gas,
|
|
257
|
+
maxFeePerGas,
|
|
258
|
+
maxPriorityFeePerGas,
|
|
259
|
+
to,
|
|
260
|
+
value,
|
|
261
|
+
};
|
|
262
|
+
log('Processed new transaction with hook', { id, params: newParams });
|
|
263
|
+
return {
|
|
264
|
+
id,
|
|
265
|
+
params: newParams,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
127
268
|
//# sourceMappingURL=batch.cjs.map
|
package/dist/utils/batch.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.cjs","sourceRoot":"","sources":["../../src/utils/batch.ts"],"names":[],"mappings":";;;AACA,qDAAiD;AAEjD,2CAAiE;AACjE,+BAAiC;AAEjC,2CAImB;AACnB,uDAIyB;AACzB,iDAAoD;AACpD,oCAKY;AACZ,0CAA0C;AAK1C,wCAKkB;AAmBlB,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,OAAO,CAAC,CAAC;AAEvD;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAAmC;IAEnC,MAAM,EACJ,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,OAAO,EAAE,WAAW,GACrB,GAAG,OAAO,CAAC;IAEZ,MAAM,SAAS,GAAG,IAAA,iCAAiB,EAAC,SAAS,CAAC,CAAC;IAE/C,IAAA,iCAAoB,EAAC;QACnB,gBAAgB,EAAE,mBAAmB,EAAE;QACvC,OAAO,EAAE,WAAW;QACpB,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,EACJ,OAAO,EAAE,eAAe,EACxB,IAAI,EACJ,eAAe,EACf,eAAe,EACf,YAAY,GACb,GAAG,WAAW,CAAC;IAEhB,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAE3B,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,gBAAgB,GAAG,IAAA,iCAAuB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAErE,IAAI,CAAC,gBAAgB,EAAE;QACrB,GAAG,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,sBAAS,CAAC,QAAQ,CAAC,iCAAiC,CA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ACtB,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,IAAA,YAAK,EAAC,QAAQ,CAAC,CAAC,CAAC;IAChD,OAAO,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,wBAAwB,CACrC,OAAgC,EAChC,aAA4C,EAC5C,QAAkB;IAElB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;IAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,4BAAwB,EAC7C,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,EACnB,QAAQ,CACT,CAAC;IAEF,OAAO;QACL,GAAG,MAAM;QACT,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["import type EthQuery from '@metamask/eth-query';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { Hex } from '@metamask/utils';\nimport { bytesToHex, createModuleLogger } from '@metamask/utils';\nimport { parse, v4 } from 'uuid';\n\nimport {\n doesChainSupportEIP7702,\n generateEIP7702BatchTransaction,\n isAccountUpgradedToEIP7702,\n} from './eip7702';\nimport {\n getBatchSizeLimit,\n getEIP7702SupportedChains,\n getEIP7702UpgradeContractAddress,\n} from './feature-flags';\nimport { validateBatchRequest } from './validation';\nimport {\n determineTransactionType,\n type TransactionBatchRequest,\n type TransactionController,\n type TransactionControllerMessenger,\n} from '..';\nimport { projectLogger } from '../logger';\nimport type {\n NestedTransactionMetadata,\n TransactionBatchSingleRequest,\n} from '../types';\nimport {\n TransactionEnvelopeType,\n type TransactionBatchResult,\n type TransactionParams,\n TransactionType,\n} from '../types';\n\ntype AddTransactionBatchRequest = {\n addTransaction: TransactionController['addTransaction'];\n getChainId: (networkClientId: string) => Hex;\n getEthQuery: (networkClientId: string) => EthQuery;\n getInternalAccounts: () => Hex[];\n messenger: TransactionControllerMessenger;\n publicKeyEIP7702?: Hex;\n request: TransactionBatchRequest;\n};\n\ntype IsAtomicBatchSupportedRequest = {\n address: Hex;\n getEthQuery: (chainId: Hex) => EthQuery;\n messenger: TransactionControllerMessenger;\n publicKeyEIP7702?: Hex;\n};\n\nconst log = createModuleLogger(projectLogger, 'batch');\n\n/**\n * Add a batch transaction.\n *\n * @param request - The request object including the user request and necessary callbacks.\n * @returns The batch result object including the batch ID.\n */\nexport async function addTransactionBatch(\n request: AddTransactionBatchRequest,\n): Promise<TransactionBatchResult> {\n const {\n addTransaction,\n getChainId,\n getInternalAccounts,\n messenger,\n publicKeyEIP7702,\n request: userRequest,\n } = request;\n\n const sizeLimit = getBatchSizeLimit(messenger);\n\n validateBatchRequest({\n internalAccounts: getInternalAccounts(),\n request: userRequest,\n sizeLimit,\n });\n\n const {\n batchId: batchIdOverride,\n from,\n networkClientId,\n requireApproval,\n transactions,\n } = userRequest;\n\n log('Adding', userRequest);\n\n const chainId = getChainId(networkClientId);\n const ethQuery = request.getEthQuery(networkClientId);\n const isChainSupported = doesChainSupportEIP7702(chainId, messenger);\n\n if (!isChainSupported) {\n log('Chain does not support EIP-7702', chainId);\n throw rpcErrors.internal('Chain does not support EIP-7702');\n }\n\n if (!publicKeyEIP7702) {\n throw rpcErrors.internal('EIP-7702 public key not specified');\n }\n\n const { delegationAddress, isSupported } = await isAccountUpgradedToEIP7702(\n from,\n chainId,\n publicKeyEIP7702,\n messenger,\n ethQuery,\n );\n\n log('Account', { delegationAddress, isSupported });\n\n if (!isSupported && delegationAddress) {\n log('Account upgraded to unsupported contract', from, delegationAddress);\n throw rpcErrors.internal('Account upgraded to unsupported contract');\n }\n\n const nestedTransactions = await Promise.all(\n transactions.map((tx) =>\n getNestedTransactionMeta(userRequest, tx, ethQuery),\n ),\n );\n\n const batchParams = generateEIP7702BatchTransaction(from, nestedTransactions);\n\n const txParams: TransactionParams = {\n from,\n ...batchParams,\n };\n\n if (!isSupported) {\n const upgradeContractAddress = getEIP7702UpgradeContractAddress(\n chainId,\n messenger,\n publicKeyEIP7702,\n );\n\n if (!upgradeContractAddress) {\n throw rpcErrors.internal('Upgrade contract address not found');\n }\n\n txParams.type = TransactionEnvelopeType.setCode;\n txParams.authorizationList = [{ address: upgradeContractAddress }];\n }\n\n log('Adding batch transaction', txParams, networkClientId);\n\n const batchId = batchIdOverride ?? generateBatchId();\n\n const { result } = await addTransaction(txParams, {\n batchId,\n nestedTransactions,\n networkClientId,\n requireApproval,\n type: TransactionType.batch,\n });\n\n // Wait for the transaction to be published.\n await result;\n\n return {\n batchId,\n };\n}\n\n/**\n * Determine which chains support atomic batch transactions for the given account.\n *\n * @param request - The request object including the account address and necessary callbacks.\n * @returns The chain IDs that support atomic batch transactions.\n */\nexport async function isAtomicBatchSupported(\n request: IsAtomicBatchSupportedRequest,\n): Promise<Hex[]> {\n const {\n address,\n getEthQuery,\n messenger,\n publicKeyEIP7702: publicKey,\n } = request;\n\n if (!publicKey) {\n throw rpcErrors.internal('EIP-7702 public key not specified');\n }\n\n const chainIds7702 = getEIP7702SupportedChains(messenger);\n const chainIds: Hex[] = [];\n\n for (const chainId of chainIds7702) {\n const ethQuery = getEthQuery(chainId);\n\n const { isSupported, delegationAddress } = await isAccountUpgradedToEIP7702(\n address,\n chainId,\n publicKey,\n messenger,\n ethQuery,\n );\n\n if (!delegationAddress || isSupported) {\n chainIds.push(chainId);\n }\n }\n\n log('Atomic batch supported chains', chainIds);\n\n return chainIds;\n}\n\n/**\n * Generate a tranasction batch ID.\n *\n * @returns A unique batch ID as a hexadecimal string.\n */\nfunction generateBatchId(): Hex {\n const idString = v4();\n const idBytes = new Uint8Array(parse(idString));\n return bytesToHex(idBytes);\n}\n\n/**\n * Generate the metadata for a nested transaction.\n *\n * @param request - The batch request.\n * @param singleRequest - The request for a single transaction.\n * @param ethQuery - The EthQuery instance used to interact with the Ethereum blockchain.\n * @returns The metadata for the nested transaction.\n */\nasync function getNestedTransactionMeta(\n request: TransactionBatchRequest,\n singleRequest: TransactionBatchSingleRequest,\n ethQuery: EthQuery,\n): Promise<NestedTransactionMetadata> {\n const { from } = request;\n const { params } = singleRequest;\n\n const { type } = await determineTransactionType(\n { from, ...params },\n ethQuery,\n );\n\n return {\n ...params,\n type,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"batch.cjs","sourceRoot":"","sources":["../../src/utils/batch.ts"],"names":[],"mappings":";;;AACA,qDAAiD;AAEjD,2CAAiE;AACjE,+BAAiC;AAEjC,2CAImB;AACnB,uDAIyB;AACzB,iDAAoD;AACpD,oCAMY;AACZ,wEAAiE;AACjE,0CAA0C;AAW1C,wCAKkB;AAyBlB,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,OAAO,CAAC,CAAC;AAEvD;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAAmC;IAEnC,MAAM,EACJ,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,OAAO,EAAE,WAAW,GACrB,GAAG,OAAO,CAAC;IAEZ,MAAM,SAAS,GAAG,IAAA,iCAAiB,EAAC,SAAS,CAAC,CAAC;IAE/C,IAAA,iCAAoB,EAAC;QACnB,gBAAgB,EAAE,mBAAmB,EAAE;QACvC,OAAO,EAAE,WAAW;QACpB,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,EACJ,OAAO,EAAE,eAAe,EACxB,IAAI,EACJ,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,EACZ,OAAO,EACP,gBAAgB,GACjB,GAAG,WAAW,CAAC;IAEhB,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAE3B,IAAI,OAAO,EAAE;QACX,OAAO,MAAM,2BAA2B,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,gBAAgB,GAAG,IAAA,iCAAu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type EthQuery from '@metamask/eth-query';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { Hex } from '@metamask/utils';\nimport { bytesToHex, createModuleLogger } from '@metamask/utils';\nimport { parse, v4 } from 'uuid';\n\nimport {\n doesChainSupportEIP7702,\n generateEIP7702BatchTransaction,\n isAccountUpgradedToEIP7702,\n} from './eip7702';\nimport {\n getBatchSizeLimit,\n getEIP7702SupportedChains,\n getEIP7702UpgradeContractAddress,\n} from './feature-flags';\nimport { validateBatchRequest } from './validation';\nimport {\n determineTransactionType,\n type BatchTransactionParams,\n type TransactionController,\n type TransactionControllerMessenger,\n type TransactionMeta,\n} from '..';\nimport { CollectPublishHook } from '../hooks/CollectPublishHook';\nimport { projectLogger } from '../logger';\nimport type {\n NestedTransactionMetadata,\n SecurityAlertResponse,\n TransactionBatchSingleRequest,\n PublishBatchHook,\n PublishBatchHookTransaction,\n PublishHook,\n TransactionBatchRequest,\n ValidateSecurityRequest,\n} from '../types';\nimport {\n TransactionEnvelopeType,\n type TransactionBatchResult,\n type TransactionParams,\n TransactionType,\n} from '../types';\n\ntype AddTransactionBatchRequest = {\n addTransaction: TransactionController['addTransaction'];\n getChainId: (networkClientId: string) => Hex;\n getEthQuery: (networkClientId: string) => EthQuery;\n getInternalAccounts: () => Hex[];\n getTransaction: (id: string) => TransactionMeta;\n messenger: TransactionControllerMessenger;\n publishBatchHook?: PublishBatchHook;\n publicKeyEIP7702?: Hex;\n request: TransactionBatchRequest;\n updateTransaction: (\n options: { transactionId: string },\n callback: (transactionMeta: TransactionMeta) => void,\n ) => void;\n};\n\ntype IsAtomicBatchSupportedRequest = {\n address: Hex;\n getEthQuery: (chainId: Hex) => EthQuery;\n messenger: TransactionControllerMessenger;\n publicKeyEIP7702?: Hex;\n};\n\nconst log = createModuleLogger(projectLogger, 'batch');\n\n/**\n * Add a batch transaction.\n *\n * @param request - The request object including the user request and necessary callbacks.\n * @returns The batch result object including the batch ID.\n */\nexport async function addTransactionBatch(\n request: AddTransactionBatchRequest,\n): Promise<TransactionBatchResult> {\n const {\n addTransaction,\n getChainId,\n getInternalAccounts,\n messenger,\n publicKeyEIP7702,\n request: userRequest,\n } = request;\n\n const sizeLimit = getBatchSizeLimit(messenger);\n\n validateBatchRequest({\n internalAccounts: getInternalAccounts(),\n request: userRequest,\n sizeLimit,\n });\n\n const {\n batchId: batchIdOverride,\n from,\n networkClientId,\n requireApproval,\n securityAlertId,\n transactions,\n useHook,\n validateSecurity,\n } = userRequest;\n\n log('Adding', userRequest);\n\n if (useHook) {\n return await addTransactionBatchWithHook(request);\n }\n\n const chainId = getChainId(networkClientId);\n const ethQuery = request.getEthQuery(networkClientId);\n const isChainSupported = doesChainSupportEIP7702(chainId, messenger);\n\n if (!isChainSupported) {\n log('Chain does not support EIP-7702', chainId);\n throw rpcErrors.internal('Chain does not support EIP-7702');\n }\n\n if (!publicKeyEIP7702) {\n throw rpcErrors.internal('EIP-7702 public key not specified');\n }\n\n const { delegationAddress, isSupported } = await isAccountUpgradedToEIP7702(\n from,\n chainId,\n publicKeyEIP7702,\n messenger,\n ethQuery,\n );\n\n log('Account', { delegationAddress, isSupported });\n\n if (!isSupported && delegationAddress) {\n log('Account upgraded to unsupported contract', from, delegationAddress);\n throw rpcErrors.internal('Account upgraded to unsupported contract');\n }\n\n const nestedTransactions = await Promise.all(\n transactions.map((tx) =>\n getNestedTransactionMeta(userRequest, tx, ethQuery),\n ),\n );\n\n const batchParams = generateEIP7702BatchTransaction(from, nestedTransactions);\n\n const txParams: TransactionParams = {\n from,\n ...batchParams,\n };\n\n if (!isSupported) {\n const upgradeContractAddress = getEIP7702UpgradeContractAddress(\n chainId,\n messenger,\n publicKeyEIP7702,\n );\n\n if (!upgradeContractAddress) {\n throw rpcErrors.internal('Upgrade contract address not found');\n }\n\n txParams.type = TransactionEnvelopeType.setCode;\n txParams.authorizationList = [{ address: upgradeContractAddress }];\n }\n\n if (validateSecurity) {\n const securityRequest: ValidateSecurityRequest = {\n method: 'eth_sendTransaction',\n params: [\n {\n ...txParams,\n authorizationList: undefined,\n type: TransactionEnvelopeType.feeMarket,\n },\n ],\n delegationMock: txParams.authorizationList?.[0]?.address,\n };\n\n log('Security request', securityRequest);\n\n validateSecurity(securityRequest, chainId).catch((error) => {\n log('Security validation failed', error);\n });\n }\n\n log('Adding batch transaction', txParams, networkClientId);\n\n const batchId = batchIdOverride ?? generateBatchId();\n\n const securityAlertResponse = securityAlertId\n ? ({ securityAlertId } as SecurityAlertResponse)\n : undefined;\n\n const { result } = await addTransaction(txParams, {\n batchId,\n nestedTransactions,\n networkClientId,\n requireApproval,\n securityAlertResponse,\n type: TransactionType.batch,\n });\n\n // Wait for the transaction to be published.\n await result;\n\n return {\n batchId,\n };\n}\n\n/**\n * Determine which chains support atomic batch transactions for the given account.\n *\n * @param request - The request object including the account address and necessary callbacks.\n * @returns The chain IDs that support atomic batch transactions.\n */\nexport async function isAtomicBatchSupported(\n request: IsAtomicBatchSupportedRequest,\n): Promise<Hex[]> {\n const {\n address,\n getEthQuery,\n messenger,\n publicKeyEIP7702: publicKey,\n } = request;\n\n if (!publicKey) {\n throw rpcErrors.internal('EIP-7702 public key not specified');\n }\n\n const chainIds7702 = getEIP7702SupportedChains(messenger);\n const chainIds: Hex[] = [];\n\n for (const chainId of chainIds7702) {\n const ethQuery = getEthQuery(chainId);\n\n const { isSupported, delegationAddress } = await isAccountUpgradedToEIP7702(\n address,\n chainId,\n publicKey,\n messenger,\n ethQuery,\n );\n\n if (!delegationAddress || isSupported) {\n chainIds.push(chainId);\n }\n }\n\n log('Atomic batch supported chains', chainIds);\n\n return chainIds;\n}\n\n/**\n * Generate a tranasction batch ID.\n *\n * @returns A unique batch ID as a hexadecimal string.\n */\nfunction generateBatchId(): Hex {\n const idString = v4();\n const idBytes = new Uint8Array(parse(idString));\n return bytesToHex(idBytes);\n}\n\n/**\n * Generate the metadata for a nested transaction.\n *\n * @param request - The batch request.\n * @param singleRequest - The request for a single transaction.\n * @param ethQuery - The EthQuery instance used to interact with the Ethereum blockchain.\n * @returns The metadata for the nested transaction.\n */\nasync function getNestedTransactionMeta(\n request: TransactionBatchRequest,\n singleRequest: TransactionBatchSingleRequest,\n ethQuery: EthQuery,\n): Promise<NestedTransactionMetadata> {\n const { from } = request;\n const { params } = singleRequest;\n\n const { type } = await determineTransactionType(\n { from, ...params },\n ethQuery,\n );\n\n return {\n ...params,\n type,\n };\n}\n\n/**\n * Process a batch transaction using a publish batch hook.\n *\n * @param request - The request object including the user request and necessary callbacks.\n * @returns The batch result object including the batch ID.\n */\nasync function addTransactionBatchWithHook(\n request: AddTransactionBatchRequest,\n): Promise<TransactionBatchResult> {\n const { publishBatchHook, request: userRequest } = request;\n\n const {\n from,\n networkClientId,\n transactions: nestedTransactions,\n } = userRequest;\n\n log('Adding transaction batch using hook', userRequest);\n\n if (!publishBatchHook) {\n log('No publish batch hook provided');\n throw new Error('No publish batch hook provided');\n }\n\n const batchId = generateBatchId();\n const transactionCount = nestedTransactions.length;\n const collectHook = new CollectPublishHook(transactionCount);\n const publishHook = collectHook.getHook();\n const hookTransactions: Omit<PublishBatchHookTransaction, 'signedTx'>[] = [];\n\n try {\n for (const nestedTransaction of nestedTransactions) {\n const hookTransaction = await processTransactionWithHook(\n batchId,\n nestedTransaction,\n publishHook,\n request,\n );\n\n hookTransactions.push(hookTransaction);\n }\n\n const { signedTransactions } = await collectHook.ready();\n\n const transactions = hookTransactions.map((transaction, index) => ({\n ...transaction,\n signedTx: signedTransactions[index],\n }));\n\n log('Calling publish batch hook', { from, networkClientId, transactions });\n\n const result = await publishBatchHook({\n from,\n networkClientId,\n transactions,\n });\n\n log('Publish batch hook result', result);\n\n if (!result) {\n throw new Error('Publish batch hook did not return a result');\n }\n\n const transactionHashes = result.results.map(\n ({ transactionHash }) => transactionHash,\n );\n\n collectHook.success(transactionHashes);\n\n log('Completed batch transaction with hook', transactionHashes);\n\n return {\n batchId,\n };\n } catch (error) {\n log('Publish batch hook failed', error);\n\n collectHook.error(error);\n\n throw error;\n }\n}\n\n/**\n * Process a single transaction with a publish batch hook.\n *\n * @param batchId - ID of the transaction batch.\n * @param nestedTransaction - The nested transaction request.\n * @param publishHook - The publish hook to use for each transaction.\n * @param request - The request object including the user request and necessary callbacks.\n * @returns The single transaction request to be processed by the publish batch hook.\n */\nasync function processTransactionWithHook(\n batchId: Hex,\n nestedTransaction: TransactionBatchSingleRequest,\n publishHook: PublishHook,\n request: AddTransactionBatchRequest,\n) {\n const { existingTransaction, params } = nestedTransaction;\n\n const {\n addTransaction,\n getTransaction,\n request: userRequest,\n updateTransaction,\n } = request;\n\n const { from, networkClientId } = userRequest;\n\n if (existingTransaction) {\n const { id, onPublish, signedTransaction } = existingTransaction;\n const transactionMeta = getTransaction(id);\n\n updateTransaction({ transactionId: id }, (_transactionMeta) => {\n _transactionMeta.batchId = batchId;\n });\n\n publishHook(transactionMeta, signedTransaction)\n .then(onPublish)\n .catch(() => {\n // Intentionally empty\n });\n\n log('Processed existing transaction with hook', {\n id,\n params,\n });\n\n return {\n id,\n params,\n };\n }\n\n const { transactionMeta } = await addTransaction(\n {\n ...params,\n from,\n },\n {\n batchId,\n disableGasBuffer: true,\n networkClientId,\n publishHook,\n requireApproval: false,\n },\n );\n\n const { id, txParams } = transactionMeta;\n const data = txParams.data as Hex | undefined;\n const gas = txParams.gas as Hex | undefined;\n const maxFeePerGas = txParams.maxFeePerGas as Hex | undefined;\n const maxPriorityFeePerGas = txParams.maxPriorityFeePerGas as Hex | undefined;\n const to = txParams.to as Hex | undefined;\n const value = txParams.value as Hex | undefined;\n\n const newParams: BatchTransactionParams = {\n data,\n gas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n to,\n value,\n };\n\n log('Processed new transaction with hook', { id, params: newParams });\n\n return {\n id,\n params: newParams,\n };\n}\n"]}
|
package/dist/utils/batch.d.cts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import type EthQuery from "@metamask/eth-query";
|
|
2
2
|
import type { Hex } from "@metamask/utils";
|
|
3
|
-
import { type
|
|
3
|
+
import { type TransactionController, type TransactionControllerMessenger, type TransactionMeta } from "../index.cjs";
|
|
4
|
+
import type { PublishBatchHook, TransactionBatchRequest } from "../types.cjs";
|
|
4
5
|
import { type TransactionBatchResult } from "../types.cjs";
|
|
5
6
|
type AddTransactionBatchRequest = {
|
|
6
7
|
addTransaction: TransactionController['addTransaction'];
|
|
7
8
|
getChainId: (networkClientId: string) => Hex;
|
|
8
9
|
getEthQuery: (networkClientId: string) => EthQuery;
|
|
9
10
|
getInternalAccounts: () => Hex[];
|
|
11
|
+
getTransaction: (id: string) => TransactionMeta;
|
|
10
12
|
messenger: TransactionControllerMessenger;
|
|
13
|
+
publishBatchHook?: PublishBatchHook;
|
|
11
14
|
publicKeyEIP7702?: Hex;
|
|
12
15
|
request: TransactionBatchRequest;
|
|
16
|
+
updateTransaction: (options: {
|
|
17
|
+
transactionId: string;
|
|
18
|
+
}, callback: (transactionMeta: TransactionMeta) => void) => void;
|
|
13
19
|
};
|
|
14
20
|
type IsAtomicBatchSupportedRequest = {
|
|
15
21
|
address: Hex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.cts","sourceRoot":"","sources":["../../src/utils/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,4BAA4B;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAe3C,OAAO,
|
|
1
|
+
{"version":3,"file":"batch.d.cts","sourceRoot":"","sources":["../../src/utils/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,4BAA4B;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAe3C,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACrB,qBAAW;AAGZ,OAAO,KAAK,EAIV,gBAAgB,EAGhB,uBAAuB,EAExB,qBAAiB;AAClB,OAAO,EAEL,KAAK,sBAAsB,EAG5B,qBAAiB;AAElB,KAAK,0BAA0B,GAAG;IAChC,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACxD,UAAU,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7C,WAAW,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,QAAQ,CAAC;IACnD,mBAAmB,EAAE,MAAM,GAAG,EAAE,CAAC;IACjC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,eAAe,CAAC;IAChD,SAAS,EAAE,8BAA8B,CAAC;IAC1C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,OAAO,EAAE,uBAAuB,CAAC;IACjC,iBAAiB,EAAE,CACjB,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAClC,QAAQ,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,KACjD,IAAI,CAAC;CACX,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,OAAO,EAAE,GAAG,CAAC;IACb,WAAW,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,QAAQ,CAAC;IACxC,SAAS,EAAE,8BAA8B,CAAC;IAC1C,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB,CAAC;AAIF;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAsIjC;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,GAAG,EAAE,CAAC,CAkChB"}
|
package/dist/utils/batch.d.mts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import type EthQuery from "@metamask/eth-query";
|
|
2
2
|
import type { Hex } from "@metamask/utils";
|
|
3
|
-
import { type
|
|
3
|
+
import { type TransactionController, type TransactionControllerMessenger, type TransactionMeta } from "../index.mjs";
|
|
4
|
+
import type { PublishBatchHook, TransactionBatchRequest } from "../types.mjs";
|
|
4
5
|
import { type TransactionBatchResult } from "../types.mjs";
|
|
5
6
|
type AddTransactionBatchRequest = {
|
|
6
7
|
addTransaction: TransactionController['addTransaction'];
|
|
7
8
|
getChainId: (networkClientId: string) => Hex;
|
|
8
9
|
getEthQuery: (networkClientId: string) => EthQuery;
|
|
9
10
|
getInternalAccounts: () => Hex[];
|
|
11
|
+
getTransaction: (id: string) => TransactionMeta;
|
|
10
12
|
messenger: TransactionControllerMessenger;
|
|
13
|
+
publishBatchHook?: PublishBatchHook;
|
|
11
14
|
publicKeyEIP7702?: Hex;
|
|
12
15
|
request: TransactionBatchRequest;
|
|
16
|
+
updateTransaction: (options: {
|
|
17
|
+
transactionId: string;
|
|
18
|
+
}, callback: (transactionMeta: TransactionMeta) => void) => void;
|
|
13
19
|
};
|
|
14
20
|
type IsAtomicBatchSupportedRequest = {
|
|
15
21
|
address: Hex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.mts","sourceRoot":"","sources":["../../src/utils/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,4BAA4B;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAe3C,OAAO,
|
|
1
|
+
{"version":3,"file":"batch.d.mts","sourceRoot":"","sources":["../../src/utils/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,4BAA4B;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAe3C,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACrB,qBAAW;AAGZ,OAAO,KAAK,EAIV,gBAAgB,EAGhB,uBAAuB,EAExB,qBAAiB;AAClB,OAAO,EAEL,KAAK,sBAAsB,EAG5B,qBAAiB;AAElB,KAAK,0BAA0B,GAAG;IAChC,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACxD,UAAU,E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