@metamask-previews/keyring-api 11.0.0-22cd5fe → 11.0.0-b85bfaa

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 (332) hide show
  1. package/dist/{api/account.cjs → account.cjs} +3 -8
  2. package/dist/account.cjs.map +1 -0
  3. package/dist/{api/account.d.cts → account.d.cts} +1 -6
  4. package/dist/account.d.cts.map +1 -0
  5. package/dist/{api/account.d.mts → account.d.mts} +1 -6
  6. package/dist/account.d.mts.map +1 -0
  7. package/dist/{api/account.mjs → account.mjs} +3 -8
  8. package/dist/account.mjs.map +1 -0
  9. package/dist/balance.cjs +10 -0
  10. package/dist/balance.cjs.map +1 -0
  11. package/dist/balance.d.cts.map +1 -0
  12. package/dist/balance.d.mts.map +1 -0
  13. package/dist/{api/balance.mjs → balance.mjs} +1 -2
  14. package/dist/balance.mjs.map +1 -0
  15. package/dist/{api/caip.cjs → caip.cjs} +3 -3
  16. package/dist/{api/caip.cjs.map → caip.cjs.map} +1 -1
  17. package/dist/caip.d.cts.map +1 -0
  18. package/dist/caip.d.mts.map +1 -0
  19. package/dist/{api/caip.mjs → caip.mjs} +1 -1
  20. package/dist/{api/caip.mjs.map → caip.mjs.map} +1 -1
  21. package/dist/export.cjs.map +1 -0
  22. package/dist/export.d.cts.map +1 -0
  23. package/dist/export.d.mts.map +1 -0
  24. package/dist/export.mjs.map +1 -0
  25. package/dist/index.cjs +6 -12
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +7 -12
  28. package/dist/index.d.cts.map +1 -1
  29. package/dist/index.d.mts +7 -12
  30. package/dist/index.d.mts.map +1 -1
  31. package/dist/index.mjs +6 -12
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/keyring.cjs +5 -0
  34. package/dist/keyring.cjs.map +1 -0
  35. package/dist/keyring.d.cts.map +1 -0
  36. package/dist/keyring.d.mts.map +1 -0
  37. package/dist/keyring.mjs +4 -0
  38. package/dist/keyring.mjs.map +1 -0
  39. package/dist/{api/request.cjs → request.cjs} +6 -7
  40. package/dist/request.cjs.map +1 -0
  41. package/dist/{api/request.d.cts → request.d.cts} +3 -3
  42. package/dist/request.d.cts.map +1 -0
  43. package/dist/{api/request.d.mts → request.d.mts} +3 -3
  44. package/dist/request.d.mts.map +1 -0
  45. package/dist/{api/request.mjs → request.mjs} +1 -2
  46. package/dist/request.mjs.map +1 -0
  47. package/dist/{api/response.cjs → response.cjs} +6 -6
  48. package/dist/{api/response.cjs.map → response.cjs.map} +1 -1
  49. package/dist/response.d.cts.map +1 -0
  50. package/dist/response.d.mts.map +1 -0
  51. package/dist/{api/response.mjs → response.mjs} +1 -1
  52. package/dist/{api/response.mjs.map → response.mjs.map} +1 -1
  53. package/package.json +9 -10
  54. package/dist/JsonRpcRequest.cjs +0 -13
  55. package/dist/JsonRpcRequest.cjs.map +0 -1
  56. package/dist/JsonRpcRequest.d.cts +0 -17
  57. package/dist/JsonRpcRequest.d.cts.map +0 -1
  58. package/dist/JsonRpcRequest.d.mts +0 -17
  59. package/dist/JsonRpcRequest.d.mts.map +0 -1
  60. package/dist/JsonRpcRequest.mjs +0 -10
  61. package/dist/JsonRpcRequest.mjs.map +0 -1
  62. package/dist/KeyringClient.cjs +0 -124
  63. package/dist/KeyringClient.cjs.map +0 -1
  64. package/dist/KeyringClient.d.cts +0 -29
  65. package/dist/KeyringClient.d.cts.map +0 -1
  66. package/dist/KeyringClient.d.mts +0 -29
  67. package/dist/KeyringClient.d.mts.map +0 -1
  68. package/dist/KeyringClient.mjs +0 -120
  69. package/dist/KeyringClient.mjs.map +0 -1
  70. package/dist/KeyringSnapRpcClient.cjs +0 -68
  71. package/dist/KeyringSnapRpcClient.cjs.map +0 -1
  72. package/dist/KeyringSnapRpcClient.d.cts +0 -40
  73. package/dist/KeyringSnapRpcClient.d.cts.map +0 -1
  74. package/dist/KeyringSnapRpcClient.d.mts +0 -40
  75. package/dist/KeyringSnapRpcClient.d.mts.map +0 -1
  76. package/dist/KeyringSnapRpcClient.mjs +0 -63
  77. package/dist/KeyringSnapRpcClient.mjs.map +0 -1
  78. package/dist/api/account.cjs.map +0 -1
  79. package/dist/api/account.d.cts.map +0 -1
  80. package/dist/api/account.d.mts.map +0 -1
  81. package/dist/api/account.mjs.map +0 -1
  82. package/dist/api/balance.cjs +0 -11
  83. package/dist/api/balance.cjs.map +0 -1
  84. package/dist/api/balance.d.cts.map +0 -1
  85. package/dist/api/balance.d.mts.map +0 -1
  86. package/dist/api/balance.mjs.map +0 -1
  87. package/dist/api/caip.d.cts.map +0 -1
  88. package/dist/api/caip.d.mts.map +0 -1
  89. package/dist/api/export.cjs.map +0 -1
  90. package/dist/api/export.d.cts.map +0 -1
  91. package/dist/api/export.d.mts.map +0 -1
  92. package/dist/api/export.mjs.map +0 -1
  93. package/dist/api/index.cjs +0 -23
  94. package/dist/api/index.cjs.map +0 -1
  95. package/dist/api/index.d.cts +0 -8
  96. package/dist/api/index.d.cts.map +0 -1
  97. package/dist/api/index.d.mts +0 -8
  98. package/dist/api/index.d.mts.map +0 -1
  99. package/dist/api/index.mjs +0 -7
  100. package/dist/api/index.mjs.map +0 -1
  101. package/dist/api/keyring.cjs +0 -3
  102. package/dist/api/keyring.cjs.map +0 -1
  103. package/dist/api/keyring.d.cts.map +0 -1
  104. package/dist/api/keyring.d.mts.map +0 -1
  105. package/dist/api/keyring.mjs +0 -2
  106. package/dist/api/keyring.mjs.map +0 -1
  107. package/dist/api/request.cjs.map +0 -1
  108. package/dist/api/request.d.cts.map +0 -1
  109. package/dist/api/request.d.mts.map +0 -1
  110. package/dist/api/request.mjs.map +0 -1
  111. package/dist/api/response.d.cts.map +0 -1
  112. package/dist/api/response.d.mts.map +0 -1
  113. package/dist/btc/constants.cjs +0 -13
  114. package/dist/btc/constants.cjs.map +0 -1
  115. package/dist/btc/constants.d.cts +0 -9
  116. package/dist/btc/constants.d.cts.map +0 -1
  117. package/dist/btc/constants.d.mts +0 -9
  118. package/dist/btc/constants.d.mts.map +0 -1
  119. package/dist/btc/constants.mjs +0 -10
  120. package/dist/btc/constants.mjs.map +0 -1
  121. package/dist/btc/index.cjs +0 -19
  122. package/dist/btc/index.cjs.map +0 -1
  123. package/dist/btc/index.d.cts +0 -3
  124. package/dist/btc/index.d.cts.map +0 -1
  125. package/dist/btc/index.d.mts +0 -3
  126. package/dist/btc/index.d.mts.map +0 -1
  127. package/dist/btc/index.mjs +0 -3
  128. package/dist/btc/index.mjs.map +0 -1
  129. package/dist/btc/types.cjs +0 -40
  130. package/dist/btc/types.cjs.map +0 -1
  131. package/dist/btc/types.d.cts +0 -36
  132. package/dist/btc/types.d.cts.map +0 -1
  133. package/dist/btc/types.d.mts +0 -36
  134. package/dist/btc/types.d.mts.map +0 -1
  135. package/dist/btc/types.mjs +0 -37
  136. package/dist/btc/types.mjs.map +0 -1
  137. package/dist/eth/constants.cjs +0 -12
  138. package/dist/eth/constants.cjs.map +0 -1
  139. package/dist/eth/constants.d.cts +0 -8
  140. package/dist/eth/constants.d.cts.map +0 -1
  141. package/dist/eth/constants.d.mts +0 -8
  142. package/dist/eth/constants.d.mts.map +0 -1
  143. package/dist/eth/constants.mjs +0 -9
  144. package/dist/eth/constants.mjs.map +0 -1
  145. package/dist/eth/erc4337/index.cjs +0 -18
  146. package/dist/eth/erc4337/index.cjs.map +0 -1
  147. package/dist/eth/erc4337/index.d.cts +0 -2
  148. package/dist/eth/erc4337/index.d.cts.map +0 -1
  149. package/dist/eth/erc4337/index.d.mts +0 -2
  150. package/dist/eth/erc4337/index.d.mts.map +0 -1
  151. package/dist/eth/erc4337/index.mjs +0 -2
  152. package/dist/eth/erc4337/index.mjs.map +0 -1
  153. package/dist/eth/erc4337/types.cjs +0 -62
  154. package/dist/eth/erc4337/types.cjs.map +0 -1
  155. package/dist/eth/erc4337/types.d.cts +0 -98
  156. package/dist/eth/erc4337/types.d.cts.map +0 -1
  157. package/dist/eth/erc4337/types.d.mts +0 -98
  158. package/dist/eth/erc4337/types.d.mts.map +0 -1
  159. package/dist/eth/erc4337/types.mjs +0 -59
  160. package/dist/eth/erc4337/types.mjs.map +0 -1
  161. package/dist/eth/index.cjs +0 -21
  162. package/dist/eth/index.cjs.map +0 -1
  163. package/dist/eth/index.d.cts +0 -5
  164. package/dist/eth/index.d.cts.map +0 -1
  165. package/dist/eth/index.d.mts +0 -5
  166. package/dist/eth/index.d.mts.map +0 -1
  167. package/dist/eth/index.mjs +0 -5
  168. package/dist/eth/index.mjs.map +0 -1
  169. package/dist/eth/types.cjs +0 -73
  170. package/dist/eth/types.cjs.map +0 -1
  171. package/dist/eth/types.d.cts +0 -85
  172. package/dist/eth/types.d.cts.map +0 -1
  173. package/dist/eth/types.d.mts +0 -85
  174. package/dist/eth/types.d.mts.map +0 -1
  175. package/dist/eth/types.mjs +0 -70
  176. package/dist/eth/types.mjs.map +0 -1
  177. package/dist/eth/utils.cjs +0 -14
  178. package/dist/eth/utils.cjs.map +0 -1
  179. package/dist/eth/utils.d.cts +0 -9
  180. package/dist/eth/utils.d.cts.map +0 -1
  181. package/dist/eth/utils.d.mts +0 -9
  182. package/dist/eth/utils.d.mts.map +0 -1
  183. package/dist/eth/utils.mjs +0 -11
  184. package/dist/eth/utils.mjs.map +0 -1
  185. package/dist/events.cjs +0 -17
  186. package/dist/events.cjs.map +0 -1
  187. package/dist/events.d.cts +0 -11
  188. package/dist/events.d.cts.map +0 -1
  189. package/dist/events.d.mts +0 -11
  190. package/dist/events.d.mts.map +0 -1
  191. package/dist/events.mjs +0 -14
  192. package/dist/events.mjs.map +0 -1
  193. package/dist/internal/api.cjs +0 -139
  194. package/dist/internal/api.cjs.map +0 -1
  195. package/dist/internal/api.d.cts +0 -431
  196. package/dist/internal/api.d.cts.map +0 -1
  197. package/dist/internal/api.d.mts +0 -431
  198. package/dist/internal/api.d.mts.map +0 -1
  199. package/dist/internal/api.mjs +0 -136
  200. package/dist/internal/api.mjs.map +0 -1
  201. package/dist/internal/eth/EthKeyring.cjs +0 -3
  202. package/dist/internal/eth/EthKeyring.cjs.map +0 -1
  203. package/dist/internal/eth/EthKeyring.d.cts +0 -34
  204. package/dist/internal/eth/EthKeyring.d.cts.map +0 -1
  205. package/dist/internal/eth/EthKeyring.d.mts +0 -34
  206. package/dist/internal/eth/EthKeyring.d.mts.map +0 -1
  207. package/dist/internal/eth/EthKeyring.mjs +0 -2
  208. package/dist/internal/eth/EthKeyring.mjs.map +0 -1
  209. package/dist/internal/eth/index.cjs +0 -3
  210. package/dist/internal/eth/index.cjs.map +0 -1
  211. package/dist/internal/eth/index.d.cts +0 -2
  212. package/dist/internal/eth/index.d.cts.map +0 -1
  213. package/dist/internal/eth/index.d.mts +0 -2
  214. package/dist/internal/eth/index.d.mts.map +0 -1
  215. package/dist/internal/eth/index.mjs +0 -2
  216. package/dist/internal/eth/index.mjs.map +0 -1
  217. package/dist/internal/events.cjs +0 -72
  218. package/dist/internal/events.cjs.map +0 -1
  219. package/dist/internal/events.d.cts +0 -170
  220. package/dist/internal/events.d.cts.map +0 -1
  221. package/dist/internal/events.d.mts +0 -170
  222. package/dist/internal/events.d.mts.map +0 -1
  223. package/dist/internal/events.mjs +0 -69
  224. package/dist/internal/events.mjs.map +0 -1
  225. package/dist/internal/index.cjs +0 -21
  226. package/dist/internal/index.cjs.map +0 -1
  227. package/dist/internal/index.d.cts +0 -6
  228. package/dist/internal/index.d.cts.map +0 -1
  229. package/dist/internal/index.d.mts +0 -6
  230. package/dist/internal/index.d.mts.map +0 -1
  231. package/dist/internal/index.mjs +0 -5
  232. package/dist/internal/index.mjs.map +0 -1
  233. package/dist/internal/rpc.cjs +0 -33
  234. package/dist/internal/rpc.cjs.map +0 -1
  235. package/dist/internal/rpc.d.cts +0 -26
  236. package/dist/internal/rpc.d.cts.map +0 -1
  237. package/dist/internal/rpc.d.mts +0 -26
  238. package/dist/internal/rpc.d.mts.map +0 -1
  239. package/dist/internal/rpc.mjs +0 -29
  240. package/dist/internal/rpc.mjs.map +0 -1
  241. package/dist/internal/types.cjs +0 -52
  242. package/dist/internal/types.cjs.map +0 -1
  243. package/dist/internal/types.d.cts +0 -402
  244. package/dist/internal/types.d.cts.map +0 -1
  245. package/dist/internal/types.d.mts +0 -402
  246. package/dist/internal/types.d.mts.map +0 -1
  247. package/dist/internal/types.mjs +0 -49
  248. package/dist/internal/types.mjs.map +0 -1
  249. package/dist/rpc-handler.cjs +0 -136
  250. package/dist/rpc-handler.cjs.map +0 -1
  251. package/dist/rpc-handler.d.cts +0 -30
  252. package/dist/rpc-handler.d.cts.map +0 -1
  253. package/dist/rpc-handler.d.mts +0 -30
  254. package/dist/rpc-handler.d.mts.map +0 -1
  255. package/dist/rpc-handler.mjs +0 -131
  256. package/dist/rpc-handler.mjs.map +0 -1
  257. package/dist/snap-utils.cjs +0 -20
  258. package/dist/snap-utils.cjs.map +0 -1
  259. package/dist/snap-utils.d.cts +0 -12
  260. package/dist/snap-utils.d.cts.map +0 -1
  261. package/dist/snap-utils.d.mts +0 -12
  262. package/dist/snap-utils.d.mts.map +0 -1
  263. package/dist/snap-utils.mjs +0 -17
  264. package/dist/snap-utils.mjs.map +0 -1
  265. package/dist/sol/constants.cjs +0 -14
  266. package/dist/sol/constants.cjs.map +0 -1
  267. package/dist/sol/constants.d.cts +0 -10
  268. package/dist/sol/constants.d.cts.map +0 -1
  269. package/dist/sol/constants.d.mts +0 -10
  270. package/dist/sol/constants.d.mts.map +0 -1
  271. package/dist/sol/constants.mjs +0 -11
  272. package/dist/sol/constants.mjs.map +0 -1
  273. package/dist/sol/index.cjs +0 -19
  274. package/dist/sol/index.cjs.map +0 -1
  275. package/dist/sol/index.d.cts +0 -3
  276. package/dist/sol/index.d.cts.map +0 -1
  277. package/dist/sol/index.d.mts +0 -3
  278. package/dist/sol/index.d.mts.map +0 -1
  279. package/dist/sol/index.mjs +0 -3
  280. package/dist/sol/index.mjs.map +0 -1
  281. package/dist/sol/types.cjs +0 -36
  282. package/dist/sol/types.cjs.map +0 -1
  283. package/dist/sol/types.d.cts +0 -41
  284. package/dist/sol/types.d.cts.map +0 -1
  285. package/dist/sol/types.d.mts +0 -41
  286. package/dist/sol/types.d.mts.map +0 -1
  287. package/dist/sol/types.mjs +0 -33
  288. package/dist/sol/types.mjs.map +0 -1
  289. package/dist/superstruct.cjs +0 -80
  290. package/dist/superstruct.cjs.map +0 -1
  291. package/dist/superstruct.d.cts +0 -84
  292. package/dist/superstruct.d.cts.map +0 -1
  293. package/dist/superstruct.d.mts +0 -84
  294. package/dist/superstruct.d.mts.map +0 -1
  295. package/dist/superstruct.mjs +0 -74
  296. package/dist/superstruct.mjs.map +0 -1
  297. package/dist/utils/index.cjs +0 -19
  298. package/dist/utils/index.cjs.map +0 -1
  299. package/dist/utils/index.d.cts +0 -3
  300. package/dist/utils/index.d.cts.map +0 -1
  301. package/dist/utils/index.d.mts +0 -3
  302. package/dist/utils/index.d.mts.map +0 -1
  303. package/dist/utils/index.mjs +0 -3
  304. package/dist/utils/index.mjs.map +0 -1
  305. package/dist/utils/types.cjs +0 -29
  306. package/dist/utils/types.cjs.map +0 -1
  307. package/dist/utils/types.d.cts +0 -18
  308. package/dist/utils/types.d.cts.map +0 -1
  309. package/dist/utils/types.d.mts +0 -18
  310. package/dist/utils/types.d.mts.map +0 -1
  311. package/dist/utils/types.mjs +0 -26
  312. package/dist/utils/types.mjs.map +0 -1
  313. package/dist/utils/typing.cjs +0 -20
  314. package/dist/utils/typing.cjs.map +0 -1
  315. package/dist/utils/typing.d.cts +0 -33
  316. package/dist/utils/typing.d.cts.map +0 -1
  317. package/dist/utils/typing.d.mts +0 -33
  318. package/dist/utils/typing.d.mts.map +0 -1
  319. package/dist/utils/typing.mjs +0 -17
  320. package/dist/utils/typing.mjs.map +0 -1
  321. /package/dist/{api/balance.d.cts → balance.d.cts} +0 -0
  322. /package/dist/{api/balance.d.mts → balance.d.mts} +0 -0
  323. /package/dist/{api/caip.d.cts → caip.d.cts} +0 -0
  324. /package/dist/{api/caip.d.mts → caip.d.mts} +0 -0
  325. /package/dist/{api/export.cjs → export.cjs} +0 -0
  326. /package/dist/{api/export.d.cts → export.d.cts} +0 -0
  327. /package/dist/{api/export.d.mts → export.d.mts} +0 -0
  328. /package/dist/{api/export.mjs → export.mjs} +0 -0
  329. /package/dist/{api/keyring.d.cts → keyring.d.cts} +0 -0
  330. /package/dist/{api/keyring.d.mts → keyring.d.mts} +0 -0
  331. /package/dist/{api/response.d.cts → response.d.cts} +0 -0
  332. /package/dist/{api/response.d.mts → response.d.mts} +0 -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,10 +51,6 @@ exports.KeyringAccountStruct = (0, superstruct_2.object)({
52
51
  * Account main address.
53
52
  */
54
53
  address: (0, superstruct_1.string)(),
55
- /**
56
- * Account supported scopes (CAIP-2 chain IDs).
57
- */
58
- scopes: (0, superstruct_1.array)((0, superstruct_1.union)([utils_1.CaipNamespaceStruct, utils_1.CaipChainIdStruct])),
59
54
  /**
60
55
  * Account options.
61
56
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAE7D,uDAAqE;AACrE,2CAA6C;AAE7C;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -30,10 +30,9 @@ export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc
30
30
  * See {@link KeyringAccount}.
31
31
  */
32
32
  export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
33
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
34
33
  id: string;
34
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
35
35
  address: string;
36
- scopes: string[];
37
36
  options: Record<string, import("@metamask/utils").Json>;
38
37
  methods: string[];
39
38
  }, {
@@ -54,10 +53,6 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
54
53
  * Account main address.
55
54
  */
56
55
  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>>;
61
56
  /**
62
57
  * Account options.
63
58
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -30,10 +30,9 @@ export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc
30
30
  * See {@link KeyringAccount}.
31
31
  */
32
32
  export declare const KeyringAccountStruct: import("@metamask/superstruct").Struct<{
33
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
34
33
  id: string;
34
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
35
35
  address: string;
36
- scopes: string[];
37
36
  options: Record<string, import("@metamask/utils").Json>;
38
37
  methods: string[];
39
38
  }, {
@@ -54,10 +53,6 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
54
53
  * Account main address.
55
54
  */
56
55
  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>>;
61
56
  /**
62
57
  * Account options.
63
58
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
- import { array, enums, record, string, union } from "@metamask/superstruct";
2
- import { CaipChainIdStruct, CaipNamespaceStruct, 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 { array, enums, record, string } from "@metamask/superstruct";
3
+ import { JsonStruct } from "@metamask/utils";
5
4
  /**
6
5
  * Supported Ethereum account types.
7
6
  */
@@ -49,10 +48,6 @@ export const KeyringAccountStruct = object({
49
48
  * Account main address.
50
49
  */
51
50
  address: string(),
52
- /**
53
- * Account supported scopes (CAIP-2 chain IDs).
54
- */
55
- scopes: array(union([CaipNamespaceStruct, CaipChainIdStruct])),
56
51
  /**
57
52
  * Account options.
58
53
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE7D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BalanceStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
5
+ const superstruct_1 = require("@metamask/superstruct");
6
+ exports.BalanceStruct = (0, keyring_utils_1.object)({
7
+ amount: keyring_utils_1.StringNumberStruct,
8
+ unit: (0, superstruct_1.string)(),
9
+ });
10
+ //# sourceMappingURL=balance.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.cjs","sourceRoot":"","sources":["../src/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"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.cts","sourceRoot":"","sources":["../src/balance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD,eAAO,MAAM,aAAa;;;;;;EAGxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.mts","sourceRoot":"","sources":["../src/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(),
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.mjs","sourceRoot":"","sources":["../src/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"]}
@@ -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/caip.ts"],"names":[],"mappings":";;;AAuCA,0CAEC;AAcD,sCAEC;AAzDD,2DAAwD;AACxD,uDAAuD;AAEvD,MAAM,qBAAqB,GACzB,2JAA2J,CAAC;AAE9J,MAAM,mBAAmB,GACvB,6LAA6L,CAAC;AAEhM;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,6BAAa,EAC9C,eAAe,EACf,qBAAqB,CACtB,CAAC;AAGF;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,6BAAa,EAC5C,aAAa,EACb,mBAAmB,CACpB,CAAC;AAGF;;;;;;;;;;;GAWG;AACH,SAAgB,eAAe,CAAC,KAAc;IAC5C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,2BAAmB,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,yBAAiB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { definePattern } from '@metamask/keyring-utils';\nimport { is, type Infer } from '@metamask/superstruct';\n\nconst CAIP_ASSET_TYPE_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u;\n\nconst CAIP_ASSET_ID_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;\n\n/**\n * A CAIP-19 asset type identifier, i.e., a human-readable type of asset identifier.\n */\nexport const CaipAssetTypeStruct = definePattern(\n 'CaipAssetType',\n CAIP_ASSET_TYPE_REGEX,\n);\nexport type CaipAssetType = Infer<typeof CaipAssetTypeStruct>;\n\n/**\n * A CAIP-19 asset ID identifier, i.e., a human-readable type of asset ID.\n */\nexport const CaipAssetIdStruct = definePattern(\n 'CaipAssetId',\n CAIP_ASSET_ID_REGEX,\n);\nexport type CaipAssetId = Infer<typeof CaipAssetIdStruct>;\n\n/**\n * Check if the given value is a {@link CaipAssetType}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetType}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // true\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // true\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // false\n * ```\n */\nexport function isCaipAssetType(value: unknown): value is CaipAssetType {\n return is(value, CaipAssetTypeStruct);\n}\n\n/**\n * Check if the given value is a {@link CaipAssetId}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetId}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // false\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // false\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // true\n * ```\n */\nexport function isCaipAssetId(value: unknown): value is CaipAssetId {\n return is(value, CaipAssetIdStruct);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.d.cts","sourceRoot":"","sources":["../src/caip.ts"],"names":[],"mappings":"AACA,OAAO,EAAM,KAAK,KAAK,EAAE,8BAA8B;AAQvD;;GAEG;AACH,eAAO,MAAM,mBAAmB,sDAG/B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,iBAAiB,sDAG7B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.d.mts","sourceRoot":"","sources":["../src/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,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/caip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gCAAgC;AACxD,OAAO,EAAE,EAAE,EAAc,8BAA8B;AAEvD,MAAM,qBAAqB,GACzB,2JAA2J,CAAC;AAE9J,MAAM,mBAAmB,GACvB,6LAA6L,CAAC;AAEhM;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAC9C,eAAe,EACf,qBAAqB,CACtB,CAAC;AAGF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAC5C,aAAa,EACb,mBAAmB,CACpB,CAAC;AAGF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { definePattern } from '@metamask/keyring-utils';\nimport { is, type Infer } from '@metamask/superstruct';\n\nconst CAIP_ASSET_TYPE_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u;\n\nconst CAIP_ASSET_ID_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;\n\n/**\n * A CAIP-19 asset type identifier, i.e., a human-readable type of asset identifier.\n */\nexport const CaipAssetTypeStruct = definePattern(\n 'CaipAssetType',\n CAIP_ASSET_TYPE_REGEX,\n);\nexport type CaipAssetType = Infer<typeof CaipAssetTypeStruct>;\n\n/**\n * A CAIP-19 asset ID identifier, i.e., a human-readable type of asset ID.\n */\nexport const CaipAssetIdStruct = definePattern(\n 'CaipAssetId',\n CAIP_ASSET_ID_REGEX,\n);\nexport type CaipAssetId = Infer<typeof CaipAssetIdStruct>;\n\n/**\n * Check if the given value is a {@link CaipAssetType}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetType}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // true\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // true\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // false\n * ```\n */\nexport function isCaipAssetType(value: unknown): value is CaipAssetType {\n return is(value, CaipAssetTypeStruct);\n}\n\n/**\n * Check if the given value is a {@link CaipAssetId}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetId}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // false\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // false\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // true\n * ```\n */\nexport function isCaipAssetId(value: unknown): value is CaipAssetId {\n return is(value, CaipAssetIdStruct);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.cjs","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":";;;AACA,uDAAuD;AACvD,2CAA6C;AAEhC,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringAccountDataStruct = record(string(), JsonStruct);\n\n/**\n * Response to a call to `exportAccount`.\n *\n * The exact response depends on the keyring implementation.\n */\nexport type KeyringAccountData = Infer<typeof KeyringAccountDataStruct>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.cts","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,wBAAwB,8FAA+B,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.mts","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,wBAAwB,8FAA+B,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.mjs","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACvD,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringAccountDataStruct = record(string(), JsonStruct);\n\n/**\n * Response to a call to `exportAccount`.\n *\n * The exact response depends on the keyring implementation.\n */\nexport type KeyringAccountData = Infer<typeof KeyringAccountDataStruct>;\n"]}
package/dist/index.cjs CHANGED
@@ -14,16 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api/index.cjs"), exports);
18
- __exportStar(require("./btc/index.cjs"), exports);
19
- __exportStar(require("./eth/index.cjs"), exports);
20
- __exportStar(require("./sol/index.cjs"), exports);
21
- __exportStar(require("./events.cjs"), exports);
22
- __exportStar(require("./internal/index.cjs"), exports);
23
- __exportStar(require("./JsonRpcRequest.cjs"), exports);
24
- __exportStar(require("./KeyringClient.cjs"), exports);
25
- __exportStar(require("./KeyringSnapRpcClient.cjs"), exports);
26
- __exportStar(require("./rpc-handler.cjs"), exports);
27
- __exportStar(require("./snap-utils.cjs"), exports);
28
- __exportStar(require("./superstruct.cjs"), exports);
17
+ __exportStar(require("./account.cjs"), exports);
18
+ __exportStar(require("./balance.cjs"), exports);
19
+ __exportStar(require("./caip.cjs"), exports);
20
+ __exportStar(require("./export.cjs"), exports);
21
+ __exportStar(require("./request.cjs"), exports);
22
+ __exportStar(require("./response.cjs"), exports);
29
23
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAsB;AACtB,kDAAsB;AAEtB,kDAAsB;AACtB,kDAAsB;AACtB,+CAAyB;AACzB,uDAA2B;AAC3B,uDAAiC;AACjC,sDAAgC;AAChC,6DAAuC;AACvC,oDAA8B;AAC9B,mDAA6B;AAC7B,oDAA8B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport type * from './contexts';\nexport * from './eth';\nexport * from './sol';\nexport * from './events';\nexport * from './internal';\nexport * from './JsonRpcRequest';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,gDAA0B;AAC1B,6CAAuB;AACvB,+CAAyB;AAEzB,gDAA0B;AAC1B,iDAA2B","sourcesContent":["export * from './account';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport type * from './keyring';\nexport * from './request';\nexport * from './response';\nexport type * from './contexts';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,14 +1,9 @@
1
- export * from "./api/index.cjs";
2
- export * from "./btc/index.cjs";
1
+ export * from "./account.cjs";
2
+ export * from "./balance.cjs";
3
+ export * from "./caip.cjs";
4
+ export * from "./export.cjs";
5
+ export type * from "./keyring.cjs";
6
+ export * from "./request.cjs";
7
+ export * from "./response.cjs";
3
8
  export type * from "./contexts.cjs";
4
- export * from "./eth/index.cjs";
5
- export * from "./sol/index.cjs";
6
- export * from "./events.cjs";
7
- export * from "./internal/index.cjs";
8
- export * from "./JsonRpcRequest.cjs";
9
- export * from "./KeyringClient.cjs";
10
- export * from "./KeyringSnapRpcClient.cjs";
11
- export * from "./rpc-handler.cjs";
12
- export * from "./snap-utils.cjs";
13
- export * from "./superstruct.cjs";
14
9
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AACtB,oCAAgC;AAChC,gCAAsB;AACtB,gCAAsB;AACtB,6BAAyB;AACzB,qCAA2B;AAC3B,qCAAiC;AACjC,oCAAgC;AAChC,2CAAuC;AACvC,kCAA8B;AAC9B,iCAA6B;AAC7B,kCAA8B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,mCAA+B;AAC/B,8BAA0B;AAC1B,+BAA2B;AAC3B,oCAAgC"}
package/dist/index.d.mts CHANGED
@@ -1,14 +1,9 @@
1
- export * from "./api/index.mjs";
2
- export * from "./btc/index.mjs";
1
+ export * from "./account.mjs";
2
+ export * from "./balance.mjs";
3
+ export * from "./caip.mjs";
4
+ export * from "./export.mjs";
5
+ export type * from "./keyring.mjs";
6
+ export * from "./request.mjs";
7
+ export * from "./response.mjs";
3
8
  export type * from "./contexts.mjs";
4
- export * from "./eth/index.mjs";
5
- export * from "./sol/index.mjs";
6
- export * from "./events.mjs";
7
- export * from "./internal/index.mjs";
8
- export * from "./JsonRpcRequest.mjs";
9
- export * from "./KeyringClient.mjs";
10
- export * from "./KeyringSnapRpcClient.mjs";
11
- export * from "./rpc-handler.mjs";
12
- export * from "./snap-utils.mjs";
13
- export * from "./superstruct.mjs";
14
9
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AACtB,oCAAgC;AAChC,gCAAsB;AACtB,gCAAsB;AACtB,6BAAyB;AACzB,qCAA2B;AAC3B,qCAAiC;AACjC,oCAAgC;AAChC,2CAAuC;AACvC,kCAA8B;AAC9B,iCAA6B;AAC7B,kCAA8B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,mCAA+B;AAC/B,8BAA0B;AAC1B,+BAA2B;AAC3B,oCAAgC"}
package/dist/index.mjs CHANGED
@@ -1,13 +1,7 @@
1
- export * from "./api/index.mjs";
2
- export * from "./btc/index.mjs";
3
- export * from "./eth/index.mjs";
4
- export * from "./sol/index.mjs";
5
- export * from "./events.mjs";
6
- export * from "./internal/index.mjs";
7
- export * from "./JsonRpcRequest.mjs";
8
- export * from "./KeyringClient.mjs";
9
- export * from "./KeyringSnapRpcClient.mjs";
10
- export * from "./rpc-handler.mjs";
11
- export * from "./snap-utils.mjs";
12
- export * from "./superstruct.mjs";
1
+ export * from "./account.mjs";
2
+ export * from "./balance.mjs";
3
+ export * from "./caip.mjs";
4
+ export * from "./export.mjs";
5
+ export * from "./request.mjs";
6
+ export * from "./response.mjs";
13
7
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AAEtB,gCAAsB;AACtB,gCAAsB;AACtB,6BAAyB;AACzB,qCAA2B;AAC3B,qCAAiC;AACjC,oCAAgC;AAChC,2CAAuC;AACvC,kCAA8B;AAC9B,iCAA6B;AAC7B,kCAA8B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport type * from './contexts';\nexport * from './eth';\nexport * from './sol';\nexport * from './events';\nexport * from './internal';\nexport * from './JsonRpcRequest';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AAEzB,8BAA0B;AAC1B,+BAA2B","sourcesContent":["export * from './account';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport type * from './keyring';\nexport * from './request';\nexport * from './response';\nexport type * from './contexts';\n"]}
@@ -0,0 +1,5 @@
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`.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=keyring.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../src/keyring.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../src/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,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAElD;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../src/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,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAElD;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -0,0 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
2
+ // This rule seems to be triggering a false positive on the `KeyringAccount`.
3
+ export {};
4
+ //# sourceMappingURL=keyring.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../src/keyring.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyringRequestStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
4
5
  const superstruct_1 = require("@metamask/superstruct");
5
6
  const utils_1 = require("@metamask/utils");
6
- const superstruct_2 = require("../superstruct.cjs");
7
- const utils_2 = require("../utils/index.cjs");
8
- exports.KeyringRequestStruct = (0, superstruct_2.object)({
7
+ exports.KeyringRequestStruct = (0, keyring_utils_1.object)({
9
8
  /**
10
9
  * Keyring request ID (UUIDv4).
11
10
  */
12
- id: utils_2.UuidStruct,
11
+ id: keyring_utils_1.UuidStruct,
13
12
  /**
14
13
  * Request's scope (CAIP-2 chain ID).
15
14
  */
@@ -17,13 +16,13 @@ exports.KeyringRequestStruct = (0, superstruct_2.object)({
17
16
  /**
18
17
  * Account ID (UUIDv4).
19
18
  */
20
- account: utils_2.UuidStruct,
19
+ account: keyring_utils_1.UuidStruct,
21
20
  /**
22
21
  * Inner request sent by the client application.
23
22
  */
24
- request: (0, superstruct_2.object)({
23
+ request: (0, keyring_utils_1.object)({
25
24
  method: (0, superstruct_1.string)(),
26
- params: (0, superstruct_2.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
25
+ params: (0, keyring_utils_1.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
27
26
  }),
28
27
  });
29
28
  //# sourceMappingURL=request.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.cjs","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";;;AAAA,2DAA4E;AAE5E,uDAAqE;AACrE,2CAA6C;AAEhC,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,OAAO,EAAE,0BAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,IAAA,sBAAM,EAAC;QACd,MAAM,EAAE,IAAA,oBAAM,GAAE;QAChB,MAAM,EAAE,IAAA,6BAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
@@ -5,7 +5,7 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
5
5
  account: string;
6
6
  request: {
7
7
  method: string;
8
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
8
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
9
9
  };
10
10
  }, {
11
11
  /**
@@ -25,10 +25,10 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
25
25
  */
26
26
  request: import("@metamask/superstruct").Struct<{
27
27
  method: string;
28
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
28
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
29
29
  }, {
30
30
  method: import("@metamask/superstruct").Struct<string, null>;
31
- params: import("@metamask/superstruct").Struct<import("../superstruct.cjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
31
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[], null>;
32
32
  }>;
33
33
  }>;
34
34
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -5,7 +5,7 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
5
5
  account: string;
6
6
  request: {
7
7
  method: string;
8
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
8
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
9
9
  };
10
10
  }, {
11
11
  /**
@@ -25,10 +25,10 @@ export declare const KeyringRequestStruct: import("@metamask/superstruct").Struc
25
25
  */
26
26
  request: import("@metamask/superstruct").Struct<{
27
27
  method: string;
28
- params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
28
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
29
29
  }, {
30
30
  method: import("@metamask/superstruct").Struct<string, null>;
31
- params: import("@metamask/superstruct").Struct<import("../superstruct.mjs").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
31
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[], null>;
32
32
  }>;
33
33
  }>;
34
34
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
+ import { exactOptional, object, UuidStruct } from "@metamask/keyring-utils";
1
2
  import { array, record, string, union } from "@metamask/superstruct";
2
3
  import { JsonStruct } from "@metamask/utils";
3
- import { exactOptional, object } from "../superstruct.mjs";
4
- import { UuidStruct } from "../utils/index.mjs";
5
4
  export const KeyringRequestStruct = object({
6
5
  /**
7
6
  * Keyring request ID (UUIDv4).
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.mjs","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE;QAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyringResponseStruct = 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
7
  exports.KeyringResponseStruct = (0, superstruct_1.union)([
8
- (0, superstruct_2.object)({
8
+ (0, keyring_utils_1.object)({
9
9
  /**
10
10
  * Pending flag.
11
11
  *
@@ -21,12 +21,12 @@ exports.KeyringResponseStruct = (0, superstruct_1.union)([
21
21
  * with a link to the redirect URL. The user can choose to follow the link
22
22
  * or cancel the request.
23
23
  */
24
- redirect: (0, superstruct_2.exactOptional)((0, superstruct_2.object)({
25
- message: (0, superstruct_2.exactOptional)((0, superstruct_1.string)()),
26
- url: (0, superstruct_2.exactOptional)((0, superstruct_1.string)()),
24
+ redirect: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
25
+ message: (0, keyring_utils_1.exactOptional)((0, superstruct_1.string)()),
26
+ url: (0, keyring_utils_1.exactOptional)((0, superstruct_1.string)()),
27
27
  })),
28
28
  }),
29
- (0, superstruct_2.object)({
29
+ (0, keyring_utils_1.object)({
30
30
  /**
31
31
  * Pending flag.
32
32
  *