@metamask-previews/transaction-controller 62.7.0-preview-9462ebb8 → 62.7.0-preview-cb897e9
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 +6 -3
- package/dist/TransactionController.cjs +11 -4
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +11 -4
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.cjs +3 -2
- package/dist/helpers/PendingTransactionTracker.cjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.d.cts.map +1 -1
- package/dist/helpers/PendingTransactionTracker.d.mts.map +1 -1
- package/dist/helpers/PendingTransactionTracker.mjs +3 -2
- package/dist/helpers/PendingTransactionTracker.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +15 -3
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +15 -3
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
-
- Add optional `
|
|
12
|
+
- Add optional `isStateOnly` property to `TransactionMeta` and `AddTransactionOptions` ([#7591](https://github.com/MetaMask/core/pull/7591))
|
|
13
|
+
- Transactions with `isStateOnly` set to `true` have no lifecycle and are not signed or published.
|
|
14
|
+
- Transactions are also excluded from confirmation polling.
|
|
13
15
|
|
|
14
16
|
### Changed
|
|
15
17
|
|
|
@@ -19,8 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
21
|
- Uses `blockTime` from `acceleratedPolling` feature flag.
|
|
20
22
|
- Deprecate `history` and `sendFlowHistory` properties from `TransactionMeta` and `TransactionController` options ([#7326](https://github.com/MetaMask/core/pull/7326))
|
|
21
23
|
- Bump `@metamask/remote-feature-flag-controller` from `^3.0.0` to `^3.1.0` ([#7519](https://github.com/MetaMask/core/pull/7519))
|
|
22
|
-
- Bump `@metamask/network-controller` from `^27.0.0` to `^27.
|
|
23
|
-
- Bump `@metamask/controller-utils` from `^11.16.0` to `^11.
|
|
24
|
+
- Bump `@metamask/network-controller` from `^27.0.0` to `^27.2.0` ([#7534](https://github.com/MetaMask/core/pull/7534), [#7583](https://github.com/MetaMask/core/pull/7583))
|
|
25
|
+
- Bump `@metamask/controller-utils` from `^11.16.0` to `^11.18.0` ([#7534](https://github.com/MetaMask/core/pull/7534), [#7583](https://github.com/MetaMask/core/pull/7583))
|
|
26
|
+
- Update error message for failed on-chain transactions in `PendingTransactionTracker` ([#7552](https://github.com/MetaMask/core/pull/7552))
|
|
24
27
|
|
|
25
28
|
### Fixed
|
|
26
29
|
|
|
@@ -386,7 +386,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
386
386
|
*/
|
|
387
387
|
async addTransaction(txParams, options) {
|
|
388
388
|
(0, logger_1.projectLogger)('Adding transaction', txParams, options);
|
|
389
|
-
const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, isGasFeeIncluded, isGasFeeSponsored, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
|
|
389
|
+
const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, isGasFeeIncluded, isGasFeeSponsored, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
|
|
390
390
|
// eslint-disable-next-line no-param-reassign
|
|
391
391
|
txParams = (0, utils_2.normalizeTransactionParams)(txParams);
|
|
392
392
|
if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
|
|
@@ -441,6 +441,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
441
441
|
isGasFeeIncluded,
|
|
442
442
|
isGasFeeSponsored,
|
|
443
443
|
isFirstTimeInteraction: undefined,
|
|
444
|
+
isStateOnly,
|
|
444
445
|
nestedTransactions,
|
|
445
446
|
networkClientId,
|
|
446
447
|
origin,
|
|
@@ -515,8 +516,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
515
516
|
return undefined;
|
|
516
517
|
})
|
|
517
518
|
.catch(lodash_1.noop);
|
|
518
|
-
|
|
519
|
-
if (requireApproval !== false) {
|
|
519
|
+
if (requireApproval !== false && !isStateOnly) {
|
|
520
520
|
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateSimulationData).call(this, addedTransactionMeta, {
|
|
521
521
|
traceContext,
|
|
522
522
|
}).catch((error) => {
|
|
@@ -1527,7 +1527,14 @@ _TransactionController_afterAdd = new WeakMap(), _TransactionController_afterSig
|
|
|
1527
1527
|
}
|
|
1528
1528
|
}
|
|
1529
1529
|
}, _TransactionController_processApproval = async function _TransactionController_processApproval(transactionMeta, { actionId, isExisting = false, publishHook, requireApproval, shouldShowRequest = true, traceContext, }) {
|
|
1530
|
-
const transactionId = transactionMeta
|
|
1530
|
+
const { id: transactionId, isStateOnly } = transactionMeta;
|
|
1531
|
+
if (isStateOnly) {
|
|
1532
|
+
__classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, skipValidation: true }, (tx) => {
|
|
1533
|
+
tx.status = types_1.TransactionStatus.submitted;
|
|
1534
|
+
tx.submittedTime = new Date().getTime();
|
|
1535
|
+
});
|
|
1536
|
+
return '';
|
|
1537
|
+
}
|
|
1531
1538
|
let resultCallbacks;
|
|
1532
1539
|
const { meta, isCompleted } = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_isTransactionCompleted).call(this, transactionId);
|
|
1533
1540
|
const finishedPromise = isCompleted
|