@metamask-previews/transaction-controller 63.3.1-preview-a560ee403 → 63.3.1-preview-bb9040b29
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 +6 -0
- package/dist/TransactionController.cjs +12 -2
- 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 +12 -2
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +16 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +16 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/batch.cjs +3 -1
- package/dist/utils/batch.cjs.map +1 -1
- package/dist/utils/batch.mjs +3 -1
- package/dist/utils/batch.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
### Changed
|
|
11
11
|
|
|
12
12
|
- Bump `@metamask/accounts-controller` from `^37.1.0` to `^37.1.1` ([#8325](https://github.com/MetaMask/core/pull/8325))
|
|
13
|
+
- Bump `@metamask/controller-utils` from `^11.19.0` to `^11.20.0` ([#8344](https://github.com/MetaMask/core/pull/8344))
|
|
14
|
+
- Add extra parameters in types and change `addTransaction` behavior ([#8052](https://github.com/MetaMask/core/pull/8052))
|
|
15
|
+
- Add optional `excludeNativeTokenForFee` in `TransactionMeta` type.
|
|
16
|
+
- Add optional `actionId` and optional `excludeNativeTokenForFee` in `TransactionBatchRequest` type.
|
|
17
|
+
- Add optional `excludeNativeTokenForFee` to `AddTransactionOptions` type.
|
|
18
|
+
- Changed `isGasFeeTokenIgnoredIfBalance` to be false if `excludeNativeTokenForFee` is passed in `addTransaction`.
|
|
13
19
|
|
|
14
20
|
### Removed
|
|
15
21
|
|
|
@@ -405,7 +405,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
405
405
|
*/
|
|
406
406
|
async addTransaction(txParams, options) {
|
|
407
407
|
(0, logger_1.projectLogger)('Adding transaction', txParams, options);
|
|
408
|
-
const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, isGasFeeIncluded, isGasFeeSponsored, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requiredAssets, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
|
|
408
|
+
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;
|
|
409
409
|
// eslint-disable-next-line no-param-reassign
|
|
410
410
|
txParams = (0, utils_2.normalizeTransactionParams)(txParams);
|
|
411
411
|
if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
|
|
@@ -443,6 +443,12 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
443
443
|
messenger: this.messenger,
|
|
444
444
|
networkClientId,
|
|
445
445
|
})).type;
|
|
446
|
+
/**
|
|
447
|
+
* Original behavior was that this was set to 'true' whenever a gasFeeToken was passed.
|
|
448
|
+
* 'excludeNativeTokenForFee' optionally overrides this behavior to prevent native token from
|
|
449
|
+
* being used when another gasFeeToken is set.
|
|
450
|
+
*/
|
|
451
|
+
const isGasFeeTokenIgnoredIfBalance = Boolean(gasFeeToken) && !excludeNativeTokenForFee;
|
|
446
452
|
let addedTransactionMeta = {
|
|
447
453
|
actionId,
|
|
448
454
|
assetsFiatValues,
|
|
@@ -452,9 +458,13 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
452
458
|
deviceConfirmedOn,
|
|
453
459
|
disableGasBuffer,
|
|
454
460
|
id: (0, uuid_1.v1)(),
|
|
455
|
-
isGasFeeTokenIgnoredIfBalance
|
|
461
|
+
isGasFeeTokenIgnoredIfBalance,
|
|
456
462
|
isGasFeeIncluded,
|
|
457
463
|
isGasFeeSponsored,
|
|
464
|
+
// To avoid the property to be set as undefined.
|
|
465
|
+
...(excludeNativeTokenForFee === undefined
|
|
466
|
+
? {}
|
|
467
|
+
: { excludeNativeTokenForFee }),
|
|
458
468
|
isFirstTimeInteraction: undefined,
|
|
459
469
|
isStateOnly,
|
|
460
470
|
nestedTransactions,
|