@metamask-previews/keyring-internal-api 0.0.1-672cc7b

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 (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +15 -0
  3. package/dist/btc/index.d.ts +1 -0
  4. package/dist/btc/index.js +18 -0
  5. package/dist/btc/index.js.map +1 -0
  6. package/dist/btc/types.d.ts +33 -0
  7. package/dist/btc/types.js +40 -0
  8. package/dist/btc/types.js.map +1 -0
  9. package/dist/eth/erc4337/index.d.ts +1 -0
  10. package/dist/eth/erc4337/index.js +18 -0
  11. package/dist/eth/erc4337/index.js.map +1 -0
  12. package/dist/eth/erc4337/types.d.ts +97 -0
  13. package/dist/eth/erc4337/types.js +61 -0
  14. package/dist/eth/erc4337/types.js.map +1 -0
  15. package/dist/eth/index.d.ts +3 -0
  16. package/dist/eth/index.js +20 -0
  17. package/dist/eth/index.js.map +1 -0
  18. package/dist/eth/types.d.ts +80 -0
  19. package/dist/eth/types.js +73 -0
  20. package/dist/eth/types.js.map +1 -0
  21. package/dist/eth/utils.d.ts +8 -0
  22. package/dist/eth/utils.js +15 -0
  23. package/dist/eth/utils.js.map +1 -0
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.js +20 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/internal/api.d.ts +415 -0
  28. package/dist/internal/api.js +138 -0
  29. package/dist/internal/api.js.map +1 -0
  30. package/dist/internal/eth/EthKeyring.d.ts +33 -0
  31. package/dist/internal/eth/EthKeyring.js +3 -0
  32. package/dist/internal/eth/EthKeyring.js.map +1 -0
  33. package/dist/internal/eth/index.d.ts +1 -0
  34. package/dist/internal/eth/index.js +18 -0
  35. package/dist/internal/eth/index.js.map +1 -0
  36. package/dist/internal/events.d.ts +169 -0
  37. package/dist/internal/events.js +83 -0
  38. package/dist/internal/events.js.map +1 -0
  39. package/dist/internal/index.d.ts +5 -0
  40. package/dist/internal/index.js +22 -0
  41. package/dist/internal/index.js.map +1 -0
  42. package/dist/internal/rpc.d.ts +25 -0
  43. package/dist/internal/rpc.js +33 -0
  44. package/dist/internal/rpc.js.map +1 -0
  45. package/dist/internal/types.d.ts +330 -0
  46. package/dist/internal/types.js +49 -0
  47. package/dist/internal/types.js.map +1 -0
  48. package/package.json +78 -0
@@ -0,0 +1,415 @@
1
+ import type { Infer } from '@metamask/superstruct';
2
+ export declare const ListAccountsRequestStruct: import("@metamask/superstruct").Struct<{
3
+ method: "keyring_listAccounts";
4
+ jsonrpc: "2.0";
5
+ id: string | number | null;
6
+ }, {
7
+ method: import("@metamask/superstruct").Struct<"keyring_listAccounts", "keyring_listAccounts">;
8
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
9
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
10
+ }>;
11
+ export declare type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
12
+ export declare const ListAccountsResponseStruct: import("@metamask/superstruct").Struct<{
13
+ id: string;
14
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
15
+ address: string;
16
+ options: Record<string, import("@metamask/utils").Json>;
17
+ methods: string[];
18
+ }[], import("@metamask/superstruct").Struct<{
19
+ id: string;
20
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
21
+ address: string;
22
+ options: Record<string, import("@metamask/utils").Json>;
23
+ methods: string[];
24
+ }, {
25
+ id: import("@metamask/superstruct").Struct<string, null>;
26
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
27
+ "eip155:eoa": "eip155:eoa";
28
+ "eip155:erc4337": "eip155:erc4337";
29
+ "bip122:p2wpkh": "bip122:p2wpkh";
30
+ }>;
31
+ address: import("@metamask/superstruct").Struct<string, null>;
32
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
33
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
34
+ }>>;
35
+ export declare type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
36
+ export declare const GetAccountRequestStruct: import("@metamask/superstruct").Struct<{
37
+ method: "keyring_getAccount";
38
+ jsonrpc: "2.0";
39
+ id: string | number | null;
40
+ params: {
41
+ id: string;
42
+ };
43
+ }, {
44
+ method: import("@metamask/superstruct").Struct<"keyring_getAccount", "keyring_getAccount">;
45
+ params: import("@metamask/superstruct").Struct<{
46
+ id: string;
47
+ }, {
48
+ id: import("@metamask/superstruct").Struct<string, null>;
49
+ }>;
50
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
51
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
52
+ }>;
53
+ export declare type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
54
+ export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
55
+ id: string;
56
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
57
+ address: string;
58
+ options: Record<string, import("@metamask/utils").Json>;
59
+ methods: string[];
60
+ }, {
61
+ id: import("@metamask/superstruct").Struct<string, null>;
62
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
63
+ "eip155:eoa": "eip155:eoa";
64
+ "eip155:erc4337": "eip155:erc4337";
65
+ "bip122:p2wpkh": "bip122:p2wpkh";
66
+ }>;
67
+ address: import("@metamask/superstruct").Struct<string, null>;
68
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
69
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
70
+ }>;
71
+ export declare type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
72
+ export declare const CreateAccountRequestStruct: import("@metamask/superstruct").Struct<{
73
+ method: "keyring_createAccount";
74
+ jsonrpc: "2.0";
75
+ id: string | number | null;
76
+ params: {
77
+ options: Record<string, import("@metamask/utils").Json>;
78
+ };
79
+ }, {
80
+ method: import("@metamask/superstruct").Struct<"keyring_createAccount", "keyring_createAccount">;
81
+ params: import("@metamask/superstruct").Struct<{
82
+ options: Record<string, import("@metamask/utils").Json>;
83
+ }, {
84
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
85
+ }>;
86
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
87
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
88
+ }>;
89
+ export declare type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
90
+ export declare const CreateAccountResponseStruct: import("@metamask/superstruct").Struct<{
91
+ id: string;
92
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
93
+ address: string;
94
+ options: Record<string, import("@metamask/utils").Json>;
95
+ methods: string[];
96
+ }, {
97
+ id: import("@metamask/superstruct").Struct<string, null>;
98
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
99
+ "eip155:eoa": "eip155:eoa";
100
+ "eip155:erc4337": "eip155:erc4337";
101
+ "bip122:p2wpkh": "bip122:p2wpkh";
102
+ }>;
103
+ address: import("@metamask/superstruct").Struct<string, null>;
104
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
105
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
106
+ }>;
107
+ export declare type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
108
+ export declare const GetAccountBalancesRequestStruct: import("@metamask/superstruct").Struct<{
109
+ method: "keyring_getAccountBalances";
110
+ jsonrpc: "2.0";
111
+ id: string | number | null;
112
+ params: {
113
+ id: string;
114
+ assets: string[];
115
+ };
116
+ }, {
117
+ method: import("@metamask/superstruct").Struct<"keyring_getAccountBalances", "keyring_getAccountBalances">;
118
+ params: import("@metamask/superstruct").Struct<{
119
+ id: string;
120
+ assets: string[];
121
+ }, {
122
+ id: import("@metamask/superstruct").Struct<string, null>;
123
+ assets: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
124
+ }>;
125
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
126
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
127
+ }>;
128
+ export declare type GetAccountBalancesRequest = Infer<typeof GetAccountBalancesRequestStruct>;
129
+ export declare const GetAccountBalancesResponseStruct: import("@metamask/superstruct").Struct<Record<string, {
130
+ amount: string;
131
+ unit: string;
132
+ }>, null>;
133
+ export declare type GetAccountBalancesResponse = Infer<typeof GetAccountBalancesResponseStruct>;
134
+ export declare const FilterAccountChainsStruct: import("@metamask/superstruct").Struct<{
135
+ method: "keyring_filterAccountChains";
136
+ jsonrpc: "2.0";
137
+ id: string | number | null;
138
+ params: {
139
+ id: string;
140
+ chains: string[];
141
+ };
142
+ }, {
143
+ method: import("@metamask/superstruct").Struct<"keyring_filterAccountChains", "keyring_filterAccountChains">;
144
+ params: import("@metamask/superstruct").Struct<{
145
+ id: string;
146
+ chains: string[];
147
+ }, {
148
+ id: import("@metamask/superstruct").Struct<string, null>;
149
+ chains: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
150
+ }>;
151
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
152
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
153
+ }>;
154
+ export declare type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
155
+ export declare const FilterAccountChainsResponseStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
156
+ export declare type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
157
+ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct").Struct<{
158
+ method: "keyring_updateAccount";
159
+ jsonrpc: "2.0";
160
+ id: string | number | null;
161
+ params: {
162
+ account: {
163
+ id: string;
164
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
165
+ address: string;
166
+ options: Record<string, import("@metamask/utils").Json>;
167
+ methods: string[];
168
+ };
169
+ };
170
+ }, {
171
+ method: import("@metamask/superstruct").Struct<"keyring_updateAccount", "keyring_updateAccount">;
172
+ params: import("@metamask/superstruct").Struct<{
173
+ account: {
174
+ id: string;
175
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
176
+ address: string;
177
+ options: Record<string, import("@metamask/utils").Json>;
178
+ methods: string[];
179
+ };
180
+ }, {
181
+ account: import("@metamask/superstruct").Struct<{
182
+ id: string;
183
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
184
+ address: string;
185
+ options: Record<string, import("@metamask/utils").Json>;
186
+ methods: string[];
187
+ }, {
188
+ id: import("@metamask/superstruct").Struct<string, null>;
189
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
190
+ "eip155:eoa": "eip155:eoa";
191
+ "eip155:erc4337": "eip155:erc4337";
192
+ "bip122:p2wpkh": "bip122:p2wpkh";
193
+ }>;
194
+ address: import("@metamask/superstruct").Struct<string, null>;
195
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
196
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
197
+ }>;
198
+ }>;
199
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
200
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
201
+ }>;
202
+ export declare type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
203
+ export declare const UpdateAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
204
+ export declare type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
205
+ export declare const DeleteAccountRequestStruct: import("@metamask/superstruct").Struct<{
206
+ method: "keyring_deleteAccount";
207
+ jsonrpc: "2.0";
208
+ id: string | number | null;
209
+ params: {
210
+ id: string;
211
+ };
212
+ }, {
213
+ method: import("@metamask/superstruct").Struct<"keyring_deleteAccount", "keyring_deleteAccount">;
214
+ params: import("@metamask/superstruct").Struct<{
215
+ id: string;
216
+ }, {
217
+ id: import("@metamask/superstruct").Struct<string, null>;
218
+ }>;
219
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
220
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
221
+ }>;
222
+ export declare type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
223
+ export declare const DeleteAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
224
+ export declare type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
225
+ export declare const ExportAccountRequestStruct: import("@metamask/superstruct").Struct<{
226
+ method: "keyring_exportAccount";
227
+ jsonrpc: "2.0";
228
+ id: string | number | null;
229
+ params: {
230
+ id: string;
231
+ };
232
+ }, {
233
+ method: import("@metamask/superstruct").Struct<"keyring_exportAccount", "keyring_exportAccount">;
234
+ params: import("@metamask/superstruct").Struct<{
235
+ id: string;
236
+ }, {
237
+ id: import("@metamask/superstruct").Struct<string, null>;
238
+ }>;
239
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
240
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
241
+ }>;
242
+ export declare type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
243
+ export declare const ExportAccountResponseStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
244
+ export declare type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
245
+ export declare const ListRequestsRequestStruct: import("@metamask/superstruct").Struct<{
246
+ method: "keyring_listRequests";
247
+ jsonrpc: "2.0";
248
+ id: string | number | null;
249
+ }, {
250
+ method: import("@metamask/superstruct").Struct<"keyring_listRequests", "keyring_listRequests">;
251
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
252
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
253
+ }>;
254
+ export declare type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
255
+ export declare const ListRequestsResponseStruct: import("@metamask/superstruct").Struct<{
256
+ id: string;
257
+ scope: string;
258
+ account: string;
259
+ request: {
260
+ method: string;
261
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
262
+ };
263
+ }[], import("@metamask/superstruct").Struct<{
264
+ id: string;
265
+ scope: string;
266
+ account: string;
267
+ request: {
268
+ method: string;
269
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
270
+ };
271
+ }, {
272
+ id: import("@metamask/superstruct").Struct<string, null>;
273
+ scope: import("@metamask/superstruct").Struct<string, null>;
274
+ account: import("@metamask/superstruct").Struct<string, null>;
275
+ request: import("@metamask/superstruct").Struct<{
276
+ method: string;
277
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
278
+ }, {
279
+ method: import("@metamask/superstruct").Struct<string, null>;
280
+ params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
281
+ }>;
282
+ }>>;
283
+ export declare type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
284
+ export declare const GetRequestRequestStruct: import("@metamask/superstruct").Struct<{
285
+ method: "keyring_getRequest";
286
+ jsonrpc: "2.0";
287
+ id: string | number | null;
288
+ params: {
289
+ id: string;
290
+ };
291
+ }, {
292
+ method: import("@metamask/superstruct").Struct<"keyring_getRequest", "keyring_getRequest">;
293
+ params: import("@metamask/superstruct").Struct<{
294
+ id: string;
295
+ }, {
296
+ id: import("@metamask/superstruct").Struct<string, null>;
297
+ }>;
298
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
299
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
300
+ }>;
301
+ export declare type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
302
+ export declare const GetRequestResponseStruct: import("@metamask/superstruct").Struct<{
303
+ id: string;
304
+ scope: string;
305
+ account: string;
306
+ request: {
307
+ method: string;
308
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
309
+ };
310
+ }, {
311
+ id: import("@metamask/superstruct").Struct<string, null>;
312
+ scope: import("@metamask/superstruct").Struct<string, null>;
313
+ account: import("@metamask/superstruct").Struct<string, null>;
314
+ request: import("@metamask/superstruct").Struct<{
315
+ method: string;
316
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
317
+ }, {
318
+ method: import("@metamask/superstruct").Struct<string, null>;
319
+ params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
320
+ }>;
321
+ }>;
322
+ export declare type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
323
+ export declare const SubmitRequestRequestStruct: import("@metamask/superstruct").Struct<{
324
+ method: "keyring_submitRequest";
325
+ jsonrpc: "2.0";
326
+ id: string | number | null;
327
+ params: {
328
+ id: string;
329
+ scope: string;
330
+ account: string;
331
+ request: {
332
+ method: string;
333
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
334
+ };
335
+ };
336
+ }, {
337
+ method: import("@metamask/superstruct").Struct<"keyring_submitRequest", "keyring_submitRequest">;
338
+ params: import("@metamask/superstruct").Struct<{
339
+ id: string;
340
+ scope: string;
341
+ account: string;
342
+ request: {
343
+ method: string;
344
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
345
+ };
346
+ }, {
347
+ id: import("@metamask/superstruct").Struct<string, null>;
348
+ scope: import("@metamask/superstruct").Struct<string, null>;
349
+ account: import("@metamask/superstruct").Struct<string, null>;
350
+ request: import("@metamask/superstruct").Struct<{
351
+ method: string;
352
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
353
+ }, {
354
+ method: import("@metamask/superstruct").Struct<string, null>;
355
+ params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[], null>;
356
+ }>;
357
+ }>;
358
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
359
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
360
+ }>;
361
+ export declare type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
362
+ export declare const SubmitRequestResponseStruct: import("@metamask/superstruct").Struct<{
363
+ pending: true;
364
+ redirect?: {
365
+ message?: string;
366
+ url?: string;
367
+ };
368
+ } | {
369
+ pending: false;
370
+ result: import("@metamask/utils").Json;
371
+ }, null>;
372
+ export declare type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
373
+ export declare const ApproveRequestRequestStruct: import("@metamask/superstruct").Struct<{
374
+ method: "keyring_approveRequest";
375
+ jsonrpc: "2.0";
376
+ id: string | number | null;
377
+ params: {
378
+ id: string;
379
+ data: Record<string, import("@metamask/utils").Json>;
380
+ };
381
+ }, {
382
+ method: import("@metamask/superstruct").Struct<"keyring_approveRequest", "keyring_approveRequest">;
383
+ params: import("@metamask/superstruct").Struct<{
384
+ id: string;
385
+ data: Record<string, import("@metamask/utils").Json>;
386
+ }, {
387
+ id: import("@metamask/superstruct").Struct<string, null>;
388
+ data: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
389
+ }>;
390
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
391
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
392
+ }>;
393
+ export declare type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
394
+ export declare const ApproveRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
395
+ export declare type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
396
+ export declare const RejectRequestRequestStruct: import("@metamask/superstruct").Struct<{
397
+ method: "keyring_rejectRequest";
398
+ jsonrpc: "2.0";
399
+ id: string | number | null;
400
+ params: {
401
+ id: string;
402
+ };
403
+ }, {
404
+ method: import("@metamask/superstruct").Struct<"keyring_rejectRequest", "keyring_rejectRequest">;
405
+ params: import("@metamask/superstruct").Struct<{
406
+ id: string;
407
+ }, {
408
+ id: import("@metamask/superstruct").Struct<string, null>;
409
+ }>;
410
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
411
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
412
+ }>;
413
+ export declare type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
414
+ export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
415
+ export declare type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
@@ -0,0 +1,138 @@
1
+ "use strict";
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.CreateAccountResponseStruct = exports.CreateAccountRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.ListAccountsResponseStruct = exports.ListAccountsRequestStruct = void 0;
4
+ const keyring_api_1 = require("@metamask/keyring-api");
5
+ const keyring_utils_1 = require("@metamask/keyring-utils");
6
+ const superstruct_1 = require("@metamask/superstruct");
7
+ const utils_1 = require("@metamask/utils");
8
+ const rpc_1 = require("./rpc");
9
+ const CommonHeader = {
10
+ jsonrpc: (0, superstruct_1.literal)('2.0'),
11
+ id: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)(), (0, superstruct_1.literal)(null)]),
12
+ };
13
+ // ----------------------------------------------------------------------------
14
+ // List accounts
15
+ exports.ListAccountsRequestStruct = (0, keyring_utils_1.object)({
16
+ ...CommonHeader,
17
+ method: (0, superstruct_1.literal)('keyring_listAccounts'),
18
+ });
19
+ exports.ListAccountsResponseStruct = (0, superstruct_1.array)(keyring_api_1.KeyringAccountStruct);
20
+ // ----------------------------------------------------------------------------
21
+ // Get account
22
+ exports.GetAccountRequestStruct = (0, keyring_utils_1.object)({
23
+ ...CommonHeader,
24
+ method: (0, superstruct_1.literal)('keyring_getAccount'),
25
+ params: (0, keyring_utils_1.object)({
26
+ id: keyring_utils_1.UuidStruct,
27
+ }),
28
+ });
29
+ exports.GetAccountResponseStruct = keyring_api_1.KeyringAccountStruct;
30
+ // ----------------------------------------------------------------------------
31
+ // Create account
32
+ exports.CreateAccountRequestStruct = (0, keyring_utils_1.object)({
33
+ ...CommonHeader,
34
+ method: (0, superstruct_1.literal)('keyring_createAccount'),
35
+ params: (0, keyring_utils_1.object)({
36
+ options: (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct),
37
+ }),
38
+ });
39
+ exports.CreateAccountResponseStruct = keyring_api_1.KeyringAccountStruct;
40
+ // ----------------------------------------------------------------------------
41
+ // Get account balances
42
+ exports.GetAccountBalancesRequestStruct = (0, keyring_utils_1.object)({
43
+ ...CommonHeader,
44
+ method: (0, superstruct_1.literal)(`${rpc_1.KeyringRpcMethod.GetAccountBalances}`),
45
+ params: (0, keyring_utils_1.object)({
46
+ id: keyring_utils_1.UuidStruct,
47
+ assets: (0, superstruct_1.array)(keyring_api_1.CaipAssetTypeStruct),
48
+ }),
49
+ });
50
+ exports.GetAccountBalancesResponseStruct = (0, superstruct_1.record)(keyring_api_1.CaipAssetTypeStruct, keyring_api_1.BalanceStruct);
51
+ // ----------------------------------------------------------------------------
52
+ // Filter account chains
53
+ exports.FilterAccountChainsStruct = (0, keyring_utils_1.object)({
54
+ ...CommonHeader,
55
+ method: (0, superstruct_1.literal)('keyring_filterAccountChains'),
56
+ params: (0, keyring_utils_1.object)({
57
+ id: keyring_utils_1.UuidStruct,
58
+ chains: (0, superstruct_1.array)((0, superstruct_1.string)()),
59
+ }),
60
+ });
61
+ exports.FilterAccountChainsResponseStruct = (0, superstruct_1.array)((0, superstruct_1.string)());
62
+ // ----------------------------------------------------------------------------
63
+ // Update account
64
+ exports.UpdateAccountRequestStruct = (0, keyring_utils_1.object)({
65
+ ...CommonHeader,
66
+ method: (0, superstruct_1.literal)('keyring_updateAccount'),
67
+ params: (0, keyring_utils_1.object)({
68
+ account: keyring_api_1.KeyringAccountStruct,
69
+ }),
70
+ });
71
+ exports.UpdateAccountResponseStruct = (0, superstruct_1.literal)(null);
72
+ // ----------------------------------------------------------------------------
73
+ // Delete account
74
+ exports.DeleteAccountRequestStruct = (0, keyring_utils_1.object)({
75
+ ...CommonHeader,
76
+ method: (0, superstruct_1.literal)('keyring_deleteAccount'),
77
+ params: (0, keyring_utils_1.object)({
78
+ id: keyring_utils_1.UuidStruct,
79
+ }),
80
+ });
81
+ exports.DeleteAccountResponseStruct = (0, superstruct_1.literal)(null);
82
+ // ----------------------------------------------------------------------------
83
+ // Export account
84
+ exports.ExportAccountRequestStruct = (0, keyring_utils_1.object)({
85
+ ...CommonHeader,
86
+ method: (0, superstruct_1.literal)('keyring_exportAccount'),
87
+ params: (0, keyring_utils_1.object)({
88
+ id: keyring_utils_1.UuidStruct,
89
+ }),
90
+ });
91
+ exports.ExportAccountResponseStruct = keyring_api_1.KeyringAccountDataStruct;
92
+ // ----------------------------------------------------------------------------
93
+ // List requests
94
+ exports.ListRequestsRequestStruct = (0, keyring_utils_1.object)({
95
+ ...CommonHeader,
96
+ method: (0, superstruct_1.literal)('keyring_listRequests'),
97
+ });
98
+ exports.ListRequestsResponseStruct = (0, superstruct_1.array)(keyring_api_1.KeyringRequestStruct);
99
+ // ----------------------------------------------------------------------------
100
+ // Get request
101
+ exports.GetRequestRequestStruct = (0, keyring_utils_1.object)({
102
+ ...CommonHeader,
103
+ method: (0, superstruct_1.literal)('keyring_getRequest'),
104
+ params: (0, keyring_utils_1.object)({
105
+ id: keyring_utils_1.UuidStruct,
106
+ }),
107
+ });
108
+ exports.GetRequestResponseStruct = keyring_api_1.KeyringRequestStruct;
109
+ // ----------------------------------------------------------------------------
110
+ // Submit request
111
+ exports.SubmitRequestRequestStruct = (0, keyring_utils_1.object)({
112
+ ...CommonHeader,
113
+ method: (0, superstruct_1.literal)('keyring_submitRequest'),
114
+ params: keyring_api_1.KeyringRequestStruct,
115
+ });
116
+ exports.SubmitRequestResponseStruct = keyring_api_1.KeyringResponseStruct;
117
+ // ----------------------------------------------------------------------------
118
+ // Approve request
119
+ exports.ApproveRequestRequestStruct = (0, keyring_utils_1.object)({
120
+ ...CommonHeader,
121
+ method: (0, superstruct_1.literal)('keyring_approveRequest'),
122
+ params: (0, keyring_utils_1.object)({
123
+ id: keyring_utils_1.UuidStruct,
124
+ data: (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct),
125
+ }),
126
+ });
127
+ exports.ApproveRequestResponseStruct = (0, superstruct_1.literal)(null);
128
+ // ----------------------------------------------------------------------------
129
+ // Reject request
130
+ exports.RejectRequestRequestStruct = (0, keyring_utils_1.object)({
131
+ ...CommonHeader,
132
+ method: (0, superstruct_1.literal)('keyring_rejectRequest'),
133
+ params: (0, keyring_utils_1.object)({
134
+ id: keyring_utils_1.UuidStruct,
135
+ }),
136
+ });
137
+ exports.RejectRequestResponseStruct = (0, superstruct_1.literal)(null);
138
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/internal/api.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAC/B,2DAA6D;AAE7D,uDAO+B;AAC/B,2CAA6C;AAE7C,+BAAyC;AAEzC,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IACvB,EAAE,EAAE,IAAA,mBAA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IAAI,CAAC,CAAC;AAI1D,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,uBAAuB,CAAC;IACxC,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb,EAAE,EAAE,0BAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC","sourcesContent":["import {\n BalanceStruct,\n CaipAssetTypeStruct,\n KeyringAccountDataStruct,\n KeyringAccountStruct,\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n array,\n literal,\n number,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringRpcMethod } from './rpc';\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// 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"]}
@@ -0,0 +1,33 @@
1
+ import type { KeyringExecutionContext } from '@metamask/keyring-api';
2
+ import type { Json, Keyring } from '@metamask/utils';
3
+ import type { EthBaseTransaction, EthBaseUserOperation, EthUserOperation, EthUserOperationPatch } from '../../eth';
4
+ export declare type EthKeyring<State extends Json> = Keyring<State> & {
5
+ /**
6
+ * Convert a base transaction to a base UserOperation.
7
+ *
8
+ * @param address - Address of the sender.
9
+ * @param transactions - Base transactions to include in the UserOperation.
10
+ * @param context - Keyring execution context.
11
+ * @returns A pseudo-UserOperation that can be used to construct a real.
12
+ */
13
+ prepareUserOperation?(address: string, transactions: EthBaseTransaction[], context: KeyringExecutionContext): Promise<EthBaseUserOperation>;
14
+ /**
15
+ * Patches properties of a UserOperation. Currently, only the
16
+ * `paymasterAndData` can be patched.
17
+ *
18
+ * @param address - Address of the sender.
19
+ * @param userOp - UserOperation to patch.
20
+ * @param context - Keyring execution context.
21
+ * @returns A patch to apply to the UserOperation.
22
+ */
23
+ patchUserOperation?(address: string, userOp: EthUserOperation, context: KeyringExecutionContext): Promise<EthUserOperationPatch>;
24
+ /**
25
+ * Signs an UserOperation.
26
+ *
27
+ * @param address - Address of the sender.
28
+ * @param userOp - UserOperation to sign.
29
+ * @param context - Keyring execution context.
30
+ * @returns The signature of the UserOperation.
31
+ */
32
+ signUserOperation?(address: string, userOp: EthUserOperation, context: KeyringExecutionContext): Promise<string>;
33
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=EthKeyring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthKeyring.js","sourceRoot":"","sources":["../../../src/internal/eth/EthKeyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyringExecutionContext } from '@metamask/keyring-api';\nimport type { Json, Keyring } from '@metamask/utils';\n\nimport type {\n EthBaseTransaction,\n EthBaseUserOperation,\n EthUserOperation,\n EthUserOperationPatch,\n} from '../../eth';\n\nexport type EthKeyring<State extends Json> = Keyring<State> & {\n /**\n * Convert a base transaction to a base UserOperation.\n *\n * @param address - Address of the sender.\n * @param transactions - Base transactions to include in the UserOperation.\n * @param context - Keyring execution context.\n * @returns A pseudo-UserOperation that can be used to construct a real.\n */\n prepareUserOperation?(\n address: string,\n transactions: EthBaseTransaction[],\n context: KeyringExecutionContext,\n ): Promise<EthBaseUserOperation>;\n\n /**\n * Patches properties of a UserOperation. Currently, only the\n * `paymasterAndData` can be patched.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to patch.\n * @param context - Keyring execution context.\n * @returns A patch to apply to the UserOperation.\n */\n patchUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<EthUserOperationPatch>;\n\n /**\n * Signs an UserOperation.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to sign.\n * @param context - Keyring execution context.\n * @returns The signature of the UserOperation.\n */\n signUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<string>;\n};\n"]}
@@ -0,0 +1 @@
1
+ export * from './EthKeyring';
@@ -0,0 +1,18 @@
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("./EthKeyring"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B","sourcesContent":["export * from './EthKeyring';\n"]}