@metamask-previews/transaction-controller 62.7.0-preview-a9886279 → 62.8.0-preview-6a568504

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 CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [62.8.0]
11
+
12
+ ### Added
13
+
14
+ - Add optional `targetFiat` property to `MetamaskPayMetadata` type ([#7562](https://github.com/MetaMask/core/pull/7562))
15
+ - Add optional `isStateOnly` property to `TransactionMeta` and `AddTransactionOptions` ([#7591](https://github.com/MetaMask/core/pull/7591))
16
+ - Transactions with `isStateOnly` set to `true` have no lifecycle and are not signed or published.
17
+ - Transactions are also excluded from confirmation polling.
18
+
10
19
  ### Changed
11
20
 
12
21
  - Bump `@metamask/remote-feature-flag-controller` from `^3.1.0` to `^4.0.0` ([#7546](https://github.com/MetaMask/core/pull/7546))
@@ -15,8 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
24
  - Uses `blockTime` from `acceleratedPolling` feature flag.
16
25
  - Deprecate `history` and `sendFlowHistory` properties from `TransactionMeta` and `TransactionController` options ([#7326](https://github.com/MetaMask/core/pull/7326))
17
26
  - Bump `@metamask/remote-feature-flag-controller` from `^3.0.0` to `^3.1.0` ([#7519](https://github.com/MetaMask/core/pull/7519))
18
- - Bump `@metamask/network-controller` from `^27.0.0` to `^27.1.0` ([#7534](https://github.com/MetaMask/core/pull/7534))
19
- - Bump `@metamask/controller-utils` from `^11.16.0` to `^11.17.0` ([#7534](https://github.com/MetaMask/core/pull/7534))
27
+ - 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))
28
+ - 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))
20
29
  - Update error message for failed on-chain transactions in `PendingTransactionTracker` ([#7552](https://github.com/MetaMask/core/pull/7552))
21
30
 
22
31
  ### Fixed
@@ -2051,7 +2060,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2051
2060
 
2052
2061
  All changes listed after this point were applied to this package following the monorepo conversion.
2053
2062
 
2054
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.7.0...HEAD
2063
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.8.0...HEAD
2064
+ [62.8.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.7.0...@metamask/transaction-controller@62.8.0
2055
2065
  [62.7.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.6.0...@metamask/transaction-controller@62.7.0
2056
2066
  [62.6.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.5.0...@metamask/transaction-controller@62.6.0
2057
2067
  [62.5.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.4.0...@metamask/transaction-controller@62.5.0
@@ -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
- // eslint-disable-next-line no-negated-condition
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.id;
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