@metamask-previews/transaction-controller 63.1.0-preview-3047a7f → 63.1.0-preview-93f8bb3d0

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,14 +7,6 @@ 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
10
  ## [63.1.0]
19
11
 
20
12
  ### Added
@@ -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, excludeNativeTokenForFee, 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, 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,10 +452,6 @@ 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;
459
455
  let addedTransactionMeta = {
460
456
  actionId,
461
457
  assetsFiatValues,
@@ -465,13 +461,9 @@ class TransactionController extends base_controller_1.BaseController {
465
461
  deviceConfirmedOn,
466
462
  disableGasBuffer,
467
463
  id: (0, uuid_1.v1)(),
468
- isGasFeeTokenIgnoredIfBalance,
464
+ isGasFeeTokenIgnoredIfBalance: Boolean(gasFeeToken),
469
465
  isGasFeeIncluded,
470
466
  isGasFeeSponsored,
471
- // To avoid the property to be set as undefined.
472
- ...(excludeNativeTokenForFee === undefined
473
- ? {}
474
- : { excludeNativeTokenForFee }),
475
467
  isFirstTimeInteraction: undefined,
476
468
  isStateOnly,
477
469
  nestedTransactions,