@metamask/transaction-controller 62.21.0 → 63.0.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/dist/TransactionController-method-action-types.cjs +7 -0
  3. package/dist/TransactionController-method-action-types.cjs.map +1 -0
  4. package/dist/TransactionController-method-action-types.d.cts +327 -0
  5. package/dist/TransactionController-method-action-types.d.cts.map +1 -0
  6. package/dist/TransactionController-method-action-types.d.mts +327 -0
  7. package/dist/TransactionController-method-action-types.d.mts.map +1 -0
  8. package/dist/TransactionController-method-action-types.mjs +6 -0
  9. package/dist/TransactionController-method-action-types.mjs.map +1 -0
  10. package/dist/TransactionController.cjs +89 -31
  11. package/dist/TransactionController.cjs.map +1 -1
  12. package/dist/TransactionController.d.cts +34 -91
  13. package/dist/TransactionController.d.cts.map +1 -1
  14. package/dist/TransactionController.d.mts +34 -91
  15. package/dist/TransactionController.d.mts.map +1 -1
  16. package/dist/TransactionController.mjs +89 -31
  17. package/dist/TransactionController.mjs.map +1 -1
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +2 -1
  20. package/dist/index.d.cts.map +1 -1
  21. package/dist/index.d.mts +2 -1
  22. package/dist/index.d.mts.map +1 -1
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/types.cjs +4 -0
  25. package/dist/types.cjs.map +1 -1
  26. package/dist/types.d.cts +6 -0
  27. package/dist/types.d.cts.map +1 -1
  28. package/dist/types.d.mts +6 -0
  29. package/dist/types.d.mts.map +1 -1
  30. package/dist/types.mjs +4 -0
  31. package/dist/types.mjs.map +1 -1
  32. package/dist/utils/first-time-interaction.cjs +28 -20
  33. package/dist/utils/first-time-interaction.cjs.map +1 -1
  34. package/dist/utils/first-time-interaction.d.cts.map +1 -1
  35. package/dist/utils/first-time-interaction.d.mts.map +1 -1
  36. package/dist/utils/first-time-interaction.mjs +28 -20
  37. package/dist/utils/first-time-interaction.mjs.map +1 -1
  38. package/package.json +6 -4
