@metamask/keyring-api 11.0.0 → 12.0.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 (264) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/api/account.cjs +3 -4
  3. package/dist/api/account.cjs.map +1 -1
  4. package/dist/api/account.d.cts +1 -1
  5. package/dist/api/account.d.cts.map +1 -1
  6. package/dist/api/account.d.mts +1 -1
  7. package/dist/api/account.d.mts.map +1 -1
  8. package/dist/api/account.mjs +1 -2
  9. package/dist/api/account.mjs.map +1 -1
  10. package/dist/api/asset.cjs +82 -0
  11. package/dist/api/asset.cjs.map +1 -0
  12. package/dist/api/asset.d.cts +93 -0
  13. package/dist/api/asset.d.cts.map +1 -0
  14. package/dist/api/asset.d.mts +93 -0
  15. package/dist/api/asset.d.mts.map +1 -0
  16. package/dist/api/asset.mjs +79 -0
  17. package/dist/api/asset.mjs.map +1 -0
  18. package/dist/api/balance.cjs +3 -4
  19. package/dist/api/balance.cjs.map +1 -1
  20. package/dist/api/balance.d.cts +1 -1
  21. package/dist/api/balance.d.cts.map +1 -1
  22. package/dist/api/balance.d.mts +1 -1
  23. package/dist/api/balance.d.mts.map +1 -1
  24. package/dist/api/balance.mjs +1 -2
  25. package/dist/api/balance.mjs.map +1 -1
  26. package/dist/api/caip.cjs +3 -3
  27. package/dist/api/caip.cjs.map +1 -1
  28. package/dist/api/caip.d.cts.map +1 -1
  29. package/dist/api/caip.d.mts.map +1 -1
  30. package/dist/api/caip.mjs +1 -1
  31. package/dist/api/caip.mjs.map +1 -1
  32. package/dist/api/index.cjs +3 -0
  33. package/dist/api/index.cjs.map +1 -1
  34. package/dist/api/index.d.cts +4 -1
  35. package/dist/api/index.d.cts.map +1 -1
  36. package/dist/api/index.d.mts +4 -1
  37. package/dist/api/index.d.mts.map +1 -1
  38. package/dist/api/index.mjs +3 -0
  39. package/dist/api/index.mjs.map +1 -1
  40. package/dist/api/keyring.cjs +2 -0
  41. package/dist/api/keyring.cjs.map +1 -1
  42. package/dist/api/keyring.d.cts +14 -0
  43. package/dist/api/keyring.d.cts.map +1 -1
  44. package/dist/api/keyring.d.mts +14 -0
  45. package/dist/api/keyring.d.mts.map +1 -1
  46. package/dist/api/keyring.mjs +2 -0
  47. package/dist/api/keyring.mjs.map +1 -1
  48. package/dist/api/pagination.cjs +28 -0
  49. package/dist/api/pagination.cjs.map +1 -0
  50. package/dist/api/pagination.d.cts +59 -0
  51. package/dist/api/pagination.d.cts.map +1 -0
  52. package/dist/api/pagination.d.mts +59 -0
  53. package/dist/api/pagination.d.mts.map +1 -0
  54. package/dist/api/pagination.mjs +25 -0
  55. package/dist/api/pagination.mjs.map +1 -0
  56. package/dist/api/request.cjs +6 -7
  57. package/dist/api/request.cjs.map +1 -1
  58. package/dist/api/request.d.cts +5 -5
  59. package/dist/api/request.d.cts.map +1 -1
  60. package/dist/api/request.d.mts +5 -5
  61. package/dist/api/request.d.mts.map +1 -1
  62. package/dist/api/request.mjs +1 -2
  63. package/dist/api/request.mjs.map +1 -1
  64. package/dist/api/response.cjs +6 -6
  65. package/dist/api/response.cjs.map +1 -1
  66. package/dist/api/response.d.cts +1 -1
  67. package/dist/api/response.d.cts.map +1 -1
  68. package/dist/api/response.d.mts +1 -1
  69. package/dist/api/response.d.mts.map +1 -1
  70. package/dist/api/response.mjs +1 -1
  71. package/dist/api/response.mjs.map +1 -1
  72. package/dist/api/transaction.cjs +294 -0
  73. package/dist/api/transaction.cjs.map +1 -0
  74. package/dist/api/transaction.d.cts +773 -0
  75. package/dist/api/transaction.d.cts.map +1 -0
  76. package/dist/api/transaction.d.mts +773 -0
  77. package/dist/api/transaction.d.mts.map +1 -0
  78. package/dist/api/transaction.mjs +291 -0
  79. package/dist/api/transaction.mjs.map +1 -0
  80. package/dist/btc/types.cjs +2 -2
  81. package/dist/btc/types.cjs.map +1 -1
  82. package/dist/btc/types.d.cts +1 -1
  83. package/dist/btc/types.d.cts.map +1 -1
  84. package/dist/btc/types.d.mts +1 -1
  85. package/dist/btc/types.d.mts.map +1 -1
  86. package/dist/btc/types.mjs +2 -2
  87. package/dist/btc/types.mjs.map +1 -1
  88. package/dist/eth/erc4337/types.cjs +10 -11
  89. package/dist/eth/erc4337/types.cjs.map +1 -1
  90. package/dist/eth/erc4337/types.d.cts +4 -4
  91. package/dist/eth/erc4337/types.d.cts.map +1 -1
  92. package/dist/eth/erc4337/types.d.mts +4 -4
  93. package/dist/eth/erc4337/types.d.mts.map +1 -1
  94. package/dist/eth/erc4337/types.mjs +1 -2
  95. package/dist/eth/erc4337/types.mjs.map +1 -1
  96. package/dist/eth/types.cjs +6 -6
  97. package/dist/eth/types.cjs.map +1 -1
  98. package/dist/eth/types.d.cts +2 -2
  99. package/dist/eth/types.d.cts.map +1 -1
  100. package/dist/eth/types.d.mts +2 -2
  101. package/dist/eth/types.d.mts.map +1 -1
  102. package/dist/eth/types.mjs +1 -1
  103. package/dist/eth/types.mjs.map +1 -1
  104. package/dist/eth/utils.cjs.map +1 -1
  105. package/dist/eth/utils.d.cts.map +1 -1
  106. package/dist/eth/utils.d.mts.map +1 -1
  107. package/dist/eth/utils.mjs.map +1 -1
  108. package/dist/events.cjs +67 -1
  109. package/dist/events.cjs.map +1 -1
  110. package/dist/events.d.cts +161 -0
  111. package/dist/events.d.cts.map +1 -1
  112. package/dist/events.d.mts +161 -0
  113. package/dist/events.d.mts.map +1 -1
  114. package/dist/events.mjs +66 -0
  115. package/dist/events.mjs.map +1 -1
  116. package/dist/index.cjs +2 -8
  117. package/dist/index.cjs.map +1 -1
  118. package/dist/index.d.cts +3 -9
  119. package/dist/index.d.cts.map +1 -1
  120. package/dist/index.d.mts +3 -9
  121. package/dist/index.d.mts.map +1 -1
  122. package/dist/index.mjs +2 -8
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/{internal/api.cjs → rpc.cjs} +78 -38
  125. package/dist/rpc.cjs.map +1 -0
  126. package/dist/{internal/api.d.cts → rpc.d.cts} +402 -59
  127. package/dist/rpc.d.cts.map +1 -0
  128. package/dist/{internal/api.d.mts → rpc.d.mts} +402 -59
  129. package/dist/rpc.d.mts.map +1 -0
  130. package/dist/{internal/api.mjs → rpc.mjs} +44 -5
  131. package/dist/rpc.mjs.map +1 -0
  132. package/dist/sol/types.cjs +3 -3
  133. package/dist/sol/types.cjs.map +1 -1
  134. package/dist/sol/types.d.cts +1 -1
  135. package/dist/sol/types.d.cts.map +1 -1
  136. package/dist/sol/types.d.mts +1 -1
  137. package/dist/sol/types.d.mts.map +1 -1
  138. package/dist/sol/types.mjs +1 -1
  139. package/dist/sol/types.mjs.map +1 -1
  140. package/package.json +11 -14
  141. package/dist/JsonRpcRequest.cjs +0 -13
  142. package/dist/JsonRpcRequest.cjs.map +0 -1
  143. package/dist/JsonRpcRequest.d.cts +0 -17
  144. package/dist/JsonRpcRequest.d.cts.map +0 -1
  145. package/dist/JsonRpcRequest.d.mts +0 -17
  146. package/dist/JsonRpcRequest.d.mts.map +0 -1
  147. package/dist/JsonRpcRequest.mjs +0 -10
  148. package/dist/JsonRpcRequest.mjs.map +0 -1
  149. package/dist/KeyringClient.cjs +0 -124
  150. package/dist/KeyringClient.cjs.map +0 -1
  151. package/dist/KeyringClient.d.cts +0 -29
  152. package/dist/KeyringClient.d.cts.map +0 -1
  153. package/dist/KeyringClient.d.mts +0 -29
  154. package/dist/KeyringClient.d.mts.map +0 -1
  155. package/dist/KeyringClient.mjs +0 -120
  156. package/dist/KeyringClient.mjs.map +0 -1
  157. package/dist/KeyringSnapRpcClient.cjs +0 -68
  158. package/dist/KeyringSnapRpcClient.cjs.map +0 -1
  159. package/dist/KeyringSnapRpcClient.d.cts +0 -40
  160. package/dist/KeyringSnapRpcClient.d.cts.map +0 -1
  161. package/dist/KeyringSnapRpcClient.d.mts +0 -40
  162. package/dist/KeyringSnapRpcClient.d.mts.map +0 -1
  163. package/dist/KeyringSnapRpcClient.mjs +0 -63
  164. package/dist/KeyringSnapRpcClient.mjs.map +0 -1
  165. package/dist/internal/api.cjs.map +0 -1
  166. package/dist/internal/api.d.cts.map +0 -1
  167. package/dist/internal/api.d.mts.map +0 -1
  168. package/dist/internal/api.mjs.map +0 -1
  169. package/dist/internal/eth/EthKeyring.cjs +0 -3
  170. package/dist/internal/eth/EthKeyring.cjs.map +0 -1
  171. package/dist/internal/eth/EthKeyring.d.cts +0 -34
  172. package/dist/internal/eth/EthKeyring.d.cts.map +0 -1
  173. package/dist/internal/eth/EthKeyring.d.mts +0 -34
  174. package/dist/internal/eth/EthKeyring.d.mts.map +0 -1
  175. package/dist/internal/eth/EthKeyring.mjs +0 -2
  176. package/dist/internal/eth/EthKeyring.mjs.map +0 -1
  177. package/dist/internal/eth/index.cjs +0 -3
  178. package/dist/internal/eth/index.cjs.map +0 -1
  179. package/dist/internal/eth/index.d.cts +0 -2
  180. package/dist/internal/eth/index.d.cts.map +0 -1
  181. package/dist/internal/eth/index.d.mts +0 -2
  182. package/dist/internal/eth/index.d.mts.map +0 -1
  183. package/dist/internal/eth/index.mjs +0 -2
  184. package/dist/internal/eth/index.mjs.map +0 -1
  185. package/dist/internal/events.cjs +0 -72
  186. package/dist/internal/events.cjs.map +0 -1
  187. package/dist/internal/events.d.cts +0 -162
  188. package/dist/internal/events.d.cts.map +0 -1
  189. package/dist/internal/events.d.mts +0 -162
  190. package/dist/internal/events.d.mts.map +0 -1
  191. package/dist/internal/events.mjs +0 -69
  192. package/dist/internal/events.mjs.map +0 -1
  193. package/dist/internal/index.cjs +0 -21
  194. package/dist/internal/index.cjs.map +0 -1
  195. package/dist/internal/index.d.cts +0 -6
  196. package/dist/internal/index.d.cts.map +0 -1
  197. package/dist/internal/index.d.mts +0 -6
  198. package/dist/internal/index.d.mts.map +0 -1
  199. package/dist/internal/index.mjs +0 -5
  200. package/dist/internal/index.mjs.map +0 -1
  201. package/dist/internal/rpc.cjs +0 -33
  202. package/dist/internal/rpc.cjs.map +0 -1
  203. package/dist/internal/rpc.d.cts +0 -26
  204. package/dist/internal/rpc.d.cts.map +0 -1
  205. package/dist/internal/rpc.d.mts +0 -26
  206. package/dist/internal/rpc.d.mts.map +0 -1
  207. package/dist/internal/rpc.mjs +0 -29
  208. package/dist/internal/rpc.mjs.map +0 -1
  209. package/dist/internal/types.cjs +0 -52
  210. package/dist/internal/types.cjs.map +0 -1
  211. package/dist/internal/types.d.cts +0 -392
  212. package/dist/internal/types.d.cts.map +0 -1
  213. package/dist/internal/types.d.mts +0 -392
  214. package/dist/internal/types.d.mts.map +0 -1
  215. package/dist/internal/types.mjs +0 -49
  216. package/dist/internal/types.mjs.map +0 -1
  217. package/dist/rpc-handler.cjs +0 -136
  218. package/dist/rpc-handler.cjs.map +0 -1
  219. package/dist/rpc-handler.d.cts +0 -30
  220. package/dist/rpc-handler.d.cts.map +0 -1
  221. package/dist/rpc-handler.d.mts +0 -30
  222. package/dist/rpc-handler.d.mts.map +0 -1
  223. package/dist/rpc-handler.mjs +0 -131
  224. package/dist/rpc-handler.mjs.map +0 -1
  225. package/dist/snap-utils.cjs +0 -20
  226. package/dist/snap-utils.cjs.map +0 -1
  227. package/dist/snap-utils.d.cts +0 -12
  228. package/dist/snap-utils.d.cts.map +0 -1
  229. package/dist/snap-utils.d.mts +0 -12
  230. package/dist/snap-utils.d.mts.map +0 -1
  231. package/dist/snap-utils.mjs +0 -17
  232. package/dist/snap-utils.mjs.map +0 -1
  233. package/dist/superstruct.cjs +0 -80
  234. package/dist/superstruct.cjs.map +0 -1
  235. package/dist/superstruct.d.cts +0 -84
  236. package/dist/superstruct.d.cts.map +0 -1
  237. package/dist/superstruct.d.mts +0 -84
  238. package/dist/superstruct.d.mts.map +0 -1
  239. package/dist/superstruct.mjs +0 -74
  240. package/dist/superstruct.mjs.map +0 -1
  241. package/dist/utils/index.cjs +0 -19
  242. package/dist/utils/index.cjs.map +0 -1
  243. package/dist/utils/index.d.cts +0 -3
  244. package/dist/utils/index.d.cts.map +0 -1
  245. package/dist/utils/index.d.mts +0 -3
  246. package/dist/utils/index.d.mts.map +0 -1
  247. package/dist/utils/index.mjs +0 -3
  248. package/dist/utils/index.mjs.map +0 -1
  249. package/dist/utils/types.cjs +0 -29
  250. package/dist/utils/types.cjs.map +0 -1
  251. package/dist/utils/types.d.cts +0 -18
  252. package/dist/utils/types.d.cts.map +0 -1
  253. package/dist/utils/types.d.mts +0 -18
  254. package/dist/utils/types.d.mts.map +0 -1
  255. package/dist/utils/types.mjs +0 -26
  256. package/dist/utils/types.mjs.map +0 -1
  257. package/dist/utils/typing.cjs +0 -20
  258. package/dist/utils/typing.cjs.map +0 -1
  259. package/dist/utils/typing.d.cts +0 -33
  260. package/dist/utils/typing.d.cts.map +0 -1
  261. package/dist/utils/typing.d.mts +0 -33
  262. package/dist/utils/typing.d.mts.map +0 -1
  263. package/dist/utils/typing.mjs +0 -17
  264. package/dist/utils/typing.mjs.map +0 -1
