@metamask/keyring-api 11.1.0 → 13.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 (314) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/dist/api/account.cjs +7 -4
  3. package/dist/api/account.cjs.map +1 -1
  4. package/dist/api/account.d.cts +6 -1
  5. package/dist/api/account.d.cts.map +1 -1
  6. package/dist/api/account.d.mts +6 -1
  7. package/dist/api/account.d.mts.map +1 -1
  8. package/dist/api/account.mjs +7 -4
  9. package/dist/api/account.mjs.map +1 -1
  10. package/dist/api/asset.cjs +5 -6
  11. package/dist/api/asset.cjs.map +1 -1
  12. package/dist/api/asset.d.cts +2 -2
  13. package/dist/api/asset.d.cts.map +1 -1
  14. package/dist/api/asset.d.mts +2 -2
  15. package/dist/api/asset.d.mts.map +1 -1
  16. package/dist/api/asset.mjs +1 -2
  17. package/dist/api/asset.mjs.map +1 -1
  18. package/dist/api/balance.cjs +3 -4
  19. package/dist/api/balance.cjs.map +1 -1
  20. package/dist/api/balance.d.cts.map +1 -1
  21. package/dist/api/balance.d.mts.map +1 -1
  22. package/dist/api/balance.mjs +1 -2
  23. package/dist/api/balance.mjs.map +1 -1
  24. package/dist/api/caip.cjs +3 -3
  25. package/dist/api/caip.cjs.map +1 -1
  26. package/dist/api/caip.d.cts.map +1 -1
  27. package/dist/api/caip.d.mts.map +1 -1
  28. package/dist/api/caip.mjs +1 -1
  29. package/dist/api/caip.mjs.map +1 -1
  30. package/dist/api/index.cjs +1 -0
  31. package/dist/api/index.cjs.map +1 -1
  32. package/dist/api/index.d.cts +1 -0
  33. package/dist/api/index.d.cts.map +1 -1
  34. package/dist/api/index.d.mts +1 -0
  35. package/dist/api/index.d.mts.map +1 -1
  36. package/dist/api/index.mjs +1 -0
  37. package/dist/api/index.mjs.map +1 -1
  38. package/dist/api/keyring.cjs +2 -0
  39. package/dist/api/keyring.cjs.map +1 -1
  40. package/dist/api/keyring.d.cts +1 -1
  41. package/dist/api/keyring.d.cts.map +1 -1
  42. package/dist/api/keyring.d.mts +1 -1
  43. package/dist/api/keyring.d.mts.map +1 -1
  44. package/dist/api/keyring.mjs +2 -0
  45. package/dist/api/keyring.mjs.map +1 -1
  46. package/dist/{utils → api}/pagination.cjs +3 -3
  47. package/dist/api/pagination.cjs.map +1 -0
  48. package/dist/{utils → api}/pagination.d.cts +1 -1
  49. package/dist/api/pagination.d.cts.map +1 -0
  50. package/dist/{utils → api}/pagination.d.mts +1 -1
  51. package/dist/api/pagination.d.mts.map +1 -0
  52. package/dist/{utils → api}/pagination.mjs +1 -1
  53. package/dist/api/pagination.mjs.map +1 -0
  54. package/dist/api/request.cjs +6 -7
  55. package/dist/api/request.cjs.map +1 -1
  56. package/dist/api/request.d.cts +5 -5
  57. package/dist/api/request.d.cts.map +1 -1
  58. package/dist/api/request.d.mts +5 -5
  59. package/dist/api/request.d.mts.map +1 -1
  60. package/dist/api/request.mjs +1 -2
  61. package/dist/api/request.mjs.map +1 -1
  62. package/dist/api/response.cjs +6 -6
  63. package/dist/api/response.cjs.map +1 -1
  64. package/dist/api/response.d.cts +1 -1
  65. package/dist/api/response.d.cts.map +1 -1
  66. package/dist/api/response.d.mts +1 -1
  67. package/dist/api/response.d.mts.map +1 -1
  68. package/dist/api/response.mjs +1 -1
  69. package/dist/api/response.mjs.map +1 -1
  70. package/dist/api/transaction.cjs +7 -8
  71. package/dist/api/transaction.cjs.map +1 -1
  72. package/dist/api/transaction.d.cts +65 -65
  73. package/dist/api/transaction.d.cts.map +1 -1
  74. package/dist/api/transaction.d.mts +65 -65
  75. package/dist/api/transaction.d.mts.map +1 -1
  76. package/dist/api/transaction.mjs +1 -2
  77. package/dist/api/transaction.mjs.map +1 -1
  78. package/dist/btc/constants.cjs +17 -0
  79. package/dist/btc/constants.cjs.map +1 -0
  80. package/dist/btc/constants.d.cts +12 -0
  81. package/dist/btc/constants.d.cts.map +1 -0
  82. package/dist/btc/constants.d.mts +12 -0
  83. package/dist/btc/constants.d.mts.map +1 -0
  84. package/dist/btc/constants.mjs +14 -0
  85. package/dist/btc/constants.mjs.map +1 -0
  86. package/dist/btc/index.cjs +1 -0
  87. package/dist/btc/index.cjs.map +1 -1
  88. package/dist/btc/index.d.cts +1 -0
  89. package/dist/btc/index.d.cts.map +1 -1
  90. package/dist/btc/index.d.mts +1 -0
  91. package/dist/btc/index.d.mts.map +1 -1
  92. package/dist/btc/index.mjs +1 -0
  93. package/dist/btc/index.mjs.map +1 -1
  94. package/dist/btc/types.cjs +2 -2
  95. package/dist/btc/types.cjs.map +1 -1
  96. package/dist/btc/types.d.cts +3 -1
  97. package/dist/btc/types.d.cts.map +1 -1
  98. package/dist/btc/types.d.mts +3 -1
  99. package/dist/btc/types.d.mts.map +1 -1
  100. package/dist/btc/types.mjs +2 -2
  101. package/dist/btc/types.mjs.map +1 -1
  102. package/dist/eth/constants.cjs +13 -0
  103. package/dist/eth/constants.cjs.map +1 -0
  104. package/dist/eth/constants.d.cts +8 -0
  105. package/dist/eth/constants.d.cts.map +1 -0
  106. package/dist/eth/constants.d.mts +8 -0
  107. package/dist/eth/constants.d.mts.map +1 -0
  108. package/dist/eth/constants.mjs +10 -0
  109. package/dist/eth/constants.mjs.map +1 -0
  110. package/dist/eth/erc4337/types.cjs +10 -11
  111. package/dist/eth/erc4337/types.cjs.map +1 -1
  112. package/dist/eth/erc4337/types.d.cts +5 -5
  113. package/dist/eth/erc4337/types.d.cts.map +1 -1
  114. package/dist/eth/erc4337/types.d.mts +5 -5
  115. package/dist/eth/erc4337/types.d.mts.map +1 -1
  116. package/dist/eth/erc4337/types.mjs +1 -2
  117. package/dist/eth/erc4337/types.mjs.map +1 -1
  118. package/dist/eth/index.cjs +1 -0
  119. package/dist/eth/index.cjs.map +1 -1
  120. package/dist/eth/index.d.cts +1 -0
  121. package/dist/eth/index.d.cts.map +1 -1
  122. package/dist/eth/index.d.mts +1 -0
  123. package/dist/eth/index.d.mts.map +1 -1
  124. package/dist/eth/index.mjs +1 -0
  125. package/dist/eth/index.mjs.map +1 -1
  126. package/dist/eth/types.cjs +11 -6
  127. package/dist/eth/types.cjs.map +1 -1
  128. package/dist/eth/types.d.cts +10 -2
  129. package/dist/eth/types.d.cts.map +1 -1
  130. package/dist/eth/types.d.mts +10 -2
  131. package/dist/eth/types.d.mts.map +1 -1
  132. package/dist/eth/types.mjs +7 -2
  133. package/dist/eth/types.mjs.map +1 -1
  134. package/dist/eth/utils.cjs.map +1 -1
  135. package/dist/eth/utils.d.cts.map +1 -1
  136. package/dist/eth/utils.d.mts.map +1 -1
  137. package/dist/eth/utils.mjs.map +1 -1
  138. package/dist/events.cjs +67 -1
  139. package/dist/events.cjs.map +1 -1
  140. package/dist/events.d.cts +169 -0
  141. package/dist/events.d.cts.map +1 -1
  142. package/dist/events.d.mts +169 -0
  143. package/dist/events.d.mts.map +1 -1
  144. package/dist/events.mjs +66 -0
  145. package/dist/events.mjs.map +1 -1
  146. package/dist/index.cjs +2 -8
  147. package/dist/index.cjs.map +1 -1
  148. package/dist/index.d.cts +3 -9
  149. package/dist/index.d.cts.map +1 -1
  150. package/dist/index.d.mts +3 -9
  151. package/dist/index.d.mts.map +1 -1
  152. package/dist/index.mjs +2 -8
  153. package/dist/index.mjs.map +1 -1
  154. package/dist/{internal/api.cjs → rpc.cjs} +71 -42
  155. package/dist/rpc.cjs.map +1 -0
  156. package/dist/{internal/api.d.cts → rpc.d.cts} +141 -104
  157. package/dist/rpc.d.cts.map +1 -0
  158. package/dist/{internal/api.d.mts → rpc.d.mts} +141 -104
  159. package/dist/rpc.d.mts.map +1 -0
  160. package/dist/{internal/api.mjs → rpc.mjs} +33 -5
  161. package/dist/rpc.mjs.map +1 -0
  162. package/dist/sol/constants.cjs +15 -0
  163. package/dist/sol/constants.cjs.map +1 -0
  164. package/dist/sol/constants.d.cts +10 -0
  165. package/dist/sol/constants.d.cts.map +1 -0
  166. package/dist/sol/constants.d.mts +10 -0
  167. package/dist/sol/constants.d.mts.map +1 -0
  168. package/dist/sol/constants.mjs +12 -0
  169. package/dist/sol/constants.mjs.map +1 -0
  170. package/dist/sol/index.cjs +1 -0
  171. package/dist/sol/index.cjs.map +1 -1
  172. package/dist/sol/index.d.cts +1 -0
  173. package/dist/sol/index.d.cts.map +1 -1
  174. package/dist/sol/index.d.mts +1 -0
  175. package/dist/sol/index.d.mts.map +1 -1
  176. package/dist/sol/index.mjs +1 -0
  177. package/dist/sol/index.mjs.map +1 -1
  178. package/dist/sol/types.cjs +3 -3
  179. package/dist/sol/types.cjs.map +1 -1
  180. package/dist/sol/types.d.cts +3 -1
  181. package/dist/sol/types.d.cts.map +1 -1
  182. package/dist/sol/types.d.mts +3 -1
  183. package/dist/sol/types.d.mts.map +1 -1
  184. package/dist/sol/types.mjs +1 -1
  185. package/dist/sol/types.mjs.map +1 -1
  186. package/package.json +11 -14
  187. package/dist/JsonRpcRequest.cjs +0 -13
  188. package/dist/JsonRpcRequest.cjs.map +0 -1
  189. package/dist/JsonRpcRequest.d.cts +0 -17
  190. package/dist/JsonRpcRequest.d.cts.map +0 -1
  191. package/dist/JsonRpcRequest.d.mts +0 -17
  192. package/dist/JsonRpcRequest.d.mts.map +0 -1
  193. package/dist/JsonRpcRequest.mjs +0 -10
  194. package/dist/JsonRpcRequest.mjs.map +0 -1
  195. package/dist/KeyringClient.cjs +0 -130
  196. package/dist/KeyringClient.cjs.map +0 -1
  197. package/dist/KeyringClient.d.cts +0 -31
  198. package/dist/KeyringClient.d.cts.map +0 -1
  199. package/dist/KeyringClient.d.mts +0 -31
  200. package/dist/KeyringClient.d.mts.map +0 -1
  201. package/dist/KeyringClient.mjs +0 -126
  202. package/dist/KeyringClient.mjs.map +0 -1
  203. package/dist/KeyringSnapRpcClient.cjs +0 -68
  204. package/dist/KeyringSnapRpcClient.cjs.map +0 -1
  205. package/dist/KeyringSnapRpcClient.d.cts +0 -40
  206. package/dist/KeyringSnapRpcClient.d.cts.map +0 -1
  207. package/dist/KeyringSnapRpcClient.d.mts +0 -40
  208. package/dist/KeyringSnapRpcClient.d.mts.map +0 -1
  209. package/dist/KeyringSnapRpcClient.mjs +0 -63
  210. package/dist/KeyringSnapRpcClient.mjs.map +0 -1
  211. package/dist/internal/api.cjs.map +0 -1
  212. package/dist/internal/api.d.cts.map +0 -1
  213. package/dist/internal/api.d.mts.map +0 -1
  214. package/dist/internal/api.mjs.map +0 -1
  215. package/dist/internal/eth/EthKeyring.cjs +0 -3
  216. package/dist/internal/eth/EthKeyring.cjs.map +0 -1
  217. package/dist/internal/eth/EthKeyring.d.cts +0 -34
  218. package/dist/internal/eth/EthKeyring.d.cts.map +0 -1
  219. package/dist/internal/eth/EthKeyring.d.mts +0 -34
  220. package/dist/internal/eth/EthKeyring.d.mts.map +0 -1
  221. package/dist/internal/eth/EthKeyring.mjs +0 -2
  222. package/dist/internal/eth/EthKeyring.mjs.map +0 -1
  223. package/dist/internal/eth/index.cjs +0 -3
  224. package/dist/internal/eth/index.cjs.map +0 -1
  225. package/dist/internal/eth/index.d.cts +0 -2
  226. package/dist/internal/eth/index.d.cts.map +0 -1
  227. package/dist/internal/eth/index.d.mts +0 -2
  228. package/dist/internal/eth/index.d.mts.map +0 -1
  229. package/dist/internal/eth/index.mjs +0 -2
  230. package/dist/internal/eth/index.mjs.map +0 -1
  231. package/dist/internal/events.cjs +0 -72
  232. package/dist/internal/events.cjs.map +0 -1
  233. package/dist/internal/events.d.cts +0 -162
  234. package/dist/internal/events.d.cts.map +0 -1
  235. package/dist/internal/events.d.mts +0 -162
  236. package/dist/internal/events.d.mts.map +0 -1
  237. package/dist/internal/events.mjs +0 -69
  238. package/dist/internal/events.mjs.map +0 -1
  239. package/dist/internal/index.cjs +0 -21
  240. package/dist/internal/index.cjs.map +0 -1
  241. package/dist/internal/index.d.cts +0 -6
  242. package/dist/internal/index.d.cts.map +0 -1
  243. package/dist/internal/index.d.mts +0 -6
  244. package/dist/internal/index.d.mts.map +0 -1
  245. package/dist/internal/index.mjs +0 -5
  246. package/dist/internal/index.mjs.map +0 -1
  247. package/dist/internal/rpc.cjs +0 -34
  248. package/dist/internal/rpc.cjs.map +0 -1
  249. package/dist/internal/rpc.d.cts +0 -27
  250. package/dist/internal/rpc.d.cts.map +0 -1
  251. package/dist/internal/rpc.d.mts +0 -27
  252. package/dist/internal/rpc.d.mts.map +0 -1
  253. package/dist/internal/rpc.mjs +0 -30
  254. package/dist/internal/rpc.mjs.map +0 -1
  255. package/dist/internal/types.cjs +0 -52
  256. package/dist/internal/types.cjs.map +0 -1
  257. package/dist/internal/types.d.cts +0 -392
  258. package/dist/internal/types.d.cts.map +0 -1
  259. package/dist/internal/types.d.mts +0 -392
  260. package/dist/internal/types.d.mts.map +0 -1
  261. package/dist/internal/types.mjs +0 -49
  262. package/dist/internal/types.mjs.map +0 -1
  263. package/dist/rpc-handler.cjs +0 -143
  264. package/dist/rpc-handler.cjs.map +0 -1
  265. package/dist/rpc-handler.d.cts +0 -30
  266. package/dist/rpc-handler.d.cts.map +0 -1
  267. package/dist/rpc-handler.d.mts +0 -30
  268. package/dist/rpc-handler.d.mts.map +0 -1
  269. package/dist/rpc-handler.mjs +0 -138
  270. package/dist/rpc-handler.mjs.map +0 -1
  271. package/dist/snap-utils.cjs +0 -20
  272. package/dist/snap-utils.cjs.map +0 -1
  273. package/dist/snap-utils.d.cts +0 -12
  274. package/dist/snap-utils.d.cts.map +0 -1
  275. package/dist/snap-utils.d.mts +0 -12
  276. package/dist/snap-utils.d.mts.map +0 -1
  277. package/dist/snap-utils.mjs +0 -17
  278. package/dist/snap-utils.mjs.map +0 -1
  279. package/dist/superstruct.cjs +0 -109
  280. package/dist/superstruct.cjs.map +0 -1
  281. package/dist/superstruct.d.cts +0 -102
  282. package/dist/superstruct.d.cts.map +0 -1
  283. package/dist/superstruct.d.mts +0 -102
  284. package/dist/superstruct.d.mts.map +0 -1
  285. package/dist/superstruct.mjs +0 -102
  286. package/dist/superstruct.mjs.map +0 -1
  287. package/dist/utils/index.cjs +0 -20
  288. package/dist/utils/index.cjs.map +0 -1
  289. package/dist/utils/index.d.cts +0 -4
  290. package/dist/utils/index.d.cts.map +0 -1
  291. package/dist/utils/index.d.mts +0 -4
  292. package/dist/utils/index.d.mts.map +0 -1
  293. package/dist/utils/index.mjs +0 -4
  294. package/dist/utils/index.mjs.map +0 -1
  295. package/dist/utils/pagination.cjs.map +0 -1
  296. package/dist/utils/pagination.d.cts.map +0 -1
  297. package/dist/utils/pagination.d.mts.map +0 -1
  298. package/dist/utils/pagination.mjs.map +0 -1
  299. package/dist/utils/types.cjs +0 -29
  300. package/dist/utils/types.cjs.map +0 -1
  301. package/dist/utils/types.d.cts +0 -42
  302. package/dist/utils/types.d.cts.map +0 -1
  303. package/dist/utils/types.d.mts +0 -42
  304. package/dist/utils/types.d.mts.map +0 -1
  305. package/dist/utils/types.mjs +0 -26
  306. package/dist/utils/types.mjs.map +0 -1
  307. package/dist/utils/typing.cjs +0 -20
  308. package/dist/utils/typing.cjs.map +0 -1
  309. package/dist/utils/typing.d.cts +0 -33
  310. package/dist/utils/typing.d.cts.map +0 -1
  311. package/dist/utils/typing.d.mts +0 -33
  312. package/dist/utils/typing.d.mts.map +0 -1
  313. package/dist/utils/typing.mjs +0 -17
  314. package/dist/utils/typing.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [13.0.0]
