@metamask/transaction-controller 52.0.0 → 52.2.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 +52 -4
- package/dist/TransactionController.cjs +113 -36
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts +38 -5
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts +38 -5
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +114 -37
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/helpers/GasFeePoller.cjs +73 -1
- package/dist/helpers/GasFeePoller.cjs.map +1 -1
- package/dist/helpers/GasFeePoller.d.cts +20 -2
- package/dist/helpers/GasFeePoller.d.cts.map +1 -1
- package/dist/helpers/GasFeePoller.d.mts +20 -2
- package/dist/helpers/GasFeePoller.d.mts.map +1 -1
- package/dist/helpers/GasFeePoller.mjs +72 -1
- package/dist/helpers/GasFeePoller.mjs.map +1 -1
- package/dist/hooks/CollectPublishHook.cjs +84 -0
- package/dist/hooks/CollectPublishHook.cjs.map +1 -0
- package/dist/hooks/CollectPublishHook.d.cts +29 -0
- package/dist/hooks/CollectPublishHook.d.cts.map +1 -0
- package/dist/hooks/CollectPublishHook.d.mts +29 -0
- package/dist/hooks/CollectPublishHook.d.mts.map +1 -0
- package/dist/hooks/CollectPublishHook.mjs +80 -0
- package/dist/hooks/CollectPublishHook.mjs.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.cjs +90 -0
- package/dist/hooks/ExtraTransactionsPublishHook.cjs.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.cts +18 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.cts.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.mts +18 -0
- package/dist/hooks/ExtraTransactionsPublishHook.d.mts.map +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.mjs +86 -0
- package/dist/hooks/ExtraTransactionsPublishHook.mjs.map +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +143 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +143 -2
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/batch.cjs +142 -1
- package/dist/utils/batch.cjs.map +1 -1
- package/dist/utils/batch.d.cts +7 -1
- package/dist/utils/batch.d.cts.map +1 -1
- package/dist/utils/batch.d.mts +7 -1
- package/dist/utils/batch.d.mts.map +1 -1
- package/dist/utils/batch.mjs +142 -1
- package/dist/utils/batch.mjs.map +1 -1
- package/dist/utils/eip7702.cjs +12 -0
- package/dist/utils/eip7702.cjs.map +1 -1
- package/dist/utils/eip7702.d.cts.map +1 -1
- package/dist/utils/eip7702.d.mts.map +1 -1
- package/dist/utils/eip7702.mjs +12 -0
- package/dist/utils/eip7702.mjs.map +1 -1
- package/dist/utils/feature-flags.cjs +2 -2
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +2 -2
- package/dist/utils/feature-flags.d.mts +2 -2
- package/dist/utils/feature-flags.mjs +2 -2
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/gas.cjs +115 -11
- package/dist/utils/gas.cjs.map +1 -1
- package/dist/utils/gas.d.cts +16 -5
- package/dist/utils/gas.d.cts.map +1 -1
- package/dist/utils/gas.d.mts +16 -5
- package/dist/utils/gas.d.mts.map +1 -1
- package/dist/utils/gas.mjs +115 -11
- package/dist/utils/gas.mjs.map +1 -1
- package/dist/utils/nonce.cjs +3 -3
- package/dist/utils/nonce.cjs.map +1 -1
- package/dist/utils/nonce.d.cts +2 -2
- package/dist/utils/nonce.d.cts.map +1 -1
- package/dist/utils/nonce.d.mts +2 -2
- package/dist/utils/nonce.d.mts.map +1 -1
- package/dist/utils/nonce.mjs +3 -3
- package/dist/utils/nonce.mjs.map +1 -1
- package/dist/utils/simulation-api.cjs.map +1 -1
- package/dist/utils/simulation-api.d.cts +46 -5
- package/dist/utils/simulation-api.d.cts.map +1 -1
- package/dist/utils/simulation-api.d.mts +46 -5
- package/dist/utils/simulation-api.d.mts.map +1 -1
- package/dist/utils/simulation-api.mjs.map +1 -1
- package/dist/utils/simulation.cjs +46 -7
- package/dist/utils/simulation.cjs.map +1 -1
- package/dist/utils/simulation.d.cts +6 -2
- package/dist/utils/simulation.d.cts.map +1 -1
- package/dist/utils/simulation.d.mts +6 -2
- package/dist/utils/simulation.d.mts.map +1 -1
- package/dist/utils/simulation.mjs +46 -7
- package/dist/utils/simulation.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [52.2.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `gasFeeTokens` to `TransactionMeta` ([#5524](https://github.com/MetaMask/core/pull/5524))
|
|
15
|
+
- Add `GasFeeToken` type.
|
|
16
|
+
- Add `selectedGasFeeToken` to `TransactionMeta`.
|
|
17
|
+
- Add `updateSelectedGasFeeToken` method.
|
|
18
|
+
- Support security validation of transaction batches ([#5526](https://github.com/MetaMask/core/pull/5526))
|
|
19
|
+
- Add `ValidateSecurityRequest` type.
|
|
20
|
+
- Add optional `securityAlertId` to `SecurityAlertResponse`.
|
|
21
|
+
- Add optional `securityAlertId` to `TransactionBatchRequest`.
|
|
22
|
+
- Add optional `validateSecurity` callback to `TransactionBatchRequest`.
|
|
23
|
+
- Support publish batch hook ([#5401](https://github.com/MetaMask/core/pull/5401))
|
|
24
|
+
- Add `hooks.publishBatch` option to constructor.
|
|
25
|
+
- Add `updateBatchTransactions` method.
|
|
26
|
+
- Add `maxFeePerGas` and `maxPriorityFeePerGas` to `updateEditableParams` options.
|
|
27
|
+
- Add types.
|
|
28
|
+
- `PublishBatchHook`
|
|
29
|
+
- `PublishBatchHookRequest`
|
|
30
|
+
- `PublishBatchHookResult`
|
|
31
|
+
- `PublishBatchHookTransaction`
|
|
32
|
+
- `PublishHook`
|
|
33
|
+
- `PublishHookResult`
|
|
34
|
+
- Add optional properties to `TransactionMeta`.
|
|
35
|
+
- `batchTransactions`
|
|
36
|
+
- `disableGasBuffer`
|
|
37
|
+
- Add optional properties to `BatchTransactionParams`.
|
|
38
|
+
- `gas`
|
|
39
|
+
- `maxFeePerGas`
|
|
40
|
+
- `maxPriorityFeePerGas`
|
|
41
|
+
- Add optional `existingTransaction` property to `TransactionBatchSingleRequest`.
|
|
42
|
+
- Add optional `useHook` property to `TransactionBatchRequest`.
|
|
43
|
+
|
|
44
|
+
## [52.1.0]
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- Add `enableTxParamsGasFeeUpdates` constructor option ([5394](https://github.com/MetaMask/core/pull/5394))
|
|
49
|
+
- If not set it will default to `false`.
|
|
50
|
+
- Automatically update gas fee properties in `txParams` when the `gasFeeEstimates` are updated via polling.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- Fix gas estimation for type 4 transactions ([#5519](https://github.com/MetaMask/core/pull/5519))
|
|
55
|
+
|
|
10
56
|
## [52.0.0]
|
|
11
57
|
|
|
12
58
|
### Changed
|
|
@@ -29,7 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
75
|
### Added
|
|
30
76
|
|
|
31
77
|
- Add additional metadata for batch metrics ([#5488](https://github.com/MetaMask/core/pull/5488))
|
|
32
|
-
- Add `delegationAddress` to `
|
|
78
|
+
- Add `delegationAddress` to `TransactionMeta`.
|
|
33
79
|
- Add `NestedTransactionMetadata` type containing `BatchTransactionParams` and `type`.
|
|
34
80
|
- Add optional `type` to `TransactionBatchSingleRequest`.
|
|
35
81
|
- Verify EIP-7702 contract address using signatures ([#5472](https://github.com/MetaMask/core/pull/5472))
|
|
@@ -40,8 +86,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
40
86
|
|
|
41
87
|
- **BREAKING:** Bump `@metamask/accounts-controller` peer dependency to `^26.1.0` ([#5481](https://github.com/MetaMask/core/pull/5481))
|
|
42
88
|
- **BREAKING:** Add additional metadata for batch metrics ([#5488](https://github.com/MetaMask/core/pull/5488))
|
|
43
|
-
- Change `error` in `
|
|
44
|
-
- Change `nestedTransactions` in `
|
|
89
|
+
- Change `error` in `TransactionMeta` to optional for all statuses.
|
|
90
|
+
- Change `nestedTransactions` in `TransactionMeta` to array of `NestedTransactionMetadata`.
|
|
45
91
|
- Throw if `addTransactionBatch` called with external origin and size limit exceeded ([#5489](https://github.com/MetaMask/core/pull/5489))
|
|
46
92
|
- Verify EIP-7702 contract address using signatures ([#5472](https://github.com/MetaMask/core/pull/5472))
|
|
47
93
|
- Use new `contracts` property from feature flags instead of `contractAddresses`.
|
|
@@ -1397,7 +1443,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1397
1443
|
|
|
1398
1444
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
1399
1445
|
|
|
1400
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@52.
|
|
1446
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@52.2.0...HEAD
|
|
1447
|
+
[52.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@52.1.0...@metamask/transaction-controller@52.2.0
|
|
1448
|
+
[52.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@52.0.0...@metamask/transaction-controller@52.1.0
|
|
1401
1449
|
[52.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@51.0.0...@metamask/transaction-controller@52.0.0
|
|
1402
1450
|
[51.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@50.0.0...@metamask/transaction-controller@51.0.0
|
|
1403
1451
|
[50.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@49.0.0...@metamask/transaction-controller@50.0.0
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || 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_internalEvents, _TransactionController_methodDataHelper, _TransactionController_incomingTransactionHelper, _TransactionController_incomingTransactionOptions, _TransactionController_pendingTransactionOptions, _TransactionController_publicKeyEIP7702, _TransactionController_trace, _TransactionController_transactionHistoryLimit, _TransactionController_isFirstTimeInteractionEnabled, _TransactionController_isSimulationEnabled, _TransactionController_testGasFeeFlows, _TransactionController_multichainTrackingHelper, _TransactionController_retryTransaction, _TransactionController_rejectTransaction, _TransactionController_getChainId, _TransactionController_getNetworkClientId, _TransactionController_getEthQuery, _TransactionController_getProvider, _TransactionController_createNonceTracker, _TransactionController_createPendingTransactionTracker, _TransactionController_checkForPendingTransactionAndStartPolling, _TransactionController_stopAllTracking, _TransactionController_addIncomingTransactionHelperListeners, _TransactionController_removePendingTransactionTrackerListeners, _TransactionController_addPendingTransactionTrackerListeners, _TransactionController_getNonceTrackerPendingTransactions, _TransactionController_getGasFeeFlows, _TransactionController_getLayer1GasFeeFlows, _TransactionController_updateTransactionInternal, _TransactionController_updateFirstTimeInteraction, _TransactionController_updateSimulationData, _TransactionController_onGasFeePollerTransactionUpdate, _TransactionController_getSelectedAccount, _TransactionController_getInternalAccounts, _TransactionController_updateSubmitHistory, _TransactionController_updateGasEstimate, _TransactionController_deleteTransaction, _TransactionController_isRejectError, _TransactionController_rejectTransactionAndThrow;
|
|
16
|
+
var _TransactionController_instances, _TransactionController_internalEvents, _TransactionController_methodDataHelper, _TransactionController_incomingTransactionHelper, _TransactionController_incomingTransactionOptions, _TransactionController_pendingTransactionOptions, _TransactionController_publishBatchHook, _TransactionController_publicKeyEIP7702, _TransactionController_trace, _TransactionController_transactionHistoryLimit, _TransactionController_isFirstTimeInteractionEnabled, _TransactionController_isSimulationEnabled, _TransactionController_testGasFeeFlows, _TransactionController_multichainTrackingHelper, _TransactionController_retryTransaction, _TransactionController_rejectTransaction, _TransactionController_getChainId, _TransactionController_getNetworkClientId, _TransactionController_getEthQuery, _TransactionController_getProvider, _TransactionController_createNonceTracker, _TransactionController_createPendingTransactionTracker, _TransactionController_checkForPendingTransactionAndStartPolling, _TransactionController_stopAllTracking, _TransactionController_addIncomingTransactionHelperListeners, _TransactionController_removePendingTransactionTrackerListeners, _TransactionController_addPendingTransactionTrackerListeners, _TransactionController_getNonceTrackerPendingTransactions, _TransactionController_getGasFeeFlows, _TransactionController_getLayer1GasFeeFlows, _TransactionController_updateTransactionInternal, _TransactionController_updateFirstTimeInteraction, _TransactionController_updateSimulationData, _TransactionController_onGasFeePollerTransactionUpdate, _TransactionController_getSelectedAccount, _TransactionController_getInternalAccounts, _TransactionController_updateSubmitHistory, _TransactionController_updateGasEstimate, _TransactionController_deleteTransaction, _TransactionController_isRejectError, _TransactionController_rejectTransactionAndThrow;
|
|
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");
|
|
@@ -23,7 +23,6 @@ const network_controller_1 = require("@metamask/network-controller");
|
|
|
23
23
|
const nonce_tracker_1 = require("@metamask/nonce-tracker");
|
|
24
24
|
const rpc_errors_1 = require("@metamask/rpc-errors");
|
|
25
25
|
const utils_1 = require("@metamask/utils");
|
|
26
|
-
const async_mutex_1 = require("async-mutex");
|
|
27
26
|
// This package purposefully relies on Node's EventEmitter module.
|
|
28
27
|
// eslint-disable-next-line import-x/no-nodejs-modules
|
|
29
28
|
const events_1 = require("events");
|
|
@@ -42,6 +41,7 @@ const MethodDataHelper_1 = require("./helpers/MethodDataHelper.cjs");
|
|
|
42
41
|
const MultichainTrackingHelper_1 = require("./helpers/MultichainTrackingHelper.cjs");
|
|
43
42
|
const PendingTransactionTracker_1 = require("./helpers/PendingTransactionTracker.cjs");
|
|
44
43
|
const ResimulateHelper_1 = require("./helpers/ResimulateHelper.cjs");
|
|
44
|
+
const ExtraTransactionsPublishHook_1 = require("./hooks/ExtraTransactionsPublishHook.cjs");
|
|
45
45
|
const logger_1 = require("./logger.cjs");
|
|
46
46
|
const types_1 = require("./types.cjs");
|
|
47
47
|
const batch_1 = require("./utils/batch.cjs");
|
|
@@ -156,7 +156,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
156
156
|
* @param options - The controller options.
|
|
157
157
|
*/
|
|
158
158
|
constructor(options) {
|
|
159
|
-
const { disableHistory, disableSendFlowHistory, disableSwaps, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getExternalPendingTransactions, getGasFeeEstimates, getNetworkClientRegistry, getNetworkState, getPermittedAccounts, getSavedGasFees, incomingTransactions = {}, isFirstTimeInteractionEnabled, isSimulationEnabled, messenger, pendingTransactions = {}, publicKeyEIP7702, securityProviderRequest, sign, state, testGasFeeFlows, trace, transactionHistoryLimit = 40, hooks, } = options;
|
|
159
|
+
const { disableHistory, disableSendFlowHistory, disableSwaps, enableTxParamsGasFeeUpdates, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getExternalPendingTransactions, getGasFeeEstimates, getNetworkClientRegistry, getNetworkState, getPermittedAccounts, getSavedGasFees, incomingTransactions = {}, isFirstTimeInteractionEnabled, isSimulationEnabled, messenger, pendingTransactions = {}, publicKeyEIP7702, securityProviderRequest, sign, state, testGasFeeFlows, trace, transactionHistoryLimit = 40, hooks, } = options;
|
|
160
160
|
super({
|
|
161
161
|
name: controllerName,
|
|
162
162
|
metadata,
|
|
@@ -170,10 +170,10 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
170
170
|
_TransactionController_internalEvents.set(this, new events_1.EventEmitter());
|
|
171
171
|
this.approvingTransactionIds = new Set();
|
|
172
172
|
_TransactionController_methodDataHelper.set(this, void 0);
|
|
173
|
-
this.mutex = new async_mutex_1.Mutex();
|
|
174
173
|
_TransactionController_incomingTransactionHelper.set(this, void 0);
|
|
175
174
|
_TransactionController_incomingTransactionOptions.set(this, void 0);
|
|
176
175
|
_TransactionController_pendingTransactionOptions.set(this, void 0);
|
|
176
|
+
_TransactionController_publishBatchHook.set(this, void 0);
|
|
177
177
|
_TransactionController_publicKeyEIP7702.set(this, void 0);
|
|
178
178
|
this.signAbortCallbacks = new Map();
|
|
179
179
|
_TransactionController_trace.set(this, void 0);
|
|
@@ -186,6 +186,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
186
186
|
__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").checkForPendingTransactionAndStartPolling();
|
|
187
187
|
});
|
|
188
188
|
this.messagingSystem = messenger;
|
|
189
|
+
this.isTxParamsGasFeeUpdatesEnabled = enableTxParamsGasFeeUpdates ?? false;
|
|
189
190
|
this.getNetworkState = getNetworkState;
|
|
190
191
|
this.isSendFlowHistoryDisabled = disableSendFlowHistory ?? false;
|
|
191
192
|
this.isHistoryDisabled = disableHistory ?? false;
|
|
@@ -205,6 +206,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
205
206
|
this.securityProviderRequest = securityProviderRequest;
|
|
206
207
|
__classPrivateFieldSet(this, _TransactionController_incomingTransactionOptions, incomingTransactions, "f");
|
|
207
208
|
__classPrivateFieldSet(this, _TransactionController_pendingTransactionOptions, pendingTransactions, "f");
|
|
209
|
+
__classPrivateFieldSet(this, _TransactionController_publishBatchHook, hooks?.publishBatch, "f");
|
|
208
210
|
__classPrivateFieldSet(this, _TransactionController_publicKeyEIP7702, publicKeyEIP7702, "f");
|
|
209
211
|
__classPrivateFieldSet(this, _TransactionController_transactionHistoryLimit, transactionHistoryLimit, "f");
|
|
210
212
|
this.sign = sign;
|
|
@@ -319,9 +321,12 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
319
321
|
getChainId: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getChainId).bind(this),
|
|
320
322
|
getEthQuery: (networkClientId) => __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getEthQuery).call(this, { networkClientId }),
|
|
321
323
|
getInternalAccounts: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getInternalAccounts).bind(this),
|
|
324
|
+
getTransaction: (transactionId) => this.getTransactionOrThrow(transactionId),
|
|
322
325
|
messenger: this.messagingSystem,
|
|
326
|
+
publishBatchHook: __classPrivateFieldGet(this, _TransactionController_publishBatchHook, "f"),
|
|
323
327
|
publicKeyEIP7702: __classPrivateFieldGet(this, _TransactionController_publicKeyEIP7702, "f"),
|
|
324
328
|
request,
|
|
329
|
+
updateTransaction: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).bind(this),
|
|
325
330
|
});
|
|
326
331
|
}
|
|
327
332
|
/**
|
|
@@ -348,9 +353,11 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
348
353
|
* @param options.actionId - Unique ID to prevent duplicate requests.
|
|
349
354
|
* @param options.batchId - A custom ID for the batch this transaction belongs to.
|
|
350
355
|
* @param options.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.
|
|
356
|
+
* @param options.disableGasBuffer - Whether to disable the gas estimation buffer.
|
|
351
357
|
* @param options.method - RPC method that requested the transaction.
|
|
352
358
|
* @param options.nestedTransactions - Params for any nested transactions encoded in the data.
|
|
353
359
|
* @param options.origin - The origin of the transaction request, such as a dApp hostname.
|
|
360
|
+
* @param options.publishHook - Custom logic to publish the transaction.
|
|
354
361
|
* @param options.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.
|
|
355
362
|
* @param options.securityAlertResponse - Response from security validator.
|
|
356
363
|
* @param options.sendFlowHistory - The sendFlowHistory entries to add.
|
|
@@ -364,7 +371,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
364
371
|
*/
|
|
365
372
|
async addTransaction(txParams, options) {
|
|
366
373
|
(0, logger_1.projectLogger)('Adding transaction', txParams, options);
|
|
367
|
-
const { actionId, batchId, deviceConfirmedOn, method, nestedTransactions, networkClientId, origin, requireApproval, securityAlertResponse, sendFlowHistory, swaps = {}, traceContext, type, } = options;
|
|
374
|
+
const { actionId, batchId, deviceConfirmedOn, disableGasBuffer, method, nestedTransactions, networkClientId, origin, publishHook, requireApproval, securityAlertResponse, sendFlowHistory, swaps = {}, traceContext, type, } = options;
|
|
368
375
|
txParams = (0, utils_2.normalizeTransactionParams)(txParams);
|
|
369
376
|
if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
|
|
370
377
|
throw new Error(`Network client not found - ${networkClientId}`);
|
|
@@ -393,7 +400,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
393
400
|
(0, validation_1.validateTxParams)(txParams, isEIP1559Compatible);
|
|
394
401
|
const isDuplicateBatchId = batchId?.length &&
|
|
395
402
|
this.state.transactions.some((tx) => tx.batchId?.toLowerCase() === batchId?.toLowerCase());
|
|
396
|
-
if (isDuplicateBatchId) {
|
|
403
|
+
if (isDuplicateBatchId && origin && origin !== controller_utils_1.ORIGIN_METAMASK) {
|
|
397
404
|
throw rpc_errors_1.rpcErrors.invalidInput('Batch ID already exists');
|
|
398
405
|
}
|
|
399
406
|
const dappSuggestedGasFees = this.generateDappSuggestedGasFees(txParams, origin);
|
|
@@ -411,6 +418,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
411
418
|
dappSuggestedGasFees,
|
|
412
419
|
delegationAddress,
|
|
413
420
|
deviceConfirmedOn,
|
|
421
|
+
disableGasBuffer,
|
|
414
422
|
id: (0, uuid_1.v1)(),
|
|
415
423
|
isFirstTimeInteraction: undefined,
|
|
416
424
|
nestedTransactions,
|
|
@@ -468,9 +476,10 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
468
476
|
}
|
|
469
477
|
return {
|
|
470
478
|
result: this.processApproval(addedTransactionMeta, {
|
|
479
|
+
actionId,
|
|
471
480
|
isExisting: Boolean(existingTransactionMeta),
|
|
481
|
+
publishHook,
|
|
472
482
|
requireApproval,
|
|
473
|
-
actionId,
|
|
474
483
|
traceContext,
|
|
475
484
|
}),
|
|
476
485
|
transactionMeta: addedTransactionMeta,
|
|
@@ -549,7 +558,12 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
549
558
|
const ethQuery = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getEthQuery).call(this, {
|
|
550
559
|
networkClientId,
|
|
551
560
|
});
|
|
552
|
-
const { estimatedGas, simulationFails } = await (0, gas_1.estimateGas)(
|
|
561
|
+
const { estimatedGas, simulationFails } = await (0, gas_1.estimateGas)({
|
|
562
|
+
chainId: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getChainId).call(this, networkClientId),
|
|
563
|
+
ethQuery,
|
|
564
|
+
isSimulationEnabled: __classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this),
|
|
565
|
+
txParams: transaction,
|
|
566
|
+
});
|
|
553
567
|
return { gas: estimatedGas, simulationFails };
|
|
554
568
|
}
|
|
555
569
|
/**
|
|
@@ -564,7 +578,12 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
564
578
|
const ethQuery = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getEthQuery).call(this, {
|
|
565
579
|
networkClientId,
|
|
566
580
|
});
|
|
567
|
-
const { blockGasLimit, estimatedGas, simulationFails } = await (0, gas_1.estimateGas)(
|
|
581
|
+
const { blockGasLimit, estimatedGas, simulationFails } = await (0, gas_1.estimateGas)({
|
|
582
|
+
chainId: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getChainId).call(this, networkClientId),
|
|
583
|
+
ethQuery,
|
|
584
|
+
isSimulationEnabled: __classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this),
|
|
585
|
+
txParams: transaction,
|
|
586
|
+
});
|
|
568
587
|
const gas = (0, gas_1.addGasBuffer)(estimatedGas, blockGasLimit, multiplier);
|
|
569
588
|
return {
|
|
570
589
|
gas,
|
|
@@ -783,14 +802,16 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
783
802
|
* @param txId - The ID of the transaction to update.
|
|
784
803
|
* @param params - The editable parameters to update.
|
|
785
804
|
* @param params.data - Data to pass with the transaction.
|
|
805
|
+
* @param params.from - Address to send the transaction from.
|
|
786
806
|
* @param params.gas - Maximum number of units of gas to use for the transaction.
|
|
787
807
|
* @param params.gasPrice - Price per gas for legacy transactions.
|
|
788
|
-
* @param params.
|
|
808
|
+
* @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
|
|
809
|
+
* @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
|
|
789
810
|
* @param params.to - Address to send the transaction to.
|
|
790
811
|
* @param params.value - Value associated with the transaction.
|
|
791
812
|
* @returns The updated transaction metadata.
|
|
792
813
|
*/
|
|
793
|
-
async updateEditableParams(txId, { data, gas, gasPrice,
|
|
814
|
+
async updateEditableParams(txId, { data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, value, }) {
|
|
794
815
|
const transactionMeta = this.getTransaction(txId);
|
|
795
816
|
if (!transactionMeta) {
|
|
796
817
|
throw new Error(`Cannot update editable params as no transaction metadata found`);
|
|
@@ -804,6 +825,8 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
804
825
|
value,
|
|
805
826
|
gas,
|
|
806
827
|
gasPrice,
|
|
828
|
+
maxFeePerGas,
|
|
829
|
+
maxPriorityFeePerGas,
|
|
807
830
|
},
|
|
808
831
|
};
|
|
809
832
|
editableParams.txParams = (0, lodash_1.pickBy)(editableParams.txParams);
|
|
@@ -1156,6 +1179,38 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1156
1179
|
});
|
|
1157
1180
|
return updatedTransactionMeta.txParams.data;
|
|
1158
1181
|
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Update the batch transactions associated with a transaction.
|
|
1184
|
+
* These transactions will be submitted with the main transaction as a batch.
|
|
1185
|
+
*
|
|
1186
|
+
* @param request - The request object.
|
|
1187
|
+
* @param request.transactionId - The ID of the transaction to update.
|
|
1188
|
+
* @param request.batchTransactions - The new batch transactions.
|
|
1189
|
+
*/
|
|
1190
|
+
updateBatchTransactions({ transactionId, batchTransactions, }) {
|
|
1191
|
+
(0, logger_1.projectLogger)('Updating batch transactions', { transactionId, batchTransactions });
|
|
1192
|
+
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, {
|
|
1193
|
+
transactionId,
|
|
1194
|
+
note: 'TransactionController#updateBatchTransactions - Batch transactions updated',
|
|
1195
|
+
}, (transactionMeta) => {
|
|
1196
|
+
transactionMeta.batchTransactions = batchTransactions;
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Update the selected gas fee token for a transaction.
|
|
1201
|
+
*
|
|
1202
|
+
* @param transactionId - The ID of the transaction to update.
|
|
1203
|
+
* @param contractAddress - The contract address of the selected gas fee token.
|
|
1204
|
+
*/
|
|
1205
|
+
updateSelectedGasFeeToken(transactionId, contractAddress) {
|
|
1206
|
+
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId }, (transactionMeta) => {
|
|
1207
|
+
const hasMatchingGasFeeToken = transactionMeta.gasFeeTokens?.some((token) => token.tokenAddress.toLowerCase() === contractAddress?.toLowerCase());
|
|
1208
|
+
if (contractAddress && !hasMatchingGasFeeToken) {
|
|
1209
|
+
throw new Error(`No matching gas fee token found with address - ${contractAddress}`);
|
|
1210
|
+
}
|
|
1211
|
+
transactionMeta.selectedGasFeeToken = contractAddress;
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1159
1214
|
addMetadata(transactionMeta) {
|
|
1160
1215
|
(0, validation_1.validateTxParams)(transactionMeta.txParams);
|
|
1161
1216
|
this.update((state) => {
|
|
@@ -1198,7 +1253,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1198
1253
|
this.failTransaction(transactionMeta, new Error('Transaction incomplete at startup'));
|
|
1199
1254
|
}
|
|
1200
1255
|
}
|
|
1201
|
-
async processApproval(transactionMeta, { isExisting = false, requireApproval, shouldShowRequest = true,
|
|
1256
|
+
async processApproval(transactionMeta, { actionId, isExisting = false, publishHook, requireApproval, shouldShowRequest = true, traceContext, }) {
|
|
1202
1257
|
const transactionId = transactionMeta.id;
|
|
1203
1258
|
let resultCallbacks;
|
|
1204
1259
|
const { meta, isCompleted } = this.isTransactionCompleted(transactionId);
|
|
@@ -1225,7 +1280,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1225
1280
|
}
|
|
1226
1281
|
const { isCompleted: isTxCompleted } = this.isTransactionCompleted(transactionId);
|
|
1227
1282
|
if (!isTxCompleted) {
|
|
1228
|
-
const approvalResult = await this.approveTransaction(transactionId, traceContext);
|
|
1283
|
+
const approvalResult = await this.approveTransaction(transactionId, traceContext, publishHook);
|
|
1229
1284
|
if (approvalResult === ApprovalState.SkippedViaBeforePublishHook &&
|
|
1230
1285
|
resultCallbacks) {
|
|
1231
1286
|
resultCallbacks.success();
|
|
@@ -1273,12 +1328,14 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1273
1328
|
*
|
|
1274
1329
|
* @param transactionId - The ID of the transaction to approve.
|
|
1275
1330
|
* @param traceContext - The parent context for any new traces.
|
|
1331
|
+
* @param publishHookOverride - Custom logic to publish the transaction.
|
|
1276
1332
|
* @returns The state of the approval.
|
|
1277
1333
|
*/
|
|
1278
|
-
async approveTransaction(transactionId, traceContext) {
|
|
1279
|
-
|
|
1280
|
-
|
|
1334
|
+
async approveTransaction(transactionId, traceContext, publishHookOverride) {
|
|
1335
|
+
let clearApprovingTransactionId;
|
|
1336
|
+
let clearNonceLock;
|
|
1281
1337
|
let transactionMeta = this.getTransactionOrThrow(transactionId);
|
|
1338
|
+
(0, logger_1.projectLogger)('Approving transaction', transactionMeta);
|
|
1282
1339
|
try {
|
|
1283
1340
|
if (!this.sign) {
|
|
1284
1341
|
this.failTransaction(transactionMeta, new Error('No sign method defined.'));
|
|
@@ -1293,10 +1350,9 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1293
1350
|
return ApprovalState.NotApproved;
|
|
1294
1351
|
}
|
|
1295
1352
|
this.approvingTransactionIds.add(transactionId);
|
|
1296
|
-
|
|
1353
|
+
clearApprovingTransactionId = () => this.approvingTransactionIds.delete(transactionId);
|
|
1297
1354
|
const [nonce, releaseNonce] = await (0, nonce_1.getNextNonce)(transactionMeta, (address) => __classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").getNonceLock(address, transactionMeta.networkClientId));
|
|
1298
|
-
|
|
1299
|
-
releaseNonce && cleanupTasks.push(releaseNonce);
|
|
1355
|
+
clearNonceLock = releaseNonce;
|
|
1300
1356
|
transactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, {
|
|
1301
1357
|
transactionId,
|
|
1302
1358
|
note: 'TransactionController#approveTransaction - Transaction approved',
|
|
@@ -1333,8 +1389,19 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1333
1389
|
}
|
|
1334
1390
|
(0, logger_1.projectLogger)('Publishing transaction', transactionMeta.txParams);
|
|
1335
1391
|
let hash;
|
|
1392
|
+
clearNonceLock?.();
|
|
1393
|
+
clearNonceLock = undefined;
|
|
1394
|
+
if (transactionMeta.batchTransactions?.length) {
|
|
1395
|
+
(0, logger_1.projectLogger)('Found batch transactions', transactionMeta.batchTransactions);
|
|
1396
|
+
const extraTransactionsPublishHook = new ExtraTransactionsPublishHook_1.ExtraTransactionsPublishHook({
|
|
1397
|
+
addTransactionBatch: this.addTransactionBatch.bind(this),
|
|
1398
|
+
transactions: transactionMeta.batchTransactions,
|
|
1399
|
+
});
|
|
1400
|
+
publishHookOverride = extraTransactionsPublishHook.getHook();
|
|
1401
|
+
}
|
|
1336
1402
|
await __classPrivateFieldGet(this, _TransactionController_trace, "f").call(this, { name: 'Publish', parentContext: traceContext }, async () => {
|
|
1337
|
-
|
|
1403
|
+
const publishHook = publishHookOverride ?? this.publish;
|
|
1404
|
+
({ transactionHash: hash } = await publishHook(transactionMeta, rawTx));
|
|
1338
1405
|
if (hash === undefined) {
|
|
1339
1406
|
hash = await this.publishTransaction(ethQuery, {
|
|
1340
1407
|
...transactionMeta,
|
|
@@ -1370,7 +1437,8 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1370
1437
|
return ApprovalState.NotApproved;
|
|
1371
1438
|
}
|
|
1372
1439
|
finally {
|
|
1373
|
-
|
|
1440
|
+
clearApprovingTransactionId?.();
|
|
1441
|
+
clearNonceLock?.();
|
|
1374
1442
|
}
|
|
1375
1443
|
}
|
|
1376
1444
|
async publishTransaction(ethQuery, transactionMeta, { skipSubmitHistory } = {}) {
|
|
@@ -1697,8 +1765,8 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1697
1765
|
transactionMeta,
|
|
1698
1766
|
});
|
|
1699
1767
|
}
|
|
1700
|
-
getNonceTrackerTransactions(
|
|
1701
|
-
return (0, nonce_1.getAndFormatTransactionsForNonceTracker)(chainId, address,
|
|
1768
|
+
getNonceTrackerTransactions(statuses, address, chainId) {
|
|
1769
|
+
return (0, nonce_1.getAndFormatTransactionsForNonceTracker)(chainId, address, statuses, this.state.transactions);
|
|
1702
1770
|
}
|
|
1703
1771
|
onConfirmedTransaction(transactionMeta) {
|
|
1704
1772
|
(0, logger_1.projectLogger)('Processing confirmed transaction', transactionMeta.id);
|
|
@@ -1759,7 +1827,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1759
1827
|
}
|
|
1760
1828
|
}
|
|
1761
1829
|
exports.TransactionController = TransactionController;
|
|
1762
|
-
_TransactionController_internalEvents = new WeakMap(), _TransactionController_methodDataHelper = new WeakMap(), _TransactionController_incomingTransactionHelper = new WeakMap(), _TransactionController_incomingTransactionOptions = new WeakMap(), _TransactionController_pendingTransactionOptions = new WeakMap(), _TransactionController_publicKeyEIP7702 = new WeakMap(), _TransactionController_trace = new WeakMap(), _TransactionController_transactionHistoryLimit = new WeakMap(), _TransactionController_isFirstTimeInteractionEnabled = new WeakMap(), _TransactionController_isSimulationEnabled = new WeakMap(), _TransactionController_testGasFeeFlows = new WeakMap(), _TransactionController_multichainTrackingHelper = 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, }) {
|
|
1830
|
+
_TransactionController_internalEvents = new WeakMap(), _TransactionController_methodDataHelper = new WeakMap(), _TransactionController_incomingTransactionHelper = new WeakMap(), _TransactionController_incomingTransactionOptions = new WeakMap(), _TransactionController_pendingTransactionOptions = new WeakMap(), _TransactionController_publishBatchHook = new WeakMap(), _TransactionController_publicKeyEIP7702 = new WeakMap(), _TransactionController_trace = new WeakMap(), _TransactionController_transactionHistoryLimit = new WeakMap(), _TransactionController_isFirstTimeInteractionEnabled = new WeakMap(), _TransactionController_isSimulationEnabled = new WeakMap(), _TransactionController_testGasFeeFlows = new WeakMap(), _TransactionController_multichainTrackingHelper = 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, }) {
|
|
1763
1831
|
// If transaction is found for same action id, do not create a new transaction.
|
|
1764
1832
|
if (this.getTransactionWithActionId(actionId)) {
|
|
1765
1833
|
return;
|
|
@@ -1867,7 +1935,7 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
1867
1935
|
// TODO: Fix types
|
|
1868
1936
|
blockTracker,
|
|
1869
1937
|
getPendingTransactions: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getNonceTrackerPendingTransactions).bind(this, chainId),
|
|
1870
|
-
getConfirmedTransactions: this.getNonceTrackerTransactions.bind(this, types_1.TransactionStatus.confirmed, chainId),
|
|
1938
|
+
getConfirmedTransactions: this.getNonceTrackerTransactions.bind(this, [types_1.TransactionStatus.confirmed], chainId),
|
|
1871
1939
|
});
|
|
1872
1940
|
}, _TransactionController_createPendingTransactionTracker = function _TransactionController_createPendingTransactionTracker({ provider, blockTracker, chainId, networkClientId, }) {
|
|
1873
1941
|
const ethQuery = new eth_query_1.default(provider);
|
|
@@ -1906,7 +1974,11 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
1906
1974
|
pendingTransactionTracker.hub.on('transaction-failed', this.failTransaction.bind(this));
|
|
1907
1975
|
pendingTransactionTracker.hub.on('transaction-updated', this.updateTransaction.bind(this));
|
|
1908
1976
|
}, _TransactionController_getNonceTrackerPendingTransactions = function _TransactionController_getNonceTrackerPendingTransactions(chainId, address) {
|
|
1909
|
-
const standardPendingTransactions = this.getNonceTrackerTransactions(
|
|
1977
|
+
const standardPendingTransactions = this.getNonceTrackerTransactions([
|
|
1978
|
+
types_1.TransactionStatus.approved,
|
|
1979
|
+
types_1.TransactionStatus.signed,
|
|
1980
|
+
types_1.TransactionStatus.submitted,
|
|
1981
|
+
], address, chainId);
|
|
1910
1982
|
const externalPendingTransactions = this.getExternalPendingTransactions(address, chainId);
|
|
1911
1983
|
return [...standardPendingTransactions, ...externalPendingTransactions];
|
|
1912
1984
|
}, _TransactionController_getGasFeeFlows = function _TransactionController_getGasFeeFlows() {
|
|
@@ -2001,8 +2073,9 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
2001
2073
|
},
|
|
2002
2074
|
tokenBalanceChanges: [],
|
|
2003
2075
|
};
|
|
2076
|
+
let gasFeeTokens = [];
|
|
2004
2077
|
if (__classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this)) {
|
|
2005
|
-
|
|
2078
|
+
const result = await __classPrivateFieldGet(this, _TransactionController_trace, "f").call(this, { name: 'Simulate', parentContext: traceContext }, () => (0, simulation_1.getSimulationData)({
|
|
2006
2079
|
chainId,
|
|
2007
2080
|
from: from,
|
|
2008
2081
|
to: to,
|
|
@@ -2011,6 +2084,8 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
2011
2084
|
}, {
|
|
2012
2085
|
blockTime,
|
|
2013
2086
|
}));
|
|
2087
|
+
gasFeeTokens = result?.gasFeeTokens;
|
|
2088
|
+
simulationData = result?.simulationData;
|
|
2014
2089
|
if (blockTime &&
|
|
2015
2090
|
prevSimulationData &&
|
|
2016
2091
|
(0, ResimulateHelper_1.hasSimulationDataChanged)(prevSimulationData, simulationData)) {
|
|
@@ -2031,20 +2106,21 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
2031
2106
|
note: 'TransactionController#updateSimulationData - Update simulation data',
|
|
2032
2107
|
skipResimulateCheck: Boolean(blockTime),
|
|
2033
2108
|
}, (txMeta) => {
|
|
2109
|
+
txMeta.gasFeeTokens = gasFeeTokens;
|
|
2034
2110
|
txMeta.simulationData = simulationData;
|
|
2035
2111
|
});
|
|
2036
2112
|
(0, logger_1.projectLogger)('Updated simulation data', transactionId, simulationData);
|
|
2037
2113
|
}, _TransactionController_onGasFeePollerTransactionUpdate = function _TransactionController_onGasFeePollerTransactionUpdate({ transactionId, gasFeeEstimates, gasFeeEstimatesLoaded, layer1GasFee, }) {
|
|
2038
2114
|
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, skipHistory: true }, (txMeta) => {
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
}
|
|
2115
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
2116
|
+
(0, GasFeePoller_1.updateTransactionGasFees)({
|
|
2117
|
+
txMeta,
|
|
2118
|
+
gasFeeEstimates,
|
|
2119
|
+
gasFeeEstimatesLoaded,
|
|
2120
|
+
getEIP1559Compatibility: this.getEIP1559Compatibility.bind(this),
|
|
2121
|
+
isTxParamsGasFeeUpdatesEnabled: this.isTxParamsGasFeeUpdatesEnabled,
|
|
2122
|
+
layer1GasFee,
|
|
2123
|
+
});
|
|
2048
2124
|
});
|
|
2049
2125
|
}, _TransactionController_getSelectedAccount = function _TransactionController_getSelectedAccount() {
|
|
2050
2126
|
return this.messagingSystem.call('AccountsController:getSelectedAccount');
|
|
@@ -2087,6 +2163,7 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
2087
2163
|
chainId,
|
|
2088
2164
|
ethQuery,
|
|
2089
2165
|
isCustomNetwork,
|
|
2166
|
+
isSimulationEnabled: __classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this),
|
|
2090
2167
|
txMeta: transactionMeta,
|
|
2091
2168
|
});
|
|
2092
2169
|
}, _TransactionController_deleteTransaction = function _TransactionController_deleteTransaction(transactionId) {
|