@@ -0,0 +1,327 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ import type { TransactionController } from "./TransactionController.mjs";
6
+ /**
7
+ * Handle new method data request.
8
+ *
9
+ * @param fourBytePrefix - The method prefix.
10
+ * @param networkClientId - The ID of the network client used to fetch the method data.
11
+ * @returns The method data object corresponding to the given signature prefix.
12
+ */
13
+ export type TransactionControllerHandleMethodDataAction = {
14
+ type: `TransactionController:handleMethodData`;
15
+ handler: TransactionController['handleMethodData'];
16
+ };
17
+ /**
18
+ * Add a batch of transactions to be submitted after approval.
19
+ *
20
+ * @param request - Request object containing the transactions to add.
21
+ * @returns Result object containing the generated batch ID.
22
+ */
23
+ export type TransactionControllerAddTransactionBatchAction = {
24
+ type: `TransactionController:addTransactionBatch`;
25
+ handler: TransactionController['addTransactionBatch'];
26
+ };
27
+ /**
28
+ * Determine which chains support atomic batch transactions with the given account address.
29
+ *
30
+ * @param request - Request object containing the account address and other parameters.
31
+ * @returns Result object containing the supported chains and related information.
32
+ */
33
+ export type TransactionControllerIsAtomicBatchSupportedAction = {
34
+ type: `TransactionController:isAtomicBatchSupported`;
35
+ handler: TransactionController['isAtomicBatchSupported'];
36
+ };
37
+ /**
38
+ * Add a new unapproved transaction to state. Parameters will be validated, a
39
+ * unique transaction ID will be generated, and `gas` and `gasPrice` will be calculated
40
+ * if not provided. A `<tx.id>:unapproved` hub event will be emitted once added.
41
+ *
42
+ * @param txParams - Standard parameters for an Ethereum transaction.
43
+ * @param options - Additional options to control how the transaction is added.
44
+ * @returns Object containing a promise resolving to the transaction hash if approved.
45
+ */
46
+ export type TransactionControllerAddTransactionAction = {
47
+ type: `TransactionController:addTransaction`;
48
+ handler: TransactionController['addTransaction'];
49
+ };
50
+ /**
51
+ * Starts polling for incoming transactions from the remote transaction source.
52
+ */
53
+ export type TransactionControllerStartIncomingTransactionPollingAction = {
54
+ type: `TransactionController:startIncomingTransactionPolling`;
55
+ handler: TransactionController['startIncomingTransactionPolling'];
56
+ };
57
+ /**
58
+ * Stops polling for incoming transactions from the remote transaction source.
59
+ */
60
+ export type TransactionControllerStopIncomingTransactionPollingAction = {
61
+ type: `TransactionController:stopIncomingTransactionPolling`;
62
+ handler: TransactionController['stopIncomingTransactionPolling'];
63
+ };
64
+ /**
65
+ * Update the incoming transactions by polling the remote transaction source.
66
+ *
67
+ * @param request - Request object.
68
+ * @param request.tags - Additional tags to identify the source of the request.
69
+ */
70
+ export type TransactionControllerUpdateIncomingTransactionsAction = {
71
+ type: `TransactionController:updateIncomingTransactions`;
72
+ handler: TransactionController['updateIncomingTransactions'];
73
+ };
74
+ /**
75
+ * Attempts to cancel a transaction based on its ID by setting its status to "rejected"
76
+ * and emitting a `<tx.id>:finished` hub event.
77
+ *
78
+ * @param transactionId - The ID of the transaction to cancel.
79
+ * @param gasValues - The gas values to use for the cancellation transaction.
80
+ * @param options - The options for the cancellation transaction.
81
+ * @param options.actionId - Unique ID to prevent duplicate requests.
82
+ * @param options.estimatedBaseFee - The estimated base fee of the transaction.
83
+ */
84
+ export type TransactionControllerStopTransactionAction = {
85
+ type: `TransactionController:stopTransaction`;
86
+ handler: TransactionController['stopTransaction'];
87
+ };
88
+ /**
89
+ * Attempts to speed up a transaction increasing transaction gasPrice by ten percent.
90
+ *
91
+ * @param transactionId - The ID of the transaction to speed up.
92
+ * @param gasValues - The gas values to use for the speed up transaction.
93
+ * @param options - The options for the speed up transaction.
94
+ * @param options.actionId - Unique ID to prevent duplicate requests
95
+ * @param options.estimatedBaseFee - The estimated base fee of the transaction.
96
+ */
97
+ export type TransactionControllerSpeedUpTransactionAction = {
98
+ type: `TransactionController:speedUpTransaction`;
99
+ handler: TransactionController['speedUpTransaction'];
100
+ };
101
+ /**
102
+ * Estimates required gas for a given transaction.
103
+ *
104
+ * @param transaction - The transaction to estimate gas for.
105
+ * @param networkClientId - The network client id to use for the estimate.
106
+ * @param options - Additional options for the estimate.
107
+ * @param options.ignoreDelegationSignatures - Ignore signature errors if submitting delegations to the DelegationManager.
108
+ * @returns The gas and gas price.
109
+ */
110
+ export type TransactionControllerEstimateGasAction = {
111
+ type: `TransactionController:estimateGas`;
112
+ handler: TransactionController['estimateGas'];
113
+ };
114
+ /**
115
+ * Estimates required gas for a batch of transactions.
116
+ *
117
+ * @param request - Request object.
118
+ * @param request.chainId - Chain ID of the transactions.
119
+ * @param request.from - Address of the sender.
120
+ * @param request.transactions - Array of transactions within a batch request.
121
+ * @returns Object containing the gas limit.
122
+ */
123
+ export type TransactionControllerEstimateGasBatchAction = {
124
+ type: `TransactionController:estimateGasBatch`;
125
+ handler: TransactionController['estimateGasBatch'];
126
+ };
127
+ /**
128
+ * Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.
129
+ *
130
+ * @param transaction - The transaction params to estimate gas for.
131
+ * @param multiplier - The multiplier to use for the gas buffer.
132
+ * @param networkClientId - The network client id to use for the estimate.
133
+ * @returns The buffered estimated gas and whether the estimation failed.
134
+ */
135
+ export type TransactionControllerEstimateGasBufferedAction = {
136
+ type: `TransactionController:estimateGasBuffered`;
137
+ handler: TransactionController['estimateGasBuffered'];
138
+ };
139
+ /**
140
+ * Updates an existing transaction in state.
141
+ *
142
+ * @param transactionMeta - The new transaction to store in state.
143
+ * @param note - A note or update reason to be logged.
144
+ */
145
+ export type TransactionControllerUpdateTransactionAction = {
146
+ type: `TransactionController:updateTransaction`;
147
+ handler: TransactionController['updateTransaction'];
148
+ };
149
+ /**
150
+ * Adds external provided transaction to state as confirmed transaction.
151
+ *
152
+ * @param transactionMeta - TransactionMeta to add transactions.
153
+ * @param transactionReceipt - TransactionReceipt of the external transaction.
154
+ * @param baseFeePerGas - Base fee per gas of the external transaction.
155
+ */
156
+ export type TransactionControllerConfirmExternalTransactionAction = {
157
+ type: `TransactionController:confirmExternalTransaction`;
158
+ handler: TransactionController['confirmExternalTransaction'];
159
+ };
160
+ /**
161
+ * Acquires a nonce lock for the given address on the specified network,
162
+ * ensuring that nonces are assigned sequentially without conflicts.
163
+ *
164
+ * @param address - The account address for which to acquire the nonce lock.
165
+ * @param networkClientId - The ID of the network client to use.
166
+ * @returns A promise that resolves to a nonce lock containing the next nonce and a release function.
167
+ */
168
+ export type TransactionControllerGetNonceLockAction = {
169
+ type: `TransactionController:getNonceLock`;
170
+ handler: TransactionController['getNonceLock'];
171
+ };
172
+ /**
173
+ * Updates the editable parameters of a transaction.
174
+ *
175
+ * @param txId - The ID of the transaction to update.
176
+ * @param params - The editable parameters to update.
177
+ * @param params.containerTypes - Container types applied to the parameters.
178
+ * @param params.data - Data to pass with the transaction.
179
+ * @param params.from - Address to send the transaction from.
180
+ * @param params.gas - Maximum number of units of gas to use for the transaction.
181
+ * @param params.gasPrice - Price per gas for legacy transactions.
182
+ * @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
183
+ * @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
184
+ * @param params.updateType - Whether to update the transaction type. Defaults to `true`.
185
+ * @param params.to - Address to send the transaction to.
186
+ * @param params.value - Value associated with the transaction.
187
+ * @returns The updated transaction metadata.
188
+ */
189
+ export type TransactionControllerUpdateEditableParamsAction = {
190
+ type: `TransactionController:updateEditableParams`;
191
+ handler: TransactionController['updateEditableParams'];
192
+ };
193
+ /**
194
+ * Update the isActive state of a transaction.
195
+ *
196
+ * @param transactionId - The ID of the transaction to update.
197
+ * @param isActive - The active state.
198
+ */
199
+ export type TransactionControllerSetTransactionActiveAction = {
200
+ type: `TransactionController:setTransactionActive`;
201
+ handler: TransactionController['setTransactionActive'];
202
+ };
203
+ /**
204
+ * Signs and returns the raw transaction data for provided transaction params list.
205
+ *
206
+ * @param listOfTxParams - The list of transaction params to approve.
207
+ * @param opts - Options bag.
208
+ * @param opts.hasNonce - Whether the transactions already have a nonce.
209
+ * @returns The raw transactions.
210
+ */
211
+ export type TransactionControllerApproveTransactionsWithSameNonceAction = {
212
+ type: `TransactionController:approveTransactionsWithSameNonce`;
213
+ handler: TransactionController['approveTransactionsWithSameNonce'];
214
+ };
215
+ /**
216
+ * Update a custodial transaction.
217
+ *
218
+ * @param request - The custodial transaction update request.
219
+ *
220
+ * @returns The updated transaction metadata.
221
+ */
222
+ export type TransactionControllerUpdateCustodialTransactionAction = {
223
+ type: `TransactionController:updateCustodialTransaction`;
224
+ handler: TransactionController['updateCustodialTransaction'];
225
+ };
226
+ /**
227
+ * Search transaction metadata for matching entries.
228
+ *
229
+ * @param opts - Options bag.
230
+ * @param opts.initialList - The transactions to search. Defaults to the current state.
231
+ * @param opts.limit - The maximum number of transactions to return. No limit by default.
232
+ * @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.
233
+ * @returns An array of transactions matching the provided options.
234
+ */
235
+ export type TransactionControllerGetTransactionsAction = {
236
+ type: `TransactionController:getTransactions`;
237
+ handler: TransactionController['getTransactions'];
238
+ };
239
+ /**
240
+ * Estimates the gas fees for a transaction.
241
+ *
242
+ * @param args - The arguments for estimating gas fees.
243
+ * @param args.transactionParams - The transaction parameters to estimate fees for.
244
+ * @param args.chainId - The chain ID to use. If not provided, the network client ID is used to determine the chain.
245
+ * @param args.networkClientId - The network client ID to use for the estimation.
246
+ * @returns A promise that resolves to the estimated gas fee response.
247
+ */
248
+ export type TransactionControllerEstimateGasFeeAction = {
249
+ type: `TransactionController:estimateGasFee`;
250
+ handler: TransactionController['estimateGasFee'];
251
+ };
252
+ /**
253
+ * Determine the layer 1 gas fee for the given transaction parameters.
254
+ *
255
+ * @param request - The request object.
256
+ * @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.
257
+ * @param request.chainId - The ID of the chain where the transaction will be executed.
258
+ * @param request.networkClientId - The ID of a specific network client to process the transaction.
259
+ * @returns The layer 1 gas fee.
260
+ */
261
+ export type TransactionControllerGetLayer1GasFeeAction = {
262
+ type: `TransactionController:getLayer1GasFee`;
263
+ handler: TransactionController['getLayer1GasFee'];
264
+ };
265
+ /**
266
+ * Removes unapproved transactions from state.
267
+ */
268
+ export type TransactionControllerClearUnapprovedTransactionsAction = {
269
+ type: `TransactionController:clearUnapprovedTransactions`;
270
+ handler: TransactionController['clearUnapprovedTransactions'];
271
+ };
272
+ /**
273
+ * Stop the signing process for a specific transaction.
274
+ * Throws an error causing the transaction status to be set to failed.
275
+ *
276
+ * @param transactionId - The ID of the transaction to stop signing.
277
+ */
278
+ export type TransactionControllerAbortTransactionSigningAction = {
279
+ type: `TransactionController:abortTransactionSigning`;
280
+ handler: TransactionController['abortTransactionSigning'];
281
+ };
282
+ /**
283
+ * Update the transaction data of a single nested transaction within an atomic batch transaction.
284
+ *
285
+ * @param options - The options bag.
286
+ * @param options.transactionId - ID of the atomic batch transaction.
287
+ * @param options.transactionIndex - Index of the nested transaction within the atomic batch transaction.
288
+ * @param options.transactionData - New data to set for the nested transaction.
289
+ * @returns The updated data for the atomic batch transaction.
290
+ */
291
+ export type TransactionControllerUpdateAtomicBatchDataAction = {
292
+ type: `TransactionController:updateAtomicBatchData`;
293
+ handler: TransactionController['updateAtomicBatchData'];
294
+ };
295
+ /**
296
+ * Emulate a new transaction.
297
+ *
298
+ * @param transactionId - The transaction ID.
299
+ */
300
+ export type TransactionControllerEmulateNewTransactionAction = {
301
+ type: `TransactionController:emulateNewTransaction`;
302
+ handler: TransactionController['emulateNewTransaction'];
303
+ };
304
+ /**
305
+ * Emulate a transaction update.
306
+ *
307
+ * @param transactionMeta - Transaction metadata.
308
+ */
309
+ export type TransactionControllerEmulateTransactionUpdateAction = {
310
+ type: `TransactionController:emulateTransactionUpdate`;
311
+ handler: TransactionController['emulateTransactionUpdate'];
312
+ };
313
+ /**
314
+ * Retrieve available gas fee tokens for a transaction.
315
+ *
316
+ * @param request - The request object containing transaction details.
317
+ * @returns The list of available gas fee tokens.
318
+ */
319
+ export type TransactionControllerGetGasFeeTokensAction = {
320
+ type: `TransactionController:getGasFeeTokens`;
321
+ handler: TransactionController['getGasFeeTokens'];
322
+ };
323
+ /**
324
+ * Union of all TransactionController action types.
325
+ */
326
+ export type TransactionControllerMethodActions = TransactionControllerHandleMethodDataAction | TransactionControllerAddTransactionBatchAction | TransactionControllerIsAtomicBatchSupportedAction | TransactionControllerAddTransactionAction | TransactionControllerStartIncomingTransactionPollingAction | TransactionControllerStopIncomingTransactionPollingAction | TransactionControllerUpdateIncomingTransactionsAction | TransactionControllerStopTransactionAction | TransactionControllerSpeedUpTransactionAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerEstimateGasBufferedAction | TransactionControllerUpdateTransactionAction | TransactionControllerConfirmExternalTransactionAction | TransactionControllerGetNonceLockAction | TransactionControllerUpdateEditableParamsAction | TransactionControllerSetTransactionActiveAction | TransactionControllerApproveTransactionsWithSameNonceAction | TransactionControllerUpdateCustodialTransactionAction | TransactionControllerGetTransactionsAction | TransactionControllerEstimateGasFeeAction | TransactionControllerGetLayer1GasFeeAction | TransactionControllerClearUnapprovedTransactionsAction | TransactionControllerAbortTransactionSigningAction | TransactionControllerUpdateAtomicBatchDataAction | TransactionControllerEmulateNewTransactionAction | TransactionControllerEmulateTransactionUpdateAction | TransactionControllerGetGasFeeTokensAction;
327
+ //# sourceMappingURL=TransactionController-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionController-method-action-types.d.mts","sourceRoot":"","sources":["../src/TransactionController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAgC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;CACvD,CAA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AAC;CAC5D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC1C,2CAA2C,GAC3C,8CAA8C,GAC9C,iDAAiD,GACjD,yCAAyC,GACzC,0DAA0D,GAC1D,yDAAyD,GACzD,qDAAqD,GACrD,0CAA0C,GAC1C,6CAA6C,GAC7C,sCAAsC,GACtC,2CAA2C,GAC3C,8CAA8C,GAC9C,4CAA4C,GAC5C,qDAAqD,GACrD,uCAAuC,GACvC,+CAA+C,GAC/C,+CAA+C,GAC/C,2DAA2D,GAC3D,qDAAqD,GACrD,0CAA0C,GAC1C,yCAAyC,GACzC,0CAA0C,GAC1C,sDAAsD,GACtD,kDAAkD,GAClD,gDAAgD,GAChD,gDAAgD,GAChD,mDAAmD,GACnD,0CAA0C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=TransactionController-method-action-types.mjs.map
@@ -0,0 +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"]}
@@ -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, _TransactionController_getTransactionWithActionId, _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, _TransactionController_getGasFeeTokensAction;
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_getTransactionWithActionId, _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");
@@ -133,6 +133,37 @@ function getDefaultTransactionControllerState() {
133
133
  submitHistory: [],
134
134
  };
