@metamask-previews/transaction-controller 46.0.0-preview-0ae65d9e → 46.0.0-preview-1b0ea93a
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 -1
- package/dist/TransactionController.cjs +0 -34
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts +0 -14
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts +0 -14
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +1 -35
- package/dist/TransactionController.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
-
- Add `updateAtomicBatchData` method ([#5380](https://github.com/MetaMask/core/pull/5380))
|
|
13
12
|
- Support atomic batch transactions ([#5306](https://github.com/MetaMask/core/pull/5306))
|
|
14
13
|
- Add methods:
|
|
15
14
|
- `addTransactionBatch`
|
|
@@ -1103,37 +1103,6 @@ class TransactionController extends base_controller_1.BaseController {
|
|
|
1103
1103
|
abortCallback();
|
|
1104
1104
|
this.signAbortCallbacks.delete(transactionId);
|
|
1105
1105
|
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Update the transaction data of a single nested transaction within an atomic batch transaction.
|
|
1108
|
-
*
|
|
1109
|
-
* @param options - The options bag.
|
|
1110
|
-
* @param options.transactionId - ID of the atomic batch transaction.
|
|
1111
|
-
* @param options.transactionIndex - Index of the nested transaction within the atomic batch transaction.
|
|
1112
|
-
* @param options.transactionData - New data to set for the nested transaction.
|
|
1113
|
-
* @returns The updated data for the atomic batch transaction.
|
|
1114
|
-
*/
|
|
1115
|
-
updateAtomicBatchData({ transactionId, transactionIndex, transactionData, }) {
|
|
1116
|
-
(0, logger_1.projectLogger)('Updating atomic batch data', {
|
|
1117
|
-
transactionId,
|
|
1118
|
-
transactionIndex,
|
|
1119
|
-
transactionData,
|
|
1120
|
-
});
|
|
1121
|
-
const updatedTransactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, {
|
|
1122
|
-
transactionId,
|
|
1123
|
-
note: 'TransactionController#updateAtomicBatchData - Atomic batch data updated',
|
|
1124
|
-
}, (transactionMeta) => {
|
|
1125
|
-
const { nestedTransactions, txParams } = transactionMeta;
|
|
1126
|
-
const from = txParams.from;
|
|
1127
|
-
const nestedTransaction = nestedTransactions?.[transactionIndex];
|
|
1128
|
-
if (!nestedTransaction) {
|
|
1129
|
-
throw new Error(`Nested transaction not found with index - ${transactionIndex}`);
|
|
1130
|
-
}
|
|
1131
|
-
nestedTransaction.data = transactionData;
|
|
1132
|
-
const batchTransaction = (0, eip7702_1.generateEIP7702BatchTransaction)(from, nestedTransactions);
|
|
1133
|
-
transactionMeta.txParams.data = batchTransaction.data;
|
|
1134
|
-
});
|
|
1135
|
-
return updatedTransactionMeta.txParams.data;
|
|
1136
|
-
}
|
|
1137
1106
|
addMetadata(transactionMeta) {
|
|
1138
1107
|
(0, validation_1.validateTxParams)(transactionMeta.txParams);
|
|
1139
1108
|
this.update((state) => {
|
|
@@ -1919,9 +1888,6 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
|
|
|
1919
1888
|
let resimulateResponse;
|
|
1920
1889
|
this.update((state) => {
|
|
1921
1890
|
const index = state.transactions.findIndex(({ id }) => id === transactionId);
|
|
1922
|
-
if (index === -1) {
|
|
1923
|
-
throw new Error(`Cannot update transaction as ID not found - ${transactionId}`);
|
|
1924
|
-
}
|
|
1925
1891
|
let transactionMeta = state.transactions[index];
|
|
1926
1892
|
const originalTransactionMeta = (0, lodash_1.cloneDeep)(transactionMeta);
|
|
1927
1893
|
transactionMeta = callback(transactionMeta) ?? transactionMeta;
|