Skip to content

Commit 89ec333

Browse files
authored
feat(keyring-api): add stake:{deposit,withdraw} transaction types (#394)
<!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? Are there any issues or other links reviewers should consult to understand this pull request better? For instance: * Fixes #12345 * See: #67890 --> ## Examples <!-- Are there any examples of this change being used in another repository? When considering changes to the MetaMask module template, it's strongly preferred that the change be experimented with in another repository first. This gives reviewers a better sense of how the change works, making it less likely the change will need to be reverted or adjusted later. --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds `stake:deposit` and `stake:withdraw` to `TransactionType` and permits them in `TransactionStruct.type`. > > - **API**: > - **Transaction types**: Add `TransactionType.StakeDeposit` (`stake:deposit`) and `TransactionType.StakeWithdraw` (`stake:withdraw`). > - **Schema**: Include the new types in `TransactionStruct.type` enum. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0bea09a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 384c186 commit 89ec333

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/keyring-api/src/api/transaction.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ export enum TransactionType {
155155
*/
156156
BridgeReceive = 'bridge:receive',
157157

158+
/**
159+
* Represents a stake deposit transaction.
160+
*/
161+
StakeDeposit = 'stake:deposit',
162+
163+
/**
164+
* Represents a stake withdrawal transaction.
165+
*/
166+
StakeWithdraw = 'stake:withdraw',
158167
/**
159168
* The transaction type is unknown. It's not possible to determine the
160169
* transaction type based on the information available.
@@ -282,6 +291,8 @@ export const TransactionStruct = object({
282291
`${TransactionType.Swap}`,
283292
`${TransactionType.BridgeSend}`,
284293
`${TransactionType.BridgeReceive}`,
294+
`${TransactionType.StakeDeposit}`,
295+
`${TransactionType.StakeWithdraw}`,
285296
`${TransactionType.Unknown}`,
286297
]),
287298

0 commit comments

Comments
 (0)