@metamask-previews/keyring-api 11.1.0-5143ee2 → 11.1.0-dde1dbb

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 (265) hide show
  1. package/dist/JsonRpcRequest.cjs +13 -0
  2. package/dist/JsonRpcRequest.cjs.map +1 -0
  3. package/dist/JsonRpcRequest.d.cts +17 -0
  4. package/dist/JsonRpcRequest.d.cts.map +1 -0
  5. package/dist/JsonRpcRequest.d.mts +17 -0
  6. package/dist/JsonRpcRequest.d.mts.map +1 -0
  7. package/dist/JsonRpcRequest.mjs +10 -0
  8. package/dist/JsonRpcRequest.mjs.map +1 -0
  9. package/dist/KeyringClient.cjs +130 -0
  10. package/dist/KeyringClient.cjs.map +1 -0
  11. package/dist/KeyringClient.d.cts +31 -0
  12. package/dist/KeyringClient.d.cts.map +1 -0
  13. package/dist/KeyringClient.d.mts +31 -0
  14. package/dist/KeyringClient.d.mts.map +1 -0
  15. package/dist/KeyringClient.mjs +126 -0
  16. package/dist/KeyringClient.mjs.map +1 -0
  17. package/dist/KeyringSnapRpcClient.cjs +68 -0
  18. package/dist/KeyringSnapRpcClient.cjs.map +1 -0
  19. package/dist/KeyringSnapRpcClient.d.cts +40 -0
  20. package/dist/KeyringSnapRpcClient.d.cts.map +1 -0
  21. package/dist/KeyringSnapRpcClient.d.mts +40 -0
  22. package/dist/KeyringSnapRpcClient.d.mts.map +1 -0
  23. package/dist/KeyringSnapRpcClient.mjs +63 -0
  24. package/dist/KeyringSnapRpcClient.mjs.map +1 -0
  25. package/dist/api/account.cjs +4 -3
  26. package/dist/api/account.cjs.map +1 -1
  27. package/dist/api/account.d.cts +1 -1
  28. package/dist/api/account.d.cts.map +1 -1
  29. package/dist/api/account.d.mts +1 -1
  30. package/dist/api/account.d.mts.map +1 -1
  31. package/dist/api/account.mjs +2 -1
  32. package/dist/api/account.mjs.map +1 -1
  33. package/dist/api/asset.cjs +6 -5
  34. package/dist/api/asset.cjs.map +1 -1
  35. package/dist/api/asset.d.cts +2 -2
  36. package/dist/api/asset.d.cts.map +1 -1
  37. package/dist/api/asset.d.mts +2 -2
  38. package/dist/api/asset.d.mts.map +1 -1
  39. package/dist/api/asset.mjs +2 -1
  40. package/dist/api/asset.mjs.map +1 -1
  41. package/dist/api/balance.cjs +4 -3
  42. package/dist/api/balance.cjs.map +1 -1
  43. package/dist/api/balance.d.cts.map +1 -1
  44. package/dist/api/balance.d.mts.map +1 -1
  45. package/dist/api/balance.mjs +2 -1
  46. package/dist/api/balance.mjs.map +1 -1
  47. package/dist/api/caip.cjs +3 -3
  48. package/dist/api/caip.cjs.map +1 -1
  49. package/dist/api/caip.d.cts.map +1 -1
  50. package/dist/api/caip.d.mts.map +1 -1
  51. package/dist/api/caip.mjs +1 -1
  52. package/dist/api/caip.mjs.map +1 -1
  53. package/dist/api/index.cjs +0 -1
  54. package/dist/api/index.cjs.map +1 -1
  55. package/dist/api/index.d.cts +0 -1
  56. package/dist/api/index.d.cts.map +1 -1
  57. package/dist/api/index.d.mts +0 -1
  58. package/dist/api/index.d.mts.map +1 -1
  59. package/dist/api/index.mjs +0 -1
  60. package/dist/api/index.mjs.map +1 -1
  61. package/dist/api/keyring.cjs +0 -2
  62. package/dist/api/keyring.cjs.map +1 -1
  63. package/dist/api/keyring.d.cts +1 -1
  64. package/dist/api/keyring.d.cts.map +1 -1
  65. package/dist/api/keyring.d.mts +1 -1
  66. package/dist/api/keyring.d.mts.map +1 -1
  67. package/dist/api/keyring.mjs +0 -2
  68. package/dist/api/keyring.mjs.map +1 -1
  69. package/dist/api/request.cjs +7 -6
  70. package/dist/api/request.cjs.map +1 -1
  71. package/dist/api/request.d.cts +5 -5
  72. package/dist/api/request.d.cts.map +1 -1
  73. package/dist/api/request.d.mts +5 -5
  74. package/dist/api/request.d.mts.map +1 -1
  75. package/dist/api/request.mjs +2 -1
  76. package/dist/api/request.mjs.map +1 -1
  77. package/dist/api/response.cjs +6 -6
  78. package/dist/api/response.cjs.map +1 -1
  79. package/dist/api/response.d.cts +1 -1
  80. package/dist/api/response.d.cts.map +1 -1
  81. package/dist/api/response.d.mts +1 -1
  82. package/dist/api/response.d.mts.map +1 -1
  83. package/dist/api/response.mjs +1 -1
  84. package/dist/api/response.mjs.map +1 -1
  85. package/dist/api/transaction.cjs +8 -7
  86. package/dist/api/transaction.cjs.map +1 -1
  87. package/dist/api/transaction.d.cts +65 -65
  88. package/dist/api/transaction.d.cts.map +1 -1
  89. package/dist/api/transaction.d.mts +65 -65
  90. package/dist/api/transaction.d.mts.map +1 -1
  91. package/dist/api/transaction.mjs +2 -1
  92. package/dist/api/transaction.mjs.map +1 -1
  93. package/dist/btc/types.cjs +2 -2
  94. package/dist/btc/types.cjs.map +1 -1
  95. package/dist/btc/types.d.cts +1 -1
  96. package/dist/btc/types.d.cts.map +1 -1
  97. package/dist/btc/types.d.mts +1 -1
  98. package/dist/btc/types.d.mts.map +1 -1
  99. package/dist/btc/types.mjs +2 -2
  100. package/dist/btc/types.mjs.map +1 -1
  101. package/dist/eth/erc4337/types.cjs +11 -10
  102. package/dist/eth/erc4337/types.cjs.map +1 -1
  103. package/dist/eth/erc4337/types.d.cts +5 -5
  104. package/dist/eth/erc4337/types.d.cts.map +1 -1
  105. package/dist/eth/erc4337/types.d.mts +5 -5
  106. package/dist/eth/erc4337/types.d.mts.map +1 -1
  107. package/dist/eth/erc4337/types.mjs +2 -1
  108. package/dist/eth/erc4337/types.mjs.map +1 -1
  109. package/dist/eth/types.cjs +6 -6
  110. package/dist/eth/types.cjs.map +1 -1
  111. package/dist/eth/types.d.cts +2 -2
  112. package/dist/eth/types.d.cts.map +1 -1
  113. package/dist/eth/types.d.mts +2 -2
  114. package/dist/eth/types.d.mts.map +1 -1
  115. package/dist/eth/types.mjs +1 -1
  116. package/dist/eth/types.mjs.map +1 -1
  117. package/dist/eth/utils.cjs.map +1 -1
  118. package/dist/eth/utils.d.cts.map +1 -1
  119. package/dist/eth/utils.d.mts.map +1 -1
  120. package/dist/eth/utils.mjs.map +1 -1
  121. package/dist/events.cjs +1 -67
  122. package/dist/events.cjs.map +1 -1
  123. package/dist/events.d.cts +0 -161
  124. package/dist/events.d.cts.map +1 -1
  125. package/dist/events.d.mts +0 -161
  126. package/dist/events.d.mts.map +1 -1
  127. package/dist/events.mjs +0 -66
  128. package/dist/events.mjs.map +1 -1
  129. package/dist/index.cjs +8 -2
  130. package/dist/index.cjs.map +1 -1
  131. package/dist/index.d.cts +9 -3
  132. package/dist/index.d.cts.map +1 -1
  133. package/dist/index.d.mts +9 -3
  134. package/dist/index.d.mts.map +1 -1
  135. package/dist/index.mjs +8 -2
  136. package/dist/index.mjs.map +1 -1
  137. package/dist/{rpc.cjs → internal/api.cjs} +42 -71
  138. package/dist/internal/api.cjs.map +1 -0
  139. package/dist/{rpc.d.cts → internal/api.d.cts} +104 -130
  140. package/dist/internal/api.d.cts.map +1 -0
  141. package/dist/{rpc.d.mts → internal/api.d.mts} +104 -130
  142. package/dist/internal/api.d.mts.map +1 -0
  143. package/dist/{rpc.mjs → internal/api.mjs} +5 -33
  144. package/dist/internal/api.mjs.map +1 -0
  145. package/dist/internal/eth/EthKeyring.cjs +3 -0
  146. package/dist/internal/eth/EthKeyring.cjs.map +1 -0
  147. package/dist/internal/eth/EthKeyring.d.cts +34 -0
  148. package/dist/internal/eth/EthKeyring.d.cts.map +1 -0
  149. package/dist/internal/eth/EthKeyring.d.mts +34 -0
  150. package/dist/internal/eth/EthKeyring.d.mts.map +1 -0
  151. package/dist/internal/eth/EthKeyring.mjs +2 -0
  152. package/dist/internal/eth/EthKeyring.mjs.map +1 -0
  153. package/dist/internal/eth/index.cjs +3 -0
  154. package/dist/internal/eth/index.cjs.map +1 -0
  155. package/dist/internal/eth/index.d.cts +2 -0
  156. package/dist/internal/eth/index.d.cts.map +1 -0
  157. package/dist/internal/eth/index.d.mts +2 -0
  158. package/dist/internal/eth/index.d.mts.map +1 -0
  159. package/dist/internal/eth/index.mjs +2 -0
  160. package/dist/internal/eth/index.mjs.map +1 -0
  161. package/dist/internal/events.cjs +72 -0
  162. package/dist/internal/events.cjs.map +1 -0
  163. package/dist/internal/events.d.cts +162 -0
  164. package/dist/internal/events.d.cts.map +1 -0
  165. package/dist/internal/events.d.mts +162 -0
  166. package/dist/internal/events.d.mts.map +1 -0
  167. package/dist/internal/events.mjs +69 -0
  168. package/dist/internal/events.mjs.map +1 -0
  169. package/dist/internal/index.cjs +21 -0
  170. package/dist/internal/index.cjs.map +1 -0
  171. package/dist/internal/index.d.cts +6 -0
  172. package/dist/internal/index.d.cts.map +1 -0
  173. package/dist/internal/index.d.mts +6 -0
  174. package/dist/internal/index.d.mts.map +1 -0
  175. package/dist/internal/index.mjs +5 -0
  176. package/dist/internal/index.mjs.map +1 -0
  177. package/dist/internal/rpc.cjs +34 -0
  178. package/dist/internal/rpc.cjs.map +1 -0
  179. package/dist/internal/rpc.d.cts +27 -0
  180. package/dist/internal/rpc.d.cts.map +1 -0
  181. package/dist/internal/rpc.d.mts +27 -0
  182. package/dist/internal/rpc.d.mts.map +1 -0
  183. package/dist/internal/rpc.mjs +30 -0
  184. package/dist/internal/rpc.mjs.map +1 -0
  185. package/dist/internal/types.cjs +52 -0
  186. package/dist/internal/types.cjs.map +1 -0
  187. package/dist/internal/types.d.cts +392 -0
  188. package/dist/internal/types.d.cts.map +1 -0
  189. package/dist/internal/types.d.mts +392 -0
  190. package/dist/internal/types.d.mts.map +1 -0
  191. package/dist/internal/types.mjs +49 -0
  192. package/dist/internal/types.mjs.map +1 -0
  193. package/dist/rpc-handler.cjs +143 -0
  194. package/dist/rpc-handler.cjs.map +1 -0
  195. package/dist/rpc-handler.d.cts +30 -0
  196. package/dist/rpc-handler.d.cts.map +1 -0
  197. package/dist/rpc-handler.d.mts +30 -0
  198. package/dist/rpc-handler.d.mts.map +1 -0
  199. package/dist/rpc-handler.mjs +138 -0
  200. package/dist/rpc-handler.mjs.map +1 -0
  201. package/dist/snap-utils.cjs +20 -0
  202. package/dist/snap-utils.cjs.map +1 -0
  203. package/dist/snap-utils.d.cts +12 -0
  204. package/dist/snap-utils.d.cts.map +1 -0
  205. package/dist/snap-utils.d.mts +12 -0
  206. package/dist/snap-utils.d.mts.map +1 -0
  207. package/dist/snap-utils.mjs +17 -0
  208. package/dist/snap-utils.mjs.map +1 -0
  209. package/dist/sol/types.cjs +3 -3
  210. package/dist/sol/types.cjs.map +1 -1
  211. package/dist/sol/types.d.cts +1 -1
  212. package/dist/sol/types.d.cts.map +1 -1
  213. package/dist/sol/types.d.mts +1 -1
  214. package/dist/sol/types.d.mts.map +1 -1
  215. package/dist/sol/types.mjs +1 -1
  216. package/dist/sol/types.mjs.map +1 -1
  217. package/dist/superstruct.cjs +109 -0
  218. package/dist/superstruct.cjs.map +1 -0
  219. package/dist/superstruct.d.cts +102 -0
  220. package/dist/superstruct.d.cts.map +1 -0
  221. package/dist/superstruct.d.mts +102 -0
  222. package/dist/superstruct.d.mts.map +1 -0
  223. package/dist/superstruct.mjs +102 -0
  224. package/dist/superstruct.mjs.map +1 -0
  225. package/dist/utils/index.cjs +20 -0
  226. package/dist/utils/index.cjs.map +1 -0
  227. package/dist/utils/index.d.cts +4 -0
  228. package/dist/utils/index.d.cts.map +1 -0
  229. package/dist/utils/index.d.mts +4 -0
  230. package/dist/utils/index.d.mts.map +1 -0
  231. package/dist/utils/index.mjs +4 -0
  232. package/dist/utils/index.mjs.map +1 -0
  233. package/dist/{api → utils}/pagination.cjs +3 -3
  234. package/dist/utils/pagination.cjs.map +1 -0
  235. package/dist/{api → utils}/pagination.d.cts +1 -1
  236. package/dist/utils/pagination.d.cts.map +1 -0
  237. package/dist/{api → utils}/pagination.d.mts +1 -1
  238. package/dist/utils/pagination.d.mts.map +1 -0
  239. package/dist/{api → utils}/pagination.mjs +1 -1
  240. package/dist/utils/pagination.mjs.map +1 -0
  241. package/dist/utils/types.cjs +29 -0
  242. package/dist/utils/types.cjs.map +1 -0
  243. package/dist/utils/types.d.cts +42 -0
  244. package/dist/utils/types.d.cts.map +1 -0
  245. package/dist/utils/types.d.mts +42 -0
  246. package/dist/utils/types.d.mts.map +1 -0
  247. package/dist/utils/types.mjs +26 -0
  248. package/dist/utils/types.mjs.map +1 -0
  249. package/dist/utils/typing.cjs +20 -0
  250. package/dist/utils/typing.cjs.map +1 -0
  251. package/dist/utils/typing.d.cts +33 -0
  252. package/dist/utils/typing.d.cts.map +1 -0
  253. package/dist/utils/typing.d.mts +33 -0
  254. package/dist/utils/typing.d.mts.map +1 -0
  255. package/dist/utils/typing.mjs +17 -0
  256. package/dist/utils/typing.mjs.map +1 -0
  257. package/package.json +12 -9
  258. package/dist/api/pagination.cjs.map +0 -1
  259. package/dist/api/pagination.d.cts.map +0 -1
  260. package/dist/api/pagination.d.mts.map +0 -1
  261. package/dist/api/pagination.mjs.map +0 -1
  262. package/dist/rpc.cjs.map +0 -1
  263. package/dist/rpc.d.cts.map +0 -1
  264. package/dist/rpc.d.mts.map +0 -1
  265. package/dist/rpc.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.cts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;QAGH;;;;;;WAMG;;QAGH;;;WAGG;;;EAGL,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;;EAGL,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;QAGlC;;WAEG;;;EAGL,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;QAGnC;;WAEG;;QAGH;;WAEG;;;EAGL,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;QAGnC;;WAEG;;;EAGL,CAAC"}
