@metamask/transaction-controller 65.4.0 → 66.0.1
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 +30 -1
- 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/gas-flows/MantleLayer1GasFeeFlow.cjs +5 -0
- package/dist/gas-flows/MantleLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/MantleLayer1GasFeeFlow.d.cts +1 -0
- package/dist/gas-flows/MantleLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/MantleLayer1GasFeeFlow.d.mts +1 -0
- package/dist/gas-flows/MantleLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/MantleLayer1GasFeeFlow.mjs +5 -0
- package/dist/gas-flows/MantleLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs +15 -3
- package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts +10 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts +10 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs +15 -3
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/hooks/ExtraTransactionsPublishHook.cjs +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.cjs.map +1 -1
- package/dist/hooks/ExtraTransactionsPublishHook.d.cts.map +1 -1
- package/dist/hooks/ExtraTransactionsPublishHook.d.mts.map +1 -1
- package/dist/hooks/ExtraTransactionsPublishHook.mjs +1 -0
- package/dist/hooks/ExtraTransactionsPublishHook.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 +5 -5
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
|
+
## [66.0.1]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bump `@metamask/accounts-controller` from `^38.1.1` to `^39.0.0` ([#8912](https://github.com/MetaMask/core/pull/8912), [#8999](https://github.com/MetaMask/core/pull/8999))
|
|
15
|
+
- Bump `@metamask/core-backend` from `^6.3.0` to `^6.3.2` ([#8912](https://github.com/MetaMask/core/pull/8912), [#8999](https://github.com/MetaMask/core/pull/8999))
|
|
16
|
+
- Bump `@metamask/remote-feature-flag-controller` from `^4.2.1` to `^4.2.2` ([#8986](https://github.com/MetaMask/core/pull/8986))
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Include Mantle operator fee in the displayed L1 gas estimate when simulated `gasUsed` is unavailable, by falling back to the transaction's gas limit ([#8837](https://github.com/MetaMask/core/pull/8837))
|
|
21
|
+
- Adds a `protected getOperatorFeeGas` hook on `OracleLayer1GasFeeFlow` that subclasses can override to supply a fallback value. The default behaviour is unchanged (returns `transactionMeta.gasUsed`).
|
|
22
|
+
- `MantleLayer1GasFeeFlow` overrides the hook with `gasUsed ?? txParams.gas ?? txParams.gasLimit`, so the operator-fee oracle is called with the gas limit when `gasUsed` is missing. Gas limit is an upper bound on actual gas used, so the operator fee is over-estimated rather than under-reported.
|
|
23
|
+
- Fix `ExtraTransactionsPublishHook` not passing `isInternal: true` when calling `addTransactionBatch`, causing the duplicate-batch-ID guard to incorrectly throw `DuplicateBundleId` (error 5720) for nested ERC-20 gas-fee-token transfers that share a `batchId` with their parent batch ([#8884](https://github.com/MetaMask/core/pull/8884))
|
|
24
|
+
|
|
25
|
+
## [66.0.0]
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **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))
|
|
30
|
+
- Bump `@metamask/core-backend` from `^6.2.2` to `^6.3.0` ([#8813](https://github.com/MetaMask/core/pull/8813))
|
|
31
|
+
- Bump `@metamask/gas-fee-controller` from `^26.2.1` to `^26.2.2` ([#8834](https://github.com/MetaMask/core/pull/8834))
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- Respect `excludeNativeTokenForFee` when publishing transactions with a selected gas fee token ([#8762](https://github.com/MetaMask/core/pull/8762))
|
|
36
|
+
|
|
10
37
|
## [65.4.0]
|
|
11
38
|
|
|
12
39
|
### Added
|
|
@@ -2431,7 +2458,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
2431
2458
|
|
|
2432
2459
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
2433
2460
|
|
|
2434
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@
|
|
2461
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@66.0.1...HEAD
|
|
2462
|
+
[66.0.1]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@66.0.0...@metamask/transaction-controller@66.0.1
|
|
2463
|
+
[66.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@65.4.0...@metamask/transaction-controller@66.0.0
|
|
2435
2464
|
[65.4.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@65.3.0...@metamask/transaction-controller@65.4.0
|
|
2436
2465
|
[65.3.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@65.2.0...@metamask/transaction-controller@65.3.0
|
|
2437
2466
|
[65.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@65.1.0...@metamask/transaction-controller@65.2.0
|
|
@@ -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;
|