135
135
  }
136
+ // === MESSENGER ===
137
+ const MESSENGER_EXPOSED_METHODS = [
138
+ 'abortTransactionSigning',
139
+ 'addTransaction',
140
+ 'addTransactionBatch',
141
+ 'approveTransactionsWithSameNonce',
142
+ 'clearUnapprovedTransactions',
143
+ 'confirmExternalTransaction',
144
+ 'emulateNewTransaction',
145
+ 'emulateTransactionUpdate',
146
+ 'estimateGas',
147
+ 'estimateGasBatch',
148
+ 'estimateGasBuffered',
149
+ 'estimateGasFee',
150
+ 'getGasFeeTokens',
151
+ 'getLayer1GasFee',
152
+ 'getNonceLock',
153
+ 'getTransactions',
154
+ 'handleMethodData',
155
+ 'isAtomicBatchSupported',
156
+ 'setTransactionActive',
157
+ 'speedUpTransaction',
158
+ 'startIncomingTransactionPolling',
159
+ 'stopIncomingTransactionPolling',
160
+ 'stopTransaction',
161
+ 'updateAtomicBatchData',
162
+ 'updateCustodialTransaction',
163
+ 'updateEditableParams',
164
+ 'updateIncomingTransactions',
165
+ 'updateTransaction',
166
+ ];
136
167
  /**
137
168
  * Controller responsible for submitting and managing transactions.
138
169
  */