1
+ {"version":3,"file":"events.d.cts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C"}
package/dist/events.d.mts CHANGED
@@ -8,165 +8,4 @@ export declare enum KeyringEvent {
8
8
  RequestApproved = "notify:requestApproved",
9
9
  RequestRejected = "notify:requestRejected"
10
10
  }
11
- export declare const AccountCreatedEventStruct: import("@metamask/superstruct").Struct<{
12
- method: "notify:accountCreated";
13
- params: {
14
- account: {
15
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
16
- id: string;
17
- options: Record<string, import("@metamask/utils").Json>;
18
- address: string;
19
- methods: string[];
20
- };
21
- accountNameSuggestion?: string;
22
- displayConfirmation?: boolean;
23
- };
24
- }, {
25
- method: import("@metamask/superstruct").Struct<"notify:accountCreated", "notify:accountCreated">;
26
- params: import("@metamask/superstruct").Struct<{
27
- account: {
28
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
29
- id: string;
30
- options: Record<string, import("@metamask/utils").Json>;
31
- address: string;
32
- methods: string[];
33
- };
34
- accountNameSuggestion?: string;
35
- displayConfirmation?: boolean;
36
- }, {
37
- /**
38
- * New account object.
39
- */
40
- account: import("@metamask/superstruct").Struct<{
41
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
42
- id: string;
43
- options: Record<string, import("@metamask/utils").Json>;
44
- address: string;
45
- methods: string[];
46
- }, {
47
- id: import("@metamask/superstruct").Struct<string, null>;
48
- type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
49
- "eip155:eoa": "eip155:eoa";
50
- "eip155:erc4337": "eip155:erc4337";
51
- "bip122:p2wpkh": "bip122:p2wpkh";
52
- "solana:data-account": "solana:data-account";
53
- }>;
54
- address: import("@metamask/superstruct").Struct<string, null>;
55
- options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
56
- methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
57
- }>;
58
- /**
59
- * Account name suggestion provided to the MetaMask client.
60
- *
61
- * The keyring can suggest a name for the account, but it's up to the
62
- * client to decide whether to use it. The keyring won't be informed if the
63
- * client decides to use a different name.
64
- */
65
- accountNameSuggestion: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
66
- /**
67
- * Instructs MetaMask to display the add account confirmation dialog in the UI.
68
- * **Note:** This is not guaranteed to be honored by the MetaMask client.
69
- */
70
- displayConfirmation: import("@metamask/superstruct").Struct<boolean | import("@metamask/keyring-utils").ExactOptionalTag, null>;
71
- }>;
72
- }>;
73
- export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").Struct<{
74
- method: "notify:accountUpdated";
75
- params: {
76
- account: {
77
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
78
- id: string;
79
- options: Record<string, import("@metamask/utils").Json>;
80
- address: string;
81
- methods: string[];
82
- };
83
- };
84
- }, {
85
- method: import("@metamask/superstruct").Struct<"notify:accountUpdated", "notify:accountUpdated">;
86
- params: import("@metamask/superstruct").Struct<{
87
- account: {
88
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
89
- id: string;
90
- options: Record<string, import("@metamask/utils").Json>;
91
- address: string;
92
- methods: string[];
93
- };
94
- }, {
95
- /**
96
- * Updated account object.
97
- */
98
- account: import("@metamask/superstruct").Struct<{
99
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
100
- id: string;
101
- options: Record<string, import("@metamask/utils").Json>;
102
- address: string;
103
- methods: string[];
104
- }, {
105
- id: import("@metamask/superstruct").Struct<string, null>;
106
- type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
107
- "eip155:eoa": "eip155:eoa";
108
- "eip155:erc4337": "eip155:erc4337";
109
- "bip122:p2wpkh": "bip122:p2wpkh";
110
- "solana:data-account": "solana:data-account";
111
- }>;
112
- address: import("@metamask/superstruct").Struct<string, null>;
113
- options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
114
- methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
115
- }>;
116
- }>;
117
- }>;
118
- export declare const AccountDeletedEventStruct: import("@metamask/superstruct").Struct<{
119
- method: "notify:accountDeleted";
120
- params: {
121
- id: string;
122
- };
123
- }, {
124
- method: import("@metamask/superstruct").Struct<"notify:accountDeleted", "notify:accountDeleted">;
125
- params: import("@metamask/superstruct").Struct<{
126
- id: string;
127
- }, {
128
- /**
129
- * Deleted account ID.
130
- */
131
- id: import("@metamask/superstruct").Struct<string, null>;
132
- }>;
133
- }>;
134
- export declare const RequestApprovedEventStruct: import("@metamask/superstruct").Struct<{
135
- method: "notify:requestApproved";
136
- params: {
137
- result: import("@metamask/utils").Json;
138
- id: string;
139
- };
140
- }, {
141
- method: import("@metamask/superstruct").Struct<"notify:requestApproved", "notify:requestApproved">;
142
- params: import("@metamask/superstruct").Struct<{
143
- result: import("@metamask/utils").Json;
144
- id: string;
145
- }, {
146
- /**
147
- * Request ID.
148
- */
149
- id: import("@metamask/superstruct").Struct<string, null>;
150
- /**
151
- * Request result.
152
- */
153
- result: import("@metamask/superstruct").Struct<import("@metamask/utils").Json, unknown>;
154
- }>;
155
- }>;
156
- export declare const RequestRejectedEventStruct: import("@metamask/superstruct").Struct<{
157
- method: "notify:requestRejected";
158
- params: {
159
- id: string;
160
- };
161
- }, {
162
- method: import("@metamask/superstruct").Struct<"notify:requestRejected", "notify:requestRejected">;
163
- params: import("@metamask/superstruct").Struct<{
164
- id: string;
165
- }, {
166
- /**
167
- * Request ID.
168
- */
169
- id: import("@metamask/superstruct").Struct<string, null>;
170
- }>;
171
- }>;
172
11
  //# sourceMappingURL=events.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;QAGH;;;;;;WAMG;;QAGH;;;WAGG;;;EAGL,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;;EAGL,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;QAGlC;;WAEG;;;EAGL,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;QAGnC;;WAEG;;QAGH;;WAEG;;;EAGL,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;QAGnC;;WAEG;;;EAGL,CAAC"}
