@metamask-previews/transaction-controller 65.4.0-preview-7fd8fb1b3 → 65.4.0-preview-784cc181c

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
@@ -9,9 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Changed
11
11
 
12
- - **BREAKING:** Replace implicit `origin === 'metamask'` trust checks with an explicit `isInternal` flag on `AddTransactionOptions`, `TransactionBatchRequest`, `TransactionMeta`, and `TransactionBatchMeta`; internal callers must now pass `isInternal: true` ([#8633](https://github.com/MetaMask/core/pull/8633))
13
12
  - Bump `@metamask/core-backend` from `^6.2.2` to `^6.3.0` ([#8813](https://github.com/MetaMask/core/pull/8813))
14
- - Bump `@metamask/gas-fee-controller` from `^26.2.1` to `^26.2.2` ([#8834](https://github.com/MetaMask/core/pull/8834))
15
13
 
16
14
  ### Fixed
17
15
 
@@ -412,7 +412,7 @@ class TransactionController extends base_controller_1.BaseController {
412
412
  */
413
413
  async addTransaction(txParams, options) {
414
414
  (0, logger_1.projectLogger)('Adding transaction', txParams, options);
415
- const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, excludeNativeTokenForFee, isGasFeeIncluded, isGasFeeSponsored, isInternal = false, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requiredAssets, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
415
+ 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;
416
416
  // eslint-disable-next-line no-param-reassign
417
417
  txParams = (0, utils_2.normalizeTransactionParams)(txParams);
418
418
  if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
@@ -427,7 +427,6 @@ class TransactionController extends base_controller_1.BaseController {
427
427
  data: txParams.data,
428
428
  from: txParams.from,
429
429
  internalAccounts,
430
- isInternal,
431
430
  origin,
432
431
  permittedAddresses,
433
432
  txParams,
@@ -442,10 +441,10 @@ class TransactionController extends base_controller_1.BaseController {
442
441
  }
443
442
  const isDuplicateBatchId = batchId?.length &&
444
443
  this.state.transactions.some((tx) => tx.batchId?.toLowerCase() === batchId?.toLowerCase());
445
- if (isDuplicateBatchId && !isInternal) {
444
+ if (isDuplicateBatchId && origin && origin !== controller_utils_1.ORIGIN_METAMASK) {
446
445
  throw new rpc_errors_1.JsonRpcError(validation_1.ErrorCode.DuplicateBundleId, 'Batch ID already exists');
447
446
  }
448
- const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin, isInternal);
447
+ const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin);
449
448
  const transactionType = type ??
450
449
  (await (0, transaction_type_1.determineTransactionType)(txParams, {
451
450
  messenger: this.messenger,
@@ -474,7 +473,6 @@ class TransactionController extends base_controller_1.BaseController {
474
473
  ? {}
475
474
  : { excludeNativeTokenForFee }),
476
475
  isFirstTimeInteraction: undefined,
477
- isInternal,
478
476
  isStateOnly,
479
477
  nestedTransactions,
480
478
  networkClientId,
@@ -1949,8 +1947,8 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
1949
1947
  (0, logger_1.projectLogger)('Added incoming transactions to state', finalTransactions.length, finalTransactions);
1950
1948
  });
1951
1949
  this.messenger.publish(`${controllerName}:incomingTransactionsReceived`, finalTransactions);
1952
- }, _TransactionController_generateDappSuggestedGasFees = function _TransactionController_generateDappSuggestedGasFees(txParams, origin, isInternal) {
1953
- if (isInternal || !origin) {
1950
+ }, _TransactionController_generateDappSuggestedGasFees = function _TransactionController_generateDappSuggestedGasFees(txParams, origin) {
1951
+ if (!origin || origin === controller_utils_1.ORIGIN_METAMASK) {
1954
1952
  return undefined;
1955
1953
  }
1956
1954
  const { gasPrice, maxFeePerGas, maxPriorityFeePerGas, gas } = txParams;