@metamask-previews/transaction-controller 63.2.0-preview-55f19615e → 63.3.1-preview-4f74a56

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,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - Add extra parameters in types and change `addTransaction` behavior ([#8052](https://github.com/MetaMask/core/pull/8052))
13
+ - Add optional `excludeNativeTokenForFee` in `TransactionMeta` type.
14
+ - Add optional `actionId` and optional `excludeNativeTokenForFee` in `TransactionBatchRequest` type.
15
+ - Add optional `excludeNativeTokenForFee` to `AddTransactionOptions` type.
16
+ - Changed `isGasFeeTokenIgnoredIfBalance` to be false if `excludeNativeTokenForFee` is passed in `addTransaction`.
17
+
18
+ ## [63.3.1]
19
+
20
+ ### Changed
21
+
22
+ - Bump `@metamask/accounts-controller` from `^37.0.0` to `^37.1.0` ([#8317](https://github.com/MetaMask/core/pull/8317))
23
+ - Bump `@metamask/approval-controller` from `^9.0.0` to `^9.0.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
24
+ - Bump `@metamask/base-controller` from `^9.0.0` to `^9.0.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
25
+ - Bump `@metamask/core-backend` from `^6.2.0` to `^6.2.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
26
+ - Bump `@metamask/gas-fee-controller` from `^26.1.0` to `^26.1.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
27
+ - Bump `@metamask/messenger` from `^0.3.0` to `^1.0.0` ([#8317](https://github.com/MetaMask/core/pull/8317))
28
+ - Bump `@metamask/network-controller` from `^30.0.0` to `^30.0.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
29
+ - Bump `@metamask/remote-feature-flag-controller` from `^4.1.0` to `^4.2.0` ([#8317](https://github.com/MetaMask/core/pull/8317))
30
+
31
+ ## [63.3.0]
32
+
33
+ ### Added
34
+
35
+ - Adding new transaction types for Money Account ([#8312](https://github.com/MetaMask/core/pull/8312))
36
+
10
37
  ## [63.2.0]
11
38
 
12
39
  ### Changed
@@ -2271,7 +2298,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2271
2298
 
2272
2299
  All changes listed after this point were applied to this package following the monorepo conversion.
2273
2300
 
2274
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.2.0...HEAD
2301
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.3.1...HEAD
2302
+ [63.3.1]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.3.0...@metamask/transaction-controller@63.3.1
2303
+ [63.3.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.2.0...@metamask/transaction-controller@63.3.0
2275
2304
  [63.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.1.0...@metamask/transaction-controller@63.2.0
2276
2305
  [63.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@63.0.0...@metamask/transaction-controller@63.1.0
2277
2306
  [63.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@62.22.0...@metamask/transaction-controller@63.0.0
@@ -415,7 +415,7 @@ class TransactionController extends base_controller_1.BaseController {
415
415
  */
416
416
  async addTransaction(txParams, options) {
417
417
  (0, logger_1.projectLogger)('Adding transaction', txParams, options);
418
- const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, isGasFeeIncluded, isGasFeeSponsored, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requiredAssets, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
418
+ const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, excludeNativeTokenForFee, isGasFeeIncluded, isGasFeeSponsored, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requiredAssets, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
419
419
  // eslint-disable-next-line no-param-reassign
420
420
  txParams = (0, utils_2.normalizeTransactionParams)(txParams);
421
421
  if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
@@ -452,6 +452,10 @@ class TransactionController extends base_controller_1.BaseController {
452
452
  }
453
453
  const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin);
454
454
  const transactionType = type ?? (await (0, transaction_type_1.determineTransactionType)(txParams, ethQuery)).type;
455
+ // Original behavior was that this was set to 'true' whenever a gasFeeToken was passed.
456
+ // 'excludeNativeTokenForFee' optionnally overrides this behavior to prevent native token from
457
+ // being used when another gasFeeToken is set.
458
+ const isGasFeeTokenIgnoredIfBalance = Boolean(gasFeeToken) && !excludeNativeTokenForFee;
455
459
  let addedTransactionMeta = {
456
460
  actionId,
457
461
  assetsFiatValues,
@@ -461,9 +465,13 @@ class TransactionController extends base_controller_1.BaseController {
461
465
  deviceConfirmedOn,
462
466
  disableGasBuffer,
463
467
  id: (0, uuid_1.v1)(),
464
- isGasFeeTokenIgnoredIfBalance: Boolean(gasFeeToken),
468
+ isGasFeeTokenIgnoredIfBalance,
465
469
  isGasFeeIncluded,
466
470
  isGasFeeSponsored,
471
+ // To avoid the property to be set as undefined.
472
+ ...(excludeNativeTokenForFee === undefined
473
+ ? {}
474
+ : { excludeNativeTokenForFee }),
467
475
  isFirstTimeInteraction: undefined,
468
476
  isStateOnly,
469
477
  nestedTransactions,