package/dist/api/caip.mjs CHANGED
@@ -1,5 +1,5 @@
1
+ import { definePattern } from "@metamask/keyring-utils";
1
2
  import { is } from "@metamask/superstruct";
2
- import { definePattern } from "../superstruct.mjs";
3
3
  const CAIP_ASSET_TYPE_REGEX = /^(?<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;
4
4
  const CAIP_ASSET_ID_REGEX = /^(?<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;
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"caip.mjs","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAc,8BAA8B;AAEvD,OAAO,EAAE,aAAa,EAAE,2BAAuB;AAE/C,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 { is, type Infer } from '@metamask/superstruct';\n\nimport { definePattern } from '../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"]}
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"]}
@@ -15,9 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account.cjs"), exports);
18
+ __exportStar(require("./asset.cjs"), exports);
18
19
  __exportStar(require("./balance.cjs"), exports);
19
20
  __exportStar(require("./caip.cjs"), exports);
20
21
  __exportStar(require("./export.cjs"), exports);
21
22
  __exportStar(require("./request.cjs"), exports);
22
23
  __exportStar(require("./response.cjs"), exports);
24
+ __exportStar(require("./transaction.cjs"), exports);
25
+ __exportStar(require("./pagination.cjs"), exports);
23
26
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,gDAA0B;AAC1B,6CAAuB;AACvB,+CAAyB;AAEzB,gDAA0B;AAC1B,iDAA2B","sourcesContent":["export * from './account';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport type * from './keyring';\nexport * from './request';\nexport * from './response';\n"]}
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;AAC9B,mDAA6B","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 * from './pagination';\nexport type * from './keyring';\n"]}
@@ -1,8 +1,11 @@
1
1
  export * from "./account.cjs";