1
+ {"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C"}
package/dist/events.mjs CHANGED
@@ -1,7 +1,3 @@
1
- import { exactOptional, object, UuidStruct } from "@metamask/keyring-utils";
2
- import { boolean, literal, string } from "@metamask/superstruct";
3
- import { JsonStruct } from "@metamask/utils";
4
- import { KeyringAccountStruct } from "./api/index.mjs";
5
1
  /**
6
2
  * Supported keyring events.
7
3
  */
@@ -15,66 +11,4 @@ export var KeyringEvent;
15
11
  KeyringEvent["RequestApproved"] = "notify:requestApproved";
16
12
  KeyringEvent["RequestRejected"] = "notify:requestRejected";
17
13
  })(KeyringEvent || (KeyringEvent = {}));
18
- export const AccountCreatedEventStruct = object({
19
- method: literal(`${KeyringEvent.AccountCreated}`),
20
- params: object({
21
- /**
22
- * New account object.
23
- */
24
- account: KeyringAccountStruct,
25
- /**
26
- * Account name suggestion provided to the MetaMask client.
27
- *
28
- * The keyring can suggest a name for the account, but it's up to the
29
- * client to decide whether to use it. The keyring won't be informed if the
30
- * client decides to use a different name.
31
- */
32
- accountNameSuggestion: exactOptional(string()),
33
- /**
34
- * Instructs MetaMask to display the add account confirmation dialog in the UI.
35
- * **Note:** This is not guaranteed to be honored by the MetaMask client.
36
- */
37
- displayConfirmation: exactOptional(boolean()),
38
- }),
39
- });
40
- export const AccountUpdatedEventStruct = object({
41
- method: literal(`${KeyringEvent.AccountUpdated}`),
42
- params: object({
43
- /**
44
- * Updated account object.
45
- */
46
- account: KeyringAccountStruct,
47
- }),
48
- });
49
- export const AccountDeletedEventStruct = object({
50
- method: literal(`${KeyringEvent.AccountDeleted}`),
51
- params: object({
52
- /**
53
- * Deleted account ID.
54
- */
55
- id: UuidStruct,
56
- }),
57
- });
58
- export const RequestApprovedEventStruct = object({
59
- method: literal(`${KeyringEvent.RequestApproved}`),
60
- params: object({
61
- /**
62
- * Request ID.
63
- */
64
- id: UuidStruct,
65
- /**
66
- * Request result.
67
- */
68
- result: JsonStruct,
69
- }),
70
- });
71
- export const RequestRejectedEventStruct = object({
72
- method: literal(`${KeyringEvent.RequestRejected}`),
73
- params: object({
74
- /**
75
- * Request ID.
76
- */
77
- id: UuidStruct,
78
- }),
79
- });
80
14
  //# sourceMappingURL=events.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.mjs","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OA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AA0B,GAAG,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,EAAE,EAAE,UAAU;QAEd;;WAEG;QACH,MAAM,EAAE,UAAU;KACnB,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,EAAE,EAAE,UAAU;KACf,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport { boolean, literal, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringAccountStruct } from './api';\n\n/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n}\n\nexport const AccountCreatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountCreated}`),\n params: object({\n /**\n * New account object.\n */\n account: KeyringAccountStruct,\n\n /**\n * Account name suggestion provided to the MetaMask client.\n *\n * The keyring can suggest a name for the account, but it's up to the\n * client to decide whether to use it. The keyring won't be informed if the\n * client decides to use a different name.\n */\n accountNameSuggestion: exactOptional(string()),\n\n /**\n * Instructs MetaMask to display the add account confirmation dialog in the UI.\n * **Note:** This is not guaranteed to be honored by the MetaMask client.\n */\n displayConfirmation: exactOptional(boolean()),\n }),\n});\n\nexport const AccountUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountUpdated}`),\n params: object({\n /**\n * Updated account object.\n */\n account: KeyringAccountStruct,\n }),\n});\n\nexport const AccountDeletedEventStruct = object({\n method: literal(`${KeyringEvent.AccountDeleted}`),\n params: object({\n /**\n * Deleted account ID.\n */\n id: UuidStruct,\n }),\n});\n\nexport const RequestApprovedEventStruct = object({\n method: literal(`${KeyringEvent.RequestApproved}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n});\n\nexport const RequestRejectedEventStruct = object({\n method: literal(`${KeyringEvent.RequestRejected}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n }),\n});\n"]}
