@metamask-previews/keyring-api 21.5.0-fd40efd → 22.0.0-5c366be

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 (88) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/api/account-options.cjs +0 -4
  3. package/dist/api/account-options.cjs.map +1 -1
  4. package/dist/api/account-options.d.cts +0 -4
  5. package/dist/api/account-options.d.cts.map +1 -1
  6. package/dist/api/account-options.d.mts +0 -4
  7. package/dist/api/account-options.d.mts.map +1 -1
  8. package/dist/api/account-options.mjs +0 -4
  9. package/dist/api/account-options.mjs.map +1 -1
  10. package/dist/api/v2/index.cjs +1 -1
  11. package/dist/api/v2/index.cjs.map +1 -1
  12. package/dist/api/v2/index.d.cts +1 -1
  13. package/dist/api/v2/index.d.cts.map +1 -1
  14. package/dist/api/v2/index.d.mts +1 -1
  15. package/dist/api/v2/index.d.mts.map +1 -1
  16. package/dist/api/v2/index.mjs +1 -1
  17. package/dist/api/v2/index.mjs.map +1 -1
  18. package/dist/api/v2/keyring-rpc.cjs +93 -0
  19. package/dist/api/v2/keyring-rpc.cjs.map +1 -0
  20. package/dist/api/v2/keyring-rpc.d.cts +440 -0
  21. package/dist/api/v2/keyring-rpc.d.cts.map +1 -0
  22. package/dist/api/v2/keyring-rpc.d.mts +440 -0
  23. package/dist/api/v2/keyring-rpc.d.mts.map +1 -0
  24. package/dist/api/v2/keyring-rpc.mjs +89 -0
  25. package/dist/api/v2/keyring-rpc.mjs.map +1 -0
  26. package/dist/api/v2/keyring-type.cjs +4 -0
  27. package/dist/api/v2/keyring-type.cjs.map +1 -1
  28. package/dist/api/v2/keyring-type.d.cts +5 -1
  29. package/dist/api/v2/keyring-type.d.cts.map +1 -1
  30. package/dist/api/v2/keyring-type.d.mts +5 -1
  31. package/dist/api/v2/keyring-type.d.mts.map +1 -1
  32. package/dist/api/v2/keyring-type.mjs +4 -0
  33. package/dist/api/v2/keyring-type.mjs.map +1 -1
  34. package/dist/eth/index.cjs +0 -1
  35. package/dist/eth/index.cjs.map +1 -1
  36. package/dist/eth/index.d.cts +0 -1
  37. package/dist/eth/index.d.cts.map +1 -1
  38. package/dist/eth/index.d.mts +0 -1
  39. package/dist/eth/index.d.mts.map +1 -1
  40. package/dist/eth/index.mjs +0 -1
  41. package/dist/eth/index.mjs.map +1 -1
  42. package/dist/rpc.cjs.map +1 -1
  43. package/dist/rpc.d.cts +1 -1
  44. package/dist/rpc.d.cts.map +1 -1
  45. package/dist/rpc.d.mts +1 -1
  46. package/dist/rpc.d.mts.map +1 -1
  47. package/dist/rpc.mjs.map +1 -1
  48. package/package.json +3 -8
  49. package/dist/api/v2/wrapper/index.cjs +0 -19
  50. package/dist/api/v2/wrapper/index.cjs.map +0 -1
  51. package/dist/api/v2/wrapper/index.d.cts +0 -3
  52. package/dist/api/v2/wrapper/index.d.cts.map +0 -1
  53. package/dist/api/v2/wrapper/index.d.mts +0 -3
  54. package/dist/api/v2/wrapper/index.d.mts.map +0 -1
  55. package/dist/api/v2/wrapper/index.mjs +0 -3
  56. package/dist/api/v2/wrapper/index.mjs.map +0 -1
  57. package/dist/api/v2/wrapper/keyring-account-registry.cjs +0 -135
  58. package/dist/api/v2/wrapper/keyring-account-registry.cjs.map +0 -1
  59. package/dist/api/v2/wrapper/keyring-account-registry.d.cts +0 -88
  60. package/dist/api/v2/wrapper/keyring-account-registry.d.cts.map +0 -1
  61. package/dist/api/v2/wrapper/keyring-account-registry.d.mts +0 -88
  62. package/dist/api/v2/wrapper/keyring-account-registry.d.mts.map +0 -1
  63. package/dist/api/v2/wrapper/keyring-account-registry.mjs +0 -131
  64. package/dist/api/v2/wrapper/keyring-account-registry.mjs.map +0 -1
  65. package/dist/api/v2/wrapper/keyring-wrapper.cjs +0 -134
  66. package/dist/api/v2/wrapper/keyring-wrapper.cjs.map +0 -1
  67. package/dist/api/v2/wrapper/keyring-wrapper.d.cts +0 -154
  68. package/dist/api/v2/wrapper/keyring-wrapper.d.cts.map +0 -1
  69. package/dist/api/v2/wrapper/keyring-wrapper.d.mts +0 -154
  70. package/dist/api/v2/wrapper/keyring-wrapper.d.mts.map +0 -1
  71. package/dist/api/v2/wrapper/keyring-wrapper.mjs +0 -130
  72. package/dist/api/v2/wrapper/keyring-wrapper.mjs.map +0 -1
  73. package/dist/eth/v2/eth-keyring-wrapper.cjs +0 -165
  74. package/dist/eth/v2/eth-keyring-wrapper.cjs.map +0 -1
  75. package/dist/eth/v2/eth-keyring-wrapper.d.cts +0 -54
  76. package/dist/eth/v2/eth-keyring-wrapper.d.cts.map +0 -1
  77. package/dist/eth/v2/eth-keyring-wrapper.d.mts +0 -54
  78. package/dist/eth/v2/eth-keyring-wrapper.d.mts.map +0 -1
  79. package/dist/eth/v2/eth-keyring-wrapper.mjs +0 -161
  80. package/dist/eth/v2/eth-keyring-wrapper.mjs.map +0 -1
  81. package/dist/eth/v2/index.cjs +0 -18
  82. package/dist/eth/v2/index.cjs.map +0 -1
  83. package/dist/eth/v2/index.d.cts +0 -2
  84. package/dist/eth/v2/index.d.cts.map +0 -1
  85. package/dist/eth/v2/index.d.mts +0 -2
  86. package/dist/eth/v2/index.d.mts.map +0 -1
  87. package/dist/eth/v2/index.mjs +0 -2
  88. package/dist/eth/v2/index.mjs.map +0 -1