11
+
12
+ ### Added
13
+
14
+ - New scope constant values added for Ethereum, Bitcoin, and Solana ([#101](https://github.com/MetaMask/accounts/pull/101))
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING:** Add `scopes` field to `KeyringAccount` ([#101](https://github.com/MetaMask/accounts/pull/101))
19
+
20
+ ## [12.0.0]
21
+
22
+ ### Changed
23
+
24
+ - Use `ts-bridge/cli@0.6.1` ([#118](https://github.com/MetaMask/accounts/pull/118))
25
+ - This new version fixes a bug with CJS re-exports.
26
+ - **BREAKING:** Split into several smaller packages ([#24](https://github.com/MetaMask/accounts/pull/24))
27
+ - This should improve dependencies management.
28
+ - Internal related types (internal to both clients) have been moved to `keyring-internal-*` packages.
29
+ - Keyring API clients (mainly used by dapps) have been moved to `keyring-snap-client` package.
30
+ - Common utils have been moevd to `keyring-utils` package.
31
+
10
32
  ## [11.1.0]
11
33
 
12
34
  ### Added
@@ -444,7 +466,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
444
466
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
445
467
  - Helper functions to create keyring handler in the snap.
446
468
 
447
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.1.0...HEAD
469
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@13.0.0...HEAD
470
+ [13.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@12.0.0...@metamask/keyring-api@13.0.0
471
+ [12.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.1.0...@metamask/keyring-api@12.0.0
448
472
  [11.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.0.0...@metamask/keyring-api@11.1.0
449
473
  [11.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.1.0...@metamask/keyring-api@11.0.0
450
474
  [10.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.0.0...@metamask/keyring-api@10.1.0
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyringAccountStruct = exports.SolAccountType = exports.BtcAccountType = exports.EthAccountType = 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
7
  /**
9
8
  * Supported Ethereum account types.
10
9
  */
@@ -34,11 +33,11 @@ var SolAccountType;
34
33
  *
35
34
  * See {@link KeyringAccount}.
36
35
  */
37
- exports.KeyringAccountStruct = (0, superstruct_2.object)({
36
+ exports.KeyringAccountStruct = (0, keyring_utils_1.object)({
38
37
  /**
39
38
  * Account ID (UUIDv4).
40
39
  */
41
- id: utils_2.UuidStruct,
40
+ id: keyring_utils_1.UuidStruct,
42
41
  /**
43
42
  * Account type.
44
43
  */
@@ -52,6 +51,10 @@ exports.KeyringAccountStruct = (0, superstruct_2.object)({
52
51
  * Account main address.
53
52
  */
54
53
  address: (0, superstruct_1.string)(),
54
+ /**
55
+ * Account supported scopes (CAIP-2 chain IDs).
56
+ */
57
+ scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)((0, superstruct_1.union)([utils_1.CaipNamespaceStruct, utils_1.CaipChainIdStruct]))),
55
58
  /**
56
59
  * Account options.
57
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AACA,uDAAqE;AACrE,2CAA6C;AAE7C,oDAAwC;AACxC,8CAAsC;AAEtC;;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,oBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,kBAAU;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 type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { object } from '../superstruct';\nimport { UuidStruct } from '../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"]}
1
+ {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAE7D,uDAO+B;AAC/B,2CAIyB;AAEzB;;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,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,2BAAmB,EAAE,yBAAiB,CAAC,CAAC,CAAC,CAAC;IAExE;;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 {\n nonempty,\n array,\n enums,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} 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 supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),\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"]}
@@ -32,8 +32,9 @@ export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc
32
32
  export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
33
33
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
34
34
  id: string;
35
- address: string;
36
35
  options: Record<string, import("@metamask/utils").Json>;
36
+ address: string;
37
+ scopes: string[];
37
38
  methods: string[];
38
39
  }, {
39
40
  /**
@@ -53,6 +54,10 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
53
54
  * Account main address.
54
55
  */
55
56
  address: import("@metamask/superstruct").Struct<string, null>;
57
+ /**
58
+ * Account supported scopes (CAIP-2 chain IDs).
59
+ */
60
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
56
61
  /**
57
62
  * Account options.
58
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD;;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"}
1
+ {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;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;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -32,8 +32,9 @@ export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc
32
32
  export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
33
33
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
34
34
  id: string;
35
- address: string;
36
35
  options: Record<string, import("@metamask/utils").Json>;
36
+ address: string;
37
+ scopes: string[];
37
38
  methods: string[];
38
39
  }, {
39
40
  /**
@@ -53,6 +54,10 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
53
54
  * Account main address.
54
55
  */
55
56
  address: import("@metamask/superstruct").Struct<string, null>;
57
+ /**
58
+ * Account supported scopes (CAIP-2 chain IDs).
59
+ */
60
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
56
61
  /**
57
62
  * Account options.
58
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD;;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"}
1
+ {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;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;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
- import { array, enums, record, string } from "@metamask/superstruct";
2
- import { JsonStruct } from "@metamask/utils";
3
- import { object } from "../superstruct.mjs";
4
- import { UuidStruct } from "../utils/index.mjs";
1
+ import { object, UuidStruct } from "@metamask/keyring-utils";
2
+ import { nonempty, array, enums, record, string, union } from "@metamask/superstruct";
3
+ import { CaipChainIdStruct, CaipNamespaceStruct, JsonStruct } from "@metamask/utils";
5
4
  /**
6
5
  * Supported Ethereum account types.
7
6
  */
@@ -49,6 +48,10 @@ export const KeyringAccountStruct = object({
49
48
  * Account main address.
50
49
  */
51
50
  address: string(),
51
+ /**
52
+ * Account supported scopes (CAIP-2 chain IDs).
53
+ */
54
+ scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),
52
55
  /**
53
56
  * Account options.
54
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,MAAM,EAAE,2BAAuB;AACxC,OAAO,EAAE,UAAU,EAAE,2BAAiB;AAEtC;;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 type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { object } from '../superstruct';\nimport { UuidStruct } from '../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"]}
1
+ {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE7D,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAC/B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACX,wBAAwB;AAEzB;;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,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAExE;;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 {\n nonempty,\n array,\n enums,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} 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 supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),\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"]}
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AssetStruct = exports.NonFungibleAssetStruct = exports.FungibleAssetStruct = 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
7
  /**
9
8
  * Fungible asset struct.
10
9
  */
11
- exports.FungibleAssetStruct = (0, superstruct_2.object)({
10
+ exports.FungibleAssetStruct = (0, keyring_utils_1.object)({
12
11
  /**
13
12
  * It is a fungible asset.
14
13
  */
@@ -24,12 +23,12 @@ exports.FungibleAssetStruct = (0, superstruct_2.object)({
24
23
  /**
25
24
  * Asset amount.
26
25
  */
27
- amount: utils_2.StringNumberStruct,
26
+ amount: keyring_utils_1.StringNumberStruct,
28
27
  });
29
28
  /**
30
29
  * Non-fungible asset struct.
31
30
  */
32
- exports.NonFungibleAssetStruct = (0, superstruct_2.object)({
31
+ exports.NonFungibleAssetStruct = (0, keyring_utils_1.object)({
33
32
  /**
34
33
  * It is a non-fungible asset.
35
34
  */
@@ -75,7 +74,7 @@ exports.NonFungibleAssetStruct = (0, superstruct_2.object)({
75
74
  * }
76
75
  * ```
77
76
  */
78
- exports.AssetStruct = (0, superstruct_2.selectiveUnion)((value) => {
77
+ exports.AssetStruct = (0, keyring_utils_1.selectiveUnion)((value) => {
79
78
  return (0, utils_1.isPlainObject)(value) && !value.fungible
80
79
  ? exports.NonFungibleAssetStruct
81
80
  : exports.FungibleAssetStruct;
@@ -1 +1 @@
1
- {"version":3,"file":"asset.cjs","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":";;;AACA,uDAAwD;AACxD,2CAIyB;AAEzB,oDAAwD;AACxD,8CAA8C;AAE9C;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,oBAAM,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,0BAAkB;CAC3B,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAA,oBAAM,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,4BAAc,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 type { Infer } from '@metamask/superstruct';\nimport { literal, string } from '@metamask/superstruct';\nimport {\n CaipAssetIdStruct,\n CaipAssetTypeStruct,\n isPlainObject,\n} from '@metamask/utils';\n\nimport { object, selectiveUnion } from '../superstruct';\nimport { StringNumberStruct } from '../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"]}
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"]}
@@ -3,9 +3,9 @@ import type { Infer } from "@metamask/superstruct";
3
3
  * Fungible asset struct.
4
4
  */
5
5
  export declare const FungibleAssetStruct: import("@metamask/superstruct").Struct<{
6
+ unit: string;
6
7
  type: `${string}:${string}/${string}:${string}`;
7
8
  fungible: true;
8
- unit: string;
9
9
  amount: string;
10
10
  }, {
11
11
  /**
@@ -78,9 +78,9 @@ export declare const NonFungibleAssetStruct: import("@metamask/superstruct").Str
78
78
  * ```
79
79
  */
80
80
  export declare const AssetStruct: import("@metamask/superstruct").Struct<{
81
+ unit: string;
81
82
  type: `${string}:${string}/${string}:${string}`;
82
83
  fungible: true;
83
- unit: string;
84
84
  amount: string;
85
85
  } | {
86
86
  id: `${string}:${string}/${string}:${string}/${string}`;
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.cts","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD;;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"}
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"}
@@ -3,9 +3,9 @@ import type { Infer } from "@metamask/superstruct";
3
3
  * Fungible asset struct.
4
4
  */
5
5
  export declare const FungibleAssetStruct: import("@metamask/superstruct").Struct<{
6
+ unit: string;
6
7
  type: `${string}:${string}/${string}:${string}`;
7
8
  fungible: true;
8
- unit: string;
9
9
  amount: string;
10
10
  }, {
11
11
  /**
@@ -78,9 +78,9 @@ export declare const NonFungibleAssetStruct: import("@metamask/superstruct").Str
78
78
  * ```
79
79
  */
80
80
  export declare const AssetStruct: import("@metamask/superstruct").Struct<{
81
+ unit: string;
81
82
  type: `${string}:${string}/${string}:${string}`;
82
83
  fungible: true;
83
- unit: string;
84
84
  amount: string;
85
85
  } | {
86
86
  id: `${string}:${string}/${string}:${string}/${string}`;
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.mts","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD;;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"}
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"}
@@ -1,7 +1,6 @@
1
+ import { object, selectiveUnion, StringNumberStruct } from "@metamask/keyring-utils";
1
2
  import { literal, string } from "@metamask/superstruct";
2
3
  import { CaipAssetIdStruct, CaipAssetTypeStruct, isPlainObject } from "@metamask/utils";
3
- import { object, selectiveUnion } from "../superstruct.mjs";
4
- import { StringNumberStruct } from "../utils/index.mjs";
5
4
  /**
6
5
  * Fungible asset struct.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"asset.mjs","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,8BAA8B;AACxD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACd,wBAAwB;AAEzB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,2BAAuB;AACxD,OAAO,EAAE,kBAAkB,EAAE,2BAAiB;AAE9C;;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 type { Infer } from '@metamask/superstruct';\nimport { literal, string } from '@metamask/superstruct';\nimport {\n CaipAssetIdStruct,\n CaipAssetTypeStruct,\n isPlainObject,\n} from '@metamask/utils';\n\nimport { object, selectiveUnion } from '../superstruct';\nimport { StringNumberStruct } from '../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"]}
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"]}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BalanceStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
4
5
  const superstruct_1 = require("@metamask/superstruct");
5
- const superstruct_2 = require("../superstruct.cjs");
6
- const utils_1 = require("../utils/index.cjs");
7
- exports.BalanceStruct = (0, superstruct_2.object)({
8
- amount: utils_1.StringNumberStruct,
6
+ exports.BalanceStruct = (0, keyring_utils_1.object)({
7
+ amount: keyring_utils_1.StringNumberStruct,
9
8
  unit: (0, superstruct_1.string)(),
10
9
  });
11
10
  //# sourceMappingURL=balance.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"balance.cjs","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":";;;AACA,uDAA+C;AAE/C,oDAAwC;AACxC,8CAA8C;AAEjC,QAAA,aAAa,GAAG,IAAA,oBAAM,EAAC;IAClC,MAAM,EAAE,0BAAkB;IAC1B,IAAI,EAAE,IAAA,oBAAM,GAAE;CACf,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string } from '@metamask/superstruct';\n\nimport { object } from '../superstruct';\nimport { StringNumberStruct } from '../utils';\n\nexport const BalanceStruct = object({\n amount: StringNumberStruct,\n unit: string(),\n});\n\nexport type Balance = Infer<typeof BalanceStruct>;\n"]}
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 +1 @@
1
- {"version":3,"file":"balance.d.cts","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,aAAa;;;;;;EAGxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
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 +1 @@
1
- {"version":3,"file":"balance.d.mts","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,aAAa;;;;;;EAGxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
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"}
@@ -1,6 +1,5 @@
1
+ import { object, StringNumberStruct } from "@metamask/keyring-utils";
1
2
  import { string } from "@metamask/superstruct";
2
- import { object } from "../superstruct.mjs";
3
- import { StringNumberStruct } from "../utils/index.mjs";
4
3
  export const BalanceStruct = object({
5
4
  amount: StringNumberStruct,
6
5
  unit: string(),
@@ -1 +1 @@
1
- {"version":3,"file":"balance.mjs","sourceRoot":"","sources":["../../src/api/balance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,8BAA8B;AAE/C,OAAO,EAAE,MAAM,EAAE,2BAAuB;AACxC,OAAO,EAAE,kBAAkB,EAAE,2BAAiB;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;IAClC,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,MAAM,EAAE;CACf,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string } from '@metamask/superstruct';\n\nimport { object } from '../superstruct';\nimport { StringNumberStruct } from '../utils';\n\nexport const BalanceStruct = object({\n amount: StringNumberStruct,\n unit: string(),\n});\n\nexport type Balance = Infer<typeof BalanceStruct>;\n"]}
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"]}
package/dist/api/caip.cjs CHANGED
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CaipAssetIdStruct = exports.CaipAssetTypeStruct = void 0;
4
4
  exports.isCaipAssetType = isCaipAssetType;
5
5
  exports.isCaipAssetId = isCaipAssetId;
6
+ const keyring_utils_1 = require("@metamask/keyring-utils");
6
7
  const superstruct_1 = require("@metamask/superstruct");
7
- const superstruct_2 = require("../superstruct.cjs");
8
8
  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;
9
9
  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;
10
10
  /**
11
11
  * A CAIP-19 asset type identifier, i.e., a human-readable type of asset identifier.
12
12
  */
13
- exports.CaipAssetTypeStruct = (0, superstruct_2.definePattern)('CaipAssetType', CAIP_ASSET_TYPE_REGEX);
13
+ exports.CaipAssetTypeStruct = (0, keyring_utils_1.definePattern)('CaipAssetType', CAIP_ASSET_TYPE_REGEX);
14
14
  /**
15
15
  * A CAIP-19 asset ID identifier, i.e., a human-readable type of asset ID.
16
16
  */
17
- exports.CaipAssetIdStruct = (0, superstruct_2.definePattern)('CaipAssetId', CAIP_ASSET_ID_REGEX);
17
+ exports.CaipAssetIdStruct = (0, keyring_utils_1.definePattern)('CaipAssetId', CAIP_ASSET_ID_REGEX);
18
18
  /**
19
19
  * Check if the given value is a {@link CaipAssetType}.
20
20
  *
@@ -1 +1 @@
1
- {"version":3,"file":"caip.cjs","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":";;;AAwCA,0CAEC;AAcD,sCAEC;AA1DD,uDAAuD;AAEvD,oDAA+C;AAE/C,MAAM,qBAAqB,GACzB,2JAA2J,CAAC;AAE9J,MAAM,mBAAmB,GACvB,6LAA6L,CAAC;AAEhM;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,2BAAa,EAC9C,eAAe,EACf,qBAAqB,CACtB,CAAC;AAGF;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,2BAAa,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 { 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.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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"caip.d.cts","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,KAAK,EAAE,8BAA8B;AAUvD;;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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"caip.d.mts","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,KAAK,EAAE,8BAA8B;AAUvD;;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"}
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"}
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"]}
@@ -22,4 +22,5 @@ __exportStar(require("./export.cjs"), exports);
22
22
  __exportStar(require("./request.cjs"), exports);
23
23
  __exportStar(require("./response.cjs"), exports);
24
24
  __exportStar(require("./transaction.cjs"), exports);
25
+ __exportStar(require("./pagination.cjs"), exports);
25
26
  //# sourceMappingURL=index.cjs.map
@@ -1 +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"]}
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"]}
@@ -6,5 +6,6 @@ export * from "./export.cjs";
6
6
  export * from "./request.cjs";
7
7
  export * from "./response.cjs";
8
8
  export * from "./transaction.cjs";
9
+ export * from "./pagination.cjs";
9
10
  export type * from "./keyring.cjs";
10
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,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,mCAA+B"}
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"}
@@ -6,5 +6,6 @@ export * from "./export.mjs";
6
6
  export * from "./request.mjs";
7
7
  export * from "./response.mjs";
8
8
  export * from "./transaction.mjs";
9
+ export * from "./pagination.mjs";
9
10
  export type * from "./keyring.mjs";
10
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,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,mCAA+B"}
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"}
@@ -6,4 +6,5 @@ export * from "./export.mjs";
6
6
  export * from "./request.mjs";
7
7
  export * from "./response.mjs";
8
8
  export * from "./transaction.mjs";
9
+ export * from "./pagination.mjs";
9
10
  //# sourceMappingURL=index.mjs.map
@@ -1 +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"]}
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';\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"]}
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,10 +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";
8
9
  import type { Transaction } from "./transaction.cjs";
9
- import type { Paginated, Pagination } from "../utils/index.cjs";
10
10
  /**
11
11
  * Keyring interface.
12
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAe;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,2BAAiB;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE1C;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE5D;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEvE;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,CACtB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,kBAAkB,CAAC,CACjB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,aAAa,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3C;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAErE;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;;;;;OAQG;IACH,UAAU,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE7D;;;;;;;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"}
1
+ {"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAe;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAqB;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE1C;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE5D;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEvE;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,CACtB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,kBAAkB,CAAC,CACjB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,aAAa,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3C;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAErE;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;;;;;OAQG;IACH,UAAU,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE7D;;;;;;;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"}