@metamask/transaction-controller 63.0.0 → 63.1.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 +13 -1
- package/dist/TransactionController-method-action-types.cjs.map +1 -1
- package/dist/TransactionController-method-action-types.d.cts +2 -2
- package/dist/TransactionController-method-action-types.d.mts +2 -2
- package/dist/TransactionController-method-action-types.mjs.map +1 -1
- package/dist/TransactionController.cjs +78 -94
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts +2 -2
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts +2 -2
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +78 -94
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +8 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +8 -2
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +4 -0
- package/dist/types.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [63.1.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `perpsWithdraw` to `TransactionType` ([#8271](https://github.com/MetaMask/core/pull/8271))
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Bump `@metamask/core-backend` from `^6.1.1` to `^6.2.0` ([#8232](https://github.com/MetaMask/core/pull/8232))
|
|
19
|
+
- Remove legacy `actionId` deduplication logic from transaction lifecycle methods ([#8256](https://github.com/MetaMask/core/pull/8256))
|
|
20
|
+
|
|
10
21
|
## [63.0.0]
|
|
11
22
|
|
|
12
23
|
### Added
|
|
@@ -2254,7 +2265,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
2254
2265
|
|
|
2255
2266
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
2256
2267
|
|
|
2257
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.
|
|
2268
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.1.0...HEAD
|
|
2269
|
+
[63.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.0.0...@metamask/transaction-controller@63.1.0
|
|
2258
2270
|
[63.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.22.0...@metamask/transaction-controller@63.0.0
|
|
2259
2271
|
[62.22.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.21.0...@metamask/transaction-controller@62.22.0
|
|
2260
2272
|
[62.21.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.20.0...@metamask/transaction-controller@62.21.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionController-method-action-types.cjs","sourceRoot":"","sources":["../src/TransactionController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { TransactionController } from './TransactionController';\n\n/**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @param networkClientId - The ID of the network client used to fetch the method data.\n * @returns The method data object corresponding to the given signature prefix.\n */\nexport type TransactionControllerHandleMethodDataAction = {\n type: `TransactionController:handleMethodData`;\n handler: TransactionController['handleMethodData'];\n};\n\n/**\n * Add a batch of transactions to be submitted after approval.\n *\n * @param request - Request object containing the transactions to add.\n * @returns Result object containing the generated batch ID.\n */\nexport type TransactionControllerAddTransactionBatchAction = {\n type: `TransactionController:addTransactionBatch`;\n handler: TransactionController['addTransactionBatch'];\n};\n\n/**\n * Determine which chains support atomic batch transactions with the given account address.\n *\n * @param request - Request object containing the account address and other parameters.\n * @returns Result object containing the supported chains and related information.\n */\nexport type TransactionControllerIsAtomicBatchSupportedAction = {\n type: `TransactionController:isAtomicBatchSupported`;\n handler: TransactionController['isAtomicBatchSupported'];\n};\n\n/**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction ID will be generated, and `gas` and `gasPrice` will be calculated\n * if not provided. A `<tx.id>:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param options - Additional options to control how the transaction is added.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\nexport type TransactionControllerAddTransactionAction = {\n type: `TransactionController:addTransaction`;\n handler: TransactionController['addTransaction'];\n};\n\n/**\n * Starts polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStartIncomingTransactionPollingAction = {\n type: `TransactionController:startIncomingTransactionPolling`;\n handler: TransactionController['startIncomingTransactionPolling'];\n};\n\n/**\n * Stops polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStopIncomingTransactionPollingAction = {\n type: `TransactionController:stopIncomingTransactionPolling`;\n handler: TransactionController['stopIncomingTransactionPolling'];\n};\n\n/**\n * Update the incoming transactions by polling the remote transaction source.\n *\n * @param request - Request object.\n * @param request.tags - Additional tags to identify the source of the request.\n */\nexport type TransactionControllerUpdateIncomingTransactionsAction = {\n type: `TransactionController:updateIncomingTransactions`;\n handler: TransactionController['updateIncomingTransactions'];\n};\n\n/**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `<tx.id>:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerStopTransactionAction = {\n type: `TransactionController:stopTransaction`;\n handler: TransactionController['stopTransaction'];\n};\n\n/**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerSpeedUpTransactionAction = {\n type: `TransactionController:speedUpTransaction`;\n handler: TransactionController['speedUpTransaction'];\n};\n\n/**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @param networkClientId - The network client id to use for the estimate.\n * @param options - Additional options for the estimate.\n * @param options.ignoreDelegationSignatures - Ignore signature errors if submitting delegations to the DelegationManager.\n * @returns The gas and gas price.\n */\nexport type TransactionControllerEstimateGasAction = {\n type: `TransactionController:estimateGas`;\n handler: TransactionController['estimateGas'];\n};\n\n/**\n * Estimates required gas for a batch of transactions.\n *\n * @param request - Request object.\n * @param request.chainId - Chain ID of the transactions.\n * @param request.from - Address of the sender.\n * @param request.transactions - Array of transactions within a batch request.\n * @returns Object containing the gas limit.\n */\nexport type TransactionControllerEstimateGasBatchAction = {\n type: `TransactionController:estimateGasBatch`;\n handler: TransactionController['estimateGasBatch'];\n};\n\n/**\n * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.\n *\n * @param transaction - The transaction params to estimate gas for.\n * @param multiplier - The multiplier to use for the gas buffer.\n * @param networkClientId - The network client id to use for the estimate.\n * @returns The buffered estimated gas and whether the estimation failed.\n */\nexport type TransactionControllerEstimateGasBufferedAction = {\n type: `TransactionController:estimateGasBuffered`;\n handler: TransactionController['estimateGasBuffered'];\n};\n\n/**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to be logged.\n */\nexport type TransactionControllerUpdateTransactionAction = {\n type: `TransactionController:updateTransaction`;\n handler: TransactionController['updateTransaction'];\n};\n\n/**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\nexport type TransactionControllerConfirmExternalTransactionAction = {\n type: `TransactionController:confirmExternalTransaction`;\n handler: TransactionController['confirmExternalTransaction'];\n};\n\n/**\n * Acquires a nonce lock for the given address on the specified network,\n * ensuring that nonces are assigned sequentially without conflicts.\n *\n * @param address - The account address for which to acquire the nonce lock.\n * @param networkClientId - The ID of the network client to use.\n * @returns A promise that resolves to a nonce lock containing the next nonce and a release function.\n */\nexport type TransactionControllerGetNonceLockAction = {\n type: `TransactionController:getNonceLock`;\n handler: TransactionController['getNonceLock'];\n};\n\n/**\n * Updates the editable parameters of a transaction.\n *\n * @param txId - The ID of the transaction to update.\n * @param params - The editable parameters to update.\n * @param params.containerTypes - Container types applied to the parameters.\n * @param params.data - Data to pass with the transaction.\n * @param params.from - Address to send the transaction from.\n * @param params.gas - Maximum number of units of gas to use for the transaction.\n * @param params.gasPrice - Price per gas for legacy transactions.\n * @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param params.updateType - Whether to update the transaction type. Defaults to `true`.\n * @param params.to - Address to send the transaction to.\n * @param params.value - Value associated with the transaction.\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateEditableParamsAction = {\n type: `TransactionController:updateEditableParams`;\n handler: TransactionController['updateEditableParams'];\n};\n\n/**\n * Update the isActive state of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param isActive - The active state.\n */\nexport type TransactionControllerSetTransactionActiveAction = {\n type: `TransactionController:setTransactionActive`;\n handler: TransactionController['setTransactionActive'];\n};\n\n/**\n * Signs and returns the raw transaction data for provided transaction params list.\n *\n * @param listOfTxParams - The list of transaction params to approve.\n * @param opts - Options bag.\n * @param opts.hasNonce - Whether the transactions already have a nonce.\n * @returns The raw transactions.\n */\nexport type TransactionControllerApproveTransactionsWithSameNonceAction = {\n type: `TransactionController:approveTransactionsWithSameNonce`;\n handler: TransactionController['approveTransactionsWithSameNonce'];\n};\n\n/**\n * Update a custodial transaction.\n *\n * @param request - The custodial transaction update request.\n *\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateCustodialTransactionAction = {\n type: `TransactionController:updateCustodialTransaction`;\n handler: TransactionController['updateCustodialTransaction'];\n};\n\n/**\n * Search transaction metadata for matching entries.\n *\n * @param opts - Options bag.\n * @param opts.initialList - The transactions to search. Defaults to the current state.\n * @param opts.limit - The maximum number of transactions to return. No limit by default.\n * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.\n * @returns An array of transactions matching the provided options.\n */\nexport type TransactionControllerGetTransactionsAction = {\n type: `TransactionController:getTransactions`;\n handler: TransactionController['getTransactions'];\n};\n\n/**\n * Estimates the gas fees for a transaction.\n *\n * @param args - The arguments for estimating gas fees.\n * @param args.transactionParams - The transaction parameters to estimate fees for.\n * @param args.chainId - The chain ID to use. If not provided, the network client ID is used to determine the chain.\n * @param args.networkClientId - The network client ID to use for the estimation.\n * @returns A promise that resolves to the estimated gas fee response.\n */\nexport type TransactionControllerEstimateGasFeeAction = {\n type: `TransactionController:estimateGasFee`;\n handler: TransactionController['estimateGasFee'];\n};\n\n/**\n * Determine the layer 1 gas fee for the given transaction parameters.\n *\n * @param request - The request object.\n * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.\n * @param request.chainId - The ID of the chain where the transaction will be executed.\n * @param request.networkClientId - The ID of a specific network client to process the transaction.\n * @returns The layer 1 gas fee.\n */\nexport type TransactionControllerGetLayer1GasFeeAction = {\n type: `TransactionController:getLayer1GasFee`;\n handler: TransactionController['getLayer1GasFee'];\n};\n\n/**\n * Removes unapproved transactions from state.\n */\nexport type TransactionControllerClearUnapprovedTransactionsAction = {\n type: `TransactionController:clearUnapprovedTransactions`;\n handler: TransactionController['clearUnapprovedTransactions'];\n};\n\n/**\n * Stop the signing process for a specific transaction.\n * Throws an error causing the transaction status to be set to failed.\n *\n * @param transactionId - The ID of the transaction to stop signing.\n */\nexport type TransactionControllerAbortTransactionSigningAction = {\n type: `TransactionController:abortTransactionSigning`;\n handler: TransactionController['abortTransactionSigning'];\n};\n\n/**\n * Update the transaction data of a single nested transaction within an atomic batch transaction.\n *\n * @param options - The options bag.\n * @param options.transactionId - ID of the atomic batch transaction.\n * @param options.transactionIndex - Index of the nested transaction within the atomic batch transaction.\n * @param options.transactionData - New data to set for the nested transaction.\n * @returns The updated data for the atomic batch transaction.\n */\nexport type TransactionControllerUpdateAtomicBatchDataAction = {\n type: `TransactionController:updateAtomicBatchData`;\n handler: TransactionController['updateAtomicBatchData'];\n};\n\n/**\n * Emulate a new transaction.\n *\n * @param transactionId - The transaction ID.\n */\nexport type TransactionControllerEmulateNewTransactionAction = {\n type: `TransactionController:emulateNewTransaction`;\n handler: TransactionController['emulateNewTransaction'];\n};\n\n/**\n * Emulate a transaction update.\n *\n * @param transactionMeta - Transaction metadata.\n */\nexport type TransactionControllerEmulateTransactionUpdateAction = {\n type: `TransactionController:emulateTransactionUpdate`;\n handler: TransactionController['emulateTransactionUpdate'];\n};\n\n/**\n * Retrieve available gas fee tokens for a transaction.\n *\n * @param request - The request object containing transaction details.\n * @returns The list of available gas fee tokens.\n */\nexport type TransactionControllerGetGasFeeTokensAction = {\n type: `TransactionController:getGasFeeTokens`;\n handler: TransactionController['getGasFeeTokens'];\n};\n\n/**\n * Union of all TransactionController action types.\n */\nexport type TransactionControllerMethodActions =\n | TransactionControllerHandleMethodDataAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerIsAtomicBatchSupportedAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerStartIncomingTransactionPollingAction\n | TransactionControllerStopIncomingTransactionPollingAction\n | TransactionControllerUpdateIncomingTransactionsAction\n | TransactionControllerStopTransactionAction\n | TransactionControllerSpeedUpTransactionAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerEstimateGasBufferedAction\n | TransactionControllerUpdateTransactionAction\n | TransactionControllerConfirmExternalTransactionAction\n | TransactionControllerGetNonceLockAction\n | TransactionControllerUpdateEditableParamsAction\n | TransactionControllerSetTransactionActiveAction\n | TransactionControllerApproveTransactionsWithSameNonceAction\n | TransactionControllerUpdateCustodialTransactionAction\n | TransactionControllerGetTransactionsAction\n | TransactionControllerEstimateGasFeeAction\n | TransactionControllerGetLayer1GasFeeAction\n | TransactionControllerClearUnapprovedTransactionsAction\n | TransactionControllerAbortTransactionSigningAction\n | TransactionControllerUpdateAtomicBatchDataAction\n | TransactionControllerEmulateNewTransactionAction\n | TransactionControllerEmulateTransactionUpdateAction\n | TransactionControllerGetGasFeeTokensAction;\n"]}
|
|
1
|
+
{"version":3,"file":"TransactionController-method-action-types.cjs","sourceRoot":"","sources":["../src/TransactionController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { TransactionController } from './TransactionController';\n\n/**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @param networkClientId - The ID of the network client used to fetch the method data.\n * @returns The method data object corresponding to the given signature prefix.\n */\nexport type TransactionControllerHandleMethodDataAction = {\n type: `TransactionController:handleMethodData`;\n handler: TransactionController['handleMethodData'];\n};\n\n/**\n * Add a batch of transactions to be submitted after approval.\n *\n * @param request - Request object containing the transactions to add.\n * @returns Result object containing the generated batch ID.\n */\nexport type TransactionControllerAddTransactionBatchAction = {\n type: `TransactionController:addTransactionBatch`;\n handler: TransactionController['addTransactionBatch'];\n};\n\n/**\n * Determine which chains support atomic batch transactions with the given account address.\n *\n * @param request - Request object containing the account address and other parameters.\n * @returns Result object containing the supported chains and related information.\n */\nexport type TransactionControllerIsAtomicBatchSupportedAction = {\n type: `TransactionController:isAtomicBatchSupported`;\n handler: TransactionController['isAtomicBatchSupported'];\n};\n\n/**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction ID will be generated, and `gas` and `gasPrice` will be calculated\n * if not provided. A `<tx.id>:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param options - Additional options to control how the transaction is added.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\nexport type TransactionControllerAddTransactionAction = {\n type: `TransactionController:addTransaction`;\n handler: TransactionController['addTransaction'];\n};\n\n/**\n * Starts polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStartIncomingTransactionPollingAction = {\n type: `TransactionController:startIncomingTransactionPolling`;\n handler: TransactionController['startIncomingTransactionPolling'];\n};\n\n/**\n * Stops polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStopIncomingTransactionPollingAction = {\n type: `TransactionController:stopIncomingTransactionPolling`;\n handler: TransactionController['stopIncomingTransactionPolling'];\n};\n\n/**\n * Update the incoming transactions by polling the remote transaction source.\n *\n * @param request - Request object.\n * @param request.tags - Additional tags to identify the source of the request.\n */\nexport type TransactionControllerUpdateIncomingTransactionsAction = {\n type: `TransactionController:updateIncomingTransactions`;\n handler: TransactionController['updateIncomingTransactions'];\n};\n\n/**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `<tx.id>:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.actionId - Unique ID persisted on transaction metadata.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerStopTransactionAction = {\n type: `TransactionController:stopTransaction`;\n handler: TransactionController['stopTransaction'];\n};\n\n/**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID persisted on transaction metadata.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerSpeedUpTransactionAction = {\n type: `TransactionController:speedUpTransaction`;\n handler: TransactionController['speedUpTransaction'];\n};\n\n/**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @param networkClientId - The network client id to use for the estimate.\n * @param options - Additional options for the estimate.\n * @param options.ignoreDelegationSignatures - Ignore signature errors if submitting delegations to the DelegationManager.\n * @returns The gas and gas price.\n */\nexport type TransactionControllerEstimateGasAction = {\n type: `TransactionController:estimateGas`;\n handler: TransactionController['estimateGas'];\n};\n\n/**\n * Estimates required gas for a batch of transactions.\n *\n * @param request - Request object.\n * @param request.chainId - Chain ID of the transactions.\n * @param request.from - Address of the sender.\n * @param request.transactions - Array of transactions within a batch request.\n * @returns Object containing the gas limit.\n */\nexport type TransactionControllerEstimateGasBatchAction = {\n type: `TransactionController:estimateGasBatch`;\n handler: TransactionController['estimateGasBatch'];\n};\n\n/**\n * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.\n *\n * @param transaction - The transaction params to estimate gas for.\n * @param multiplier - The multiplier to use for the gas buffer.\n * @param networkClientId - The network client id to use for the estimate.\n * @returns The buffered estimated gas and whether the estimation failed.\n */\nexport type TransactionControllerEstimateGasBufferedAction = {\n type: `TransactionController:estimateGasBuffered`;\n handler: TransactionController['estimateGasBuffered'];\n};\n\n/**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to be logged.\n */\nexport type TransactionControllerUpdateTransactionAction = {\n type: `TransactionController:updateTransaction`;\n handler: TransactionController['updateTransaction'];\n};\n\n/**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\nexport type TransactionControllerConfirmExternalTransactionAction = {\n type: `TransactionController:confirmExternalTransaction`;\n handler: TransactionController['confirmExternalTransaction'];\n};\n\n/**\n * Acquires a nonce lock for the given address on the specified network,\n * ensuring that nonces are assigned sequentially without conflicts.\n *\n * @param address - The account address for which to acquire the nonce lock.\n * @param networkClientId - The ID of the network client to use.\n * @returns A promise that resolves to a nonce lock containing the next nonce and a release function.\n */\nexport type TransactionControllerGetNonceLockAction = {\n type: `TransactionController:getNonceLock`;\n handler: TransactionController['getNonceLock'];\n};\n\n/**\n * Updates the editable parameters of a transaction.\n *\n * @param txId - The ID of the transaction to update.\n * @param params - The editable parameters to update.\n * @param params.containerTypes - Container types applied to the parameters.\n * @param params.data - Data to pass with the transaction.\n * @param params.from - Address to send the transaction from.\n * @param params.gas - Maximum number of units of gas to use for the transaction.\n * @param params.gasPrice - Price per gas for legacy transactions.\n * @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param params.updateType - Whether to update the transaction type. Defaults to `true`.\n * @param params.to - Address to send the transaction to.\n * @param params.value - Value associated with the transaction.\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateEditableParamsAction = {\n type: `TransactionController:updateEditableParams`;\n handler: TransactionController['updateEditableParams'];\n};\n\n/**\n * Update the isActive state of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param isActive - The active state.\n */\nexport type TransactionControllerSetTransactionActiveAction = {\n type: `TransactionController:setTransactionActive`;\n handler: TransactionController['setTransactionActive'];\n};\n\n/**\n * Signs and returns the raw transaction data for provided transaction params list.\n *\n * @param listOfTxParams - The list of transaction params to approve.\n * @param opts - Options bag.\n * @param opts.hasNonce - Whether the transactions already have a nonce.\n * @returns The raw transactions.\n */\nexport type TransactionControllerApproveTransactionsWithSameNonceAction = {\n type: `TransactionController:approveTransactionsWithSameNonce`;\n handler: TransactionController['approveTransactionsWithSameNonce'];\n};\n\n/**\n * Update a custodial transaction.\n *\n * @param request - The custodial transaction update request.\n *\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateCustodialTransactionAction = {\n type: `TransactionController:updateCustodialTransaction`;\n handler: TransactionController['updateCustodialTransaction'];\n};\n\n/**\n * Search transaction metadata for matching entries.\n *\n * @param opts - Options bag.\n * @param opts.initialList - The transactions to search. Defaults to the current state.\n * @param opts.limit - The maximum number of transactions to return. No limit by default.\n * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.\n * @returns An array of transactions matching the provided options.\n */\nexport type TransactionControllerGetTransactionsAction = {\n type: `TransactionController:getTransactions`;\n handler: TransactionController['getTransactions'];\n};\n\n/**\n * Estimates the gas fees for a transaction.\n *\n * @param args - The arguments for estimating gas fees.\n * @param args.transactionParams - The transaction parameters to estimate fees for.\n * @param args.chainId - The chain ID to use. If not provided, the network client ID is used to determine the chain.\n * @param args.networkClientId - The network client ID to use for the estimation.\n * @returns A promise that resolves to the estimated gas fee response.\n */\nexport type TransactionControllerEstimateGasFeeAction = {\n type: `TransactionController:estimateGasFee`;\n handler: TransactionController['estimateGasFee'];\n};\n\n/**\n * Determine the layer 1 gas fee for the given transaction parameters.\n *\n * @param request - The request object.\n * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.\n * @param request.chainId - The ID of the chain where the transaction will be executed.\n * @param request.networkClientId - The ID of a specific network client to process the transaction.\n * @returns The layer 1 gas fee.\n */\nexport type TransactionControllerGetLayer1GasFeeAction = {\n type: `TransactionController:getLayer1GasFee`;\n handler: TransactionController['getLayer1GasFee'];\n};\n\n/**\n * Removes unapproved transactions from state.\n */\nexport type TransactionControllerClearUnapprovedTransactionsAction = {\n type: `TransactionController:clearUnapprovedTransactions`;\n handler: TransactionController['clearUnapprovedTransactions'];\n};\n\n/**\n * Stop the signing process for a specific transaction.\n * Throws an error causing the transaction status to be set to failed.\n *\n * @param transactionId - The ID of the transaction to stop signing.\n */\nexport type TransactionControllerAbortTransactionSigningAction = {\n type: `TransactionController:abortTransactionSigning`;\n handler: TransactionController['abortTransactionSigning'];\n};\n\n/**\n * Update the transaction data of a single nested transaction within an atomic batch transaction.\n *\n * @param options - The options bag.\n * @param options.transactionId - ID of the atomic batch transaction.\n * @param options.transactionIndex - Index of the nested transaction within the atomic batch transaction.\n * @param options.transactionData - New data to set for the nested transaction.\n * @returns The updated data for the atomic batch transaction.\n */\nexport type TransactionControllerUpdateAtomicBatchDataAction = {\n type: `TransactionController:updateAtomicBatchData`;\n handler: TransactionController['updateAtomicBatchData'];\n};\n\n/**\n * Emulate a new transaction.\n *\n * @param transactionId - The transaction ID.\n */\nexport type TransactionControllerEmulateNewTransactionAction = {\n type: `TransactionController:emulateNewTransaction`;\n handler: TransactionController['emulateNewTransaction'];\n};\n\n/**\n * Emulate a transaction update.\n *\n * @param transactionMeta - Transaction metadata.\n */\nexport type TransactionControllerEmulateTransactionUpdateAction = {\n type: `TransactionController:emulateTransactionUpdate`;\n handler: TransactionController['emulateTransactionUpdate'];\n};\n\n/**\n * Retrieve available gas fee tokens for a transaction.\n *\n * @param request - The request object containing transaction details.\n * @returns The list of available gas fee tokens.\n */\nexport type TransactionControllerGetGasFeeTokensAction = {\n type: `TransactionController:getGasFeeTokens`;\n handler: TransactionController['getGasFeeTokens'];\n};\n\n/**\n * Union of all TransactionController action types.\n */\nexport type TransactionControllerMethodActions =\n | TransactionControllerHandleMethodDataAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerIsAtomicBatchSupportedAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerStartIncomingTransactionPollingAction\n | TransactionControllerStopIncomingTransactionPollingAction\n | TransactionControllerUpdateIncomingTransactionsAction\n | TransactionControllerStopTransactionAction\n | TransactionControllerSpeedUpTransactionAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerEstimateGasBufferedAction\n | TransactionControllerUpdateTransactionAction\n | TransactionControllerConfirmExternalTransactionAction\n | TransactionControllerGetNonceLockAction\n | TransactionControllerUpdateEditableParamsAction\n | TransactionControllerSetTransactionActiveAction\n | TransactionControllerApproveTransactionsWithSameNonceAction\n | TransactionControllerUpdateCustodialTransactionAction\n | TransactionControllerGetTransactionsAction\n | TransactionControllerEstimateGasFeeAction\n | TransactionControllerGetLayer1GasFeeAction\n | TransactionControllerClearUnapprovedTransactionsAction\n | TransactionControllerAbortTransactionSigningAction\n | TransactionControllerUpdateAtomicBatchDataAction\n | TransactionControllerEmulateNewTransactionAction\n | TransactionControllerEmulateTransactionUpdateAction\n | TransactionControllerGetGasFeeTokensAction;\n"]}
|
|
@@ -78,7 +78,7 @@ export type TransactionControllerUpdateIncomingTransactionsAction = {
|
|
|
78
78
|
* @param transactionId - The ID of the transaction to cancel.
|
|
79
79
|
* @param gasValues - The gas values to use for the cancellation transaction.
|
|
80
80
|
* @param options - The options for the cancellation transaction.
|
|
81
|
-
* @param options.actionId - Unique ID
|
|
81
|
+
* @param options.actionId - Unique ID persisted on transaction metadata.
|
|
82
82
|
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
83
83
|
*/
|
|
84
84
|
export type TransactionControllerStopTransactionAction = {
|
|
@@ -91,7 +91,7 @@ export type TransactionControllerStopTransactionAction = {
|
|
|
91
91
|
* @param transactionId - The ID of the transaction to speed up.
|
|
92
92
|
* @param gasValues - The gas values to use for the speed up transaction.
|
|
93
93
|
* @param options - The options for the speed up transaction.
|
|
94
|
-
* @param options.actionId - Unique ID
|
|
94
|
+
* @param options.actionId - Unique ID persisted on transaction metadata.
|
|
95
95
|
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
96
96
|
*/
|
|
97
97
|
export type TransactionControllerSpeedUpTransactionAction = {
|
|
@@ -78,7 +78,7 @@ export type TransactionControllerUpdateIncomingTransactionsAction = {
|
|
|
78
78
|
* @param transactionId - The ID of the transaction to cancel.
|
|
79
79
|
* @param gasValues - The gas values to use for the cancellation transaction.
|
|
80
80
|
* @param options - The options for the cancellation transaction.
|
|
81
|
-
* @param options.actionId - Unique ID
|
|
81
|
+
* @param options.actionId - Unique ID persisted on transaction metadata.
|
|
82
82
|
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
83
83
|
*/
|
|
84
84
|
export type TransactionControllerStopTransactionAction = {
|
|
@@ -91,7 +91,7 @@ export type TransactionControllerStopTransactionAction = {
|
|
|
91
91
|
* @param transactionId - The ID of the transaction to speed up.
|
|
92
92
|
* @param gasValues - The gas values to use for the speed up transaction.
|
|
93
93
|
* @param options - The options for the speed up transaction.
|
|
94
|
-
* @param options.actionId - Unique ID
|
|
94
|
+
* @param options.actionId - Unique ID persisted on transaction metadata.
|
|
95
95
|
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
96
96
|
*/
|
|
97
97
|
export type TransactionControllerSpeedUpTransactionAction = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionController-method-action-types.mjs","sourceRoot":"","sources":["../src/TransactionController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { TransactionController } from './TransactionController';\n\n/**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @param networkClientId - The ID of the network client used to fetch the method data.\n * @returns The method data object corresponding to the given signature prefix.\n */\nexport type TransactionControllerHandleMethodDataAction = {\n type: `TransactionController:handleMethodData`;\n handler: TransactionController['handleMethodData'];\n};\n\n/**\n * Add a batch of transactions to be submitted after approval.\n *\n * @param request - Request object containing the transactions to add.\n * @returns Result object containing the generated batch ID.\n */\nexport type TransactionControllerAddTransactionBatchAction = {\n type: `TransactionController:addTransactionBatch`;\n handler: TransactionController['addTransactionBatch'];\n};\n\n/**\n * Determine which chains support atomic batch transactions with the given account address.\n *\n * @param request - Request object containing the account address and other parameters.\n * @returns Result object containing the supported chains and related information.\n */\nexport type TransactionControllerIsAtomicBatchSupportedAction = {\n type: `TransactionController:isAtomicBatchSupported`;\n handler: TransactionController['isAtomicBatchSupported'];\n};\n\n/**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction ID will be generated, and `gas` and `gasPrice` will be calculated\n * if not provided. A `<tx.id>:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param options - Additional options to control how the transaction is added.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\nexport type TransactionControllerAddTransactionAction = {\n type: `TransactionController:addTransaction`;\n handler: TransactionController['addTransaction'];\n};\n\n/**\n * Starts polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStartIncomingTransactionPollingAction = {\n type: `TransactionController:startIncomingTransactionPolling`;\n handler: TransactionController['startIncomingTransactionPolling'];\n};\n\n/**\n * Stops polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStopIncomingTransactionPollingAction = {\n type: `TransactionController:stopIncomingTransactionPolling`;\n handler: TransactionController['stopIncomingTransactionPolling'];\n};\n\n/**\n * Update the incoming transactions by polling the remote transaction source.\n *\n * @param request - Request object.\n * @param request.tags - Additional tags to identify the source of the request.\n */\nexport type TransactionControllerUpdateIncomingTransactionsAction = {\n type: `TransactionController:updateIncomingTransactions`;\n handler: TransactionController['updateIncomingTransactions'];\n};\n\n/**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `<tx.id>:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerStopTransactionAction = {\n type: `TransactionController:stopTransaction`;\n handler: TransactionController['stopTransaction'];\n};\n\n/**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID to prevent duplicate requests\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerSpeedUpTransactionAction = {\n type: `TransactionController:speedUpTransaction`;\n handler: TransactionController['speedUpTransaction'];\n};\n\n/**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @param networkClientId - The network client id to use for the estimate.\n * @param options - Additional options for the estimate.\n * @param options.ignoreDelegationSignatures - Ignore signature errors if submitting delegations to the DelegationManager.\n * @returns The gas and gas price.\n */\nexport type TransactionControllerEstimateGasAction = {\n type: `TransactionController:estimateGas`;\n handler: TransactionController['estimateGas'];\n};\n\n/**\n * Estimates required gas for a batch of transactions.\n *\n * @param request - Request object.\n * @param request.chainId - Chain ID of the transactions.\n * @param request.from - Address of the sender.\n * @param request.transactions - Array of transactions within a batch request.\n * @returns Object containing the gas limit.\n */\nexport type TransactionControllerEstimateGasBatchAction = {\n type: `TransactionController:estimateGasBatch`;\n handler: TransactionController['estimateGasBatch'];\n};\n\n/**\n * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.\n *\n * @param transaction - The transaction params to estimate gas for.\n * @param multiplier - The multiplier to use for the gas buffer.\n * @param networkClientId - The network client id to use for the estimate.\n * @returns The buffered estimated gas and whether the estimation failed.\n */\nexport type TransactionControllerEstimateGasBufferedAction = {\n type: `TransactionController:estimateGasBuffered`;\n handler: TransactionController['estimateGasBuffered'];\n};\n\n/**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to be logged.\n */\nexport type TransactionControllerUpdateTransactionAction = {\n type: `TransactionController:updateTransaction`;\n handler: TransactionController['updateTransaction'];\n};\n\n/**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\nexport type TransactionControllerConfirmExternalTransactionAction = {\n type: `TransactionController:confirmExternalTransaction`;\n handler: TransactionController['confirmExternalTransaction'];\n};\n\n/**\n * Acquires a nonce lock for the given address on the specified network,\n * ensuring that nonces are assigned sequentially without conflicts.\n *\n * @param address - The account address for which to acquire the nonce lock.\n * @param networkClientId - The ID of the network client to use.\n * @returns A promise that resolves to a nonce lock containing the next nonce and a release function.\n */\nexport type TransactionControllerGetNonceLockAction = {\n type: `TransactionController:getNonceLock`;\n handler: TransactionController['getNonceLock'];\n};\n\n/**\n * Updates the editable parameters of a transaction.\n *\n * @param txId - The ID of the transaction to update.\n * @param params - The editable parameters to update.\n * @param params.containerTypes - Container types applied to the parameters.\n * @param params.data - Data to pass with the transaction.\n * @param params.from - Address to send the transaction from.\n * @param params.gas - Maximum number of units of gas to use for the transaction.\n * @param params.gasPrice - Price per gas for legacy transactions.\n * @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param params.updateType - Whether to update the transaction type. Defaults to `true`.\n * @param params.to - Address to send the transaction to.\n * @param params.value - Value associated with the transaction.\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateEditableParamsAction = {\n type: `TransactionController:updateEditableParams`;\n handler: TransactionController['updateEditableParams'];\n};\n\n/**\n * Update the isActive state of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param isActive - The active state.\n */\nexport type TransactionControllerSetTransactionActiveAction = {\n type: `TransactionController:setTransactionActive`;\n handler: TransactionController['setTransactionActive'];\n};\n\n/**\n * Signs and returns the raw transaction data for provided transaction params list.\n *\n * @param listOfTxParams - The list of transaction params to approve.\n * @param opts - Options bag.\n * @param opts.hasNonce - Whether the transactions already have a nonce.\n * @returns The raw transactions.\n */\nexport type TransactionControllerApproveTransactionsWithSameNonceAction = {\n type: `TransactionController:approveTransactionsWithSameNonce`;\n handler: TransactionController['approveTransactionsWithSameNonce'];\n};\n\n/**\n * Update a custodial transaction.\n *\n * @param request - The custodial transaction update request.\n *\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateCustodialTransactionAction = {\n type: `TransactionController:updateCustodialTransaction`;\n handler: TransactionController['updateCustodialTransaction'];\n};\n\n/**\n * Search transaction metadata for matching entries.\n *\n * @param opts - Options bag.\n * @param opts.initialList - The transactions to search. Defaults to the current state.\n * @param opts.limit - The maximum number of transactions to return. No limit by default.\n * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.\n * @returns An array of transactions matching the provided options.\n */\nexport type TransactionControllerGetTransactionsAction = {\n type: `TransactionController:getTransactions`;\n handler: TransactionController['getTransactions'];\n};\n\n/**\n * Estimates the gas fees for a transaction.\n *\n * @param args - The arguments for estimating gas fees.\n * @param args.transactionParams - The transaction parameters to estimate fees for.\n * @param args.chainId - The chain ID to use. If not provided, the network client ID is used to determine the chain.\n * @param args.networkClientId - The network client ID to use for the estimation.\n * @returns A promise that resolves to the estimated gas fee response.\n */\nexport type TransactionControllerEstimateGasFeeAction = {\n type: `TransactionController:estimateGasFee`;\n handler: TransactionController['estimateGasFee'];\n};\n\n/**\n * Determine the layer 1 gas fee for the given transaction parameters.\n *\n * @param request - The request object.\n * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.\n * @param request.chainId - The ID of the chain where the transaction will be executed.\n * @param request.networkClientId - The ID of a specific network client to process the transaction.\n * @returns The layer 1 gas fee.\n */\nexport type TransactionControllerGetLayer1GasFeeAction = {\n type: `TransactionController:getLayer1GasFee`;\n handler: TransactionController['getLayer1GasFee'];\n};\n\n/**\n * Removes unapproved transactions from state.\n */\nexport type TransactionControllerClearUnapprovedTransactionsAction = {\n type: `TransactionController:clearUnapprovedTransactions`;\n handler: TransactionController['clearUnapprovedTransactions'];\n};\n\n/**\n * Stop the signing process for a specific transaction.\n * Throws an error causing the transaction status to be set to failed.\n *\n * @param transactionId - The ID of the transaction to stop signing.\n */\nexport type TransactionControllerAbortTransactionSigningAction = {\n type: `TransactionController:abortTransactionSigning`;\n handler: TransactionController['abortTransactionSigning'];\n};\n\n/**\n * Update the transaction data of a single nested transaction within an atomic batch transaction.\n *\n * @param options - The options bag.\n * @param options.transactionId - ID of the atomic batch transaction.\n * @param options.transactionIndex - Index of the nested transaction within the atomic batch transaction.\n * @param options.transactionData - New data to set for the nested transaction.\n * @returns The updated data for the atomic batch transaction.\n */\nexport type TransactionControllerUpdateAtomicBatchDataAction = {\n type: `TransactionController:updateAtomicBatchData`;\n handler: TransactionController['updateAtomicBatchData'];\n};\n\n/**\n * Emulate a new transaction.\n *\n * @param transactionId - The transaction ID.\n */\nexport type TransactionControllerEmulateNewTransactionAction = {\n type: `TransactionController:emulateNewTransaction`;\n handler: TransactionController['emulateNewTransaction'];\n};\n\n/**\n * Emulate a transaction update.\n *\n * @param transactionMeta - Transaction metadata.\n */\nexport type TransactionControllerEmulateTransactionUpdateAction = {\n type: `TransactionController:emulateTransactionUpdate`;\n handler: TransactionController['emulateTransactionUpdate'];\n};\n\n/**\n * Retrieve available gas fee tokens for a transaction.\n *\n * @param request - The request object containing transaction details.\n * @returns The list of available gas fee tokens.\n */\nexport type TransactionControllerGetGasFeeTokensAction = {\n type: `TransactionController:getGasFeeTokens`;\n handler: TransactionController['getGasFeeTokens'];\n};\n\n/**\n * Union of all TransactionController action types.\n */\nexport type TransactionControllerMethodActions =\n | TransactionControllerHandleMethodDataAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerIsAtomicBatchSupportedAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerStartIncomingTransactionPollingAction\n | TransactionControllerStopIncomingTransactionPollingAction\n | TransactionControllerUpdateIncomingTransactionsAction\n | TransactionControllerStopTransactionAction\n | TransactionControllerSpeedUpTransactionAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerEstimateGasBufferedAction\n | TransactionControllerUpdateTransactionAction\n | TransactionControllerConfirmExternalTransactionAction\n | TransactionControllerGetNonceLockAction\n | TransactionControllerUpdateEditableParamsAction\n | TransactionControllerSetTransactionActiveAction\n | TransactionControllerApproveTransactionsWithSameNonceAction\n | TransactionControllerUpdateCustodialTransactionAction\n | TransactionControllerGetTransactionsAction\n | TransactionControllerEstimateGasFeeAction\n | TransactionControllerGetLayer1GasFeeAction\n | TransactionControllerClearUnapprovedTransactionsAction\n | TransactionControllerAbortTransactionSigningAction\n | TransactionControllerUpdateAtomicBatchDataAction\n | TransactionControllerEmulateNewTransactionAction\n | TransactionControllerEmulateTransactionUpdateAction\n | TransactionControllerGetGasFeeTokensAction;\n"]}
|
|
1
|
+
{"version":3,"file":"TransactionController-method-action-types.mjs","sourceRoot":"","sources":["../src/TransactionController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { TransactionController } from './TransactionController';\n\n/**\n * Handle new method data request.\n *\n * @param fourBytePrefix - The method prefix.\n * @param networkClientId - The ID of the network client used to fetch the method data.\n * @returns The method data object corresponding to the given signature prefix.\n */\nexport type TransactionControllerHandleMethodDataAction = {\n type: `TransactionController:handleMethodData`;\n handler: TransactionController['handleMethodData'];\n};\n\n/**\n * Add a batch of transactions to be submitted after approval.\n *\n * @param request - Request object containing the transactions to add.\n * @returns Result object containing the generated batch ID.\n */\nexport type TransactionControllerAddTransactionBatchAction = {\n type: `TransactionController:addTransactionBatch`;\n handler: TransactionController['addTransactionBatch'];\n};\n\n/**\n * Determine which chains support atomic batch transactions with the given account address.\n *\n * @param request - Request object containing the account address and other parameters.\n * @returns Result object containing the supported chains and related information.\n */\nexport type TransactionControllerIsAtomicBatchSupportedAction = {\n type: `TransactionController:isAtomicBatchSupported`;\n handler: TransactionController['isAtomicBatchSupported'];\n};\n\n/**\n * Add a new unapproved transaction to state. Parameters will be validated, a\n * unique transaction ID will be generated, and `gas` and `gasPrice` will be calculated\n * if not provided. A `<tx.id>:unapproved` hub event will be emitted once added.\n *\n * @param txParams - Standard parameters for an Ethereum transaction.\n * @param options - Additional options to control how the transaction is added.\n * @returns Object containing a promise resolving to the transaction hash if approved.\n */\nexport type TransactionControllerAddTransactionAction = {\n type: `TransactionController:addTransaction`;\n handler: TransactionController['addTransaction'];\n};\n\n/**\n * Starts polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStartIncomingTransactionPollingAction = {\n type: `TransactionController:startIncomingTransactionPolling`;\n handler: TransactionController['startIncomingTransactionPolling'];\n};\n\n/**\n * Stops polling for incoming transactions from the remote transaction source.\n */\nexport type TransactionControllerStopIncomingTransactionPollingAction = {\n type: `TransactionController:stopIncomingTransactionPolling`;\n handler: TransactionController['stopIncomingTransactionPolling'];\n};\n\n/**\n * Update the incoming transactions by polling the remote transaction source.\n *\n * @param request - Request object.\n * @param request.tags - Additional tags to identify the source of the request.\n */\nexport type TransactionControllerUpdateIncomingTransactionsAction = {\n type: `TransactionController:updateIncomingTransactions`;\n handler: TransactionController['updateIncomingTransactions'];\n};\n\n/**\n * Attempts to cancel a transaction based on its ID by setting its status to \"rejected\"\n * and emitting a `<tx.id>:finished` hub event.\n *\n * @param transactionId - The ID of the transaction to cancel.\n * @param gasValues - The gas values to use for the cancellation transaction.\n * @param options - The options for the cancellation transaction.\n * @param options.actionId - Unique ID persisted on transaction metadata.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerStopTransactionAction = {\n type: `TransactionController:stopTransaction`;\n handler: TransactionController['stopTransaction'];\n};\n\n/**\n * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.\n *\n * @param transactionId - The ID of the transaction to speed up.\n * @param gasValues - The gas values to use for the speed up transaction.\n * @param options - The options for the speed up transaction.\n * @param options.actionId - Unique ID persisted on transaction metadata.\n * @param options.estimatedBaseFee - The estimated base fee of the transaction.\n */\nexport type TransactionControllerSpeedUpTransactionAction = {\n type: `TransactionController:speedUpTransaction`;\n handler: TransactionController['speedUpTransaction'];\n};\n\n/**\n * Estimates required gas for a given transaction.\n *\n * @param transaction - The transaction to estimate gas for.\n * @param networkClientId - The network client id to use for the estimate.\n * @param options - Additional options for the estimate.\n * @param options.ignoreDelegationSignatures - Ignore signature errors if submitting delegations to the DelegationManager.\n * @returns The gas and gas price.\n */\nexport type TransactionControllerEstimateGasAction = {\n type: `TransactionController:estimateGas`;\n handler: TransactionController['estimateGas'];\n};\n\n/**\n * Estimates required gas for a batch of transactions.\n *\n * @param request - Request object.\n * @param request.chainId - Chain ID of the transactions.\n * @param request.from - Address of the sender.\n * @param request.transactions - Array of transactions within a batch request.\n * @returns Object containing the gas limit.\n */\nexport type TransactionControllerEstimateGasBatchAction = {\n type: `TransactionController:estimateGasBatch`;\n handler: TransactionController['estimateGasBatch'];\n};\n\n/**\n * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.\n *\n * @param transaction - The transaction params to estimate gas for.\n * @param multiplier - The multiplier to use for the gas buffer.\n * @param networkClientId - The network client id to use for the estimate.\n * @returns The buffered estimated gas and whether the estimation failed.\n */\nexport type TransactionControllerEstimateGasBufferedAction = {\n type: `TransactionController:estimateGasBuffered`;\n handler: TransactionController['estimateGasBuffered'];\n};\n\n/**\n * Updates an existing transaction in state.\n *\n * @param transactionMeta - The new transaction to store in state.\n * @param note - A note or update reason to be logged.\n */\nexport type TransactionControllerUpdateTransactionAction = {\n type: `TransactionController:updateTransaction`;\n handler: TransactionController['updateTransaction'];\n};\n\n/**\n * Adds external provided transaction to state as confirmed transaction.\n *\n * @param transactionMeta - TransactionMeta to add transactions.\n * @param transactionReceipt - TransactionReceipt of the external transaction.\n * @param baseFeePerGas - Base fee per gas of the external transaction.\n */\nexport type TransactionControllerConfirmExternalTransactionAction = {\n type: `TransactionController:confirmExternalTransaction`;\n handler: TransactionController['confirmExternalTransaction'];\n};\n\n/**\n * Acquires a nonce lock for the given address on the specified network,\n * ensuring that nonces are assigned sequentially without conflicts.\n *\n * @param address - The account address for which to acquire the nonce lock.\n * @param networkClientId - The ID of the network client to use.\n * @returns A promise that resolves to a nonce lock containing the next nonce and a release function.\n */\nexport type TransactionControllerGetNonceLockAction = {\n type: `TransactionController:getNonceLock`;\n handler: TransactionController['getNonceLock'];\n};\n\n/**\n * Updates the editable parameters of a transaction.\n *\n * @param txId - The ID of the transaction to update.\n * @param params - The editable parameters to update.\n * @param params.containerTypes - Container types applied to the parameters.\n * @param params.data - Data to pass with the transaction.\n * @param params.from - Address to send the transaction from.\n * @param params.gas - Maximum number of units of gas to use for the transaction.\n * @param params.gasPrice - Price per gas for legacy transactions.\n * @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.\n * @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.\n * @param params.updateType - Whether to update the transaction type. Defaults to `true`.\n * @param params.to - Address to send the transaction to.\n * @param params.value - Value associated with the transaction.\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateEditableParamsAction = {\n type: `TransactionController:updateEditableParams`;\n handler: TransactionController['updateEditableParams'];\n};\n\n/**\n * Update the isActive state of a transaction.\n *\n * @param transactionId - The ID of the transaction to update.\n * @param isActive - The active state.\n */\nexport type TransactionControllerSetTransactionActiveAction = {\n type: `TransactionController:setTransactionActive`;\n handler: TransactionController['setTransactionActive'];\n};\n\n/**\n * Signs and returns the raw transaction data for provided transaction params list.\n *\n * @param listOfTxParams - The list of transaction params to approve.\n * @param opts - Options bag.\n * @param opts.hasNonce - Whether the transactions already have a nonce.\n * @returns The raw transactions.\n */\nexport type TransactionControllerApproveTransactionsWithSameNonceAction = {\n type: `TransactionController:approveTransactionsWithSameNonce`;\n handler: TransactionController['approveTransactionsWithSameNonce'];\n};\n\n/**\n * Update a custodial transaction.\n *\n * @param request - The custodial transaction update request.\n *\n * @returns The updated transaction metadata.\n */\nexport type TransactionControllerUpdateCustodialTransactionAction = {\n type: `TransactionController:updateCustodialTransaction`;\n handler: TransactionController['updateCustodialTransaction'];\n};\n\n/**\n * Search transaction metadata for matching entries.\n *\n * @param opts - Options bag.\n * @param opts.initialList - The transactions to search. Defaults to the current state.\n * @param opts.limit - The maximum number of transactions to return. No limit by default.\n * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.\n * @returns An array of transactions matching the provided options.\n */\nexport type TransactionControllerGetTransactionsAction = {\n type: `TransactionController:getTransactions`;\n handler: TransactionController['getTransactions'];\n};\n\n/**\n * Estimates the gas fees for a transaction.\n *\n * @param args - The arguments for estimating gas fees.\n * @param args.transactionParams - The transaction parameters to estimate fees for.\n * @param args.chainId - The chain ID to use. If not provided, the network client ID is used to determine the chain.\n * @param args.networkClientId - The network client ID to use for the estimation.\n * @returns A promise that resolves to the estimated gas fee response.\n */\nexport type TransactionControllerEstimateGasFeeAction = {\n type: `TransactionController:estimateGasFee`;\n handler: TransactionController['estimateGasFee'];\n};\n\n/**\n * Determine the layer 1 gas fee for the given transaction parameters.\n *\n * @param request - The request object.\n * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.\n * @param request.chainId - The ID of the chain where the transaction will be executed.\n * @param request.networkClientId - The ID of a specific network client to process the transaction.\n * @returns The layer 1 gas fee.\n */\nexport type TransactionControllerGetLayer1GasFeeAction = {\n type: `TransactionController:getLayer1GasFee`;\n handler: TransactionController['getLayer1GasFee'];\n};\n\n/**\n * Removes unapproved transactions from state.\n */\nexport type TransactionControllerClearUnapprovedTransactionsAction = {\n type: `TransactionController:clearUnapprovedTransactions`;\n handler: TransactionController['clearUnapprovedTransactions'];\n};\n\n/**\n * Stop the signing process for a specific transaction.\n * Throws an error causing the transaction status to be set to failed.\n *\n * @param transactionId - The ID of the transaction to stop signing.\n */\nexport type TransactionControllerAbortTransactionSigningAction = {\n type: `TransactionController:abortTransactionSigning`;\n handler: TransactionController['abortTransactionSigning'];\n};\n\n/**\n * Update the transaction data of a single nested transaction within an atomic batch transaction.\n *\n * @param options - The options bag.\n * @param options.transactionId - ID of the atomic batch transaction.\n * @param options.transactionIndex - Index of the nested transaction within the atomic batch transaction.\n * @param options.transactionData - New data to set for the nested transaction.\n * @returns The updated data for the atomic batch transaction.\n */\nexport type TransactionControllerUpdateAtomicBatchDataAction = {\n type: `TransactionController:updateAtomicBatchData`;\n handler: TransactionController['updateAtomicBatchData'];\n};\n\n/**\n * Emulate a new transaction.\n *\n * @param transactionId - The transaction ID.\n */\nexport type TransactionControllerEmulateNewTransactionAction = {\n type: `TransactionController:emulateNewTransaction`;\n handler: TransactionController['emulateNewTransaction'];\n};\n\n/**\n * Emulate a transaction update.\n *\n * @param transactionMeta - Transaction metadata.\n */\nexport type TransactionControllerEmulateTransactionUpdateAction = {\n type: `TransactionController:emulateTransactionUpdate`;\n handler: TransactionController['emulateTransactionUpdate'];\n};\n\n/**\n * Retrieve available gas fee tokens for a transaction.\n *\n * @param request - The request object containing transaction details.\n * @returns The list of available gas fee tokens.\n */\nexport type TransactionControllerGetGasFeeTokensAction = {\n type: `TransactionController:getGasFeeTokens`;\n handler: TransactionController['getGasFeeTokens'];\n};\n\n/**\n * Union of all TransactionController action types.\n */\nexport type TransactionControllerMethodActions =\n | TransactionControllerHandleMethodDataAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerIsAtomicBatchSupportedAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerStartIncomingTransactionPollingAction\n | TransactionControllerStopIncomingTransactionPollingAction\n | TransactionControllerUpdateIncomingTransactionsAction\n | TransactionControllerStopTransactionAction\n | TransactionControllerSpeedUpTransactionAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerEstimateGasBufferedAction\n | TransactionControllerUpdateTransactionAction\n | TransactionControllerConfirmExternalTransactionAction\n | TransactionControllerGetNonceLockAction\n | TransactionControllerUpdateEditableParamsAction\n | TransactionControllerSetTransactionActiveAction\n | TransactionControllerApproveTransactionsWithSameNonceAction\n | TransactionControllerUpdateCustodialTransactionAction\n | TransactionControllerGetTransactionsAction\n | TransactionControllerEstimateGasFeeAction\n | TransactionControllerGetLayer1GasFeeAction\n | TransactionControllerClearUnapprovedTransactionsAction\n | TransactionControllerAbortTransactionSigningAction\n | TransactionControllerUpdateAtomicBatchDataAction\n | TransactionControllerEmulateNewTransactionAction\n | TransactionControllerEmulateTransactionUpdateAction\n | TransactionControllerGetGasFeeTokensAction;\n"]}
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
|
-
var _TransactionController_instances, _TransactionController_afterAdd, _TransactionController_afterSign, _TransactionController_afterSimulate, _TransactionController_approvingTransactionIds, _TransactionController_beforeCheckPendingTransaction, _TransactionController_beforePublish, _TransactionController_beforeSign, _TransactionController_gasFeeFlows, _TransactionController_getAdditionalSignArguments, _TransactionController_getCurrentAccountEIP1559Compatibility, _TransactionController_getCurrentNetworkEIP1559Compatibility, _TransactionController_getExternalPendingTransactions, _TransactionController_getGasFeeEstimates, _TransactionController_getNetworkState, _TransactionController_getPermittedAccounts, _TransactionController_getSavedGasFees, _TransactionController_getSimulationConfig, _TransactionController_incomingTransactionHelper, _TransactionController_incomingTransactionOptions, _TransactionController_internalEvents, _TransactionController_isAutomaticGasFeeUpdateEnabled, _TransactionController_isEIP7702GasFeeTokensEnabled, _TransactionController_isFirstTimeInteractionEnabled, _TransactionController_isSimulationEnabled, _TransactionController_isSwapsDisabled, _TransactionController_isTimeoutEnabled, _TransactionController_layer1GasFeeFlows, _TransactionController_methodDataHelper, _TransactionController_multichainTrackingHelper, _TransactionController_pendingTransactionOptions, _TransactionController_publicKeyEIP7702, _TransactionController_publish, _TransactionController_publishBatchHook, _TransactionController_securityProviderRequest, _TransactionController_sign, _TransactionController_signAbortCallbacks, _TransactionController_skipSimulationTransactionIds, _TransactionController_testGasFeeFlows, _TransactionController_trace, _TransactionController_retryTransaction, _TransactionController_signExternalTransaction, _TransactionController_addMetadata, _TransactionController_updateGasProperties, _TransactionController_onBootCleanup, _TransactionController_failIncompleteTransactions, _TransactionController_processApproval, _TransactionController_approveTransaction, _TransactionController_publishTransaction, _TransactionController_rejectTransaction, _TransactionController_trimTransactionsForState, _TransactionController_isFinalState, _TransactionController_isLocalFinalState, _TransactionController_requestApproval, _TransactionController_getTransaction, _TransactionController_getTransactionOrThrow, _TransactionController_getApprovalId, _TransactionController_isTransactionCompleted, _TransactionController_getChainId, _TransactionController_getNetworkClientId, _TransactionController_getEthQuery, _TransactionController_getProvider, _TransactionController_onIncomingTransactions, _TransactionController_generateDappSuggestedGasFees, _TransactionController_addExternalTransaction, _TransactionController_markNonceDuplicatesDropped, _TransactionController_setTransactionStatusDropped,
|
|
16
|
+
var _TransactionController_instances, _TransactionController_afterAdd, _TransactionController_afterSign, _TransactionController_afterSimulate, _TransactionController_approvingTransactionIds, _TransactionController_beforeCheckPendingTransaction, _TransactionController_beforePublish, _TransactionController_beforeSign, _TransactionController_gasFeeFlows, _TransactionController_getAdditionalSignArguments, _TransactionController_getCurrentAccountEIP1559Compatibility, _TransactionController_getCurrentNetworkEIP1559Compatibility, _TransactionController_getExternalPendingTransactions, _TransactionController_getGasFeeEstimates, _TransactionController_getNetworkState, _TransactionController_getPermittedAccounts, _TransactionController_getSavedGasFees, _TransactionController_getSimulationConfig, _TransactionController_incomingTransactionHelper, _TransactionController_incomingTransactionOptions, _TransactionController_internalEvents, _TransactionController_isAutomaticGasFeeUpdateEnabled, _TransactionController_isEIP7702GasFeeTokensEnabled, _TransactionController_isFirstTimeInteractionEnabled, _TransactionController_isSimulationEnabled, _TransactionController_isSwapsDisabled, _TransactionController_isTimeoutEnabled, _TransactionController_layer1GasFeeFlows, _TransactionController_methodDataHelper, _TransactionController_multichainTrackingHelper, _TransactionController_pendingTransactionOptions, _TransactionController_publicKeyEIP7702, _TransactionController_publish, _TransactionController_publishBatchHook, _TransactionController_securityProviderRequest, _TransactionController_sign, _TransactionController_signAbortCallbacks, _TransactionController_skipSimulationTransactionIds, _TransactionController_testGasFeeFlows, _TransactionController_trace, _TransactionController_retryTransaction, _TransactionController_signExternalTransaction, _TransactionController_addMetadata, _TransactionController_updateGasProperties, _TransactionController_onBootCleanup, _TransactionController_failIncompleteTransactions, _TransactionController_processApproval, _TransactionController_approveTransaction, _TransactionController_publishTransaction, _TransactionController_rejectTransaction, _TransactionController_trimTransactionsForState, _TransactionController_isFinalState, _TransactionController_isLocalFinalState, _TransactionController_requestApproval, _TransactionController_getTransaction, _TransactionController_getTransactionOrThrow, _TransactionController_getApprovalId, _TransactionController_isTransactionCompleted, _TransactionController_getChainId, _TransactionController_getNetworkClientId, _TransactionController_getEthQuery, _TransactionController_getProvider, _TransactionController_onIncomingTransactions, _TransactionController_generateDappSuggestedGasFees, _TransactionController_addExternalTransaction, _TransactionController_markNonceDuplicatesDropped, _TransactionController_setTransactionStatusDropped, _TransactionController_waitForTransactionFinished, _TransactionController_updateTransactionMetaRSV, _TransactionController_getEIP1559Compatibility, _TransactionController_signTransaction, _TransactionController_onTransactionStatusChange, _TransactionController_getNonceTrackerTransactions, _TransactionController_onConfirmedTransaction, _TransactionController_updatePostBalance, _TransactionController_createNonceTracker, _TransactionController_createPendingTransactionTracker, _TransactionController_checkForPendingTransactionAndStartPolling, _TransactionController_stopAllTracking, _TransactionController_addIncomingTransactionHelperListeners, _TransactionController_removePendingTransactionTrackerListeners, _TransactionController_addPendingTransactionTrackerListeners, _TransactionController_getNonceTrackerPendingTransactions, _TransactionController_publishTransactionForRetry, _TransactionController_isTransactionAlreadyConfirmedError, _TransactionController_getGasFeeFlows, _TransactionController_getLayer1GasFeeFlows, _TransactionController_updateTransactionInternal, _TransactionController_updateSimulationData, _TransactionController_onGasFeePollerTransactionUpdate, _TransactionController_onGasFeePollerTransactionBatchUpdate, _TransactionController_updateTransactionBatch, _TransactionController_getSelectedAccount, _TransactionController_getInternalAccounts, _TransactionController_updateSubmitHistory, _TransactionController_updateGasEstimate, _TransactionController_registerActionHandlers, _TransactionController_deleteTransaction, _TransactionController_isRejectError, _TransactionController_rejectTransactionAndThrow, _TransactionController_failTransaction, _TransactionController_runAfterSimulateHook, _TransactionController_defaultPublishHook, _TransactionController_getGasFeeTokens;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TransactionController = exports.ApprovalState = exports.SPEED_UP_RATE = exports.CANCEL_RATE = void 0;
|
|
19
19
|
const base_controller_1 = require("@metamask/base-controller");
|
|
@@ -452,39 +452,34 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
452
452
|
}
|
|
453
453
|
const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin);
|
|
454
454
|
const transactionType = type ?? (await (0, transaction_type_1.determineTransactionType)(txParams, ethQuery)).type;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
txParams,
|
|
484
|
-
type: transactionType,
|
|
485
|
-
userEditedGasLimit: false,
|
|
486
|
-
verifiedOnBlockchain: false,
|
|
487
|
-
};
|
|
455
|
+
let addedTransactionMeta = {
|
|
456
|
+
actionId,
|
|
457
|
+
assetsFiatValues,
|
|
458
|
+
batchId,
|
|
459
|
+
chainId,
|
|
460
|
+
dappSuggestedGasFees,
|
|
461
|
+
deviceConfirmedOn,
|
|
462
|
+
disableGasBuffer,
|
|
463
|
+
id: (0, uuid_1.v1)(),
|
|
464
|
+
isGasFeeTokenIgnoredIfBalance: Boolean(gasFeeToken),
|
|
465
|
+
isGasFeeIncluded,
|
|
466
|
+
isGasFeeSponsored,
|
|
467
|
+
isFirstTimeInteraction: undefined,
|
|
468
|
+
isStateOnly,
|
|
469
|
+
nestedTransactions,
|
|
470
|
+
networkClientId,
|
|
471
|
+
origin,
|
|
472
|
+
requestId,
|
|
473
|
+
requiredAssets,
|
|
474
|
+
securityAlertResponse,
|
|
475
|
+
selectedGasFeeToken: gasFeeToken,
|
|
476
|
+
status: types_1.TransactionStatus.unapproved,
|
|
477
|
+
time: Date.now(),
|
|
478
|
+
txParams,
|
|
479
|
+
type: transactionType,
|
|
480
|
+
userEditedGasLimit: false,
|
|
481
|
+
verifiedOnBlockchain: false,
|
|
482
|
+
};
|
|
488
483
|
const { updateTransaction } = await __classPrivateFieldGet(this, _TransactionController_afterAdd, "f").call(this, {
|
|
489
484
|
transactionMeta: addedTransactionMeta,
|
|
490
485
|
});
|
|
@@ -519,61 +514,56 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
519
514
|
})
|
|
520
515
|
.catch(lodash_1.noop);
|
|
521
516
|
}
|
|
522
|
-
//
|
|
523
|
-
if (
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
517
|
+
// Set security provider response
|
|
518
|
+
if (method && __classPrivateFieldGet(this, _TransactionController_securityProviderRequest, "f")) {
|
|
519
|
+
const securityProviderResponse = await __classPrivateFieldGet(this, _TransactionController_securityProviderRequest, "f").call(this, addedTransactionMeta, method);
|
|
520
|
+
// eslint-disable-next-line require-atomic-updates
|
|
521
|
+
addedTransactionMeta.securityProviderResponse = securityProviderResponse;
|
|
522
|
+
}
|
|
523
|
+
addedTransactionMeta = (0, swaps_1.updateSwapsTransaction)(addedTransactionMeta, transactionType, swaps, {
|
|
524
|
+
isSwapsDisabled: __classPrivateFieldGet(this, _TransactionController_isSwapsDisabled, "f"),
|
|
525
|
+
cancelTransaction: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_rejectTransaction).bind(this),
|
|
526
|
+
messenger: this.messenger,
|
|
527
|
+
});
|
|
528
|
+
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_addMetadata).call(this, addedTransactionMeta);
|
|
529
|
+
delegationAddressPromise
|
|
530
|
+
.then((delegationAddress) => {
|
|
531
|
+
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, {
|
|
532
|
+
transactionId: addedTransactionMeta.id,
|
|
533
|
+
skipResimulateCheck: true,
|
|
534
|
+
skipValidation: true,
|
|
535
|
+
}, (tx) => {
|
|
536
|
+
tx.delegationAddress = delegationAddress;
|
|
537
|
+
});
|
|
538
|
+
return undefined;
|
|
539
|
+
})
|
|
540
|
+
.catch(lodash_1.noop);
|
|
541
|
+
if (requireApproval !== false && !isStateOnly) {
|
|
542
|
+
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateSimulationData).call(this, addedTransactionMeta, {
|
|
543
|
+
traceContext,
|
|
544
|
+
}).catch((error) => {
|
|
545
|
+
(0, logger_1.projectLogger)('Error while updating simulation data', error);
|
|
546
|
+
throw error;
|
|
547
|
+
});
|
|
548
|
+
(0, first_time_interaction_1.updateFirstTimeInteraction)({
|
|
549
|
+
existingTransactions: this.state.transactions,
|
|
550
|
+
getTransaction: (transactionId) => __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, transactionId),
|
|
551
|
+
isFirstTimeInteractionEnabled: __classPrivateFieldGet(this, _TransactionController_isFirstTimeInteractionEnabled, "f"),
|
|
552
|
+
trace: __classPrivateFieldGet(this, _TransactionController_trace, "f"),
|
|
553
|
+
traceContext,
|
|
554
|
+
transactionMeta: addedTransactionMeta,
|
|
555
|
+
updateTransaction: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).bind(this),
|
|
556
|
+
}).catch((error) => {
|
|
557
|
+
(0, logger_1.projectLogger)('Error while updating first interaction properties', error);
|
|
535
558
|
});
|
|
536
|
-
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_addMetadata).call(this, addedTransactionMeta);
|
|
537
|
-
delegationAddressPromise
|
|
538
|
-
.then((delegationAddress) => {
|
|
539
|
-
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, {
|
|
540
|
-
transactionId: addedTransactionMeta.id,
|
|
541
|
-
skipResimulateCheck: true,
|
|
542
|
-
skipValidation: true,
|
|
543
|
-
}, (tx) => {
|
|
544
|
-
tx.delegationAddress = delegationAddress;
|
|
545
|
-
});
|
|
546
|
-
return undefined;
|
|
547
|
-
})
|
|
548
|
-
.catch(lodash_1.noop);
|
|
549
|
-
if (requireApproval !== false && !isStateOnly) {
|
|
550
|
-
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateSimulationData).call(this, addedTransactionMeta, {
|
|
551
|
-
traceContext,
|
|
552
|
-
}).catch((error) => {
|
|
553
|
-
(0, logger_1.projectLogger)('Error while updating simulation data', error);
|
|
554
|
-
throw error;
|
|
555
|
-
});
|
|
556
|
-
(0, first_time_interaction_1.updateFirstTimeInteraction)({
|
|
557
|
-
existingTransactions: this.state.transactions,
|
|
558
|
-
getTransaction: (transactionId) => __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, transactionId),
|
|
559
|
-
isFirstTimeInteractionEnabled: __classPrivateFieldGet(this, _TransactionController_isFirstTimeInteractionEnabled, "f"),
|
|
560
|
-
trace: __classPrivateFieldGet(this, _TransactionController_trace, "f"),
|
|
561
|
-
traceContext,
|
|
562
|
-
transactionMeta: addedTransactionMeta,
|
|
563
|
-
updateTransaction: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).bind(this),
|
|
564
|
-
}).catch((error) => {
|
|
565
|
-
(0, logger_1.projectLogger)('Error while updating first interaction properties', error);
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
else {
|
|
569
|
-
(0, logger_1.projectLogger)('Skipping simulation & first interaction update as approval not required');
|
|
570
|
-
}
|
|
571
|
-
this.messenger.publish(`${controllerName}:unapprovedTransactionAdded`, addedTransactionMeta);
|
|
572
559
|
}
|
|
560
|
+
else {
|
|
561
|
+
(0, logger_1.projectLogger)('Skipping simulation & first interaction update as approval not required');
|
|
562
|
+
}
|
|
563
|
+
this.messenger.publish(`${controllerName}:unapprovedTransactionAdded`, addedTransactionMeta);
|
|
573
564
|
return {
|
|
574
565
|
result: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_processApproval).call(this, addedTransactionMeta, {
|
|
575
566
|
actionId,
|
|
576
|
-
isExisting: Boolean(existingTransactionMeta),
|
|
577
567
|
publishHook,
|
|
578
568
|
requireApproval,
|
|
579
569
|
traceContext,
|
|
@@ -609,7 +599,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
609
599
|
* @param transactionId - The ID of the transaction to cancel.
|
|
610
600
|
* @param gasValues - The gas values to use for the cancellation transaction.
|
|
611
601
|
* @param options - The options for the cancellation transaction.
|
|
612
|
-
* @param options.actionId - Unique ID
|
|
602
|
+
* @param options.actionId - Unique ID persisted on transaction metadata.
|
|
613
603
|
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
614
604
|
*/
|
|
615
605
|
async stopTransaction(transactionId, gasValues, { estimatedBaseFee, actionId, } = {}) {
|
|
@@ -638,7 +628,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
638
628
|
* @param transactionId - The ID of the transaction to speed up.
|
|
639
629
|
* @param gasValues - The gas values to use for the speed up transaction.
|
|
640
630
|
* @param options - The options for the speed up transaction.
|
|
641
|
-
* @param options.actionId - Unique ID
|
|
631
|
+
* @param options.actionId - Unique ID persisted on transaction metadata.
|
|
642
632
|
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
643
633
|
*/
|
|
644
634
|
async speedUpTransaction(transactionId, gasValues, { actionId, estimatedBaseFee, } = {}) {
|
|
@@ -1470,10 +1460,6 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1470
1460
|
}
|
|
1471
1461
|
exports.TransactionController = TransactionController;
|
|
1472
1462
|
_TransactionController_afterAdd = new WeakMap(), _TransactionController_afterSign = new WeakMap(), _TransactionController_afterSimulate = new WeakMap(), _TransactionController_approvingTransactionIds = new WeakMap(), _TransactionController_beforeCheckPendingTransaction = new WeakMap(), _TransactionController_beforePublish = new WeakMap(), _TransactionController_beforeSign = new WeakMap(), _TransactionController_gasFeeFlows = new WeakMap(), _TransactionController_getAdditionalSignArguments = new WeakMap(), _TransactionController_getCurrentAccountEIP1559Compatibility = new WeakMap(), _TransactionController_getCurrentNetworkEIP1559Compatibility = new WeakMap(), _TransactionController_getExternalPendingTransactions = new WeakMap(), _TransactionController_getGasFeeEstimates = new WeakMap(), _TransactionController_getNetworkState = new WeakMap(), _TransactionController_getPermittedAccounts = new WeakMap(), _TransactionController_getSavedGasFees = new WeakMap(), _TransactionController_getSimulationConfig = new WeakMap(), _TransactionController_incomingTransactionHelper = new WeakMap(), _TransactionController_incomingTransactionOptions = new WeakMap(), _TransactionController_internalEvents = new WeakMap(), _TransactionController_isAutomaticGasFeeUpdateEnabled = new WeakMap(), _TransactionController_isEIP7702GasFeeTokensEnabled = new WeakMap(), _TransactionController_isFirstTimeInteractionEnabled = new WeakMap(), _TransactionController_isSimulationEnabled = new WeakMap(), _TransactionController_isSwapsDisabled = new WeakMap(), _TransactionController_isTimeoutEnabled = new WeakMap(), _TransactionController_layer1GasFeeFlows = new WeakMap(), _TransactionController_methodDataHelper = new WeakMap(), _TransactionController_multichainTrackingHelper = new WeakMap(), _TransactionController_pendingTransactionOptions = new WeakMap(), _TransactionController_publicKeyEIP7702 = new WeakMap(), _TransactionController_publish = new WeakMap(), _TransactionController_publishBatchHook = new WeakMap(), _TransactionController_securityProviderRequest = new WeakMap(), _TransactionController_sign = new WeakMap(), _TransactionController_signAbortCallbacks = new WeakMap(), _TransactionController_skipSimulationTransactionIds = new WeakMap(), _TransactionController_testGasFeeFlows = new WeakMap(), _TransactionController_trace = new WeakMap(), _TransactionController_checkForPendingTransactionAndStartPolling = new WeakMap(), _TransactionController_instances = new WeakSet(), _TransactionController_retryTransaction = async function _TransactionController_retryTransaction({ actionId, afterSubmit, estimatedBaseFee, gasValues, label, prepareTransactionParams, rate, transactionId, transactionType, }) {
|
|
1473
|
-
// If transaction is found for same action id, do not create a new transaction.
|
|
1474
|
-
if (__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransactionWithActionId).call(this, actionId)) {
|
|
1475
|
-
return;
|
|
1476
|
-
}
|
|
1477
1463
|
if (gasValues) {
|
|
1478
1464
|
// Not good practice to reassign a parameter but temporarily avoiding a larger refactor.
|
|
1479
1465
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -1611,7 +1597,7 @@ _TransactionController_afterAdd = new WeakMap(), _TransactionController_afterSig
|
|
|
1611
1597
|
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_failTransaction).call(this, requiredTransactionMeta, new Error('Parent transaction incomplete at startup'));
|
|
1612
1598
|
}
|
|
1613
1599
|
}
|
|
1614
|
-
}, _TransactionController_processApproval = async function _TransactionController_processApproval(transactionMeta, { actionId,
|
|
1600
|
+
}, _TransactionController_processApproval = async function _TransactionController_processApproval(transactionMeta, { actionId, publishHook, requireApproval, shouldShowRequest = true, traceContext, }) {
|
|
1615
1601
|
const { id: transactionId, isStateOnly } = transactionMeta;
|
|
1616
1602
|
if (isStateOnly) {
|
|
1617
1603
|
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, skipValidation: true }, (tx) => {
|
|
@@ -1625,7 +1611,7 @@ _TransactionController_afterAdd = new WeakMap(), _TransactionController_afterSig
|
|
|
1625
1611
|
const finishedPromise = isCompleted
|
|
1626
1612
|
? Promise.resolve(meta)
|
|
1627
1613
|
: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_waitForTransactionFinished).call(this, transactionId);
|
|
1628
|
-
if (meta && !
|
|
1614
|
+
if (meta && !isCompleted) {
|
|
1629
1615
|
try {
|
|
1630
1616
|
if (requireApproval !== false) {
|
|
1631
1617
|
const acceptResult = await __classPrivateFieldGet(this, _TransactionController_trace, "f").call(this, { name: 'Await Approval', parentContext: traceContext }, (context) => __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_requestApproval).call(this, transactionMeta, {
|
|
@@ -2041,8 +2027,6 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
|
|
|
2041
2027
|
});
|
|
2042
2028
|
this.updateTransaction(updatedTransactionMeta, 'TransactionController#setTransactionStatusDropped - Transaction dropped');
|
|
2043
2029
|
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_onTransactionStatusChange).call(this, updatedTransactionMeta);
|
|
2044
|
-
}, _TransactionController_getTransactionWithActionId = function _TransactionController_getTransactionWithActionId(actionId) {
|
|
2045
|
-
return this.state.transactions.find((transaction) => actionId && transaction.actionId === actionId);
|
|
2046
2030
|
}, _TransactionController_waitForTransactionFinished = async function _TransactionController_waitForTransactionFinished(transactionId) {
|
|
2047
2031
|
return new Promise((resolve) => {
|
|
2048
2032
|
__classPrivateFieldGet(this, _TransactionController_internalEvents, "f").once(`${transactionId}:finished`, (txMeta) => {
|