@metamask-previews/transaction-controller 62.21.0-preview-87d1261 → 62.21.0-preview-54bc644cd

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
@@ -15,11 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
  ### Changed
16
16
 
17
17
  - Bump `@metamask/core-backend` from `^6.1.0` to `^6.1.1` ([#8162](https://github.com/MetaMask/core/pull/8162))
18
- - Add extra parameters in types and change `addTransaction` behavior ([#8052](https://github.com/MetaMask/core/pull/8052))
19
- - Add optional `excludeNativeTokenForFee` in `TransactionMeta` type.
20
- - Add optional `actionId` and optional `excludeNativeTokenForFee` in `TransactionBatchRequest` type.
21
- - Add optional `excludeNativeTokenForFee` to `AddTransactionOptions` type.
22
- - Changed `isGasFeeTokenIgnoredIfBalance` to be false if `excludeNativeTokenForFee` is passed in `addTransaction`.
23
18
 
24
19
  ### Fixed
25
20
 
@@ -384,7 +384,7 @@ class TransactionController extends base_controller_1.BaseController {
384
384
  */
385
385
  async addTransaction(txParams, options) {
386
386
  (0, logger_1.projectLogger)('Adding transaction', txParams, options);
387
- 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;
387
+ const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, isGasFeeIncluded, isGasFeeSponsored, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requiredAssets, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
388
388
  // eslint-disable-next-line no-param-reassign
389
389
  txParams = (0, utils_2.normalizeTransactionParams)(txParams);
390
390
  if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
@@ -422,10 +422,6 @@ class TransactionController extends base_controller_1.BaseController {
422
422
  const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin);
423
423
  const transactionType = type ?? (await (0, transaction_type_1.determineTransactionType)(txParams, ethQuery)).type;
424
424
  const existingTransactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransactionWithActionId).call(this, actionId);
425
- // Original behavior was that this was set to 'true' whenever a gasFeeToken was passed.
426
- // 'excludeNativeTokenForFee' optionnally overrides this behavior to prevent native token from
427
- // being used when another gasFeeToken is set.
428
- const isGasFeeTokenIgnoredIfBalance = Boolean(gasFeeToken) && !excludeNativeTokenForFee;
429
425
  // If a request to add a transaction with the same actionId is submitted again, a new transaction will not be created for it.
430
426
  let addedTransactionMeta = existingTransactionMeta
431
427
  ? (0, lodash_1.cloneDeep)(existingTransactionMeta)
@@ -439,13 +435,9 @@ class TransactionController extends base_controller_1.BaseController {
439
435
  deviceConfirmedOn,
440
436
  disableGasBuffer,
441
437
  id: (0, uuid_1.v1)(),
442
- isGasFeeTokenIgnoredIfBalance,
438
+ isGasFeeTokenIgnoredIfBalance: Boolean(gasFeeToken),
443
439
  isGasFeeIncluded,
444
440
  isGasFeeSponsored,
445
- // To avoid the property to be set as undefined.
446
- ...(excludeNativeTokenForFee === undefined
447
- ? {}
448
- : { excludeNativeTokenForFee }),
449
441
  isFirstTimeInteraction: undefined,
450
442
  isStateOnly,
451
443
  nestedTransactions,