1
+ {"version":3,"file":"events.mjs","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,iBAAiB;IACjB,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IAExC,iBAAiB;IACjB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;AAC5C,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB","sourcesContent":["/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n}\n"]}
package/dist/index.cjs CHANGED
@@ -16,8 +16,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api/index.cjs"), exports);
18
18
  __exportStar(require("./btc/index.cjs"), exports);
19
- __exportStar(require("./sol/index.cjs"), exports);
20
19
  __exportStar(require("./eth/index.cjs"), exports);
21
- __exportStar(require("./rpc.cjs"), exports);
20
+ __exportStar(require("./sol/index.cjs"), exports);
22
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);
23
29
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAsB;AACtB,kDAAsB;AACtB,kDAAsB;AACtB,kDAAsB;AAEtB,4CAAsB;AACtB,+CAAyB","sourcesContent":["export * from './api';\nexport * from './btc';\nexport * from './sol';\nexport * from './eth';\nexport type * from './contexts';\nexport * from './rpc';\nexport * from './events';\n"]}
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"]}
package/dist/index.d.cts CHANGED
@@ -1,8 +1,14 @@
1
1
  export * from "./api/index.cjs";
2
2
  export * from "./btc/index.cjs";
3
- export * from "./sol/index.cjs";
4
- export * from "./eth/index.cjs";
5
3
  export type * from "./contexts.cjs";
