@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,40 +0,0 @@
1
- import type { MetaMaskInpageProvider } from "@metamask/providers";
2
- import type { Json } from "@metamask/utils";
3
- import type { JsonRpcRequest } from "./JsonRpcRequest.cjs";
4
- import type { Sender } from "./KeyringClient.cjs";
5
- import { KeyringClient } from "./KeyringClient.cjs";
6
- /**
7
- * Implementation of the `Sender` interface that can be used to send requests
8
- * to a snap through the snap JSON-RPC API.
9
- */
10
- export declare class SnapRpcSender implements Sender {
11
- #private;
12
- /**
13
- * Create a new instance of `SnapRpcSender`.
14
- *
15
- * @param origin - The caller's origin.
16
- * @param provider - The `MetaMaskInpageProvider` instance to use.
17
- */
18
- constructor(origin: string, provider: MetaMaskInpageProvider);
19
- /**
20
- * Send a request to the snap and return the response.
21
- *
22
- * @param request - The JSON-RPC request to send to the snap.
23
- * @returns A promise that resolves to the response of the request.
24
- */
25
- send(request: JsonRpcRequest): Promise<Json>;
26
- }
27
- /**
28
- * A `KeyringClient` that allows the communication with a snap through the snap
29
- * JSON-RPC API.
30
- */
31
- export declare class KeyringSnapRpcClient extends KeyringClient {
32
- /**
33
- * Create a new instance of `KeyringSnapRpcClient`.
34
- *
35
- * @param origin - Caller's origin.
36
- * @param provider - The `MetaMaskInpageProvider` instance to use.
37
- */
38
- constructor(origin: string, provider: MetaMaskInpageProvider);
39
- }
40
- //# sourceMappingURL=KeyringSnapRpcClient.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KeyringSnapRpcClient.d.cts","sourceRoot":"","sources":["../src/KeyringSnapRpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B;AAClE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,6BAAyB;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,4BAAwB;AAC9C,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD;;;GAGG;AACH,qBAAa,aAAc,YAAW,MAAM;;IAK1C;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB;IAK5D;;;;;OAKG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CASnD;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB;CAG7D"}
@@ -1,40 +0,0 @@
1
- import type { MetaMaskInpageProvider } from "@metamask/providers";
2
- import type { Json } from "@metamask/utils";
3
- import type { JsonRpcRequest } from "./JsonRpcRequest.mjs";
4
- import type { Sender } from "./KeyringClient.mjs";
5
- import { KeyringClient } from "./KeyringClient.mjs";
6
- /**
7
- * Implementation of the `Sender` interface that can be used to send requests
8
- * to a snap through the snap JSON-RPC API.
9
- */
10
- export declare class SnapRpcSender implements Sender {
11
- #private;
12
- /**
13
- * Create a new instance of `SnapRpcSender`.
14
- *
15
- * @param origin - The caller's origin.
16
- * @param provider - The `MetaMaskInpageProvider` instance to use.
17
- */
18
- constructor(origin: string, provider: MetaMaskInpageProvider);
19
- /**
20
- * Send a request to the snap and return the response.
21
- *
22
- * @param request - The JSON-RPC request to send to the snap.
23
- * @returns A promise that resolves to the response of the request.
24
- */
25
- send(request: JsonRpcRequest): Promise<Json>;
26
- }
27
- /**
28
- * A `KeyringClient` that allows the communication with a snap through the snap
29
- * JSON-RPC API.
30
- */
31
- export declare class KeyringSnapRpcClient extends KeyringClient {
32
- /**
33
- * Create a new instance of `KeyringSnapRpcClient`.
34
- *
35
- * @param origin - Caller's origin.
36
- * @param provider - The `MetaMaskInpageProvider` instance to use.
37
- */
38
- constructor(origin: string, provider: MetaMaskInpageProvider);
39
- }
40
- //# sourceMappingURL=KeyringSnapRpcClient.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KeyringSnapRpcClient.d.mts","sourceRoot":"","sources":["../src/KeyringSnapRpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B;AAClE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,6BAAyB;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,4BAAwB;AAC9C,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD;;;GAGG;AACH,qBAAa,aAAc,YAAW,MAAM;;IAK1C;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB;IAK5D;;;;;OAKG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CASnD;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB;CAG7D"}
@@ -1,63 +0,0 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _SnapRpcSender_origin, _SnapRpcSender_provider;
13
- import { KeyringClient } from "./KeyringClient.mjs";
14
- /**
15
- * Implementation of the `Sender` interface that can be used to send requests
16
- * to a snap through the snap JSON-RPC API.
17
- */
18
- export class SnapRpcSender {
19
- /**
20
- * Create a new instance of `SnapRpcSender`.
21
- *
22
- * @param origin - The caller's origin.
23
- * @param provider - The `MetaMaskInpageProvider` instance to use.
24
- */
25
- constructor(origin, provider) {
26
- _SnapRpcSender_origin.set(this, void 0);
27
- _SnapRpcSender_provider.set(this, void 0);
28
- __classPrivateFieldSet(this, _SnapRpcSender_origin, origin, "f");
29
- __classPrivateFieldSet(this, _SnapRpcSender_provider, provider, "f");
30
- }
31
- /**
32
- * Send a request to the snap and return the response.
33
- *
34
- * @param request - The JSON-RPC request to send to the snap.
35
- * @returns A promise that resolves to the response of the request.
36
- */
37
- async send(request) {
38
- return __classPrivateFieldGet(this, _SnapRpcSender_provider, "f").request({
39
- method: 'wallet_invokeKeyring',
40
- params: {
41
- snapId: __classPrivateFieldGet(this, _SnapRpcSender_origin, "f"),
42
- request,
43
- },
44
- });
45
- }
46
- }
47
- _SnapRpcSender_origin = new WeakMap(), _SnapRpcSender_provider = new WeakMap();
48
- /**
49
- * A `KeyringClient` that allows the communication with a snap through the snap
50
- * JSON-RPC API.
51
- */
52
- export class KeyringSnapRpcClient extends KeyringClient {
53
- /**
54
- * Create a new instance of `KeyringSnapRpcClient`.
55
- *
56
- * @param origin - Caller's origin.
57
- * @param provider - The `MetaMaskInpageProvider` instance to use.
58
- */
59
- constructor(origin, provider) {
60
- super(new SnapRpcSender(origin, provider));
61
- }
62
- }
63
- //# sourceMappingURL=KeyringSnapRpcClient.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KeyringSnapRpcClient.mjs","sourceRoot":"","sources":["../src/KeyringSnapRpcClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD;;;GAGG;AACH,MAAM,OAAO,aAAa;IAKxB;;;;;OAKG;IACH,YAAY,MAAc,EAAE,QAAgC;QAVnD,wCAAgB;QAEhB,0CAAkC;QASzC,uBAAA,IAAI,yBAAW,MAAM,MAAA,CAAC;QACtB,uBAAA,IAAI,2BAAa,QAAQ,MAAA,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,OAAO,uBAAA,IAAI,+BAAU,CAAC,OAAO,CAAC;YAC5B,MAAM,EAAE,sBAAsB;YAC9B,MAAM,EAAE;gBACN,MAAM,EAAE,uBAAA,IAAI,6BAAQ;gBACpB,OAAO;aACR;SACF,CAAkB,CAAC;IACtB,CAAC;CACF;;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD;;;;;OAKG;IACH,YAAY,MAAc,EAAE,QAAgC;QAC1D,KAAK,CAAC,IAAI,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import type { MetaMaskInpageProvider } from '@metamask/providers';\nimport type { Json } from '@metamask/utils';\n\nimport type { JsonRpcRequest } from './JsonRpcRequest';\nimport type { Sender } from './KeyringClient';\nimport { KeyringClient } from './KeyringClient';\n\n/**\n * Implementation of the `Sender` interface that can be used to send requests\n * to a snap through the snap JSON-RPC API.\n */\nexport class SnapRpcSender implements Sender {\n readonly #origin: string;\n\n readonly #provider: MetaMaskInpageProvider;\n\n /**\n * Create a new instance of `SnapRpcSender`.\n *\n * @param origin - The caller's origin.\n * @param provider - The `MetaMaskInpageProvider` instance to use.\n */\n constructor(origin: string, provider: MetaMaskInpageProvider) {\n this.#origin = origin;\n this.#provider = provider;\n }\n\n /**\n * Send a request to the snap and return the response.\n *\n * @param request - The JSON-RPC request to send to the snap.\n * @returns A promise that resolves to the response of the request.\n */\n async send(request: JsonRpcRequest): Promise<Json> {\n return this.#provider.request({\n method: 'wallet_invokeKeyring',\n params: {\n snapId: this.#origin,\n request,\n },\n }) as Promise<Json>;\n }\n}\n\n/**\n * A `KeyringClient` that allows the communication with a snap through the snap\n * JSON-RPC API.\n */\nexport class KeyringSnapRpcClient extends KeyringClient {\n /**\n * Create a new instance of `KeyringSnapRpcClient`.\n *\n * @param origin - Caller's origin.\n * @param provider - The `MetaMaskInpageProvider` instance to use.\n */\n constructor(origin: string, provider: MetaMaskInpageProvider) {\n super(new SnapRpcSender(origin, provider));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AACA,uDAA4E;AAC5E,2CAIyB;AAEzB,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,MAAM,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,2BAAmB,EAAE,yBAAiB,CAAC,CAAC,CAAC;IAE9D;;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, union } from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} 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 supported scopes (CAIP-2 chain IDs).\n */\n scopes: 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 +0,0 @@
1
- {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD;;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 +0,0 @@
1
- {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;A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,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,KAAK,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE9D;;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, union } from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} 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 supported scopes (CAIP-2 chain IDs).\n */\n scopes: 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,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BalanceStruct = void 0;
4
- 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,
9
- unit: (0, superstruct_1.string)(),
10
- });
11
- //# sourceMappingURL=balance.cjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"export.cjs","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":";;;AACA,uDAAuD;AACvD,2CAA6C;AAEhC,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringAccountDataStruct = record(string(), JsonStruct);\n\n/**\n * Response to a call to `exportAccount`.\n *\n * The exact response depends on the keyring implementation.\n */\nexport type KeyringAccountData = Infer<typeof KeyringAccountDataStruct>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"export.d.cts","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,wBAAwB,8FAA+B,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"export.d.mts","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,eAAO,MAAM,wBAAwB,8FAA+B,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"export.mjs","sourceRoot":"","sources":["../../src/api/export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACvD,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringAccountDataStruct = record(string(), JsonStruct);\n\n/**\n * Response to a call to `exportAccount`.\n *\n * The exact response depends on the keyring implementation.\n */\nexport type KeyringAccountData = Infer<typeof KeyringAccountDataStruct>;\n"]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./account.cjs"), exports);
18
- __exportStar(require("./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);
23
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,gDAA0B;AAC1B,6CAAuB;AACvB,+CAAyB;AAEzB,gDAA0B;AAC1B,iDAA2B","sourcesContent":["export * from './account';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport type * from './keyring';\nexport * from './request';\nexport * from './response';\n"]}
@@ -1,8 +0,0 @@
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";
8
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,mCAA+B;AAC/B,8BAA0B;AAC1B,+BAA2B"}
@@ -1,8 +0,0 @@
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";
8
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,mCAA+B;AAC/B,8BAA0B;AAC1B,+BAA2B"}
@@ -1,7 +0,0 @@
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";
7
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AAEzB,8BAA0B;AAC1B,+BAA2B","sourcesContent":["export * from './account';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport type * from './keyring';\nexport * from './request';\nexport * from './response';\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=keyring.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
@@ -1 +0,0 @@
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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":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.cjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":";;;AACA,uDAAqE;AACrE,2CAA6C;AAE7C,oDAAuD;AACvD,8CAAsC;AAEzB,QAAA,oBAAoB,GAAG,IAAA,oBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,kBAAU;IAEd;;OAEG;IACH,KAAK,EAAE,IAAA,oBAAM,GAAE;IAEf;;OAEG;IACH,OAAO,EAAE,kBAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC;QACd,MAAM,EAAE,IAAA,oBAAM,GAAE;QAChB,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.d.cts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.d.mts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,oBAAoB;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;EAOH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.mjs","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,2BAAuB;AACvD,OAAO,EAAE,UAAU,EAAE,2BAAiB;AAEtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE;IAEf;;OAEG;IACH,OAAO,EAAE,UAAU;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE;QAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, record, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const KeyringRequestStruct = object({\n /**\n * Keyring request ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Request's scope (CAIP-2 chain ID).\n */\n scope: string(),\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Inner request sent by the client application.\n */\n request: object({\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n }),\n});\n\n/**\n * Keyring request.\n *\n * Represents a request made to the keyring for account-related operations.\n */\nexport type KeyringRequest = Infer<typeof KeyringRequestStruct>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"response.d.cts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,qBAAqB;;;;;;;;;QAwChC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"response.d.mts","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,qBAAqB;;;;;;;;;QAwChC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BtcScopes = void 0;
4
- /**
5
- * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
6
- */
7
- var BtcScopes;
8
- (function (BtcScopes) {
9
- BtcScopes["Namespace"] = "bip122";
10
- BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
11
- BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
12
- })(BtcScopes || (exports.BtcScopes = BtcScopes = {}));
13
- //# sourceMappingURL=constants.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;AACrD,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB","sourcesContent":["/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n}\n"]}
@@ -1,9 +0,0 @@
1
- /**
2
- * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
- */
4
- export declare enum BtcScopes {
5
- Namespace = "bip122",
6
- Mainnet = "bip122:000000000019d6689c085ae165831e93",
7
- Testnet = "bip122:000000000933ea01ad0ee984209779ba"
8
- }
9
- //# sourceMappingURL=constants.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;CACpD"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
- */
4
- export declare enum BtcScopes {
5
- Namespace = "bip122",
6
- Mainnet = "bip122:000000000019d6689c085ae165831e93",
7
- Testnet = "bip122:000000000933ea01ad0ee984209779ba"
8
- }
9
- //# sourceMappingURL=constants.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;CACpD"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
- */
4
- export var BtcScopes;
5
- (function (BtcScopes) {
6
- BtcScopes["Namespace"] = "bip122";
7
- BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
8
- BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
9
- })(BtcScopes || (BtcScopes = {}));
10
- //# sourceMappingURL=constants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;AACrD,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB","sourcesContent":["/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n}\n"]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants.cjs"), exports);
18
- __exportStar(require("./types.cjs"), exports);
19
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -1,3 +0,0 @@
1
- export * from "./constants.cjs";
2
- export * from "./types.cjs";
3
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
@@ -1,3 +0,0 @@
1
- export * from "./constants.mjs";
2
- export * from "./types.mjs";
3
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
@@ -1,3 +0,0 @@
1
- export * from "./constants.mjs";
2
- export * from "./types.mjs";
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BtcP2wpkhAccountStruct = exports.BtcMethod = exports.BtcP2wpkhAddressStruct = void 0;
4
- const superstruct_1 = require("@metamask/superstruct");
5
- const bech32_1 = require("bech32");
6
- const api_1 = require("../api/index.cjs");
7
- const superstruct_2 = require("../superstruct.cjs");
8
- exports.BtcP2wpkhAddressStruct = (0, superstruct_1.refine)((0, superstruct_1.string)(), 'BtcP2wpkhAddressStruct', (address) => {
9
- try {
10
- bech32_1.bech32.decode(address);
11
- }
12
- catch (error) {
13
- return new Error(`Could not decode P2WPKH address: ${error.message}`);
14
- }
15
- return true;
16
- });
17
- /**
18
- * Supported Bitcoin methods.
19
- */
20
- var BtcMethod;
21
- (function (BtcMethod) {
22
- // General transaction methods
23
- BtcMethod["SendBitcoin"] = "sendBitcoin";
24
- })(BtcMethod || (exports.BtcMethod = BtcMethod = {}));
25
- exports.BtcP2wpkhAccountStruct = (0, superstruct_2.object)({
26
- ...api_1.KeyringAccountStruct.schema,
27
- /**
28
- * Account address.
29
- */
30
- address: exports.BtcP2wpkhAddressStruct,
31
- /**
32
- * Account type.
33
- */
34
- type: (0, superstruct_1.literal)(`${api_1.BtcAccountType.P2wpkh}`),
35
- /**
36
- * Account supported methods.
37
- */
38
- methods: (0, superstruct_1.array)((0, superstruct_1.enums)([`${BtcMethod.SendBitcoin}`])),
39
- });
40
- //# sourceMappingURL=types.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":";;;AACA,uDAA8E;AAC9E,mCAAgC;AAEhC,0CAA8D;AAC9D,oDAAwC;AAE3B,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAC1C,IAAA,oBAAM,GAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,8BAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
@@ -1,36 +0,0 @@
1
- import type { Infer } from "@metamask/superstruct";
2
- export declare const BtcP2wpkhAddressStruct: import("@metamask/superstruct").Struct<string, null>;
3
- /**
4
- * Supported Bitcoin methods.
5
- */
6
- export declare enum BtcMethod {
7
- SendBitcoin = "sendBitcoin"
8
- }
9
- export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Struct<{
10
- type: "bip122:p2wpkh";
11
- id: string;
12
- address: string;
13
- scopes: string[];
14
- options: Record<string, import("@metamask/utils").Json>;
15
- methods: "sendBitcoin"[];
16
- }, {
17
- /**
18
- * Account address.
19
- */
20
- address: import("@metamask/superstruct").Struct<string, null>;
21
- /**
22
- * Account type.
23
- */
24
- type: import("@metamask/superstruct").Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
25
- /**
26
- * Account supported methods.
27
- */
28
- methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
29
- sendBitcoin: "sendBitcoin";
30
- }>>;
31
- id: import("@metamask/superstruct").Struct<string, null>;
32
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
33
- options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
34
- }>;
35
- export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
36
- //# sourceMappingURL=types.d.cts.map