@metamask/keyring-api 23.1.0 → 23.3.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +25 -4
  2. package/dist/api/transaction.cjs +19 -3
  3. package/dist/api/transaction.cjs.map +1 -1
  4. package/dist/api/transaction.d.cts +44 -12
  5. package/dist/api/transaction.d.cts.map +1 -1
  6. package/dist/api/transaction.d.mts +44 -12
  7. package/dist/api/transaction.d.mts.map +1 -1
  8. package/dist/api/transaction.mjs +19 -3
  9. package/dist/api/transaction.mjs.map +1 -1
  10. package/dist/eth/types.cjs +5 -2
  11. package/dist/eth/types.cjs.map +1 -1
  12. package/dist/eth/types.d.cts +1 -0
  13. package/dist/eth/types.d.cts.map +1 -1
  14. package/dist/eth/types.d.mts +1 -0
  15. package/dist/eth/types.d.mts.map +1 -1
  16. package/dist/eth/types.mjs +4 -1
  17. package/dist/eth/types.mjs.map +1 -1
  18. package/dist/eth/utils.cjs +2 -1
  19. package/dist/eth/utils.cjs.map +1 -1
  20. package/dist/events.d.cts +6 -3
  21. package/dist/events.d.cts.map +1 -1
  22. package/dist/events.d.mts +6 -3
  23. package/dist/events.d.mts.map +1 -1
  24. package/dist/rpc.cjs +2 -2
  25. package/dist/rpc.cjs.map +1 -1
  26. package/dist/rpc.d.cts +10 -4
  27. package/dist/rpc.d.cts.map +1 -1
  28. package/dist/rpc.d.mts +10 -4
  29. package/dist/rpc.d.mts.map +1 -1
  30. package/dist/v2/api/create-account/index.cjs +2 -2
  31. package/dist/v2/api/create-account/index.cjs.map +1 -1
  32. package/dist/v2/api/keyring-rpc.cjs +2 -2
  33. package/dist/v2/api/keyring-rpc.cjs.map +1 -1
  34. package/dist/xlm/types.cjs +1 -0
  35. package/dist/xlm/types.cjs.map +1 -1
  36. package/dist/xlm/types.d.cts +3 -1
  37. package/dist/xlm/types.d.cts.map +1 -1
  38. package/dist/xlm/types.d.mts +3 -1
  39. package/dist/xlm/types.d.mts.map +1 -1
  40. package/dist/xlm/types.mjs +1 -0
  41. package/dist/xlm/types.mjs.map +1 -1
  42. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [23.3.0]
