@metamask-previews/transaction-controller 63.0.0-preview-222195b7a → 63.0.0-preview-cc3d9fe8e
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 +0 -5
- package/dist/TransactionController.cjs +2 -10
- 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 +2 -10
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +0 -14
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +0 -14
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/batch.cjs +1 -3
- package/dist/utils/batch.cjs.map +1 -1
- package/dist/utils/batch.mjs +1 -3
- package/dist/utils/batch.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,11 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
### Changed
|
|
11
11
|
|
|
12
12
|
- Bump `@metamask/core-backend` from `^6.1.1` to `^6.2.0` ([#8232](https://github.com/MetaMask/core/pull/8232))
|
|
13
|
-
- Add extra parameters in types and change `addTransaction` behavior ([#8052](https://github.com/MetaMask/core/pull/8052))
|
|
14
|
-
- Add optional `excludeNativeTokenForFee` in `TransactionMeta` type.
|
|
15
|
-
- Add optional `actionId` and optional `excludeNativeTokenForFee` in `TransactionBatchRequest` type.
|
|
16
|
-
- Add optional `excludeNativeTokenForFee` to `AddTransactionOptions` type.
|
|
17
|
-
- Changed `isGasFeeTokenIgnoredIfBalance` to be false if `excludeNativeTokenForFee` is passed in `addTransaction`.
|
|
18
13
|
|
|
19
14
|
## [63.0.0]
|
|
20
15
|
|
|
@@ -415,7 +415,7 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
415
415
|
*/
|
|
416
416
|
async addTransaction(txParams, options) {
|
|
417
417
|
(0, logger_1.projectLogger)('Adding transaction', txParams, options);
|
|
418
|
-
const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken,
|
|
418
|
+
const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, gasFeeToken, isGasFeeIncluded, isGasFeeSponsored, isStateOnly, method, nestedTransactions, networkClientId, origin, publishHook, requestId, requiredAssets, requireApproval, securityAlertResponse, skipInitialGasEstimate, swaps = {}, traceContext, type, } = options;
|
|
419
419
|
// eslint-disable-next-line no-param-reassign
|
|
420
420
|
txParams = (0, utils_2.normalizeTransactionParams)(txParams);
|
|
421
421
|
if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
|
|
@@ -453,10 +453,6 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
453
453
|
const dappSuggestedGasFees = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_generateDappSuggestedGasFees).call(this, txParams, origin);
|
|
454
454
|
const transactionType = type ?? (await (0, transaction_type_1.determineTransactionType)(txParams, ethQuery)).type;
|
|
455
455
|
const existingTransactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransactionWithActionId).call(this, actionId);
|
|
456
|
-
// Original behavior was that this was set to 'true' whenever a gasFeeToken was passed.
|
|
457
|
-
// 'excludeNativeTokenForFee' optionnally overrides this behavior to prevent native token from
|
|
458
|
-
// being used when another gasFeeToken is set.
|
|
459
|
-
const isGasFeeTokenIgnoredIfBalance = Boolean(gasFeeToken) && !excludeNativeTokenForFee;
|
|
460
456
|
// If a request to add a transaction with the same actionId is submitted again, a new transaction will not be created for it.
|
|
461
457
|
let addedTransactionMeta = existingTransactionMeta
|
|
462
458
|
? (0, lodash_1.cloneDeep)(existingTransactionMeta)
|
|
@@ -470,13 +466,9 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
470
466
|
deviceConfirmedOn,
|
|
471
467
|
disableGasBuffer,
|
|
472
468
|
id: (0, uuid_1.v1)(),
|
|
473
|
-
isGasFeeTokenIgnoredIfBalance,
|
|
469
|
+
isGasFeeTokenIgnoredIfBalance: Boolean(gasFeeToken),
|
|
474
470
|
isGasFeeIncluded,
|
|
475
471
|
isGasFeeSponsored,
|
|
476
|
-
// To avoid the property to be set as undefined.
|
|
477
|
-
...(excludeNativeTokenForFee === undefined
|
|
478
|
-
? {}
|
|
479
|
-
: { excludeNativeTokenForFee }),
|
|
480
472
|
isFirstTimeInteraction: undefined,
|
|
481
473
|
isStateOnly,
|
|
482
474
|
nestedTransactions,
|