2
+ export * from "./asset.cjs";
2
3
  export * from "./balance.cjs";
3
4
  export * from "./caip.cjs";
4
5
  export * from "./export.cjs";
5
- export type * from "./keyring.cjs";
6
6
  export * from "./request.cjs";
7
7
  export * from "./response.cjs";
8
+ export * from "./transaction.cjs";
9
+ export * from "./pagination.cjs";
10
+ export type * from "./keyring.cjs";
8
11
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,mCAA+B;AAC/B,8BAA0B;AAC1B,+BAA2B"}
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,iCAA6B;AAC7B,mCAA+B"}
@@ -1,8 +1,11 @@
1
1
  export * from "./account.mjs";
2
+ export * from "./asset.mjs";
2
3
  export * from "./balance.mjs";
3
4
  export * from "./caip.mjs";
4
5
  export * from "./export.mjs";
5
- export type * from "./keyring.mjs";
6
6
  export * from "./request.mjs";
7
7
  export * from "./response.mjs";
8
+ export * from "./transaction.mjs";
9
+ export * from "./pagination.mjs";
10
+ export type * from "./keyring.mjs";
8
11
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,mCAA+B;AAC/B,8BAA0B;AAC1B,+BAA2B"}
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,iCAA6B;AAC7B,mCAA+B"}
@@ -1,7 +1,10 @@
1
1
  export * from "./account.mjs";
