@metamask-previews/keyring-api 11.0.0-b85bfaa → 11.1.0-72196d6

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 (222) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/api/account.cjs.map +1 -0
  3. package/dist/{account.d.cts → api/account.d.cts} +2 -2
  4. package/dist/api/account.d.cts.map +1 -0
  5. package/dist/{account.d.mts → api/account.d.mts} +2 -2
  6. package/dist/api/account.d.mts.map +1 -0
  7. package/dist/api/account.mjs.map +1 -0
  8. package/dist/api/asset.cjs +82 -0
  9. package/dist/api/asset.cjs.map +1 -0
  10. package/dist/api/asset.d.cts +93 -0
  11. package/dist/api/asset.d.cts.map +1 -0
  12. package/dist/api/asset.d.mts +93 -0
  13. package/dist/api/asset.d.mts.map +1 -0
  14. package/dist/api/asset.mjs +79 -0
  15. package/dist/api/asset.mjs.map +1 -0
  16. package/dist/api/balance.cjs.map +1 -0
  17. package/dist/{balance.d.cts → api/balance.d.cts} +1 -1
  18. package/dist/api/balance.d.cts.map +1 -0
  19. package/dist/{balance.d.mts → api/balance.d.mts} +1 -1
  20. package/dist/api/balance.d.mts.map +1 -0
  21. package/dist/api/balance.mjs.map +1 -0
  22. package/dist/api/caip.cjs.map +1 -0
  23. package/dist/api/caip.d.cts.map +1 -0
  24. package/dist/api/caip.d.mts.map +1 -0
  25. package/dist/api/caip.mjs.map +1 -0
  26. package/dist/api/export.cjs.map +1 -0
  27. package/dist/api/export.d.cts.map +1 -0
  28. package/dist/api/export.d.mts.map +1 -0
  29. package/dist/api/export.mjs.map +1 -0
  30. package/dist/api/index.cjs +25 -0
  31. package/dist/api/index.cjs.map +1 -0
  32. package/dist/api/index.d.cts +10 -0
  33. package/dist/api/index.d.cts.map +1 -0
  34. package/dist/api/index.d.mts +10 -0
  35. package/dist/api/index.d.mts.map +1 -0
  36. package/dist/api/index.mjs +9 -0
  37. package/dist/api/index.mjs.map +1 -0
  38. package/dist/api/keyring.cjs.map +1 -0
  39. package/dist/{keyring.d.cts → api/keyring.d.cts} +14 -0
  40. package/dist/api/keyring.d.cts.map +1 -0
  41. package/dist/{keyring.d.mts → api/keyring.d.mts} +14 -0
  42. package/dist/api/keyring.d.mts.map +1 -0
  43. package/dist/api/keyring.mjs.map +1 -0
  44. package/dist/api/request.cjs.map +1 -0
  45. package/dist/{request.d.cts → api/request.d.cts} +3 -3
  46. package/dist/api/request.d.cts.map +1 -0
  47. package/dist/{request.d.mts → api/request.d.mts} +3 -3
  48. package/dist/api/request.d.mts.map +1 -0
  49. package/dist/api/request.mjs.map +1 -0
  50. package/dist/api/response.cjs.map +1 -0
  51. package/dist/{response.d.cts → api/response.d.cts} +1 -1
  52. package/dist/api/response.d.cts.map +1 -0
  53. package/dist/{response.d.mts → api/response.d.mts} +1 -1
  54. package/dist/api/response.d.mts.map +1 -0
  55. package/dist/api/response.mjs.map +1 -0
  56. package/dist/api/transaction.cjs +294 -0
  57. package/dist/api/transaction.cjs.map +1 -0
  58. package/dist/api/transaction.d.cts +773 -0
  59. package/dist/api/transaction.d.cts.map +1 -0
  60. package/dist/api/transaction.d.mts +773 -0
  61. package/dist/api/transaction.d.mts.map +1 -0
  62. package/dist/api/transaction.mjs +291 -0
  63. package/dist/api/transaction.mjs.map +1 -0
  64. package/dist/btc/index.cjs +18 -0
  65. package/dist/btc/index.cjs.map +1 -0
  66. package/dist/btc/index.d.cts +2 -0
  67. package/dist/btc/index.d.cts.map +1 -0
  68. package/dist/btc/index.d.mts +2 -0
  69. package/dist/btc/index.d.mts.map +1 -0
  70. package/dist/btc/index.mjs +2 -0
  71. package/dist/btc/index.mjs.map +1 -0
  72. package/dist/btc/types.cjs +40 -0
  73. package/dist/btc/types.cjs.map +1 -0
  74. package/dist/btc/types.d.cts +34 -0
  75. package/dist/btc/types.d.cts.map +1 -0
  76. package/dist/btc/types.d.mts +34 -0
  77. package/dist/btc/types.d.mts.map +1 -0
  78. package/dist/btc/types.mjs +37 -0
  79. package/dist/btc/types.mjs.map +1 -0
  80. package/dist/eth/erc4337/index.cjs +18 -0
  81. package/dist/eth/erc4337/index.cjs.map +1 -0
  82. package/dist/eth/erc4337/index.d.cts +2 -0
  83. package/dist/eth/erc4337/index.d.cts.map +1 -0
  84. package/dist/eth/erc4337/index.d.mts +2 -0
  85. package/dist/eth/erc4337/index.d.mts.map +1 -0
  86. package/dist/eth/erc4337/index.mjs +2 -0
  87. package/dist/eth/erc4337/index.mjs.map +1 -0
  88. package/dist/eth/erc4337/types.cjs +61 -0
  89. package/dist/eth/erc4337/types.cjs.map +1 -0
  90. package/dist/eth/erc4337/types.d.cts +98 -0
  91. package/dist/eth/erc4337/types.d.cts.map +1 -0
  92. package/dist/eth/erc4337/types.d.mts +98 -0
  93. package/dist/eth/erc4337/types.d.mts.map +1 -0
  94. package/dist/eth/erc4337/types.mjs +58 -0
  95. package/dist/eth/erc4337/types.mjs.map +1 -0
  96. package/dist/eth/index.cjs +20 -0
  97. package/dist/eth/index.cjs.map +1 -0
  98. package/dist/eth/index.d.cts +4 -0
  99. package/dist/eth/index.d.cts.map +1 -0
  100. package/dist/eth/index.d.mts +4 -0
  101. package/dist/eth/index.d.mts.map +1 -0
  102. package/dist/eth/index.mjs +4 -0
  103. package/dist/eth/index.mjs.map +1 -0
  104. package/dist/eth/types.cjs +73 -0
  105. package/dist/eth/types.cjs.map +1 -0
  106. package/dist/eth/types.d.cts +81 -0
  107. package/dist/eth/types.d.cts.map +1 -0
  108. package/dist/eth/types.d.mts +81 -0
  109. package/dist/eth/types.d.mts.map +1 -0
  110. package/dist/eth/types.mjs +70 -0
  111. package/dist/eth/types.mjs.map +1 -0
  112. package/dist/eth/utils.cjs +14 -0
  113. package/dist/eth/utils.cjs.map +1 -0
  114. package/dist/eth/utils.d.cts +9 -0
  115. package/dist/eth/utils.d.cts.map +1 -0
  116. package/dist/eth/utils.d.mts +9 -0
  117. package/dist/eth/utils.d.mts.map +1 -0
  118. package/dist/eth/utils.mjs +11 -0
  119. package/dist/eth/utils.mjs.map +1 -0
  120. package/dist/events.cjs +83 -0
  121. package/dist/events.cjs.map +1 -0
  122. package/dist/events.d.cts +172 -0
  123. package/dist/events.d.cts.map +1 -0
  124. package/dist/events.d.mts +172 -0
  125. package/dist/events.d.mts.map +1 -0
  126. package/dist/events.mjs +80 -0
  127. package/dist/events.mjs.map +1 -0
  128. package/dist/index.cjs +7 -6
  129. package/dist/index.cjs.map +1 -1
  130. package/dist/index.d.cts +7 -7
  131. package/dist/index.d.cts.map +1 -1
  132. package/dist/index.d.mts +7 -7
  133. package/dist/index.d.mts.map +1 -1
  134. package/dist/index.mjs +7 -6
  135. package/dist/index.mjs.map +1 -1
  136. package/dist/rpc.cjs +34 -0
  137. package/dist/rpc.cjs.map +1 -0
  138. package/dist/rpc.d.cts +27 -0
  139. package/dist/rpc.d.cts.map +1 -0
  140. package/dist/rpc.d.mts +27 -0
  141. package/dist/rpc.d.mts.map +1 -0
  142. package/dist/rpc.mjs +30 -0
  143. package/dist/rpc.mjs.map +1 -0
  144. package/dist/sol/index.cjs +18 -0
  145. package/dist/sol/index.cjs.map +1 -0
  146. package/dist/sol/index.d.cts +2 -0
  147. package/dist/sol/index.d.cts.map +1 -0
  148. package/dist/sol/index.d.mts +2 -0
  149. package/dist/sol/index.d.mts.map +1 -0
  150. package/dist/sol/index.mjs +2 -0
  151. package/dist/sol/index.mjs.map +1 -0
  152. package/dist/sol/types.cjs +36 -0
  153. package/dist/sol/types.cjs.map +1 -0
  154. package/dist/sol/types.d.cts +39 -0
  155. package/dist/sol/types.d.cts.map +1 -0
  156. package/dist/sol/types.d.mts +39 -0
  157. package/dist/sol/types.d.mts.map +1 -0
  158. package/dist/sol/types.mjs +33 -0
  159. package/dist/sol/types.mjs.map +1 -0
  160. package/dist/utils/index.cjs +18 -0
  161. package/dist/utils/index.cjs.map +1 -0
  162. package/dist/utils/index.d.cts +2 -0
  163. package/dist/utils/index.d.cts.map +1 -0
  164. package/dist/utils/index.d.mts +2 -0
  165. package/dist/utils/index.d.mts.map +1 -0
  166. package/dist/utils/index.mjs +2 -0
  167. package/dist/utils/index.mjs.map +1 -0
  168. package/dist/utils/pagination.cjs +28 -0
  169. package/dist/utils/pagination.cjs.map +1 -0
  170. package/dist/utils/pagination.d.cts +59 -0
  171. package/dist/utils/pagination.d.cts.map +1 -0
  172. package/dist/utils/pagination.d.mts +59 -0
  173. package/dist/utils/pagination.d.mts.map +1 -0
  174. package/dist/utils/pagination.mjs +25 -0
  175. package/dist/utils/pagination.mjs.map +1 -0
  176. package/package.json +3 -5
  177. package/dist/account.cjs.map +0 -1
  178. package/dist/account.d.cts.map +0 -1
  179. package/dist/account.d.mts.map +0 -1
  180. package/dist/account.mjs.map +0 -1
  181. package/dist/balance.cjs.map +0 -1
  182. package/dist/balance.d.cts.map +0 -1
  183. package/dist/balance.d.mts.map +0 -1
  184. package/dist/balance.mjs.map +0 -1
  185. package/dist/caip.cjs.map +0 -1
  186. package/dist/caip.d.cts.map +0 -1
  187. package/dist/caip.d.mts.map +0 -1
  188. package/dist/caip.mjs.map +0 -1
  189. package/dist/export.cjs.map +0 -1
  190. package/dist/export.d.cts.map +0 -1
  191. package/dist/export.d.mts.map +0 -1
  192. package/dist/export.mjs.map +0 -1
  193. package/dist/keyring.cjs.map +0 -1
  194. package/dist/keyring.d.cts.map +0 -1
  195. package/dist/keyring.d.mts.map +0 -1
  196. package/dist/keyring.mjs.map +0 -1
  197. package/dist/request.cjs.map +0 -1
  198. package/dist/request.d.cts.map +0 -1
  199. package/dist/request.d.mts.map +0 -1
  200. package/dist/request.mjs.map +0 -1
  201. package/dist/response.cjs.map +0 -1
  202. package/dist/response.d.cts.map +0 -1
  203. package/dist/response.d.mts.map +0 -1
  204. package/dist/response.mjs.map +0 -1
  205. /package/dist/{account.cjs → api/account.cjs} +0 -0
  206. /package/dist/{account.mjs → api/account.mjs} +0 -0
  207. /package/dist/{balance.cjs → api/balance.cjs} +0 -0
  208. /package/dist/{balance.mjs → api/balance.mjs} +0 -0
  209. /package/dist/{caip.cjs → api/caip.cjs} +0 -0
  210. /package/dist/{caip.d.cts → api/caip.d.cts} +0 -0
  211. /package/dist/{caip.d.mts → api/caip.d.mts} +0 -0
  212. /package/dist/{caip.mjs → api/caip.mjs} +0 -0
  213. /package/dist/{export.cjs → api/export.cjs} +0 -0
  214. /package/dist/{export.d.cts → api/export.d.cts} +0 -0
  215. /package/dist/{export.d.mts → api/export.d.mts} +0 -0
  216. /package/dist/{export.mjs → api/export.mjs} +0 -0
  217. /package/dist/{keyring.cjs → api/keyring.cjs} +0 -0
  218. /package/dist/{keyring.mjs → api/keyring.mjs} +0 -0
  219. /package/dist/{request.cjs → api/request.cjs} +0 -0
  220. /package/dist/{request.mjs → api/request.mjs} +0 -0
  221. /package/dist/{response.cjs → api/response.cjs} +0 -0
  222. /package/dist/{response.mjs → api/response.mjs} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [11.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add `listAccountTransactions` keyring method ([#41](https://github.com/MetaMask/accounts/pull/41))
15
+
10
16
  ## [11.0.0]
11
17
 
12
18
  ### Added
@@ -438,7 +444,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
438
444
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
439
445
  - Helper functions to create keyring handler in the snap.
440
446
 
441
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.0.0...HEAD
447
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.1.0...HEAD
448
+ [11.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.0.0...@metamask/keyring-api@11.1.0
442
449
  [11.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.1.0...@metamask/keyring-api@11.0.0
443
450
  [10.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.0.0...@metamask/keyring-api@10.1.0
444
451
  [10.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@9.0.0...@metamask/keyring-api@10.0.0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAE7D,uDAAqE;AACrE,2CAA6C;AAE7C;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -30,10 +30,10 @@ export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc
30
30
  * See {@link KeyringAccount}.
31
31
  */
32
32
  export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
33
- id: string;
34
33
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
35
- address: string;
34
+ id: string;
36
35
  options: Record<string, import("@metamask/utils").Json>;
36
+ address: string;
37
37
  methods: string[];
38
38
  }, {
39
39
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -30,10 +30,10 @@ export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc
30
30
  * See {@link KeyringAccount}.
31
31
  */
32
32
  export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
33
- id: string;
34
33
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
35
- address: string;
34
+ id: string;
36
35
  options: Record<string, import("@metamask/utils").Json>;
36
+ address: string;
37
37
  methods: string[];
38
38
  }, {
39
39
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE7D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssetStruct = exports.NonFungibleAssetStruct = exports.FungibleAssetStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
5
+ const superstruct_1 = require("@metamask/superstruct");
6
+ const utils_1 = require("@metamask/utils");
7
+ /**
8
+ * Fungible asset struct.
9
+ */
10
+ exports.FungibleAssetStruct = (0, keyring_utils_1.object)({
11
+ /**
12
+ * It is a fungible asset.
13
+ */
14
+ fungible: (0, superstruct_1.literal)(true),
15
+ /**
16
+ * Asset type (CAIP-19).
17
+ */
18
+ type: utils_1.CaipAssetTypeStruct,
19
+ /**
20
+ * Asset unit.
21
+ */
22
+ unit: (0, superstruct_1.string)(),
23
+ /**
24
+ * Asset amount.
25
+ */
26
+ amount: keyring_utils_1.StringNumberStruct,
27
+ });
28
+ /**
29
+ * Non-fungible asset struct.
30
+ */
31
+ exports.NonFungibleAssetStruct = (0, keyring_utils_1.object)({
32
+ /**
33
+ * It is a non-fungible asset.
34
+ */
35
+ fungible: (0, superstruct_1.literal)(false),
36
+ /**
37
+ * Asset ID (CAIP-19).
38
+ */
39
+ id: utils_1.CaipAssetIdStruct,
40
+ });
41
+ /**
42
+ * Asset struct. This represents a fungible or non-fungible asset. Fungible
43
+ * assets include an amount and a unit in addition to the asset type. While
44
+ * non-fungible assets include only an asset ID.
45
+ *
46
+ * See {@link NonFungibleAssetStruct} and {@link FungibleAssetStruct}.
47
+ *
48
+ * All assets have a `fungible` property that is used to tag the union and
49
+ * allow the following pattern:
50
+ *
51
+ * ```ts
52
+ * if (asset.fungible) {
53
+ * // Use asset.type
54
+ * } else {
55
+ * // Use asset.id
56
+ * }
57
+ * ```
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * {
62
+ * fungible: true,
63
+ * type: 'eip155:1/slip44:60',
64
+ * unit: 'ETH',
65
+ * amount: '0.01',
66
+ * }
67
+ * ```
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * {
72
+ * fungible: false,
73
+ * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',
74
+ * }
75
+ * ```
76
+ */
77
+ exports.AssetStruct = (0, keyring_utils_1.selectiveUnion)((value) => {
78
+ return (0, utils_1.isPlainObject)(value) && !value.fungible
79
+ ? exports.NonFungibleAssetStruct
80
+ : exports.FungibleAssetStruct;
81
+ });
82
+ //# sourceMappingURL=asset.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.cjs","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":";;;AAAA,2DAIiC;AAEjC,uDAAwD;AACxD,2CAIyB;AAEzB;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC;;OAEG;IACH,QAAQ,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,2BAAmB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,oBAAM,GAAE;IAEd;;OAEG;IACH,MAAM,EAAE,kCAAkB;CAC3B,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C;;OAEG;IACH,QAAQ,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IAExB;;OAEG;IACH,EAAE,EAAE,yBAAiB;CACtB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACU,QAAA,WAAW,GAAG,IAAA,8BAAc,EAAC,CAAC,KAAU,EAAE,EAAE;IACvD,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;QAC5C,CAAC,CAAC,8BAAsB;QACxB,CAAC,CAAC,2BAAmB,CAAC;AAC1B,CAAC,CAAC,CAAC","sourcesContent":["import {\n object,\n selectiveUnion,\n StringNumberStruct,\n} from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, string } from '@metamask/superstruct';\nimport {\n CaipAssetIdStruct,\n CaipAssetTypeStruct,\n isPlainObject,\n} from '@metamask/utils';\n\n/**\n * Fungible asset struct.\n */\nexport const FungibleAssetStruct = object({\n /**\n * It is a fungible asset.\n */\n fungible: literal(true),\n\n /**\n * Asset type (CAIP-19).\n */\n type: CaipAssetTypeStruct,\n\n /**\n * Asset unit.\n */\n unit: string(),\n\n /**\n * Asset amount.\n */\n amount: StringNumberStruct,\n});\n\n/**\n * Non-fungible asset struct.\n */\nexport const NonFungibleAssetStruct = object({\n /**\n * It is a non-fungible asset.\n */\n fungible: literal(false),\n\n /**\n * Asset ID (CAIP-19).\n */\n id: CaipAssetIdStruct,\n});\n\n/**\n * Asset struct. This represents a fungible or non-fungible asset. Fungible\n * assets include an amount and a unit in addition to the asset type. While\n * non-fungible assets include only an asset ID.\n *\n * See {@link NonFungibleAssetStruct} and {@link FungibleAssetStruct}.\n *\n * All assets have a `fungible` property that is used to tag the union and\n * allow the following pattern:\n *\n * ```ts\n * if (asset.fungible) {\n * // Use asset.type\n * } else {\n * // Use asset.id\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * }\n * ```\n */\nexport const AssetStruct = selectiveUnion((value: any) => {\n return isPlainObject(value) && !value.fungible\n ? NonFungibleAssetStruct\n : FungibleAssetStruct;\n});\n\n/**\n * Asset type {@see AssetStruct}.\n */\nexport type Asset = Infer<typeof AssetStruct>;\n"]}
@@ -0,0 +1,93 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Fungible asset struct.
4
+ */
5
+ export declare const FungibleAssetStruct: import("@metamask/superstruct").Struct<{
6
+ unit: string;
7
+ type: `${string}:${string}/${string}:${string}`;
8
+ fungible: true;
9
+ amount: string;
10
+ }, {
11
+ /**
12
+ * It is a fungible asset.
13
+ */
14
+ fungible: import("@metamask/superstruct").Struct<true, true>;
15
+ /**
16
+ * Asset type (CAIP-19).
17
+ */
18
+ type: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>;
19
+ /**
20
+ * Asset unit.
21
+ */
22
+ unit: import("@metamask/superstruct").Struct<string, null>;
23
+ /**
24
+ * Asset amount.
25
+ */
26
+ amount: import("@metamask/superstruct").Struct<string, null>;
27
+ }>;
28
+ /**
29
+ * Non-fungible asset struct.
30
+ */
31
+ export declare const NonFungibleAssetStruct: import("@metamask/superstruct").Struct<{
32
+ id: `${string}:${string}/${string}:${string}/${string}`;
33
+ fungible: false;
34
+ }, {
35
+ /**
36
+ * It is a non-fungible asset.
37
+ */
38
+ fungible: import("@metamask/superstruct").Struct<false, false>;
39
+ /**
40
+ * Asset ID (CAIP-19).
41
+ */
42
+ id: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}/${string}`, null>;
43
+ }>;
44
+ /**
45
+ * Asset struct. This represents a fungible or non-fungible asset. Fungible
46
+ * assets include an amount and a unit in addition to the asset type. While
47
+ * non-fungible assets include only an asset ID.
48
+ *
49
+ * See {@link NonFungibleAssetStruct} and {@link FungibleAssetStruct}.
50
+ *
51
+ * All assets have a `fungible` property that is used to tag the union and
52
+ * allow the following pattern:
53
+ *
54
+ * ```ts
55
+ * if (asset.fungible) {
56
+ * // Use asset.type
57
+ * } else {
58
+ * // Use asset.id
59
+ * }
60
+ * ```
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * {
65
+ * fungible: true,
66
+ * type: 'eip155:1/slip44:60',
67
+ * unit: 'ETH',
68
+ * amount: '0.01',
69
+ * }
70
+ * ```
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * {
75
+ * fungible: false,
76
+ * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',
77
+ * }
78
+ * ```
79
+ */
80
+ export declare const AssetStruct: import("@metamask/superstruct").Struct<{
81
+ unit: string;
82
+ type: `${string}:${string}/${string}:${string}`;
83
+ fungible: true;
84
+ amount: string;
85
+ } | {
86
+ id: `${string}:${string}/${string}:${string}/${string}`;
87
+ fungible: false;
88
+ }, null>;
89
+ /**
90
+ * Asset type {@see AssetStruct}.
91
+ */
92
+ export type Asset = Infer<typeof AssetStruct>;
93
+ //# sourceMappingURL=asset.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.d.cts","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAQnD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;IAC9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;IACjC;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,WAAW;;;;;;;;QAItB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,93 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Fungible asset struct.
4
+ */
5
+ export declare const FungibleAssetStruct: import("@metamask/superstruct").Struct<{
6
+ unit: string;
7
+ type: `${string}:${string}/${string}:${string}`;
8
+ fungible: true;
9
+ amount: string;
10
+ }, {
11
+ /**
12
+ * It is a fungible asset.
13
+ */
14
+ fungible: import("@metamask/superstruct").Struct<true, true>;
15
+ /**
16
+ * Asset type (CAIP-19).
17
+ */
18
+ type: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>;
19
+ /**
20
+ * Asset unit.
21
+ */
22
+ unit: import("@metamask/superstruct").Struct<string, null>;
23
+ /**
24
+ * Asset amount.
25
+ */
26
+ amount: import("@metamask/superstruct").Struct<string, null>;
27
+ }>;
28
+ /**
29
+ * Non-fungible asset struct.
30
+ */
31
+ export declare const NonFungibleAssetStruct: import("@metamask/superstruct").Struct<{
32
+ id: `${string}:${string}/${string}:${string}/${string}`;
33
+ fungible: false;
34
+ }, {
35
+ /**
36
+ * It is a non-fungible asset.
37
+ */
38
+ fungible: import("@metamask/superstruct").Struct<false, false>;
39
+ /**
40
+ * Asset ID (CAIP-19).
41
+ */
42
+ id: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}/${string}`, null>;
43
+ }>;
44
+ /**
45
+ * Asset struct. This represents a fungible or non-fungible asset. Fungible
46
+ * assets include an amount and a unit in addition to the asset type. While
47
+ * non-fungible assets include only an asset ID.
48
+ *
49
+ * See {@link NonFungibleAssetStruct} and {@link FungibleAssetStruct}.
50
+ *
51
+ * All assets have a `fungible` property that is used to tag the union and
52
+ * allow the following pattern:
53
+ *
54
+ * ```ts
55
+ * if (asset.fungible) {
56
+ * // Use asset.type
57
+ * } else {
58
+ * // Use asset.id
59
+ * }
60
+ * ```
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * {
65
+ * fungible: true,
66
+ * type: 'eip155:1/slip44:60',
67
+ * unit: 'ETH',
68
+ * amount: '0.01',
69
+ * }
70
+ * ```
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * {
75
+ * fungible: false,
76
+ * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',
77
+ * }
78
+ * ```
79
+ */
80
+ export declare const AssetStruct: import("@metamask/superstruct").Struct<{
81
+ unit: string;
82
+ type: `${string}:${string}/${string}:${string}`;
83
+ fungible: true;
84
+ amount: string;
85
+ } | {
86
+ id: `${string}:${string}/${string}:${string}/${string}`;
87
+ fungible: false;
88
+ }, null>;
89
+ /**
90
+ * Asset type {@see AssetStruct}.
91
+ */
92
+ export type Asset = Infer<typeof AssetStruct>;
93
+ //# sourceMappingURL=asset.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.d.mts","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAQnD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;IAC9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;IACjC;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,WAAW;;;;;;;;QAItB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { object, selectiveUnion, StringNumberStruct } from "@metamask/keyring-utils";
2
+ import { literal, string } from "@metamask/superstruct";
3
+ import { CaipAssetIdStruct, CaipAssetTypeStruct, isPlainObject } from "@metamask/utils";
4
+ /**
5
+ * Fungible asset struct.
6
+ */
7
+ export const FungibleAssetStruct = object({
8
+ /**
9
+ * It is a fungible asset.
10
+ */
11
+ fungible: literal(true),
12
+ /**
13
+ * Asset type (CAIP-19).
14
+ */
15
+ type: CaipAssetTypeStruct,
16
+ /**
17
+ * Asset unit.
18
+ */
19
+ unit: string(),
20
+ /**
21
+ * Asset amount.
22
+ */
23
+ amount: StringNumberStruct,
24
+ });
25
+ /**
26
+ * Non-fungible asset struct.
27
+ */
28
+ export const NonFungibleAssetStruct = object({
29
+ /**
30
+ * It is a non-fungible asset.
31
+ */
32
+ fungible: literal(false),
33
+ /**
34
+ * Asset ID (CAIP-19).
35
+ */
36
+ id: CaipAssetIdStruct,
37
+ });
38
+ /**
39
+ * Asset struct. This represents a fungible or non-fungible asset. Fungible
40
+ * assets include an amount and a unit in addition to the asset type. While
41
+ * non-fungible assets include only an asset ID.
42
+ *
43
+ * See {@link NonFungibleAssetStruct} and {@link FungibleAssetStruct}.
44
+ *
45
+ * All assets have a `fungible` property that is used to tag the union and
46
+ * allow the following pattern:
47
+ *
48
+ * ```ts
49
+ * if (asset.fungible) {
50
+ * // Use asset.type
51
+ * } else {
52
+ * // Use asset.id
53
+ * }
54
+ * ```
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * {
59
+ * fungible: true,
60
+ * type: 'eip155:1/slip44:60',
61
+ * unit: 'ETH',
62
+ * amount: '0.01',
63
+ * }
64
+ * ```
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * {
69
+ * fungible: false,
70
+ * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',
71
+ * }
72
+ * ```
73
+ */
74
+ export const AssetStruct = selectiveUnion((value) => {
75
+ return isPlainObject(value) && !value.fungible
76
+ ? NonFungibleAssetStruct
77
+ : FungibleAssetStruct;
78
+ });
79
+ //# sourceMappingURL=asset.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.mjs","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,cAAc,EACd,kBAAkB,EACnB,gCAAgC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,8BAA8B;AACxD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACd,wBAAwB;AAEzB;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;IACxC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,mBAAmB;IAEzB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE;IAEd;;OAEG;IACH,MAAM,EAAE,kBAAkB;CAC3B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;IAExB;;OAEG;IACH,EAAE,EAAE,iBAAiB;CACtB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,KAAU,EAAE,EAAE;IACvD,OAAO,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;QAC5C,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,mBAAmB,CAAC;AAC1B,CAAC,CAAC,CAAC","sourcesContent":["import {\n object,\n selectiveUnion,\n StringNumberStruct,\n} from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, string } from '@metamask/superstruct';\nimport {\n CaipAssetIdStruct,\n CaipAssetTypeStruct,\n isPlainObject,\n} from '@metamask/utils';\n\n/**\n * Fungible asset struct.\n */\nexport const FungibleAssetStruct = object({\n /**\n * It is a fungible asset.\n */\n fungible: literal(true),\n\n /**\n * Asset type (CAIP-19).\n */\n type: CaipAssetTypeStruct,\n\n /**\n * Asset unit.\n */\n unit: string(),\n\n /**\n * Asset amount.\n */\n amount: StringNumberStruct,\n});\n\n/**\n * Non-fungible asset struct.\n */\nexport const NonFungibleAssetStruct = object({\n /**\n * It is a non-fungible asset.\n */\n fungible: literal(false),\n\n /**\n * Asset ID (CAIP-19).\n */\n id: CaipAssetIdStruct,\n});\n\n/**\n * Asset struct. This represents a fungible or non-fungible asset. Fungible\n * assets include an amount and a unit in addition to the asset type. While\n * non-fungible assets include only an asset ID.\n *\n * See {@link NonFungibleAssetStruct} and {@link FungibleAssetStruct}.\n *\n * All assets have a `fungible` property that is used to tag the union and\n * allow the following pattern:\n *\n * ```ts\n * if (asset.fungible) {\n * // Use asset.type\n * } else {\n * // Use asset.id\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * }\n * ```\n */\nexport const AssetStruct = selectiveUnion((value: any) => {\n return isPlainObject(value) && !value.fungible\n ? NonFungibleAssetStruct\n : FungibleAssetStruct;\n});\n\n/**\n * Asset type {@see AssetStruct}.\n */\nexport type Asset = Infer<typeof AssetStruct>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.cjs","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":";;;AAAA,2DAAqE;AAErE,uDAA+C;AAElC,QAAA,aAAa,GAAG,IAAA,sBAAM,EAAC;IAClC,MAAM,EAAE,kCAAkB;IAC1B,IAAI,EAAE,IAAA,oBAAM,GAAE;CACf,CAAC,CAAC","sourcesContent":["import { object, StringNumberStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { string } from '@metamask/superstruct';\n\nexport const BalanceStruct = object({\n amount: StringNumberStruct,\n unit: string(),\n});\n\nexport type Balance = Infer<typeof BalanceStruct>;\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  export declare const BalanceStruct: import("@metamask/superstruct").Struct<{
3
- amount: string;
4
3
  unit: string;
4
+ amount: string;
5
5
  }, {
6
6
  amount: import("@metamask/superstruct").Struct<string, null>;
7
7
  unit: import("@metamask/superstruct").Struct<string, null>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.cts","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD,eAAO,MAAM,aAAa;;;;;;EAGxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  export declare const BalanceStruct: import("@metamask/superstruct").Struct<{
3
- amount: string;
4
3
  unit: string;
4
+ amount: string;
5
5
  }, {
6
6
  amount: import("@metamask/superstruct").Struct<string, null>;
7
7
  unit: import("@metamask/superstruct").Struct<string, null>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.mts","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD,eAAO,MAAM,aAAa;;;;;;EAGxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.mjs","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,gCAAgC;AAErE,OAAO,EAAE,MAAM,EAAE,8BAA8B;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;IAClC,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,MAAM,EAAE;CACf,CAAC,CAAC","sourcesContent":["import { object, StringNumberStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { string } from '@metamask/superstruct';\n\nexport const BalanceStruct = object({\n amount: StringNumberStruct,\n unit: string(),\n});\n\nexport type Balance = Infer<typeof BalanceStruct>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.cjs","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":";;;AAuCA,0CAEC;AAcD,sCAEC;AAzDD,2DAAwD;AACxD,uDAAuD;AAEvD,MAAM,qBAAqB,GACzB,2JAA2J,CAAC;AAE9J,MAAM,mBAAmB,GACvB,6LAA6L,CAAC;AAEhM;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,6BAAa,EAC9C,eAAe,EACf,qBAAqB,CACtB,CAAC;AAGF;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,6BAAa,EAC5C,aAAa,EACb,mBAAmB,CACpB,CAAC;AAGF;;;;;;;;;;;GAWG;AACH,SAAgB,eAAe,CAAC,KAAc;IAC5C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,2BAAmB,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,yBAAiB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { definePattern } from '@metamask/keyring-utils';\nimport { is, type Infer } from '@metamask/superstruct';\n\nconst CAIP_ASSET_TYPE_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u;\n\nconst CAIP_ASSET_ID_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;\n\n/**\n * A CAIP-19 asset type identifier, i.e., a human-readable type of asset identifier.\n */\nexport const CaipAssetTypeStruct = definePattern(\n 'CaipAssetType',\n CAIP_ASSET_TYPE_REGEX,\n);\nexport type CaipAssetType = Infer<typeof CaipAssetTypeStruct>;\n\n/**\n * A CAIP-19 asset ID identifier, i.e., a human-readable type of asset ID.\n */\nexport const CaipAssetIdStruct = definePattern(\n 'CaipAssetId',\n CAIP_ASSET_ID_REGEX,\n);\nexport type CaipAssetId = Infer<typeof CaipAssetIdStruct>;\n\n/**\n * Check if the given value is a {@link CaipAssetType}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetType}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // true\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // true\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // false\n * ```\n */\nexport function isCaipAssetType(value: unknown): value is CaipAssetType {\n return is(value, CaipAssetTypeStruct);\n}\n\n/**\n * Check if the given value is a {@link CaipAssetId}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetId}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // false\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // false\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // true\n * ```\n */\nexport function isCaipAssetId(value: unknown): value is CaipAssetId {\n return is(value, CaipAssetIdStruct);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.d.cts","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":"AACA,OAAO,EAAM,KAAK,KAAK,EAAE,8BAA8B;AAQvD;;GAEG;AACH,eAAO,MAAM,mBAAmB,sDAG/B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,iBAAiB,sDAG7B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.d.mts","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":"AACA,OAAO,EAAM,KAAK,KAAK,EAAE,8BAA8B;AAQvD;;GAEG;AACH,eAAO,MAAM,mBAAmB,sDAG/B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,iBAAiB,sDAG7B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.mjs","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gCAAgC;AACxD,OAAO,EAAE,EAAE,EAAc,8BAA8B;AAEvD,MAAM,qBAAqB,GACzB,2JAA2J,CAAC;AAE9J,MAAM,mBAAmB,GACvB,6LAA6L,CAAC;AAEhM;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAC9C,eAAe,EACf,qBAAqB,CACtB,CAAC;AAGF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAC5C,aAAa,EACb,mBAAmB,CACpB,CAAC;AAGF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { definePattern } from '@metamask/keyring-utils';\nimport { is, type Infer } from '@metamask/superstruct';\n\nconst CAIP_ASSET_TYPE_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u;\n\nconst CAIP_ASSET_ID_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;\n\n/**\n * A CAIP-19 asset type identifier, i.e., a human-readable type of asset identifier.\n */\nexport const CaipAssetTypeStruct = definePattern(\n 'CaipAssetType',\n CAIP_ASSET_TYPE_REGEX,\n);\nexport type CaipAssetType = Infer<typeof CaipAssetTypeStruct>;\n\n/**\n * A CAIP-19 asset ID identifier, i.e., a human-readable type of asset ID.\n */\nexport const CaipAssetIdStruct = definePattern(\n 'CaipAssetId',\n CAIP_ASSET_ID_REGEX,\n);\nexport type CaipAssetId = Infer<typeof CaipAssetIdStruct>;\n\n/**\n * Check if the given value is a {@link CaipAssetType}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetType}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // true\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // true\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // false\n * ```\n */\nexport function isCaipAssetType(value: unknown): value is CaipAssetType {\n return is(value, CaipAssetTypeStruct);\n}\n\n/**\n * Check if the given value is a {@link CaipAssetId}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetId}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // false\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // false\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // true\n * ```\n */\nexport function isCaipAssetId(value: unknown): value is CaipAssetId {\n return is(value, CaipAssetIdStruct);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.cjs","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":";;;AACA,uDAAuD;AACvD,2CAA6C;AAEhC,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringAccountDataStruct = record(string(), JsonStruct);\n\n/**\n * Response to a call to `exportAccount`.\n *\n * The exact response depends on the keyring implementation.\n */\nexport type KeyringAccountData = Infer<typeof KeyringAccountDataStruct>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.cts","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,wBAAwB,8FAA+B,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.mts","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,wBAAwB,8FAA+B,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.mjs","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACvD,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringAccountDataStruct = record(string(), JsonStruct);\n\n/**\n * Response to a call to `exportAccount`.\n *\n * The exact response depends on the keyring implementation.\n */\nexport type KeyringAccountData = Infer<typeof KeyringAccountDataStruct>;\n"]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./account.cjs"), exports);
18
+ __exportStar(require("./asset.cjs"), exports);
19
+ __exportStar(require("./balance.cjs"), exports);
20
+ __exportStar(require("./caip.cjs"), exports);
21
+ __exportStar(require("./export.cjs"), exports);
22
+ __exportStar(require("./request.cjs"), exports);
23
+ __exportStar(require("./response.cjs"), exports);
24
+ __exportStar(require("./transaction.cjs"), exports);
25
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B","sourcesContent":["export * from './account';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport type * from './keyring';\n"]}
@@ -0,0 +1,10 @@
1
+ export * from "./account.cjs";
2
+ export * from "./asset.cjs";
3
+ export * from "./balance.cjs";
4
+ export * from "./caip.cjs";
5
+ export * from "./export.cjs";
6
+ export * from "./request.cjs";
7
+ export * from "./response.cjs";
8
+ export * from "./transaction.cjs";
9
+ export type * from "./keyring.cjs";
10
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,mCAA+B"}
@@ -0,0 +1,10 @@
1
+ export * from "./account.mjs";
2
+ export * from "./asset.mjs";
3
+ export * from "./balance.mjs";
4
+ export * from "./caip.mjs";
5
+ export * from "./export.mjs";
6
+ export * from "./request.mjs";
7
+ export * from "./response.mjs";
8
+ export * from "./transaction.mjs";
9
+ export type * from "./keyring.mjs";
10
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,mCAA+B"}
@@ -0,0 +1,9 @@
1
+ export * from "./account.mjs";
2
+ export * from "./asset.mjs";
3
+ export * from "./balance.mjs";
4
+ export * from "./caip.mjs";
5
+ export * from "./export.mjs";
6
+ export * from "./request.mjs";
7
+ export * from "./response.mjs";
8
+ export * from "./transaction.mjs";
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B","sourcesContent":["export * from './account';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport type * from './keyring';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\nimport type { Paginated, Pagination } from '../utils';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}