11
+
12
+ ### Added
13
+
14
+ - Add `TransactionType.TokenDisapprove` for token disapproval transactions ([#568](https://github.com/MetaMask/accounts/pull/568))
15
+ - Add optional `TransactionDetails.typeLabel` ([#568](https://github.com/MetaMask/accounts/pull/568))
16
+ - This can be used to display a custom label regarding the transaction type.
17
+
18
+ ## [23.2.0]
19
+
20
+ ### Added
21
+
22
+ - Add Stellar method `signAuthEntry` to `XlmMethod` ([#548](https://github.com/MetaMask/accounts/pull/548))
23
+ - Add `EthBytesStrictStruct` ([#555](https://github.com/MetaMask/accounts/pull/555))
24
+
25
+ ### Changed
26
+
27
+ - Bump `@metamask/keyring-utils` from `^3.2.0` to `^3.3.1` ([#544](https://github.com/MetaMask/accounts/pull/544), [#546](https://github.com/MetaMask/accounts/pull/546))
28
+
10
29
  ## [23.1.0]
11
30
 
12
31
  ### Added
@@ -36,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
36
55
  - `KeyringCapabilities`, `KeyringType`, account creation options (except `CreateAccountOptions`), and account export options are now exclusively available from `@metamask/keyring-api/v2`.
37
56
  - `CreateAccountOptions` and its subtypes (`Bip44CreateAccountOptions`, `PrivateKeyCreateAccountOptions`, `CustomCreateAccountOptions`) remain available from both `@metamask/keyring-api` and `@metamask/keyring-api/v2`.
38
57
  - Improve return type of `isKeyringRpcMethod` to use type predicate `method is KeyringRpcMethod` ([#408](https://github.com/MetaMask/accounts/pull/408))
39
- - Bump `@metamask/utils` from `^11.1.0` to `^11.11.0` ([#489](https://github.com/MetaMask/accounts/pull/489)), ([#483](https://github.com/MetaMask/accounts/pull/483))
58
+ - Bump `@metamask/utils` from `^11.1.0` to `^11.11.0` ([#489](https://github.com/MetaMask/accounts/pull/489), [#483](https://github.com/MetaMask/accounts/pull/483))
40
59
 
41
60
  ## [22.0.0]
42
61
 
@@ -89,7 +108,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
89
108
  - Add `AccountCreationType.Custom` and `CreateAccountCustomOptions` for custom account creation flows.
90
109
  - Add `EthKeyringWrapper` abstract class for Ethereum-based `KeyringV2` implementations ([#404](https://github.com/MetaMask/accounts/pull/404))
91
110
  - Provides common Ethereum signing method routing (`submitRequest`) for all Ethereum-based keyrings.
92
- - Add `KeyringWrapper` base class to adapt legacy keyrings to `KeyringV2` ([#398](https://github.com/MetaMask/accounts/pull/398)),([#402](https://github.com/MetaMask/accounts/pull/402)), ([#409](https://github.com/MetaMask/accounts/pull/409)), ([#410](https://github.com/MetaMask/accounts/pull/410))
111
+ - Add `KeyringWrapper` base class to adapt legacy keyrings to `KeyringV2` ([#398](https://github.com/MetaMask/accounts/pull/398), [#402](https://github.com/MetaMask/accounts/pull/402), [#409](https://github.com/MetaMask/accounts/pull/409), [#410](https://github.com/MetaMask/accounts/pull/410))
93
112
 
94
113
  ### Changed
95
114
 
@@ -130,7 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
130
149
 
131
150
  ### Added
132
151
 
133
- - **BREAKING:** Add new bitcoin methods to `BtcMethod` enum ([#355](https://github.com/MetaMask/accounts/pull/355)), ([#356](https://github.com/MetaMask/accounts/pull/356))
152
+ - **BREAKING:** Add new bitcoin methods to `BtcMethod` enum ([#355](https://github.com/MetaMask/accounts/pull/355), [#356](https://github.com/MetaMask/accounts/pull/356))
134
153
  - This change was not properly reported as breaking on the `20.1.1`.
135
154
 
136
155
  ### Removed
@@ -749,7 +768,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
749
768
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
750
769
  - Helper functions to create keyring handler in the snap.
751
770
 
752
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.1.0...HEAD
771
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.3.0...HEAD
772
+ [23.3.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.2.0...@metamask/keyring-api@23.3.0
773
+ [23.2.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.1.0...@metamask/keyring-api@23.2.0
753
774
  [23.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.0.1...@metamask/keyring-api@23.1.0
754
775
  [23.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.0.0...@metamask/keyring-api@23.0.1
755
776
  [23.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@22.0.0...@metamask/keyring-api@23.0.0
@@ -153,6 +153,10 @@ var TransactionType;
153
153
  * Represents a token approval transaction.
154
154
  */
155
155
  TransactionType["TokenApprove"] = "token:approve";
156
+ /**
157
+ * Represents a token disapproval transaction.
158
+ */
159
+ TransactionType["TokenDisapprove"] = "token:disapprove";
156
160
  /**
157
161
  * The transaction type is unknown. It's not possible to determine the
158
162
  * transaction type based on the information available.
@@ -195,6 +199,13 @@ var SecurityAlertResponse;
195
199
  * securityAlertResponse: 'Warning',
196
200
  * }
197
201
  * ```
202
+ *
203
+ * @example
204
+ * ```ts
205
+ * {
206
+ * typeLabel: 'Some label',
207
+ * }
208
+ * ```
198
209
  */
199
210
  exports.TransactionDetailsStruct = (0, keyring_utils_1.object)({
200
211
  /**
@@ -213,6 +224,10 @@ exports.TransactionDetailsStruct = (0, keyring_utils_1.object)({
213
224
  `${SecurityAlertResponse.Warning}`,
214
225
  `${SecurityAlertResponse.Malicious}`,
215
226
  ])),
227
+ /**
228
+ * Optional transaction type label (for UI display purposes).
229
+ */
230
+ typeLabel: (0, keyring_utils_1.exactOptional)((0, superstruct_1.string)()),
216
231
  });
217
232
  /**
218
233
  * This struct represents a transaction event.
@@ -330,6 +345,7 @@ exports.TransactionStruct = (0, keyring_utils_1.object)({
330
345
  `${TransactionType.StakeDeposit}`,
331
346
  `${TransactionType.StakeWithdraw}`,
332
347
  `${TransactionType.TokenApprove}`,
348
+ `${TransactionType.TokenDisapprove}`,
333
349
  `${TransactionType.Unknown}`,
334
350
  ]),
335
351
  /**
@@ -354,9 +370,9 @@ exports.TransactionStruct = (0, keyring_utils_1.object)({
354
370
  /**
355
371
  * Additional transaction details {@see TransactionDetailsStruct}.
356
372
  *
357
- * Contains contextual information about the transaction such as its origin and
358
- * security assessment. This field is optional and may not be present for all
359
- * transactions.
373
+ * Contains contextual information about the transaction such as its origin,
374
+ * security assessment, and optional `typeLabel`. This field is optional and
375
+ * may not be present for all transactions.
360
376
  */
361
377
  details: (0, keyring_utils_1.exactOptional)(exports.TransactionDetailsStruct),
362
378
  });
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.cjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":";;;AACA,2DAA4E;AAE5E,uDAA+E;AAE/E,uCAAsC;AACtC,qCAA2C;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,iBAAiB,GAAG,IAAA,sBAAM,EAAC;IAC/B;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,KAAK,EAAE,IAAA,sBAAQ,EAAC,mBAAW,CAAC;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB;;;;;;OAMG;IACH,wBAAa,CAAA;IAEb;;;;;OAKG;IACH,gCAAqB,CAAA;AACvB,CAAC,EAjBW,OAAO,uBAAP,OAAO,QAiBlB;AAED;;GAEG;AACH,MAAM,SAAS,GAAG,IAAA,sBAAM,EAAC;IACvB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EA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AAe,CAAC,aAAa,EAAE;QAClC,GAAG,eAAe,CAAC,YAAY,EAAE;QACjC,GAAG,eAAe,CAAC,aAAa,EAAE;QAClC,GAAG,eAAe,CAAC,YAAY,EAAE;QACjC,GAAG,eAAe,CAAC,OAAO,EAAE;KAC7B,CAAC;IAEF;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,iBAAiB,CAAC;IAE9B;;OAEG;IACH,EAAE,EAAE,IAAA,mBAAK,EAAC,iBAAiB,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC,8BAAsB,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,EAAE,IAAA,6BAAa,EAAC,gCAAwB,CAAC;CACjD,CAAC,CAAC;AAgBH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,yBAAiB,CAAC;IAE9B;;;OAGG;IACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\n\nimport { AssetStruct } from './asset';\nimport { CaipChainIdStruct } from './caip';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n\n /**\n * The transaction is a swap. It decreases the balance of one asset and\n * increases the balance of another asset in a single transaction.\n *\n * A swap transaction must be originated by the account.\n */\n Swap = 'swap',\n\n /**\n * Represents an outgoing bridge transaction, transferring assets from\n * the account to another blockchain.\n */\n BridgeSend = 'bridge:send',\n\n /**\n * Represents an incoming bridge transaction, transferring assets from\n * another blockchain to the account.\n */\n BridgeReceive = 'bridge:receive',\n\n /**\n * Represents a stake deposit transaction.\n */\n StakeDeposit = 'stake:deposit',\n\n /**\n * Represents a stake withdrawal transaction.\n */\n StakeWithdraw = 'stake:withdraw',\n\n /**\n * Represents a token approval transaction.\n */\n TokenApprove = 'token:approve',\n\n /**\n * The transaction type is unknown. It's not possible to determine the\n * transaction type based on the information available.\n */\n Unknown = 'unknown',\n}\n\n/**\n * Security alert response values from the Security Alert API.\n */\nexport enum SecurityAlertResponse {\n /**\n * The transaction is considered safe with no detected security issues.\n */\n Benign = 'Benign',\n\n /**\n * The transaction has potential security concerns that warrant user attention.\n */\n Warning = 'Warning',\n\n /**\n * The transaction has been identified as malicious and should be avoided.\n */\n Malicious = 'Malicious',\n}\n\n/**\n * This struct represents additional transaction details.\n *\n * @example\n * ```ts\n * {\n * origin: 'https://dapp.example.com',\n * securityAlertResponse: 'Benign',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * origin: 'metamask',\n * securityAlertResponse: 'Warning',\n * }\n * ```\n */\nexport const TransactionDetailsStruct = object({\n /**\n * Origin of the original transaction request.\n *\n * This can be either 'metamask' for internally initiated transactions, or a URL\n * (e.g., 'https://dapp.example.com') for dapp-initiated transactions.\n */\n origin: exactOptional(string()),\n\n /**\n * Response from the Security Alert API indicating the security assessment of the\n * transaction.\n */\n securityAlertResponse: exactOptional(\n enums([\n `${SecurityAlertResponse.Benign}`,\n `${SecurityAlertResponse.Warning}`,\n `${SecurityAlertResponse.Malicious}`,\n ]),\n ),\n});\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([\n `${TransactionType.Send}`,\n `${TransactionType.Receive}`,\n `${TransactionType.Swap}`,\n `${TransactionType.BridgeSend}`,\n `${TransactionType.BridgeReceive}`,\n `${TransactionType.StakeDeposit}`,\n `${TransactionType.StakeWithdraw}`,\n `${TransactionType.TokenApprove}`,\n `${TransactionType.Unknown}`,\n ]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n\n /**\n * Additional transaction details {@see TransactionDetailsStruct}.\n *\n * Contains contextual information about the transaction such as its origin and\n * security assessment. This field is optional and may not be present for all\n * transactions.\n */\n details: exactOptional(TransactionDetailsStruct),\n});\n\n/**\n * Transaction details object.\n *\n * See {@link TransactionDetailsStruct}.\n */\nexport type TransactionDetails = Infer<typeof TransactionDetailsStruct>;\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
1
+ {"version":3,"file":"transaction.cjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":";;;AACA,2DAA4E;AAE5E,uDAA+E;AAE/E,uCAAsC;AACtC,qCAA2C;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,iBAAiB,GAAG,IAAA,sBAAM,EAAC;IAC/B;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,KAAK,EAAE,IAAA,sBAAQ,EAAC,mBAAW,CAAC;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB;;;;;;OAMG;IACH,wBAAa,CAAA;IAEb;;;;;OAKG;IACH,gCAAqB,CAAA;AACvB,CAAC,EAjBW,OAAO,uBAAP,OAAO,QAiBlB;AAED;;GAEG;AACH,MAAM,SAAS,GAAG,IAAA,sBAAM,EAAC;IACvB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEvD;;OAEG;IACH,KAAK,EAAE,mBAAW;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,IAAY,iBAsBX;AAtBD,WAAY,iBAAiB;IAC3B;;;OAGG;IACH,4CAAuB,CAAA;IAEvB;;;OAGG;IACH,gDAA2B,CAAA;IAE3B;;OAEG;IACH,4CAAuB,CAAA;IAEvB;;OAEG;IACH,sCAAiB,CAAA;AACnB,CAAC,EAtBW,iBAAiB,iCAAjB,iBAAiB,QAsB5B;AAED;;GAEG;AACH,IAAY,eA2DX;AA3DD,WAAY,eAAe;IACzB;;;;OAIG;IACH,gCAAa,CAAA;IAEb;;;OAGG;IACH,sCAAmB,CAAA;IAEnB;;;;;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AAI,EAAE,IAAA,mBAAK,EAAC,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC,8BAAsB,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,EAAE,IAAA,6BAAa,EAAC,gCAAwB,CAAC;CACjD,CAAC,CAAC;AAgBH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,yBAAiB,CAAC;IAE9B;;;OAGG;IACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\n\nimport { AssetStruct } from './asset';\nimport { CaipChainIdStruct } from './caip';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n\n /**\n * The transaction is a swap. It decreases the balance of one asset and\n * increases the balance of another asset in a single transaction.\n *\n * A swap transaction must be originated by the account.\n */\n Swap = 'swap',\n\n /**\n * Represents an outgoing bridge transaction, transferring assets from\n * the account to another blockchain.\n */\n BridgeSend = 'bridge:send',\n\n /**\n * Represents an incoming bridge transaction, transferring assets from\n * another blockchain to the account.\n */\n BridgeReceive = 'bridge:receive',\n\n /**\n * Represents a stake deposit transaction.\n */\n StakeDeposit = 'stake:deposit',\n\n /**\n * Represents a stake withdrawal transaction.\n */\n StakeWithdraw = 'stake:withdraw',\n\n /**\n * Represents a token approval transaction.\n */\n TokenApprove = 'token:approve',\n\n /**\n * Represents a token disapproval transaction.\n */\n TokenDisapprove = 'token:disapprove',\n\n /**\n * The transaction type is unknown. It's not possible to determine the\n * transaction type based on the information available.\n */\n Unknown = 'unknown',\n}\n\n/**\n * Security alert response values from the Security Alert API.\n */\nexport enum SecurityAlertResponse {\n /**\n * The transaction is considered safe with no detected security issues.\n */\n Benign = 'Benign',\n\n /**\n * The transaction has potential security concerns that warrant user attention.\n */\n Warning = 'Warning',\n\n /**\n * The transaction has been identified as malicious and should be avoided.\n */\n Malicious = 'Malicious',\n}\n\n/**\n * This struct represents additional transaction details.\n *\n * @example\n * ```ts\n * {\n * origin: 'https://dapp.example.com',\n * securityAlertResponse: 'Benign',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * origin: 'metamask',\n * securityAlertResponse: 'Warning',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * typeLabel: 'Some label',\n * }\n * ```\n */\nexport const TransactionDetailsStruct = object({\n /**\n * Origin of the original transaction request.\n *\n * This can be either 'metamask' for internally initiated transactions, or a URL\n * (e.g., 'https://dapp.example.com') for dapp-initiated transactions.\n */\n origin: exactOptional(string()),\n\n /**\n * Response from the Security Alert API indicating the security assessment of the\n * transaction.\n */\n securityAlertResponse: exactOptional(\n enums([\n `${SecurityAlertResponse.Benign}`,\n `${SecurityAlertResponse.Warning}`,\n `${SecurityAlertResponse.Malicious}`,\n ]),\n ),\n\n /**\n * Optional transaction type label (for UI display purposes).\n */\n typeLabel: exactOptional(string()),\n});\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([\n `${TransactionType.Send}`,\n `${TransactionType.Receive}`,\n `${TransactionType.Swap}`,\n `${TransactionType.BridgeSend}`,\n `${TransactionType.BridgeReceive}`,\n `${TransactionType.StakeDeposit}`,\n `${TransactionType.StakeWithdraw}`,\n `${TransactionType.TokenApprove}`,\n `${TransactionType.TokenDisapprove}`,\n `${TransactionType.Unknown}`,\n ]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n\n /**\n * Additional transaction details {@see TransactionDetailsStruct}.\n *\n * Contains contextual information about the transaction such as its origin,\n * security assessment, and optional `typeLabel`. This field is optional and\n * may not be present for all transactions.\n */\n details: exactOptional(TransactionDetailsStruct),\n});\n\n/**\n * Transaction details object.\n *\n * See {@link TransactionDetailsStruct}.\n */\nexport type TransactionDetails = Infer<typeof TransactionDetailsStruct>;\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
@@ -88,6 +88,10 @@ export declare enum TransactionType {
88
88
  * Represents a token approval transaction.
89
89
  */
90
90
  TokenApprove = "token:approve",
91
+ /**
92
+ * Represents a token disapproval transaction.
93
+ */
94
+ TokenDisapprove = "token:disapprove",
91
95
  /**
92
96
  * The transaction type is unknown. It's not possible to determine the
93
97
  * transaction type based on the information available.
@@ -129,10 +133,18 @@ export declare enum SecurityAlertResponse {
129
133
  * securityAlertResponse: 'Warning',
130
134
  * }
131
135
  * ```
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * {
140
+ * typeLabel: 'Some label',
141
+ * }
142
+ * ```
132
143
  */
133
144
  export declare const TransactionDetailsStruct: import("@metamask/superstruct").Struct<{
134
145
  origin?: string;
135
146
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
147
+ typeLabel?: string;
136
148
  }, {
137
149
  /**
138
150
  * Origin of the original transaction request.
@@ -150,6 +162,10 @@ export declare const TransactionDetailsStruct: import("@metamask/superstruct").S
150
162
  Warning: "Warning";
151
163
  Malicious: "Malicious";
152
164
  }>;
165
+ /**
166
+ * Optional transaction type label (for UI display purposes).
167
+ */
168
+ typeLabel: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
153
169
  }>;
154
170
  /**
155
171
  * This struct represents a transaction event.
@@ -230,7 +246,7 @@ export declare const TransactionEventStruct: import("@metamask/superstruct").Str
230
246
  * ```
231
247
  */
232
248
  export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
233
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
249
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
234
250
  id: string;
235
251
  from: {
236
252
  address: string;
@@ -279,6 +295,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
279
295
  details?: {
280
296
  origin?: string;
281
297
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
298
+ typeLabel?: string;
282
299
  };
283
300
  }, {
284
301
  /**
@@ -312,7 +329,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
312
329
  * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
313
330
  * details on the UI.
314
331
  */
315
- type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
332
+ type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove", {
316
333
  unknown: "unknown";
317
334
  send: "send";
318
335
  receive: "receive";
@@ -322,6 +339,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
322
339
  "stake:deposit": "stake:deposit";
323
340
  "stake:withdraw": "stake:withdraw";
324
341
  "token:approve": "token:approve";
342
+ "token:disapprove": "token:disapprove";
325
343
  }>;
326
344
  /**
327
345
  * Transaction sender addresses and amounts.
@@ -485,13 +503,14 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
485
503
  /**
486
504
  * Additional transaction details {@see TransactionDetailsStruct}.
487
505
  *
488
- * Contains contextual information about the transaction such as its origin and
489
- * security assessment. This field is optional and may not be present for all
490
- * transactions.
506
+ * Contains contextual information about the transaction such as its origin,
507
+ * security assessment, and optional `typeLabel`. This field is optional and
508
+ * may not be present for all transactions.
491
509
  */
492
510
  details: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
493
511
  origin?: string;
494
512
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
513
+ typeLabel?: string;
495
514
  }, {
496
515
  /**
497
516
  * Origin of the original transaction request.
@@ -509,6 +528,10 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
509
528
  Warning: "Warning";
510
529
  Malicious: "Malicious";
511
530
  }>;
531
+ /**
532
+ * Optional transaction type label (for UI display purposes).
533
+ */
534
+ typeLabel: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
512
535
  }>;
513
536
  }>;
514
537
  /**
@@ -552,7 +575,7 @@ export type Transaction = Infer<typeof TransactionStruct>;
552
575
  */
553
576
  export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
554
577
  data: {
555
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
578
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
556
579
  id: string;
557
580
  from: {
558
581
  address: string;
@@ -601,6 +624,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
601
624
  details?: {
602
625
  origin?: string;
603
626
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
627
+ typeLabel?: string;
604
628
  };
605
629
  }[];
606
630
  next: string | null;
@@ -609,7 +633,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
609
633
  * List of transactions.
610
634
  */
611
635
  data: import("@metamask/superstruct").Struct<{
612
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
636
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
613
637
  id: string;
614
638
  from: {
615
639
  address: string;
@@ -658,9 +682,10 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
658
682
  details?: {
659
683
  origin?: string;
660
684
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
685
+ typeLabel?: string;
661
686
  };
662
687
  }[], import("@metamask/superstruct").Struct<{
663
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
688
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
664
689
  id: string;
665
690
  from: {
666
691
  address: string;
@@ -709,6 +734,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
709
734
  details?: {
710
735
  origin?: string;
711
736
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
737
+ typeLabel?: string;
712
738
  };
713
739
  }, {
714
740
  /**
@@ -742,7 +768,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
742
768
  * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
743
769
  * details on the UI.
744
770
  */
745
- type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
771
+ type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove", {
746
772
  unknown: "unknown";
747
773
  send: "send";
748
774
  receive: "receive";
@@ -752,6 +778,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
752
778
  "stake:deposit": "stake:deposit";
753
779
  "stake:withdraw": "stake:withdraw";
754
780
  "token:approve": "token:approve";
781
+ "token:disapprove": "token:disapprove";
755
782
  }>;
756
783
  /**
757
784
  * Transaction sender addresses and amounts.
@@ -915,13 +942,14 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
915
942
  /**
916
943
  * Additional transaction details {@see TransactionDetailsStruct}.
917
944
  *
918
- * Contains contextual information about the transaction such as its origin and
919
- * security assessment. This field is optional and may not be present for all
920
- * transactions.
945
+ * Contains contextual information about the transaction such as its origin,
946
+ * security assessment, and optional `typeLabel`. This field is optional and
947
+ * may not be present for all transactions.
921
948
  */
922
949
  details: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
923
950
  origin?: string;
924
951
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
952
+ typeLabel?: string;
925
953
  }, {
926
954
  /**
927
955
  * Origin of the original transaction request.
@@ -939,6 +967,10 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
939
967
  Warning: "Warning";
940
968
  Malicious: "Malicious";
941
969
  }>;
970
+ /**
971
+ * Optional transaction type label (for UI display purposes).
972
+ */
973
+ typeLabel: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
942
974
  }>;
943
975
  }>>;
944
976
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.cts","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gCAAgC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAiD9C;;GAEG;AACH,oBAAY,OAAO;IACjB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAiBD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB;;;;OAIG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,OAAO,YAAY;IAEnB;;;;;OAKG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,UAAU,gBAAgB;IAE1B;;;OAGG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,YAAY,kBAAkB;IAE9B;;OAEG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,YAAY,kBAAkB;IAE9B;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC/B;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,SAAS,cAAc;CACxB;AAED;;;;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B,CAAC"}
@@ -88,6 +88,10 @@ export declare enum TransactionType {
88
88
  * Represents a token approval transaction.
89
89
  */
90
90
  TokenApprove = "token:approve",
91
+ /**
92
+ * Represents a token disapproval transaction.
93
+ */
94
+ TokenDisapprove = "token:disapprove",
91
95
  /**
92
96
  * The transaction type is unknown. It's not possible to determine the
93
97
  * transaction type based on the information available.
@@ -129,10 +133,18 @@ export declare enum SecurityAlertResponse {
129
133
  * securityAlertResponse: 'Warning',
130
134
  * }
131
135
  * ```
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * {
140
+ * typeLabel: 'Some label',
141
+ * }
142
+ * ```
132
143
  */
133
144
  export declare const TransactionDetailsStruct: import("@metamask/superstruct").Struct<{
134
145
  origin?: string;
135
146
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
147
+ typeLabel?: string;
136
148
  }, {
137
149
  /**
138
150
  * Origin of the original transaction request.
@@ -150,6 +162,10 @@ export declare const TransactionDetailsStruct: import("@metamask/superstruct").S
150
162
  Warning: "Warning";
151
163
  Malicious: "Malicious";
152
164
  }>;
165
+ /**
166
+ * Optional transaction type label (for UI display purposes).
167
+ */
168
+ typeLabel: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
153
169
  }>;
154
170
  /**
155
171
  * This struct represents a transaction event.
@@ -230,7 +246,7 @@ export declare const TransactionEventStruct: import("@metamask/superstruct").Str
230
246
  * ```
231
247
  */
232
248
  export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
233
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
249
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
234
250
  id: string;
235
251
  from: {
236
252
  address: string;
@@ -279,6 +295,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
279
295
  details?: {
280
296
  origin?: string;
281
297
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
298
+ typeLabel?: string;
282
299
  };
283
300
  }, {
284
301
  /**
@@ -312,7 +329,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
312
329
  * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
313
330
  * details on the UI.
314
331
  */
315
- type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
332
+ type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove", {
316
333
  unknown: "unknown";
317
334
  send: "send";
318
335
  receive: "receive";
@@ -322,6 +339,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
322
339
  "stake:deposit": "stake:deposit";
323
340
  "stake:withdraw": "stake:withdraw";
324
341
  "token:approve": "token:approve";
342
+ "token:disapprove": "token:disapprove";
325
343
  }>;
326
344
  /**
327
345
  * Transaction sender addresses and amounts.
@@ -485,13 +503,14 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
485
503
  /**
486
504
  * Additional transaction details {@see TransactionDetailsStruct}.
487
505
  *
488
- * Contains contextual information about the transaction such as its origin and
489
- * security assessment. This field is optional and may not be present for all
490
- * transactions.
506
+ * Contains contextual information about the transaction such as its origin,
507
+ * security assessment, and optional `typeLabel`. This field is optional and
508
+ * may not be present for all transactions.
491
509
  */
492
510
  details: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
493
511
  origin?: string;
494
512
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
513
+ typeLabel?: string;
495
514
  }, {
496
515
  /**
497
516
  * Origin of the original transaction request.
@@ -509,6 +528,10 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
509
528
  Warning: "Warning";
510
529
  Malicious: "Malicious";
511
530
  }>;
531
+ /**
532
+ * Optional transaction type label (for UI display purposes).
533
+ */
534
+ typeLabel: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
512
535
  }>;
513
536
  }>;
514
537
  /**
@@ -552,7 +575,7 @@ export type Transaction = Infer<typeof TransactionStruct>;
552
575
  */
553
576
  export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
554
577
  data: {
555
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
578
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
556
579
  id: string;
557
580
  from: {
558
581
  address: string;
@@ -601,6 +624,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
601
624
  details?: {
602
625
  origin?: string;
603
626
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
627
+ typeLabel?: string;
604
628
  };
605
629
  }[];
606
630
  next: string | null;
@@ -609,7 +633,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
609
633
  * List of transactions.
610
634
  */
611
635
  data: import("@metamask/superstruct").Struct<{
612
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
636
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
613
637
  id: string;
614
638
  from: {
615
639
  address: string;
@@ -658,9 +682,10 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
658
682
  details?: {
659
683
  origin?: string;
660
684
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
685
+ typeLabel?: string;
661
686
  };
662
687
  }[], import("@metamask/superstruct").Struct<{
663
- type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
688
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove";
664
689
  id: string;
665
690
  from: {
666
691
  address: string;
@@ -709,6 +734,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
709
734
  details?: {
710
735
  origin?: string;
711
736
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
737
+ typeLabel?: string;
712
738
  };
713
739
  }, {
714
740
  /**
@@ -742,7 +768,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
742
768
  * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
743
769
  * details on the UI.
744
770
  */
745
- type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
771
+ type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "token:disapprove", {
746
772
  unknown: "unknown";
747
773
  send: "send";
748
774
  receive: "receive";
@@ -752,6 +778,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
752
778
  "stake:deposit": "stake:deposit";
753
779
  "stake:withdraw": "stake:withdraw";
754
780
  "token:approve": "token:approve";
781
+ "token:disapprove": "token:disapprove";
755
782
  }>;
756
783
  /**
757
784
  * Transaction sender addresses and amounts.
@@ -915,13 +942,14 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
915
942
  /**
916
943
  * Additional transaction details {@see TransactionDetailsStruct}.
917
944
  *
918
- * Contains contextual information about the transaction such as its origin and
919
- * security assessment. This field is optional and may not be present for all
920
- * transactions.
945
+ * Contains contextual information about the transaction such as its origin,
946
+ * security assessment, and optional `typeLabel`. This field is optional and
947
+ * may not be present for all transactions.
921
948
  */
922
949
  details: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
923
950
  origin?: string;
924
951
  securityAlertResponse?: "Benign" | "Warning" | "Malicious";
952
+ typeLabel?: string;
925
953
  }, {
926
954
  /**
927
955
  * Origin of the original transaction request.
@@ -939,6 +967,10 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
939
967
  Warning: "Warning";
940
968
  Malicious: "Malicious";
941
969
  }>;
970
+ /**
971
+ * Optional transaction type label (for UI display purposes).
972
+ */
973
+ typeLabel: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
942
974
  }>;
943
975
  }>>;
944
976
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.mts","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gCAAgC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAiD9C;;GAEG;AACH,oBAAY,OAAO;IACjB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAiBD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB;;;;OAIG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,OAAO,YAAY;IAEnB;;;;;OAKG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,UAAU,gBAAgB;IAE1B;;;OAGG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,YAAY,kBAAkB;IAE9B;;OAEG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,YAAY,kBAAkB;IAE9B;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC/B;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG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