@@ -0,0 +1,440 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ import type { KeyringV2 } from "./keyring.cjs";
3
+ /**
4
+ * Keyring interface for keyring methods that can be invoked through
5
+ * RPC calls.
6
+ */
7
+ export type KeyringRpcV2 = {
8
+ getAccount: KeyringV2['getAccount'];
9
+ getAccounts: KeyringV2['getAccounts'];
10
+ createAccounts: KeyringV2['createAccounts'];
11
+ deleteAccount: KeyringV2['deleteAccount'];
12
+ submitRequest: KeyringV2['submitRequest'];
13
+ exportAccount?: KeyringV2['exportAccount'];
14
+ };
15
+ /**
16
+ * Keyring RPC methods used by the API.
17
+ */
18
+ export declare const KeyringRpcV2Method: {
19
+ readonly GetAccounts: "keyring_getAccounts";
20
+ readonly CreateAccounts: "keyring_createAccounts";
21
+ readonly GetAccount: "keyring_getAccount";
22
+ readonly DeleteAccount: "keyring_deleteAccount";
23
+ readonly ExportAccount: "keyring_exportAccount";
24
+ readonly SubmitRequest: "keyring_submitRequest";
25
+ };
26
+ /**
27
+ * Keyring RPC methods used by the API.
28
+ */
29
+ export type KeyringRpcV2Method = (typeof KeyringRpcV2Method)[keyof typeof KeyringRpcV2Method];
30
+ /**
31
+ * Check if a method is a keyring RPC method (v2).
32
+ *
33
+ * @param method - Method to check.
34
+ * @returns Whether the method is a keyring RPC method (v2).
35
+ */
36
+ export declare function isKeyringRpcV2Method(method: string): method is KeyringRpcV2Method;
37
+ export declare const GetAccountsV2RequestStruct: import("@metamask/superstruct").Struct<{
38
+ method: "keyring_getAccounts";
39
+ id: string | number | null;
40
+ jsonrpc: "2.0";
41
+ }, {
42
+ method: import("@metamask/superstruct").Struct<"keyring_getAccounts", "keyring_getAccounts">;
43
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
44
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
45
+ }>;
46
+ export type GetAccountsV2Request = Infer<typeof GetAccountsV2RequestStruct>;
47
+ export declare const GetAccountsV2ResponseStruct: import("@metamask/superstruct").Struct<{
48
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
49
+ id: string;
50
+ options: Record<string, import("@metamask/utils").Json> & {
51
+ entropy?: {
52
+ type: "mnemonic";
53
+ id: string;
54
+ derivationPath: string;
55
+ groupIndex: number;
56
+ } | {
57
+ type: "private-key";
58
+ } | {
59
+ type: "custom";
60
+ };
61
+ exportable?: boolean;
62
+ };
63
+ address: string;
64
+ scopes: `${string}:${string}`[];
65
+ methods: string[];
66
+ }[], import("@metamask/superstruct").Struct<{
67
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
68
+ id: string;
69
+ options: Record<string, import("@metamask/utils").Json> & {
70
+ entropy?: {
71
+ type: "mnemonic";
72
+ id: string;
73
+ derivationPath: string;
74
+ groupIndex: number;
75
+ } | {
76
+ type: "private-key";
77
+ } | {
78
+ type: "custom";
79
+ };
80
+ exportable?: boolean;
81
+ };
82
+ address: string;
83
+ scopes: `${string}:${string}`[];
84
+ methods: string[];
85
+ }, {
86
+ id: import("@metamask/superstruct").Struct<string, null>;
87
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
88
+ "eip155:eoa": "eip155:eoa";
89
+ "eip155:erc4337": "eip155:erc4337";
90
+ "bip122:p2pkh": "bip122:p2pkh";
91
+ "bip122:p2sh": "bip122:p2sh";
92
+ "bip122:p2wpkh": "bip122:p2wpkh";
93
+ "bip122:p2tr": "bip122:p2tr";
94
+ "solana:data-account": "solana:data-account";
95
+ "tron:eoa": "tron:eoa";
96
+ "any:account": "any:account";
97
+ }>;
98
+ address: import("@metamask/superstruct").Struct<string, null>;
99
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
100
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
101
+ entropy?: {
102
+ type: "mnemonic";
103
+ id: string;
104
+ derivationPath: string;
105
+ groupIndex: number;
106
+ } | {
107
+ type: "private-key";
108
+ } | {
109
+ type: "custom";
110
+ };
111
+ exportable?: boolean;
112
+ }, null>;
113
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
114
+ }>>;
115
+ export type GetAccountsV2Response = Infer<typeof GetAccountsV2ResponseStruct>;
116
+ export declare const GetAccountV2RequestStruct: import("@metamask/superstruct").Struct<{
117
+ method: "keyring_getAccount";
118
+ id: string | number | null;
119
+ jsonrpc: "2.0";
120
+ params: {
121
+ id: string;
122
+ };
123
+ }, {
124
+ method: import("@metamask/superstruct").Struct<"keyring_getAccount", "keyring_getAccount">;
125
+ params: import("@metamask/superstruct").Struct<{
126
+ id: string;
127
+ }, {
128
+ id: import("@metamask/superstruct").Struct<string, null>;
129
+ }>;
130
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
131
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
132
+ }>;
133
+ export type GetAccountV2Request = Infer<typeof GetAccountV2RequestStruct>;
134
+ export declare const GetAccountV2ResponseStruct: import("@metamask/superstruct").Struct<{
135
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
136
+ id: string;
137
+ options: Record<string, import("@metamask/utils").Json> & {
138
+ entropy?: {
139
+ type: "mnemonic";
140
+ id: string;
141
+ derivationPath: string;
142
+ groupIndex: number;
143
+ } | {
144
+ type: "private-key";
145
+ } | {
146
+ type: "custom";
147
+ };
148
+ exportable?: boolean;
149
+ };
150
+ address: string;
151
+ scopes: `${string}:${string}`[];
152
+ methods: string[];
153
+ }, {
154
+ id: import("@metamask/superstruct").Struct<string, null>;
155
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
156
+ "eip155:eoa": "eip155:eoa";
157
+ "eip155:erc4337": "eip155:erc4337";
158
+ "bip122:p2pkh": "bip122:p2pkh";
159
+ "bip122:p2sh": "bip122:p2sh";
160
+ "bip122:p2wpkh": "bip122:p2wpkh";
161
+ "bip122:p2tr": "bip122:p2tr";
162
+ "solana:data-account": "solana:data-account";
163
+ "tron:eoa": "tron:eoa";
164
+ "any:account": "any:account";
165
+ }>;
166
+ address: import("@metamask/superstruct").Struct<string, null>;
167
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
168
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
169
+ entropy?: {
170
+ type: "mnemonic";
171
+ id: string;
172
+ derivationPath: string;
173
+ groupIndex: number;
174
+ } | {
175
+ type: "private-key";
176
+ } | {
177
+ type: "custom";
178
+ };
179
+ exportable?: boolean;
180
+ }, null>;
181
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
182
+ }>;
183
+ export type GetAccountV2Response = Infer<typeof GetAccountV2ResponseStruct>;
184
+ export declare const CreateAccountsV2RequestStruct: import("@metamask/superstruct").Struct<{
185
+ method: "keyring_createAccounts";
186
+ id: string | number | null;
187
+ jsonrpc: "2.0";
188
+ params: {
189
+ type: "bip44:derive-path";
190
+ derivationPath: `m/${string}`;
191
+ entropySource: string;
192
+ } | {
193
+ type: "bip44:derive-index";
194
+ groupIndex: number;
195
+ entropySource: string;
196
+ } | {
197
+ type: "bip44:discover";
198
+ groupIndex: number;
199
+ entropySource: string;
200
+ } | {
201
+ type: "bip44:derive-index-range";
202
+ range: {
203
+ from: number;
204
+ to: number;
205
+ };
206
+ entropySource: string;
207
+ } | {
208
+ type: "custom";
209
+ } | {
210
+ type: "private-key:import";
211
+ encoding: "hexadecimal" | "base58";
212
+ privateKey: string;
213
+ accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
214
+ };
215
+ }, {
216
+ method: import("@metamask/superstruct").Struct<"keyring_createAccounts", "keyring_createAccounts">;
217
+ params: import("@metamask/superstruct").Struct<{
218
+ type: "bip44:derive-path";
219
+ derivationPath: `m/${string}`;
220
+ entropySource: string;
221
+ } | {
222
+ type: "bip44:derive-index";
223
+ groupIndex: number;
224
+ entropySource: string;
225
+ } | {
226
+ type: "bip44:discover";
227
+ groupIndex: number;
228
+ entropySource: string;
229
+ } | {
230
+ type: "bip44:derive-index-range";
231
+ range: {
232
+ from: number;
233
+ to: number;
234
+ };
235
+ entropySource: string;
236
+ } | {
237
+ type: "custom";
238
+ } | {
239
+ type: "private-key:import";
240
+ encoding: "hexadecimal" | "base58";
241
+ privateKey: string;
242
+ accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
243
+ }, null>;
244
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
245
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
246
+ }>;
247
+ export type CreateAccountsV2Request = Infer<typeof CreateAccountsV2RequestStruct>;
248
+ export declare const CreateAccountsV2ResponseStruct: import("@metamask/superstruct").Struct<{
249
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
250
+ id: string;
251
+ options: Record<string, import("@metamask/utils").Json> & {
252
+ entropy?: {
253
+ type: "mnemonic";
254
+ id: string;
255
+ derivationPath: string;
256
+ groupIndex: number;
257
+ } | {
258
+ type: "private-key";
259
+ } | {
260
+ type: "custom";
261
+ };
262
+ exportable?: boolean;
263
+ };
264
+ address: string;
265
+ scopes: `${string}:${string}`[];
266
+ methods: string[];
267
+ }[], import("@metamask/superstruct").Struct<{
268
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
269
+ id: string;
270
+ options: Record<string, import("@metamask/utils").Json> & {
271
+ entropy?: {
272
+ type: "mnemonic";
273
+ id: string;
274
+ derivationPath: string;
275
+ groupIndex: number;
276
+ } | {
277
+ type: "private-key";
278
+ } | {
279
+ type: "custom";
280
+ };
281
+ exportable?: boolean;
282
+ };
283
+ address: string;
284
+ scopes: `${string}:${string}`[];
285
+ methods: string[];
286
+ }, {
287
+ id: import("@metamask/superstruct").Struct<string, null>;
288
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
289
+ "eip155:eoa": "eip155:eoa";
290
+ "eip155:erc4337": "eip155:erc4337";
291
+ "bip122:p2pkh": "bip122:p2pkh";
292
+ "bip122:p2sh": "bip122:p2sh";
293
+ "bip122:p2wpkh": "bip122:p2wpkh";
294
+ "bip122:p2tr": "bip122:p2tr";
295
+ "solana:data-account": "solana:data-account";
296
+ "tron:eoa": "tron:eoa";
297
+ "any:account": "any:account";
298
+ }>;
299
+ address: import("@metamask/superstruct").Struct<string, null>;
300
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
301
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
302
+ entropy?: {
303
+ type: "mnemonic";
304
+ id: string;
305
+ derivationPath: string;
306
+ groupIndex: number;
307
+ } | {
308
+ type: "private-key";
309
+ } | {
310
+ type: "custom";
311
+ };
312
+ exportable?: boolean;
313
+ }, null>;
314
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
315
+ }>>;
316
+ export type CreateAccountsV2Response = Infer<typeof CreateAccountsV2ResponseStruct>;
317
+ export declare const DeleteAccountV2RequestStruct: import("@metamask/superstruct").Struct<{
318
+ method: "keyring_deleteAccount";
319
+ id: string | number | null;
320
+ jsonrpc: "2.0";
321
+ params: {
322
+ id: string;
323
+ };
324
+ }, {
325
+ method: import("@metamask/superstruct").Struct<"keyring_deleteAccount", "keyring_deleteAccount">;
326
+ params: import("@metamask/superstruct").Struct<{
327
+ id: string;
328
+ }, {
329
+ id: import("@metamask/superstruct").Struct<string, null>;
330
+ }>;
331
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
332
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
333
+ }>;
334
+ export type DeleteAccountV2Request = Infer<typeof DeleteAccountV2RequestStruct>;
335
+ export declare const DeleteAccountV2ResponseStruct: import("@metamask/superstruct").Struct<null, null>;
336
+ export type DeleteAccountV2Response = Infer<typeof DeleteAccountV2ResponseStruct>;
337
+ export declare const ExportAccountV2RequestStruct: import("@metamask/superstruct").Struct<{
338
+ method: "keyring_exportAccount";
339
+ id: string | number | null;
340
+ jsonrpc: "2.0";
341
+ params: {
342
+ id: string;
343
+ options?: {
344
+ type: "private-key";
345
+ encoding: "hexadecimal" | "base58";
346
+ };
347
+ };
348
+ }, {
349
+ method: import("@metamask/superstruct").Struct<"keyring_exportAccount", "keyring_exportAccount">;
350
+ params: import("@metamask/superstruct").Struct<{
351
+ id: string;
352
+ options?: {
353
+ type: "private-key";
354
+ encoding: "hexadecimal" | "base58";
355
+ };
356
+ }, {
357
+ id: import("@metamask/superstruct").Struct<string, null>;
358
+ options: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
359
+ type: "private-key";
360
+ encoding: "hexadecimal" | "base58";
361
+ }, {
362
+ type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
363
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
364
+ hexadecimal: "hexadecimal";
365
+ base58: "base58";
366
+ }>;
367
+ }>;
368
+ }>;
369
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
370
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
371
+ }>;
372
+ export type ExportAccountV2Request = Infer<typeof ExportAccountV2RequestStruct>;
373
+ export declare const ExportAccountV2ResponseStruct: import("@metamask/superstruct").Struct<{
374
+ type: "private-key";
375
+ encoding: "hexadecimal" | "base58";
376
+ privateKey: string;
377
+ }, {
378
+ type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
379
+ privateKey: import("@metamask/superstruct").Struct<string, null>;
380
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
381
+ hexadecimal: "hexadecimal";
382
+ base58: "base58";
383
+ }>;
384
+ }>;
385
+ export type ExportAccountV2Response = Infer<typeof ExportAccountV2ResponseStruct>;
386
+ export declare const SubmitRequestV2RequestStruct: import("@metamask/superstruct").Struct<{
387
+ method: "keyring_submitRequest";
388
+ id: string | number | null;
389
+ jsonrpc: "2.0";
390
+ params: {
391
+ id: string;
392
+ origin: string;
393
+ request: {
394
+ method: string;
395
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
396
+ };
397
+ scope: string;
398
+ account: string;
399
+ };
400
+ }, {
401
+ method: import("@metamask/superstruct").Struct<"keyring_submitRequest", "keyring_submitRequest">;
402
+ params: import("@metamask/superstruct").Struct<{
403
+ id: string;
404
+ origin: string;
405
+ request: {
406
+ method: string;
407
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
408
+ };
409
+ scope: string;
410
+ account: string;
411
+ }, {
412
+ id: import("@metamask/superstruct").Struct<string, null>;
413
+ scope: import("@metamask/superstruct").Struct<string, null>;
414
+ account: import("@metamask/superstruct").Struct<string, null>;
415
+ origin: import("@metamask/superstruct").Struct<string, null>;
416
+ request: import("@metamask/superstruct").Struct<{
417
+ method: string;
418
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
419
+ }, {
420
+ method: import("@metamask/superstruct").Struct<string, null>;
421
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
422
+ }>;
423
+ }>;
424
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
425
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
426
+ }>;
427
+ export type SubmitRequestV2Request = Infer<typeof SubmitRequestV2RequestStruct>;
428
+ export declare const SubmitRequestV2ResponseStruct: import("@metamask/superstruct").Struct<import("@metamask/utils").Json, unknown>;
429
+ export type SubmitRequestV2Response = Infer<typeof SubmitRequestV2ResponseStruct>;
430
+ /**
431
+ * Keyring RPC requests.
432
+ */
433
+ export type KeyringRpcV2Requests = GetAccountsV2Request | GetAccountV2Request | CreateAccountsV2Request | DeleteAccountV2Request | ExportAccountV2Request | SubmitRequestV2Request;
434
+ /**
435
+ * Extract the proper request type for a given `KeyringRpcV2Method`.
436
+ */
437
+ export type KeyringRpcV2Request<RpcMethod extends KeyringRpcV2Method> = Extract<KeyringRpcV2Requests, {
438
+ method: `${RpcMethod}`;
439
+ }>;
440
+ //# sourceMappingURL=keyring-rpc.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring-rpc.d.cts","sourceRoot":"","sources":["../../../src/api/v2/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AASnD,OAAO,KAAK,EAAE,SAAS,EAAE,sBAAkB;AAI3C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACpC,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACtC,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC1C,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;CASrB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;;;;GAK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