@metamask-previews/transaction-controller 59.1.0-preview-8a39b4da → 59.1.0-preview-eb8c7b7a
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 +5 -0
- package/dist/TransactionController.cjs +6 -3
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts +3 -1
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts +3 -1
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +6 -3
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +4 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +4 -0
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Add optional `updateType` property to disable `type` update in `updateEditableParams` method ([#6289](https://github.com/MetaMask/core/pull/6289))
|
|
13
|
+
- Add `perpsDeposit` to `TransactionType` ([#6282](https://github.com/MetaMask/core/pull/6282))
|
|
14
|
+
|
|
10
15
|
### Changed
|
|
11
16
|
|
|
12
17
|
- Bump `@metamask/base-controller` from `^8.0.1` to `^8.1.0` ([#6284](https://github.com/MetaMask/core/pull/6284))
|
|
@@ -875,11 +875,12 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
875
875
|
* @param params.gasPrice - Price per gas for legacy transactions.
|
|
876
876
|
* @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
|
|
877
877
|
* @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
|
|
878
|
+
* @param params.updateType - Whether to update the transaction type. Defaults to `true`.
|
|
878
879
|
* @param params.to - Address to send the transaction to.
|
|
879
880
|
* @param params.value - Value associated with the transaction.
|
|
880
881
|
* @returns The updated transaction metadata.
|
|
881
882
|
*/
|
|
882
|
-
async updateEditableParams(txId, { containerTypes, data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, value, }) {
|
|
883
|
+
async updateEditableParams(txId, { containerTypes, data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, updateType, value, }) {
|
|
883
884
|
const transactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, txId);
|
|
884
885
|
if (!transactionMeta) {
|
|
885
886
|
throw new Error(`Cannot update editable params as no transaction metadata found`);
|
|
@@ -902,8 +903,10 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
902
903
|
const { networkClientId } = transactionMeta;
|
|
903
904
|
const provider = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getProvider).call(this, { networkClientId });
|
|
904
905
|
const ethQuery = new eth_query_1.default(provider);
|
|
905
|
-
|
|
906
|
-
|
|
906
|
+
if (updateType !== false) {
|
|
907
|
+
const { type } = await (0, transaction_type_1.determineTransactionType)(updatedTransaction.txParams, ethQuery);
|
|
908
|
+
updatedTransaction.type = type;
|
|
909
|
+
}
|
|
907
910
|
if (containerTypes) {
|
|
908
911
|
updatedTransaction.containerTypes = containerTypes;
|
|
909
912
|
}
|