@@ -550,9 +581,15 @@ class TransactionController extends base_controller_1.BaseController {
550
581
  transactionMeta: addedTransactionMeta,
551
582
  };
552
583
  }
584
+ /**
585
+ * Starts polling for incoming transactions from the remote transaction source.
586
+ */
553
587
  startIncomingTransactionPolling() {
554
588
  __classPrivateFieldGet(this, _TransactionController_incomingTransactionHelper, "f").start();
555
589
  }
590
+ /**
591
+ * Stops polling for incoming transactions from the remote transaction source.
592
+ */
556
593
  stopIncomingTransactionPolling() {
557
594
  __classPrivateFieldGet(this, _TransactionController_incomingTransactionHelper, "f").stop();
558
595
  }
@@ -913,6 +950,14 @@ class TransactionController extends base_controller_1.BaseController {
913
950
  this.updateTransaction(updatedMeta, `${controllerName}:updatePreviousGasParams - Previous gas values updated`);
914
951
  return __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, transactionId);
915
952
  }
953
+ /**
954
+ * Acquires a nonce lock for the given address on the specified network,
955
+ * ensuring that nonces are assigned sequentially without conflicts.
956
+ *
957
+ * @param address - The account address for which to acquire the nonce lock.
958
+ * @param networkClientId - The ID of the network client to use.
959
+ * @returns A promise that resolves to a nonce lock containing the next nonce and a release function.
960
+ */
916
961
  async getNonceLock(address, networkClientId) {
917
962
  return __classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").getNonceLock(address, networkClientId);
918
963
  }
