@metamask-previews/transaction-controller 65.4.0-preview-b6651eda2 → 65.4.0-preview-bfa94c060
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 +10 -0
- package/dist/TransactionController.cjs +7 -5
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +7 -5
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +8 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +8 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/batch.cjs +7 -3
- package/dist/utils/batch.cjs.map +1 -1
- package/dist/utils/batch.d.cts.map +1 -1
- package/dist/utils/batch.d.mts.map +1 -1
- package/dist/utils/batch.mjs +7 -3
- package/dist/utils/batch.mjs.map +1 -1
- package/dist/utils/gas-fee-tokens.cjs +13 -10
- package/dist/utils/gas-fee-tokens.cjs.map +1 -1
- package/dist/utils/gas-fee-tokens.d.cts.map +1 -1
- package/dist/utils/gas-fee-tokens.d.mts.map +1 -1
- package/dist/utils/gas-fee-tokens.mjs +13 -10
- package/dist/utils/gas-fee-tokens.mjs.map +1 -1
- package/dist/utils/gas-fees.cjs +2 -2
- package/dist/utils/gas-fees.cjs.map +1 -1
- package/dist/utils/gas-fees.d.cts.map +1 -1
- package/dist/utils/gas-fees.d.mts.map +1 -1
- package/dist/utils/gas-fees.mjs +3 -3
- package/dist/utils/gas-fees.mjs.map +1 -1
- package/dist/utils/validation.cjs +15 -14
- package/dist/utils/validation.cjs.map +1 -1
- package/dist/utils/validation.d.cts +6 -2
- package/dist/utils/validation.d.cts.map +1 -1
- package/dist/utils/validation.d.mts +6 -2
- package/dist/utils/validation.d.mts.map +1 -1
- package/dist/utils/validation.mjs +16 -15
- package/dist/utils/validation.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ 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
|
+
- **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
|
+
- 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
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Respect `excludeNativeTokenForFee` when publishing transactions with a selected gas fee token ([#8762](https://github.com/MetaMask/core/pull/8762))
|
|
19
|
+
|
|
10
20
|
## [65.4.0]
|
|
11
21
|
|
|
12
22
|
### Added
|
|
@@ -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, 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, isInternal = false, 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,6 +427,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
427
427
|
data: txParams.data,
|
|
428
428
|
from: txParams.from,
|
|
429
429
|
internalAccounts,
|
|
430
|
+
isInternal,
|
|
430
431
|
origin,
|
|
431
432
|
permittedAddresses,
|
|
432
433
|
txParams,
|
|
@@ -441,10 +442,10 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
441
442
|
}
|
|
442
443
|
const isDuplicateBatchId = batchId?.length &&
|
|
443
444
|
this.state.transactions.some((tx) => tx.batchId?.toLowerCase() === batchId?.toLowerCase());
|
|
444
|
-
if (isDuplicateBatchId &&
|
|
445
|
+
if (isDuplicateBatchId && !isInternal) {
|
|
445
446
|
throw new rpc_errors_1.JsonRpcError(validation_1.ErrorCode.DuplicateBundleId, 'Batch ID already exists');
|
|
446
447
|
}
|
|
447
|
-
const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin);
|
|
448
|
+
const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin, isInternal);
|
|
448
449
|
const transactionType = type ??
|
|
449
450
|
(await (0, transaction_type_1.determineTransactionType)(txParams, {
|
|
450
451
|
messenger: this.messenger,
|
|
@@ -473,6 +474,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
473
474
|
? {}
|
|
474
475
|
: { excludeNativeTokenForFee }),
|
|
475
476
|
isFirstTimeInteraction: undefined,
|
|
477
|
+
isInternal,
|
|
476
478
|
isStateOnly,
|
|
477
479
|
nestedTransactions,
|
|
478
480
|
networkClientId,
|
|
@@ -1947,8 +1949,8 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
|
|
|
1947
1949
|
(0, logger_1.projectLogger)('Added incoming transactions to state', finalTransactions.length, finalTransactions);
|
|
1948
1950
|
});
|
|
1949
1951
|
this.messenger.publish(`${controllerName}:incomingTransactionsReceived`, finalTransactions);
|
|
1950
|
-
}, _TransactionController_generateDappSuggestedGasFees = function _TransactionController_generateDappSuggestedGasFees(txParams, origin) {
|
|
1951
|
-
if (
|
|
1952
|
+
}, _TransactionController_generateDappSuggestedGasFees = function _TransactionController_generateDappSuggestedGasFees(txParams, origin, isInternal) {
|
|
1953
|
+
if (isInternal || !origin) {
|
|
1952
1954
|
return undefined;
|
|
1953
1955
|
}
|
|
1954
1956
|
const { gasPrice, maxFeePerGas, maxPriorityFeePerGas, gas } = txParams;
|