Skip to content

Commit 9ceae96

Browse files
authored
feat: Expose TransactionController:wipeTransactions through messenger (MetaMask#8592)
## Explanation This adds `TransactionController:wipeTransactions` to `MESSENGER_EXPOSED_METHODS` and exports the type, as this was missed in MetaMask#8183. ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this only adds a new messenger-exposed method and corresponding TypeScript action type/export, without changing transaction processing logic. > > **Overview** > Adds messenger support for `TransactionController:wipeTransactions` by including it in `MESSENGER_EXPOSED_METHODS` and introducing the corresponding `TransactionControllerWipeTransactionsAction` in the generated method action types. > > Updates the package public API exports and documents the new exposed action in the `transaction-controller` changelog. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4dbc86f. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 2fb50ce commit 9ceae96

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

packages/transaction-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Expose `TransactionController:wipeTransactions` method through `TransactionController` messenger ([#8592](https://github.com/MetaMask/core/pull/8592))
13+
1014
## [64.4.0]
1115

1216
### Changed

packages/transaction-controller/src/TransactionController-method-action-types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ export type TransactionControllerUpdateTransactionAction = {
161161
handler: TransactionController['updateTransaction'];
162162
};
163163

164+
/**
165+
* Remove transactions from state.
166+
*
167+
* @param options - The options bag.
168+
* @param options.address - Remove transactions from this account only. Defaults to all accounts.
169+
* @param options.chainId - Remove transactions for the specified chain only. Defaults to all chains.
170+
*/
171+
export type TransactionControllerWipeTransactionsAction = {
172+
type: `TransactionController:wipeTransactions`;
173+
handler: TransactionController['wipeTransactions'];
174+
};
175+
164176
/**
165177
* Adds external provided transaction to state as confirmed transaction.
166178
*
@@ -367,6 +379,7 @@ export type TransactionControllerMethodActions =
367379
| TransactionControllerEstimateGasBatchAction
368380
| TransactionControllerEstimateGasBufferedAction
369381
| TransactionControllerUpdateTransactionAction
382+
| TransactionControllerWipeTransactionsAction
370383
| TransactionControllerConfirmExternalTransactionAction
371384
| TransactionControllerGetNonceLockAction
372385
| TransactionControllerUpdateEditableParamsAction

packages/transaction-controller/src/TransactionController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ const MESSENGER_EXPOSED_METHODS = [
759759
'updateEditableParams',
760760
'updateIncomingTransactions',
761761
'updateTransaction',
762+
'wipeTransactions',
762763
] as const;
763764

764765
/**

packages/transaction-controller/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export type {
5353
TransactionControllerClearUnapprovedTransactionsAction,
5454
TransactionControllerAbortTransactionSigningAction,
5555
TransactionControllerUpdateAtomicBatchDataAction,
56+
TransactionControllerWipeTransactionsAction,
5657
} from './TransactionController-method-action-types';
5758
export {
5859
CANCEL_RATE,

0 commit comments

Comments
 (0)