2
+ export * from "./asset.mjs";
2
3
  export * from "./balance.mjs";
3
4
  export * from "./caip.mjs";
4
5
  export * from "./export.mjs";
5
6
  export * from "./request.mjs";
6
7
  export * from "./response.mjs";
8
+ export * from "./transaction.mjs";
9
+ export * from "./pagination.mjs";
7
10
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AAEzB,8BAA0B;AAC1B,+BAA2B","sourcesContent":["export * from './account';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport type * from './keyring';\nexport * from './request';\nexport * from './response';\n"]}
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;AAC9B,iCAA6B","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 * from './pagination';\nexport type * from './keyring';\n"]}
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
3
+ // This rule seems to be triggering a false positive on the `KeyringAccount`.
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  //# sourceMappingURL=keyring.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import 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';\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 * 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"]}
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 { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\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"]}
@@ -3,8 +3,10 @@ import type { KeyringAccount } from "./account.cjs";
3
3
  import type { Balance } from "./balance.cjs";
4
4
  import type { CaipAssetType } from "./caip.cjs";
5
5
  import type { KeyringAccountData } from "./export.cjs";
6
+ import type { Paginated, Pagination } from "./pagination.cjs";
6
7
  import type { KeyringRequest } from "./request.cjs";
7
8
  import type { KeyringResponse } from "./response.cjs";
9
+ import type { Transaction } from "./transaction.cjs";
8
10
  /**
9
11
  * Keyring interface.
10
12
  *
@@ -41,6 +43,18 @@ export type Keyring = {
41
43
  * object without any private information.
42
44
  */
43
45
  createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;
46
+ /**
47
+ * Lists the transactions of an account, paginated and ordered by the most
48
+ * recent first.
49
+ *
50
+ * The pagination options are used to limit the number of transactions in the
51
+ * response and to iterate over the results.
52
+ *
53
+ * @param id - The ID of the account to list the transactions for.
54
+ * @param pagination - The pagination options.
55
+ * @returns A promise that resolves to the next page of transactions.
56
+ */
57
+ listAccountTransactions?(id: string, pagination: Pagination): Promise<Paginated<Transaction>>;
44
58
  /**
45
59
  * Retrieve the balances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D;;;;;;;OAOG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjE;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
@@ -3,8 +3,10 @@ import type { KeyringAccount } from "./account.mjs";
3
3
  import type { Balance } from "./balance.mjs";
4
4
  import type { CaipAssetType } from "./caip.mjs";
5
5
  import type { KeyringAccountData } from "./export.mjs";
6
+ import type { Paginated, Pagination } from "./pagination.mjs";
6
7
  import type { KeyringRequest } from "./request.mjs";
7
8
  import type { KeyringResponse } from "./response.mjs";
9
+ import type { Transaction } from "./transaction.mjs";
8
10
  /**
9
11
  * Keyring interface.
10
12
  *
@@ -41,6 +43,18 @@ export type Keyring = {
41
43
  * object without any private information.
42
44
  */
43
45
  createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;
46
+ /**
47
+ * Lists the transactions of an account, paginated and ordered by the most
48
+ * recent first.
49
+ *
50
+ * The pagination options are used to limit the number of transactions in the
51
+ * response and to iterate over the results.
52
+ *
53
+ * @param id - The ID of the account to list the transactions for.
54
+ * @param pagination - The pagination options.
55
+ * @returns A promise that resolves to the next page of transactions.
56
+ */
57
+ listAccountTransactions?(id: string, pagination: Pagination): Promise<Paginated<Transaction>>;
44
58
  /**
45
59
  * Retrieve the balances of a given account.
46
60
  *
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AA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E,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
@@ -1,2 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
2
+ // This rule seems to be triggering a false positive on the `KeyringAccount`.
1
3
  export {};
2
4
  //# sourceMappingURL=keyring.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import 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';\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 * 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"]}
1
+ {"version":3,"file":"keyring.mjs","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 { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\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"]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaginationStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
5
+ const superstruct_1 = require("@metamask/superstruct");
6
+ /**
7
+ * Pagination struct. This struct is used to specify the limit of items to
8
+ * return and the next cursor to iterate over the results.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * {
13
+ * limit: 10,
14
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
15
+ * }
16
+ * ```
17
+ */
18
+ exports.PaginationStruct = (0, keyring_utils_1.object)({
19
+ /**
20
+ * Maximum number of items to return.
21
+ */
22
+ limit: (0, superstruct_1.number)(),
23
+ /**
24
+ * Next cursor to iterate over the results.
25
+ */
26
+ next: (0, keyring_utils_1.exactOptional)((0, superstruct_1.nullable)((0, superstruct_1.string)())),
27
+ });
28
+ //# sourceMappingURL=pagination.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.cjs","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,uDAAiE;AAEjE;;;;;;;;;;;GAWG;AACU,QAAA,gBAAgB,GAAG,IAAA,sBAAM,EAAC;IACrC;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,IAAI,EAAE,IAAA,6BAAa,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nullable, number, string } from '@metamask/superstruct';\n\n/**\n * Pagination struct. This struct is used to specify the limit of items to\n * return and the next cursor to iterate over the results.\n *\n * @example\n * ```ts\n * {\n * limit: 10,\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport const PaginationStruct = object({\n /**\n * Maximum number of items to return.\n */\n limit: number(),\n\n /**\n * Next cursor to iterate over the results.\n */\n next: exactOptional(nullable(string())),\n});\n\n/**\n * Pagination object.\n *\n * See {@link PaginationStruct}.\n */\nexport type Pagination = Infer<typeof PaginationStruct>;\n\n/**\n * Page of results. It includes the data and the next cursor to iterate over\n * the results.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Item object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport type Paginated<Type> = {\n /**\n * The list of items for this page.\n */\n data: Type[];\n\n /**\n * Next cursor to iterate over the results if any, will be `null` otherwise.\n */\n next: string | null;\n};\n"]}
@@ -0,0 +1,59 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Pagination struct. This struct is used to specify the limit of items to
4
+ * return and the next cursor to iterate over the results.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * {
9
+ * limit: 10,
10
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
11
+ * }
12
+ * ```
13
+ */
14
+ export declare const PaginationStruct: import("@metamask/superstruct").Struct<{
15
+ limit: number;
16
+ next?: string | null;
17
+ }, {
18
+ /**
19
+ * Maximum number of items to return.
20
+ */
21
+ limit: import("@metamask/superstruct").Struct<number, null>;
22
+ /**
23
+ * Next cursor to iterate over the results.
24
+ */
25
+ next: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag | null, null>;
26
+ }>;
27
+ /**
28
+ * Pagination object.
29
+ *
30
+ * See {@link PaginationStruct}.
31
+ */
32
+ export type Pagination = Infer<typeof PaginationStruct>;
33
+ /**
34
+ * Page of results. It includes the data and the next cursor to iterate over
35
+ * the results.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * {
40
+ * data: [
41
+ * {
42
+ * // Item object
43
+ * }
44
+ * ],
45
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
46
+ * }
47
+ * ```
48
+ */
49
+ export type Paginated<Type> = {
50
+ /**
51
+ * The list of items for this page.
52
+ */
53
+ data: Type[];
54
+ /**
55
+ * Next cursor to iterate over the results if any, will be `null` otherwise.
56
+ */
57
+ next: string | null;
58
+ };
59
+ //# sourceMappingURL=pagination.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.cts","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;;IAC3B;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI;IAC5B;;OAEG;IACH,IAAI,EAAE,IAAI,EAAE,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Pagination struct. This struct is used to specify the limit of items to
4
+ * return and the next cursor to iterate over the results.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * {
9
+ * limit: 10,
10
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
11
+ * }
12
+ * ```
13
+ */
14
+ export declare const PaginationStruct: import("@metamask/superstruct").Struct<{
15
+ limit: number;
16
+ next?: string | null;
17
+ }, {
18
+ /**
19
+ * Maximum number of items to return.
20
+ */
21
+ limit: import("@metamask/superstruct").Struct<number, null>;
22
+ /**
23
+ * Next cursor to iterate over the results.
24
+ */
25
+ next: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag | null, null>;
26
+ }>;
27
+ /**
28
+ * Pagination object.
29
+ *
30
+ * See {@link PaginationStruct}.
31
+ */
32
+ export type Pagination = Infer<typeof PaginationStruct>;
33
+ /**
34
+ * Page of results. It includes the data and the next cursor to iterate over
35
+ * the results.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * {
40
+ * data: [
41
+ * {
42
+ * // Item object
43
+ * }
44
+ * ],
45
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
46
+ * }
47
+ * ```
48
+ */
49
+ export type Paginated<Type> = {
50
+ /**
51
+ * The list of items for this page.
52
+ */
53
+ data: Type[];
54
+ /**
55
+ * Next cursor to iterate over the results if any, will be `null` otherwise.
56
+ */
57
+ next: string | null;
58
+ };
59
+ //# sourceMappingURL=pagination.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.mts","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;;IAC3B;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI;IAC5B;;OAEG;IACH,IAAI,EAAE,IAAI,EAAE,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { exactOptional, object } from "@metamask/keyring-utils";
2
+ import { nullable, number, string } from "@metamask/superstruct";
3
+ /**
4
+ * Pagination struct. This struct is used to specify the limit of items to
5
+ * return and the next cursor to iterate over the results.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * {
10
+ * limit: 10,
11
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
12
+ * }
13
+ * ```
14
+ */
15
+ export const PaginationStruct = object({
16
+ /**
17
+ * Maximum number of items to return.
18
+ */
19
+ limit: number(),
20
+ /**
21
+ * Next cursor to iterate over the results.
22
+ */
23
+ next: exactOptional(nullable(string())),
24
+ });
25
+ //# sourceMappingURL=pagination.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nullable, number, string } from '@metamask/superstruct';\n\n/**\n * Pagination struct. This struct is used to specify the limit of items to\n * return and the next cursor to iterate over the results.\n *\n * @example\n * ```ts\n * {\n * limit: 10,\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport const PaginationStruct = object({\n /**\n * Maximum number of items to return.\n */\n limit: number(),\n\n /**\n * Next cursor to iterate over the results.\n */\n next: exactOptional(nullable(string())),\n});\n\n/**\n * Pagination object.\n *\n * See {@link PaginationStruct}.\n */\nexport type Pagination = Infer<typeof PaginationStruct>;\n\n/**\n * Page of results. It includes the data and the next cursor to iterate over\n * the results.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Item object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n */\nexport type Paginated<Type> = {\n /**\n * The list of items for this page.\n */\n data: Type[];\n\n /**\n * Next cursor to iterate over the results if any, will be `null` otherwise.\n */\n next: string | null;\n};\n"]}
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyringRequestStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
4
5
  const superstruct_1 = require("@metamask/superstruct");
5
6
  const utils_1 = require("@metamask/utils");
6
- const superstruct_2 = require("../superstruct.cjs");
7
- const utils_2 = require("../utils/index.cjs");
8
- exports.KeyringRequestStruct = (0, superstruct_2.object)({
7
+ exports.KeyringRequestStruct = (0, keyring_utils_1.object)({
9
8
  /**
10
9
  * Keyring request ID (UUIDv4).
11
10
  */
12
- id: utils_2.UuidStruct,
11
+ id: keyring_utils_1.UuidStruct,
13
12
  /**
14
13
  * Request's scope (CAIP-2 chain ID).
15
14
  */
@@ -17,13 +16,13 @@ exports.KeyringRequestStruct = (0, superstruct_2.object)({
17
16
  /**
18
17
  * Account ID (UUIDv4).
19
18
  */
20
- account: utils_2.UuidStruct,
19
+ account: keyring_utils_1.UuidStruct,
21
20
  /**
22
21
  * Inner request sent by the client application.
23
22
  */
24
- request: (0, superstruct_2.object)({
23
+ request: (0, keyring_utils_1.object)({
25
24
  method: (0, superstruct_1.string)(),
26
- params: (0, superstruct_2.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
25
+ params: (0, keyring_utils_1.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
27
26
  }),
28
27
  });
29
28
  //# sourceMappingURL=request.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.cjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":";;;AACA,uDAAqE;AACrE,2CAA6C;AAE7C,oDAAuD;AACvD,8CAAsC;AAEzB,QAAA,oBAAoB,GAAG,IAAA,oBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,kBAAU;IAEd;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,OAAO,EAAE,kBAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC;QACd,MAAM,EAAE,IAAA,oBAAM,GAAE;QAChB,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
1
+ {"version":3,"file":"request.cjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":";;;AAAA,2DAA4E;AAE5E,uDAAqE;AACrE,2CAA6C;AAEhC,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,OAAO,EAAE,0BAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,IAAA,sBAAM,EAAC;QACd,MAAM,EAAE,IAAA,oBAAM,GAAE;QAChB,MAAM,EAAE,IAAA,6BAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
@@ -1,12 +1,12 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  export declare const KeyringRequestStruct: import("@metamask/superstruct").Struct<{
3
3
  id: string;
4
- scope: string;
5
- account: string;
6
4
  request: {
7
5
  method: string;
8
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
6
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
9
7
  };
8
+ scope: string;
9
+ account: string;
10
10
  }, {
11
11
  /**
12
12
  * Keyring request ID (UUIDv4).
@@ -25,10 +25,10 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
25
25
  */
26
26
  request: import("@metamask/superstruct").Struct<{
27
27
  method: string;
28
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
28
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
29
29
  }, {
30
30
  method: import("@metamask/superstruct").Struct<string, null>;
31
- params: import("@metamask/superstruct").Struct<import("../superstruct.cjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
31
+ params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
32
32
  }>;
33
33
  }>;
34
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  export declare const KeyringRequestStruct: import("@metamask/superstruct").Struct<{
3
3
  id: string;
4
- scope: string;
5
- account: string;
6
4
  request: {
7
5
  method: string;
8
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
6
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
9
7
  };
8
+ scope: string;
9
+ account: string;
10
10
  }, {
11
11
  /**
12
12
  * Keyring request ID (UUIDv4).
@@ -25,10 +25,10 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
25
25
  */
26
26
  request: import("@metamask/superstruct").Struct<{
27
27
  method: string;
28
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
28
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
29
29
  }, {
30
30
  method: import("@metamask/superstruct").Struct<string, null>;
31
- params: import("@metamask/superstruct").Struct<import("../superstruct.mjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
31
+ params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
32
32
  }>;
33
33
  }>;
34
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
+ import { exactOptional, object, UuidStruct } from "@metamask/keyring-utils";
1
2
  import { array, record, string, union } from "@metamask/superstruct";
2
3
  import { JsonStruct } from "@metamask/utils";
3
- import { exactOptional, object } from "../superstruct.mjs";
4
- import { UuidStruct } from "../utils/index.mjs";
5
4
  export const KeyringRequestStruct = object({
6
5
  /**
7
6
  * Keyring request ID (UUIDv4).
@@ -1 +1 @@
1
- {"version":3,"file":"request.mjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,2BAAuB;AACvD,OAAO,EAAE,UAAU,EAAE,2BAAiB;AAEtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE;QAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
1
+ {"version":3,"file":"request.mjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE;QAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}