6
- export * from "./rpc.cjs";
4
+ export * from "./eth/index.cjs";
5
+ export * from "./sol/index.cjs";
7
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";
8
14
  //# 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,gCAAsB;AACtB,gCAAsB;AACtB,oCAAgC;AAChC,0BAAsB;AACtB,6BAAyB"}
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"}
package/dist/index.d.mts CHANGED
@@ -1,8 +1,14 @@
1
1
  export * from "./api/index.mjs";
2
2
  export * from "./btc/index.mjs";
3
- export * from "./sol/index.mjs";
4
- export * from "./eth/index.mjs";
5
3
  export type * from "./contexts.mjs";
6
- export * from "./rpc.mjs";
4
+ export * from "./eth/index.mjs";
5
+ export * from "./sol/index.mjs";
7
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";
8
14
  //# 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,gCAAsB;AACtB,gCAAsB;AACtB,oCAAgC;AAChC,0BAAsB;AACtB,6BAAyB"}
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"}
package/dist/index.mjs CHANGED
@@ -1,7 +1,13 @@
1
1
  export * from "./api/index.mjs";
2
2
  export * from "./btc/index.mjs";
3
- export * from "./sol/index.mjs";
4
3
  export * from "./eth/index.mjs";
5
- export * from "./rpc.mjs";
4
+ export * from "./sol/index.mjs";
6
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";
7
13
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAsB;AACtB,gCAAsB;AACtB,gCAAsB;AACtB,gCAAsB;AAEtB,0BAAsB;AACtB,6BAAyB","sourcesContent":["export * from './api';\nexport * from './btc';\nexport * from './sol';\nexport * from './eth';\nexport type * from './contexts';\nexport * from './rpc';\nexport * from './events';\n"]}
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,155 +1,126 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RejectRequestResponseStruct = exports.RejectRequestRequestStruct = exports.ApproveRequestResponseStruct = exports.ApproveRequestRequestStruct = exports.SubmitRequestResponseStruct = exports.SubmitRequestRequestStruct = exports.GetRequestResponseStruct = exports.GetRequestRequestStruct = exports.ListRequestsResponseStruct = exports.ListRequestsRequestStruct = exports.ExportAccountResponseStruct = exports.ExportAccountRequestStruct = exports.DeleteAccountResponseStruct = exports.DeleteAccountRequestStruct = exports.UpdateAccountResponseStruct = exports.UpdateAccountRequestStruct = exports.FilterAccountChainsResponseStruct = exports.FilterAccountChainsStruct = exports.GetAccountBalancesResponseStruct = exports.GetAccountBalancesRequestStruct = exports.ListAccountTransactionsResponseStruct = exports.ListAccountTransactionsRequestStruct = exports.CreateAccountResponseStruct = exports.CreateAccountRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.ListAccountsResponseStruct = exports.ListAccountsRequestStruct = exports.KeyringRpcMethod = void 0;
4
- exports.isKeyringRpcMethod = isKeyringRpcMethod;
5
- const keyring_utils_1 = require("@metamask/keyring-utils");
3
+ exports.RejectRequestResponseStruct = exports.RejectRequestRequestStruct = exports.ApproveRequestResponseStruct = exports.ApproveRequestRequestStruct = exports.SubmitRequestResponseStruct = exports.SubmitRequestRequestStruct = exports.GetRequestResponseStruct = exports.GetRequestRequestStruct = exports.ListRequestsResponseStruct = exports.ListRequestsRequestStruct = exports.ExportAccountResponseStruct = exports.ExportAccountRequestStruct = exports.DeleteAccountResponseStruct = exports.DeleteAccountRequestStruct = exports.UpdateAccountResponseStruct = exports.UpdateAccountRequestStruct = exports.FilterAccountChainsResponseStruct = exports.FilterAccountChainsStruct = exports.GetAccountBalancesResponseStruct = exports.GetAccountBalancesRequestStruct = exports.ListAccountTransactionsResponseStruct = exports.ListAccountTransactionsRequestStruct = exports.CreateAccountResponseStruct = exports.CreateAccountRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.ListAccountsResponseStruct = exports.ListAccountsRequestStruct = void 0;
6
4
  const superstruct_1 = require("@metamask/superstruct");