@@ -1177,6 +1222,15 @@ class TransactionController extends base_controller_1.BaseController {
1177
1222
  }
1178
1223
  return filteredTransactions;
1179
1224
  }
1225
+ /**
1226
+ * Estimates the gas fees for a transaction.
1227
+ *
1228
+ * @param args - The arguments for estimating gas fees.
1229
+ * @param args.transactionParams - The transaction parameters to estimate fees for.
1230
+ * @param args.chainId - The chain ID to use. If not provided, the network client ID is used to determine the chain.
1231
+ * @param args.networkClientId - The network client ID to use for the estimation.
1232
+ * @returns A promise that resolves to the estimated gas fee response.
1233
+ */
1180
1234
  async estimateGasFee({ transactionParams, chainId, networkClientId: requestNetworkClientId, }) {
1181
1235
  const { id: networkClientId, provider } = __classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").getNetworkClient({
1182
1236
  chainId,
@@ -1389,6 +1443,30 @@ class TransactionController extends base_controller_1.BaseController {
1389
1443
  transactionMeta: updatedTransactionMeta,
1390
1444
  });
1391
1445
  }
1446
+ /**
1447
+ * Retrieve available gas fee tokens for a transaction.
1448
+ *
1449
+ * @param request - The request object containing transaction details.
1450
+ * @returns The list of available gas fee tokens.
1451
+ */
1452
+ async getGasFeeTokens(request) {
1453
+ const { chainId, data, from, to, value } = request;
1454
+ const ethQuery = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getEthQuery).call(this, { chainId });
1455
+ const delegationAddress = await (0, eip7702_1.getDelegationAddress)(from, ethQuery);
1456
+ const transaction = {
1457
+ chainId,
1458
+ delegationAddress,
1459
+ isExternalSign: true,
1460
+ txParams: {
1461
+ data,
1462
+ from,
1463
+ to,
1464
+ value,
1465
+ },
1466
+ };
1467
+ const result = await __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getGasFeeTokens).call(this, transaction);
1468
+ return result.gasFeeTokens;
1469
+ }
1392
1470
  }