7
5
  const utils_1 = require("@metamask/utils");
8
- const api_1 = require("./api/index.cjs");
9
- /**
10
- * Keyring RPC methods used by the API.
11
- */
12
- var KeyringRpcMethod;
13
- (function (KeyringRpcMethod) {
14
- KeyringRpcMethod["ListAccounts"] = "keyring_listAccounts";
15
- KeyringRpcMethod["GetAccount"] = "keyring_getAccount";
16
- KeyringRpcMethod["CreateAccount"] = "keyring_createAccount";
17
- KeyringRpcMethod["ListAccountTransactions"] = "keyring_listAccountTransactions";
18
- KeyringRpcMethod["GetAccountBalances"] = "keyring_getAccountBalances";
19
- KeyringRpcMethod["FilterAccountChains"] = "keyring_filterAccountChains";
20
- KeyringRpcMethod["UpdateAccount"] = "keyring_updateAccount";
21
- KeyringRpcMethod["DeleteAccount"] = "keyring_deleteAccount";
22
- KeyringRpcMethod["ExportAccount"] = "keyring_exportAccount";
23
- KeyringRpcMethod["ListRequests"] = "keyring_listRequests";
24
- KeyringRpcMethod["GetRequest"] = "keyring_getRequest";
25
- KeyringRpcMethod["SubmitRequest"] = "keyring_submitRequest";
26
- KeyringRpcMethod["ApproveRequest"] = "keyring_approveRequest";
27
- KeyringRpcMethod["RejectRequest"] = "keyring_rejectRequest";
28
- })(KeyringRpcMethod || (exports.KeyringRpcMethod = KeyringRpcMethod = {}));
29
- /**
30
- * Check if a method is a keyring RPC method.
31
- *
32
- * @param method - Method to check.
33
- * @returns Whether the method is a keyring RPC method.
34
- */
35
- function isKeyringRpcMethod(method) {
36
- return Object.values(KeyringRpcMethod).includes(method);
37
- }
38
- // ----------------------------------------------------------------------------
6
+ const rpc_1 = require("./rpc.cjs");
7
+ const api_1 = require("../api/index.cjs");
8
+ const superstruct_2 = require("../superstruct.cjs");
9
+ const utils_2 = require("../utils/index.cjs");
39
10
  const CommonHeader = {
40
11
  jsonrpc: (0, superstruct_1.literal)('2.0'),
41
12
  id: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)(), (0, superstruct_1.literal)(null)]),
42
13
  };
43
14
  // ----------------------------------------------------------------------------
44
15
  // List accounts
45
- exports.ListAccountsRequestStruct = (0, keyring_utils_1.object)({
16
+ exports.ListAccountsRequestStruct = (0, superstruct_2.object)({
46
17
  ...CommonHeader,
47
18
  method: (0, superstruct_1.literal)('keyring_listAccounts'),
48
19
  });
49
20
  exports.ListAccountsResponseStruct = (0, superstruct_1.array)(api_1.KeyringAccountStruct);
50
21
  // ----------------------------------------------------------------------------
51
22
  // Get account
52
- exports.GetAccountRequestStruct = (0, keyring_utils_1.object)({
23
+ exports.GetAccountRequestStruct = (0, superstruct_2.object)({
53
24
  ...CommonHeader,
54
25
  method: (0, superstruct_1.literal)('keyring_getAccount'),
55
- params: (0, keyring_utils_1.object)({
56
- id: keyring_utils_1.UuidStruct,
26
+ params: (0, superstruct_2.object)({
27
+ id: utils_2.UuidStruct,
57
28
  }),
58
29
  });
59
30
  exports.GetAccountResponseStruct = api_1.KeyringAccountStruct;
60
31
  // ----------------------------------------------------------------------------
61
32
  // Create account
62
- exports.CreateAccountRequestStruct = (0, keyring_utils_1.object)({
33
+ exports.CreateAccountRequestStruct = (0, superstruct_2.object)({
63
34
  ...CommonHeader,
64
35
  method: (0, superstruct_1.literal)('keyring_createAccount'),
65
- params: (0, keyring_utils_1.object)({
36
+ params: (0, superstruct_2.object)({
66
37
  options: (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct),
67
38
  }),
68
39
  });
69
40
  exports.CreateAccountResponseStruct = api_1.KeyringAccountStruct;
70
41
  // ----------------------------------------------------------------------------
71
42
  // List account transactions
72
- exports.ListAccountTransactionsRequestStruct = (0, keyring_utils_1.object)({
43
+ exports.ListAccountTransactionsRequestStruct = (0, superstruct_2.object)({
73
44
  ...CommonHeader,
74
45
  method: (0, superstruct_1.literal)('keyring_listAccountTransactions'),
75
- params: (0, keyring_utils_1.object)({
76
- id: keyring_utils_1.UuidStruct,
77
- pagination: api_1.PaginationStruct,
46
+ params: (0, superstruct_2.object)({
47
+ id: utils_2.UuidStruct,
48
+ pagination: utils_2.PaginationStruct,
78
49
  }),
79
50
  });
80
51
  exports.ListAccountTransactionsResponseStruct = api_1.TransactionsPageStruct;
81
52
  // ----------------------------------------------------------------------------
82
53
  // Get account balances
83
- exports.GetAccountBalancesRequestStruct = (0, keyring_utils_1.object)({
54
+ exports.GetAccountBalancesRequestStruct = (0, superstruct_2.object)({
84
55
  ...CommonHeader,
85
- method: (0, superstruct_1.literal)(`${KeyringRpcMethod.GetAccountBalances}`),
86
- params: (0, keyring_utils_1.object)({
87
- id: keyring_utils_1.UuidStruct,
56
+ method: (0, superstruct_1.literal)(`${rpc_1.KeyringRpcMethod.GetAccountBalances}`),
57
+ params: (0, superstruct_2.object)({
58
+ id: utils_2.UuidStruct,
88
59
  assets: (0, superstruct_1.array)(api_1.CaipAssetTypeStruct),
89
60
  }),
90
61
  });
91
62
  exports.GetAccountBalancesResponseStruct = (0, superstruct_1.record)(api_1.CaipAssetTypeStruct, api_1.BalanceStruct);
92
63
  // ----------------------------------------------------------------------------
93
64
  // Filter account chains
94
- exports.FilterAccountChainsStruct = (0, keyring_utils_1.object)({
65
+ exports.FilterAccountChainsStruct = (0, superstruct_2.object)({
95
66
  ...CommonHeader,
96
67
  method: (0, superstruct_1.literal)('keyring_filterAccountChains'),
97
- params: (0, keyring_utils_1.object)({
98
- id: keyring_utils_1.UuidStruct,
68
+ params: (0, superstruct_2.object)({
69
+ id: utils_2.UuidStruct,
99
70
  chains: (0, superstruct_1.array)((0, superstruct_1.string)()),
100
71
  }),
101
72
  });
102
73
  exports.FilterAccountChainsResponseStruct = (0, superstruct_1.array)((0, superstruct_1.string)());
103
74
  // ----------------------------------------------------------------------------
104
75
  // Update account
105
- exports.UpdateAccountRequestStruct = (0, keyring_utils_1.object)({
76
+ exports.UpdateAccountRequestStruct = (0, superstruct_2.object)({
106
77
  ...CommonHeader,
107
78
  method: (0, superstruct_1.literal)('keyring_updateAccount'),
108
- params: (0, keyring_utils_1.object)({
79
+ params: (0, superstruct_2.object)({
109
80
  account: api_1.KeyringAccountStruct,
110
81
  }),
111
82
  });
112
83
  exports.UpdateAccountResponseStruct = (0, superstruct_1.literal)(null);
113
84
  // ----------------------------------------------------------------------------
114
85
  // Delete account
115
- exports.DeleteAccountRequestStruct = (0, keyring_utils_1.object)({
86
+ exports.DeleteAccountRequestStruct = (0, superstruct_2.object)({
116
87
  ...CommonHeader,
117
88
  method: (0, superstruct_1.literal)('keyring_deleteAccount'),
118
- params: (0, keyring_utils_1.object)({
119
- id: keyring_utils_1.UuidStruct,
89
+ params: (0, superstruct_2.object)({
90
+ id: utils_2.UuidStruct,
120
91
  }),
121
92
  });
122
93
  exports.DeleteAccountResponseStruct = (0, superstruct_1.literal)(null);
123
94
  // ----------------------------------------------------------------------------
124
95
  // Export account
125
- exports.ExportAccountRequestStruct = (0, keyring_utils_1.object)({
96
+ exports.ExportAccountRequestStruct = (0, superstruct_2.object)({
126
97
  ...CommonHeader,
127
98
  method: (0, superstruct_1.literal)('keyring_exportAccount'),
128
- params: (0, keyring_utils_1.object)({
129
- id: keyring_utils_1.UuidStruct,
99
+ params: (0, superstruct_2.object)({
100
+ id: utils_2.UuidStruct,
130
101
  }),
131
102
  });
132
103
  exports.ExportAccountResponseStruct = api_1.KeyringAccountDataStruct;
133
104
  // ----------------------------------------------------------------------------
134
105
  // List requests
135
- exports.ListRequestsRequestStruct = (0, keyring_utils_1.object)({
106
+ exports.ListRequestsRequestStruct = (0, superstruct_2.object)({
136
107
  ...CommonHeader,
137
108
  method: (0, superstruct_1.literal)('keyring_listRequests'),
138
109
  });
139
110
  exports.ListRequestsResponseStruct = (0, superstruct_1.array)(api_1.KeyringRequestStruct);
140
111
  // ----------------------------------------------------------------------------
141
112
  // Get request
142
- exports.GetRequestRequestStruct = (0, keyring_utils_1.object)({
113
+ exports.GetRequestRequestStruct = (0, superstruct_2.object)({
143
114
  ...CommonHeader,
144
115
  method: (0, superstruct_1.literal)('keyring_getRequest'),
145
- params: (0, keyring_utils_1.object)({
146
- id: keyring_utils_1.UuidStruct,
116
+ params: (0, superstruct_2.object)({
117
+ id: utils_2.UuidStruct,
147
118
  }),
148
119
  });
149
120
  exports.GetRequestResponseStruct = api_1.KeyringRequestStruct;
150
121
  // ----------------------------------------------------------------------------
151
122
  // Submit request
152
- exports.SubmitRequestRequestStruct = (0, keyring_utils_1.object)({
123
+ exports.SubmitRequestRequestStruct = (0, superstruct_2.object)({
153
124
  ...CommonHeader,
154
125
  method: (0, superstruct_1.literal)('keyring_submitRequest'),
155
126
  params: api_1.KeyringRequestStruct,
@@ -157,23 +128,23 @@ exports.SubmitRequestRequestStruct = (0, keyring_utils_1.object)({
157
128
  exports.SubmitRequestResponseStruct = api_1.KeyringResponseStruct;
158
129
  // ----------------------------------------------------------------------------
159
130
  // Approve request
160
- exports.ApproveRequestRequestStruct = (0, keyring_utils_1.object)({
131
+ exports.ApproveRequestRequestStruct = (0, superstruct_2.object)({
161
132
  ...CommonHeader,
162
133
  method: (0, superstruct_1.literal)('keyring_approveRequest'),
163
- params: (0, keyring_utils_1.object)({
164
- id: keyring_utils_1.UuidStruct,
134
+ params: (0, superstruct_2.object)({
135
+ id: utils_2.UuidStruct,
165
136
  data: (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct),
166
137
  }),
167
138
  });
168
139
  exports.ApproveRequestResponseStruct = (0, superstruct_1.literal)(null);
169
140
  // ----------------------------------------------------------------------------
170
141
  // Reject request
171
- exports.RejectRequestRequestStruct = (0, keyring_utils_1.object)({
142
+ exports.RejectRequestRequestStruct = (0, superstruct_2.object)({
172
143
  ...CommonHeader,
173
144
  method: (0, superstruct_1.literal)('keyring_rejectRequest'),
174
- params: (0, keyring_utils_1.object)({
175
- id: keyring_utils_1.UuidStruct,
145
+ params: (0, superstruct_2.object)({
146
+ id: utils_2.UuidStruct,
176
147
  }),
177
148
  });
178
149
  exports.RejectRequestResponseStruct = (0, superstruct_1.literal)(null);
179
- //# sourceMappingURL=rpc.cjs.map
150
+ //# sourceMappingURL=api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.cjs","sourceRoot":"","sources":["../../src/internal/api.ts"],"names":[],"mappings":";;;AACA,uDAO+B;AAC/B,2CAA6C;AAE7C,mCAAyC;AACzC,0CAQgB;AAChB,oDAAwC;AACxC,8CAAwD;AAExD,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IACvB,EAAE,EAAE,IAAA,mBAAK,EAAC,CAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,+EAA+E;AAC/E,gBAAgB;AAEH,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,sBAAsB,CAAC;CACxC,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,mBAAK,EAAC,0BAAoB,CAAC,CAAC;AAItE,+EAA+E;AAC/E,cAAc;AAED,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,oBAAoB,CAAC;IACrC,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,wBAAwB,GAAG,0BAAoB,CAAC;AAI7D,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,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literal,\n number,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringRpcMethod } from './rpc';\nimport {\n BalanceStruct,\n CaipAssetTypeStruct,\n KeyringAccountDataStruct,\n KeyringAccountStruct,\n KeyringRequestStruct,\n KeyringResponseStruct,\n TransactionsPageStruct,\n} from '../api';\nimport { object } from '../superstruct';\nimport { PaginationStruct, UuidStruct } from '../utils';\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// List accounts\n\nexport const ListAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_listAccounts'),\n});\n\nexport type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;\n\nexport const ListAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_getAccount'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;\n\nexport const GetAccountResponseStruct = KeyringAccountStruct;\n\nexport type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Create account\n\nexport const CreateAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_createAccount'),\n params: object({\n options: record(string(), JsonStruct),\n }),\n});\n\nexport type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;\n\nexport const CreateAccountResponseStruct = KeyringAccountStruct;\n\nexport type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// List account transactions\n\nexport const ListAccountTransactionsRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_listAccountTransactions'),\n params: object({\n id: UuidStruct,\n pagination: PaginationStruct,\n }),\n});\n\nexport type ListAccountTransactionsRequest = Infer<\n typeof ListAccountTransactionsRequestStruct\n>;\n\nexport const ListAccountTransactionsResponseStruct = TransactionsPageStruct;\n\nexport type ListAccountTransactionsResponse = Infer<\n typeof ListAccountTransactionsResponseStruct\n>;\n\n// ----------------------------------------------------------------------------\n// Get account balances\n\nexport const GetAccountBalancesRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccountBalances}`),\n params: object({\n id: UuidStruct,\n assets: array(CaipAssetTypeStruct),\n }),\n});\n\nexport type GetAccountBalancesRequest = Infer<\n typeof GetAccountBalancesRequestStruct\n>;\n\nexport const GetAccountBalancesResponseStruct = record(\n CaipAssetTypeStruct,\n BalanceStruct,\n);\n\nexport type GetAccountBalancesResponse = Infer<\n typeof GetAccountBalancesResponseStruct\n>;\n\n// ----------------------------------------------------------------------------\n// Filter account chains\n\nexport const FilterAccountChainsStruct = object({\n ...CommonHeader,\n method: literal('keyring_filterAccountChains'),\n params: object({\n id: UuidStruct,\n chains: array(string()),\n }),\n});\n\nexport type FilterAccountChainsRequest = Infer<\n typeof FilterAccountChainsStruct\n>;\n\nexport const FilterAccountChainsResponseStruct = array(string());\n\nexport type FilterAccountChainsResponse = Infer<\n typeof FilterAccountChainsResponseStruct\n>;\n\n// ----------------------------------------------------------------------------\n// Update account\n\nexport const UpdateAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_updateAccount'),\n params: object({\n account: KeyringAccountStruct,\n }),\n});\n\nexport type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;\n\nexport const UpdateAccountResponseStruct = literal(null);\n\nexport type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_deleteAccount'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;\n\nexport const DeleteAccountResponseStruct = literal(null);\n\nexport type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Export account\n\nexport const ExportAccountRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_exportAccount'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = KeyringAccountDataStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// List requests\n\nexport const ListRequestsRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_listRequests'),\n});\n\nexport type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;\n\nexport const ListRequestsResponseStruct = array(KeyringRequestStruct);\n\nexport type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get request\n\nexport const GetRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_getRequest'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;\n\nexport const GetRequestResponseStruct = KeyringRequestStruct;\n\nexport type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_submitRequest'),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = KeyringResponseStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Approve request\n\nexport const ApproveRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_approveRequest'),\n params: object({\n id: UuidStruct,\n data: record(string(), JsonStruct),\n }),\n});\n\nexport type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;\n\nexport const ApproveRequestResponseStruct = literal(null);\n\nexport type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Reject request\n\nexport const RejectRequestRequestStruct = object({\n ...CommonHeader,\n method: literal('keyring_rejectRequest'),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;\n\nexport const RejectRequestResponseStruct = literal(null);\n\nexport type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;\n"]}