1393
1471
  exports.TransactionController = TransactionController;
1394
1472
  _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, }) {
@@ -1514,8 +1592,16 @@ _TransactionController_afterAdd = new WeakMap(), _TransactionController_afterSig
1514
1592
  }, _TransactionController_failIncompleteTransactions = function _TransactionController_failIncompleteTransactions() {
1515
1593
  const incompleteTransactions = this.state.transactions.filter((transaction) => [types_1.TransactionStatus.approved, types_1.TransactionStatus.signed].includes(transaction.status));
1516
1594
  for (const transactionMeta of incompleteTransactions) {
1517
- __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_failTransaction).call(this, transactionMeta, new Error('Transaction incomplete at startup'));
1518
1595
  const requiredTransactionIds = transactionMeta.requiredTransactionIds ?? [];
1596
+ const allRequiredConfirmed = requiredTransactionIds.length > 0 &&
1597
+ requiredTransactionIds.every((id) => {
1598
+ const tx = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, id);
1599
+ return tx?.status === types_1.TransactionStatus.confirmed;
1600
+ });
1601
+ const message = allRequiredConfirmed
1602
+ ? 'Transaction incomplete at startup with all required transactions confirmed'
1603
+ : 'Transaction incomplete at startup';
1604
+ __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_failTransaction).call(this, transactionMeta, new Error(message));
1519
1605
  for (const requiredTransactionId of requiredTransactionIds) {
1520
1606
  const requiredTransactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, requiredTransactionId);
1521
1607
  if (!requiredTransactionMeta ||
@@ -2323,18 +2409,7 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
2323
2409
  txMeta: transactionMeta,
2324
2410
  });
2325
2411
  }, _TransactionController_registerActionHandlers = function _TransactionController_registerActionHandlers() {
2326
- this.messenger.registerActionHandler(`${controllerName}:addTransaction`, this.addTransaction.bind(this));
2327
- this.messenger.registerActionHandler(`${controllerName}:addTransactionBatch`, this.addTransactionBatch.bind(this));
2328
- this.messenger.registerActionHandler(`${controllerName}:confirmExternalTransaction`, this.confirmExternalTransaction.bind(this));
2329
- this.messenger.registerActionHandler(`${controllerName}:emulateNewTransaction`, this.emulateNewTransaction.bind(this));
2330
- this.messenger.registerActionHandler(`${controllerName}:emulateTransactionUpdate`, this.emulateTransactionUpdate.bind(this));
2331
- this.messenger.registerActionHandler(`${controllerName}:estimateGas`, this.estimateGas.bind(this));
2332
- this.messenger.registerActionHandler(`${controllerName}:estimateGasBatch`, this.estimateGasBatch.bind(this));
2333
- this.messenger.registerActionHandler(`${controllerName}:getGasFeeTokens`, __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getGasFeeTokensAction).bind(this));
2334
- this.messenger.registerActionHandler(`${controllerName}:getNonceLock`, this.getNonceLock.bind(this));
2335
- this.messenger.registerActionHandler(`${controllerName}:getTransactions`, this.getTransactions.bind(this));
2336
- this.messenger.registerActionHandler(`${controllerName}:updateCustodialTransaction`, this.updateCustodialTransaction.bind(this));
2337
- this.messenger.registerActionHandler(`${controllerName}:updateTransaction`, this.updateTransaction.bind(this));
2412
+ this.messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
2338
2413
  }, _TransactionController_deleteTransaction = function _TransactionController_deleteTransaction(transactionId) {
2339
2414
  this.update((state) => {
2340
2415
  const transactions = state.transactions.filter(({ id }) => id !== transactionId);
@@ -2428,22 +2503,5 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
2428
2503
  publicKeyEIP7702: __classPrivateFieldGet(this, _TransactionController_publicKeyEIP7702, "f"),
2429
2504
  transactionMeta: transaction,
2430
2505
  });
2431
- }, _TransactionController_getGasFeeTokensAction = async function _TransactionController_getGasFeeTokensAction(request) {
2432
- const { chainId, data, from, to, value } = request;
2433
- const ethQuery = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getEthQuery).call(this, { chainId });
2434
- const delegationAddress = await (0, eip7702_1.getDelegationAddress)(from, ethQuery);
2435
- const transaction = {
2436
- chainId,
2437
- delegationAddress,
2438
- isExternalSign: true,
2439
- txParams: {
2440
- data,
2441
- from,
2442
- to,
2443
- value,
2444
- },
2445
- };
2446
- const result = await __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getGasFeeTokens).call(this, transaction);
2447
- return result.gasFeeTokens;
2448
2506
  };
2449
2507
  //# sourceMappingURL=TransactionController.cjs.map