@metamask/keyring-api 22.0.0 → 23.0.0
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.
- package/CHANGELOG.md +21 -1
- package/dist/api/account.cjs +15 -1
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +17 -4
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +17 -4
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +14 -0
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.cts.map +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.d.mts.map +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +1 -1
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +1 -1
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/events.d.cts +10 -8
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +10 -8
- package/dist/events.d.mts.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/rpc.cjs +2 -1
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +23 -18
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +23 -18
- package/dist/rpc.d.mts.map +1 -1
- package/dist/rpc.mjs +2 -1
- package/dist/rpc.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.cjs +1 -1
- package/dist/{api/v2/create-account/bip44.mjs.map → v2/api/create-account/bip44.cjs.map} +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/bip44.mjs +1 -1
- package/dist/v2/api/create-account/bip44.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/create-account/custom.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/custom.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/custom.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/custom.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.cts +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.mts +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/index.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/private-key.cjs +1 -1
- package/dist/v2/api/create-account/private-key.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.cts +3 -2
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.mts +3 -2
- package/dist/{api/v2 → v2/api}/create-account/private-key.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/create-account/private-key.mjs +1 -1
- package/dist/v2/api/create-account/private-key.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/export-account/index.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/index.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/index.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/index.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/export-account/private-key.mjs.map +1 -1
- package/dist/{api/v2 → v2/api}/index.cjs +1 -0
- package/dist/v2/api/index.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/index.d.cts +1 -0
- package/dist/v2/api/index.d.cts.map +1 -0
- package/dist/{api/v2 → v2/api}/index.d.mts +1 -0
- package/dist/v2/api/index.d.mts.map +1 -0
- package/dist/{api/v2 → v2/api}/index.mjs +1 -0
- package/dist/v2/api/index.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.cjs +2 -2
- package/dist/v2/api/keyring-capabilities.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.d.cts +7 -6
- package/dist/v2/api/keyring-capabilities.d.cts.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.d.mts +7 -6
- package/dist/v2/api/keyring-capabilities.d.mts.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-capabilities.mjs +2 -2
- package/dist/v2/api/keyring-capabilities.mjs.map +1 -0
- package/dist/v2/api/keyring-rpc.cjs +93 -0
- package/dist/v2/api/keyring-rpc.cjs.map +1 -0
- package/dist/v2/api/keyring-rpc.d.cts +443 -0
- package/dist/v2/api/keyring-rpc.d.cts.map +1 -0
- package/dist/v2/api/keyring-rpc.d.mts +443 -0
- package/dist/v2/api/keyring-rpc.d.mts.map +1 -0
- package/dist/v2/api/keyring-rpc.mjs +89 -0
- package/dist/v2/api/keyring-rpc.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring-type.cjs.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring-type.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring-type.d.mts.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring-type.mjs.map +1 -1
- package/dist/v2/api/keyring.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/keyring.d.cts +4 -4
- package/dist/{api/v2 → v2/api}/keyring.d.cts.map +1 -1
- package/dist/{api/v2 → v2/api}/keyring.d.mts +4 -4
- package/dist/{api/v2 → v2/api}/keyring.d.mts.map +1 -1
- package/dist/v2/api/keyring.mjs.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.cjs +1 -1
- package/dist/v2/api/private-key.cjs.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.d.cts +3 -2
- package/dist/v2/api/private-key.d.cts.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.d.mts +3 -2
- package/dist/v2/api/private-key.d.mts.map +1 -0
- package/dist/{api/v2 → v2/api}/private-key.mjs +1 -1
- package/dist/v2/api/private-key.mjs.map +1 -0
- package/dist/v2/index.cjs +18 -0
- package/dist/v2/index.cjs.map +1 -0
- package/dist/v2/index.d.cts +2 -0
- package/dist/v2/index.d.cts.map +1 -0
- package/dist/v2/index.d.mts +2 -0
- package/dist/v2/index.d.mts.map +1 -0
- package/dist/v2/index.mjs +2 -0
- package/dist/v2/index.mjs.map +1 -0
- package/dist/xlm/constants.cjs +15 -0
- package/dist/xlm/constants.cjs.map +1 -0
- package/dist/xlm/constants.d.cts +10 -0
- package/dist/xlm/constants.d.cts.map +1 -0
- package/dist/xlm/constants.d.mts +10 -0
- package/dist/xlm/constants.d.mts.map +1 -0
- package/dist/xlm/constants.mjs +12 -0
- package/dist/xlm/constants.mjs.map +1 -0
- package/dist/xlm/index.cjs +19 -0
- package/dist/xlm/index.cjs.map +1 -0
- package/dist/xlm/index.d.cts +3 -0
- package/dist/xlm/index.d.cts.map +1 -0
- package/dist/xlm/index.d.mts +3 -0
- package/dist/xlm/index.d.mts.map +1 -0
- package/dist/xlm/index.mjs +3 -0
- package/dist/xlm/index.mjs.map +1 -0
- package/dist/xlm/types.cjs +42 -0
- package/dist/xlm/types.cjs.map +1 -0
- package/dist/xlm/types.d.cts +71 -0
- package/dist/xlm/types.d.cts.map +1 -0
- package/dist/xlm/types.d.mts +71 -0
- package/dist/xlm/types.d.mts.map +1 -0
- package/dist/xlm/types.mjs +39 -0
- package/dist/xlm/types.mjs.map +1 -0
- package/package.json +26 -11
- package/dist/api/v2/create-account/bip44.cjs.map +0 -1
- package/dist/api/v2/create-account/private-key.cjs.map +0 -1
- package/dist/api/v2/create-account/private-key.mjs.map +0 -1
- package/dist/api/v2/index.cjs.map +0 -1
- package/dist/api/v2/index.d.cts.map +0 -1
- package/dist/api/v2/index.d.mts.map +0 -1
- package/dist/api/v2/index.mjs.map +0 -1
- package/dist/api/v2/keyring-capabilities.cjs.map +0 -1
- package/dist/api/v2/keyring-capabilities.d.cts.map +0 -1
- package/dist/api/v2/keyring-capabilities.d.mts.map +0 -1
- package/dist/api/v2/keyring-capabilities.mjs.map +0 -1
- package/dist/api/v2/keyring.cjs.map +0 -1
- package/dist/api/v2/keyring.mjs.map +0 -1
- package/dist/api/v2/private-key.cjs.map +0 -1
- package/dist/api/v2/private-key.d.cts.map +0 -1
- package/dist/api/v2/private-key.d.mts.map +0 -1
- package/dist/api/v2/private-key.mjs.map +0 -1
- /package/dist/{api/v2 → v2/api}/create-account/bip44.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/bip44.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/custom.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/index.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/create-account/index.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/index.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/export-account/private-key.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.d.cts +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.d.mts +0 -0
- /package/dist/{api/v2 → v2/api}/keyring-type.mjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring.cjs +0 -0
- /package/dist/{api/v2 → v2/api}/keyring.mjs +0 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
|
+
import type { Keyring } from "./keyring.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Keyring interface for keyring methods that can be invoked through
|
|
5
|
+
* RPC calls.
|
|
6
|
+
*/
|
|
7
|
+
export type KeyringRpc = {
|
|
8
|
+
getAccount: Keyring['getAccount'];
|
|
9
|
+
getAccounts: Keyring['getAccounts'];
|
|
10
|
+
createAccounts: Keyring['createAccounts'];
|
|
11
|
+
deleteAccount: Keyring['deleteAccount'];
|
|
12
|
+
submitRequest: Keyring['submitRequest'];
|
|
13
|
+
exportAccount?: Keyring['exportAccount'];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Keyring RPC methods used by the API.
|
|
17
|
+
*/
|
|
18
|
+
export declare const KeyringRpcMethod: {
|
|
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 KeyringRpcMethod = (typeof KeyringRpcMethod)[keyof typeof KeyringRpcMethod];
|
|
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 isKeyringRpcMethod(method: string): method is KeyringRpcMethod;
|
|
37
|
+
export declare const GetAccountsRequestStruct: 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 GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;
|
|
47
|
+
export declare const GetAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
48
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "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" | "stellar:account" | "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" | "stellar:account" | "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
|
+
"stellar:account": "stellar:account";
|
|
97
|
+
"any:account": "any:account";
|
|
98
|
+
}>;
|
|
99
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
100
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
101
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
|
|
102
|
+
entropy?: {
|
|
103
|
+
type: "mnemonic";
|
|
104
|
+
id: string;
|
|
105
|
+
derivationPath: string;
|
|
106
|
+
groupIndex: number;
|
|
107
|
+
} | {
|
|
108
|
+
type: "private-key";
|
|
109
|
+
} | {
|
|
110
|
+
type: "custom";
|
|
111
|
+
};
|
|
112
|
+
exportable?: boolean;
|
|
113
|
+
}, null>;
|
|
114
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
115
|
+
}>>;
|
|
116
|
+
export type GetAccountsResponse = Infer<typeof GetAccountsResponseStruct>;
|
|
117
|
+
export declare const GetAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
118
|
+
method: "keyring_getAccount";
|
|
119
|
+
id: string | number | null;
|
|
120
|
+
jsonrpc: "2.0";
|
|
121
|
+
params: {
|
|
122
|
+
id: string;
|
|
123
|
+
};
|
|
124
|
+
}, {
|
|
125
|
+
method: import("@metamask/superstruct").Struct<"keyring_getAccount", "keyring_getAccount">;
|
|
126
|
+
params: import("@metamask/superstruct").Struct<{
|
|
127
|
+
id: string;
|
|
128
|
+
}, {
|
|
129
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
130
|
+
}>;
|
|
131
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
132
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
133
|
+
}>;
|
|
134
|
+
export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
|
|
135
|
+
export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
136
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
137
|
+
id: string;
|
|
138
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
139
|
+
entropy?: {
|
|
140
|
+
type: "mnemonic";
|
|
141
|
+
id: string;
|
|
142
|
+
derivationPath: string;
|
|
143
|
+
groupIndex: number;
|
|
144
|
+
} | {
|
|
145
|
+
type: "private-key";
|
|
146
|
+
} | {
|
|
147
|
+
type: "custom";
|
|
148
|
+
};
|
|
149
|
+
exportable?: boolean;
|
|
150
|
+
};
|
|
151
|
+
address: string;
|
|
152
|
+
scopes: `${string}:${string}`[];
|
|
153
|
+
methods: string[];
|
|
154
|
+
}, {
|
|
155
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
156
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
157
|
+
"eip155:eoa": "eip155:eoa";
|
|
158
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
159
|
+
"bip122:p2pkh": "bip122:p2pkh";
|
|
160
|
+
"bip122:p2sh": "bip122:p2sh";
|
|
161
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
162
|
+
"bip122:p2tr": "bip122:p2tr";
|
|
163
|
+
"solana:data-account": "solana:data-account";
|
|
164
|
+
"tron:eoa": "tron:eoa";
|
|
165
|
+
"stellar:account": "stellar:account";
|
|
166
|
+
"any:account": "any:account";
|
|
167
|
+
}>;
|
|
168
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
169
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
170
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
|
|
171
|
+
entropy?: {
|
|
172
|
+
type: "mnemonic";
|
|
173
|
+
id: string;
|
|
174
|
+
derivationPath: string;
|
|
175
|
+
groupIndex: number;
|
|
176
|
+
} | {
|
|
177
|
+
type: "private-key";
|
|
178
|
+
} | {
|
|
179
|
+
type: "custom";
|
|
180
|
+
};
|
|
181
|
+
exportable?: boolean;
|
|
182
|
+
}, null>;
|
|
183
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
184
|
+
}>;
|
|
185
|
+
export type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
|
|
186
|
+
export declare const CreateAccountsRequestStruct: import("@metamask/superstruct").Struct<{
|
|
187
|
+
method: "keyring_createAccounts";
|
|
188
|
+
id: string | number | null;
|
|
189
|
+
jsonrpc: "2.0";
|
|
190
|
+
params: {
|
|
191
|
+
type: "bip44:derive-path";
|
|
192
|
+
derivationPath: `m/${string}`;
|
|
193
|
+
entropySource: string;
|
|
194
|
+
} | {
|
|
195
|
+
type: "bip44:derive-index";
|
|
196
|
+
groupIndex: number;
|
|
197
|
+
entropySource: string;
|
|
198
|
+
} | {
|
|
199
|
+
type: "bip44:discover";
|
|
200
|
+
groupIndex: number;
|
|
201
|
+
entropySource: string;
|
|
202
|
+
} | {
|
|
203
|
+
type: "bip44:derive-index-range";
|
|
204
|
+
range: {
|
|
205
|
+
from: number;
|
|
206
|
+
to: number;
|
|
207
|
+
};
|
|
208
|
+
entropySource: string;
|
|
209
|
+
} | {
|
|
210
|
+
type: "custom";
|
|
211
|
+
} | {
|
|
212
|
+
type: "private-key:import";
|
|
213
|
+
encoding: "hexadecimal" | "base58";
|
|
214
|
+
privateKey: string;
|
|
215
|
+
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
216
|
+
};
|
|
217
|
+
}, {
|
|
218
|
+
method: import("@metamask/superstruct").Struct<"keyring_createAccounts", "keyring_createAccounts">;
|
|
219
|
+
params: import("@metamask/superstruct").Struct<{
|
|
220
|
+
type: "bip44:derive-path";
|
|
221
|
+
derivationPath: `m/${string}`;
|
|
222
|
+
entropySource: string;
|
|
223
|
+
} | {
|
|
224
|
+
type: "bip44:derive-index";
|
|
225
|
+
groupIndex: number;
|
|
226
|
+
entropySource: string;
|
|
227
|
+
} | {
|
|
228
|
+
type: "bip44:discover";
|
|
229
|
+
groupIndex: number;
|
|
230
|
+
entropySource: string;
|
|
231
|
+
} | {
|
|
232
|
+
type: "bip44:derive-index-range";
|
|
233
|
+
range: {
|
|
234
|
+
from: number;
|
|
235
|
+
to: number;
|
|
236
|
+
};
|
|
237
|
+
entropySource: string;
|
|
238
|
+
} | {
|
|
239
|
+
type: "custom";
|
|
240
|
+
} | {
|
|
241
|
+
type: "private-key:import";
|
|
242
|
+
encoding: "hexadecimal" | "base58";
|
|
243
|
+
privateKey: string;
|
|
244
|
+
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
245
|
+
}, null>;
|
|
246
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
247
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
248
|
+
}>;
|
|
249
|
+
export type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;
|
|
250
|
+
export declare const CreateAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
251
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
252
|
+
id: string;
|
|
253
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
254
|
+
entropy?: {
|
|
255
|
+
type: "mnemonic";
|
|
256
|
+
id: string;
|
|
257
|
+
derivationPath: string;
|
|
258
|
+
groupIndex: number;
|
|
259
|
+
} | {
|
|
260
|
+
type: "private-key";
|
|
261
|
+
} | {
|
|
262
|
+
type: "custom";
|
|
263
|
+
};
|
|
264
|
+
exportable?: boolean;
|
|
265
|
+
};
|
|
266
|
+
address: string;
|
|
267
|
+
scopes: `${string}:${string}`[];
|
|
268
|
+
methods: string[];
|
|
269
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
270
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
271
|
+
id: string;
|
|
272
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
273
|
+
entropy?: {
|
|
274
|
+
type: "mnemonic";
|
|
275
|
+
id: string;
|
|
276
|
+
derivationPath: string;
|
|
277
|
+
groupIndex: number;
|
|
278
|
+
} | {
|
|
279
|
+
type: "private-key";
|
|
280
|
+
} | {
|
|
281
|
+
type: "custom";
|
|
282
|
+
};
|
|
283
|
+
exportable?: boolean;
|
|
284
|
+
};
|
|
285
|
+
address: string;
|
|
286
|
+
scopes: `${string}:${string}`[];
|
|
287
|
+
methods: string[];
|
|
288
|
+
}, {
|
|
289
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
290
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
291
|
+
"eip155:eoa": "eip155:eoa";
|
|
292
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
293
|
+
"bip122:p2pkh": "bip122:p2pkh";
|
|
294
|
+
"bip122:p2sh": "bip122:p2sh";
|
|
295
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
296
|
+
"bip122:p2tr": "bip122:p2tr";
|
|
297
|
+
"solana:data-account": "solana:data-account";
|
|
298
|
+
"tron:eoa": "tron:eoa";
|
|
299
|
+
"stellar:account": "stellar:account";
|
|
300
|
+
"any:account": "any:account";
|
|
301
|
+
}>;
|
|
302
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
303
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
304
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
|
|
305
|
+
entropy?: {
|
|
306
|
+
type: "mnemonic";
|
|
307
|
+
id: string;
|
|
308
|
+
derivationPath: string;
|
|
309
|
+
groupIndex: number;
|
|
310
|
+
} | {
|
|
311
|
+
type: "private-key";
|
|
312
|
+
} | {
|
|
313
|
+
type: "custom";
|
|
314
|
+
};
|
|
315
|
+
exportable?: boolean;
|
|
316
|
+
}, null>;
|
|
317
|
+
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
318
|
+
}>>;
|
|
319
|
+
export type CreateAccountsResponse = Infer<typeof CreateAccountsResponseStruct>;
|
|
320
|
+
export declare const DeleteAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
321
|
+
method: "keyring_deleteAccount";
|
|
322
|
+
id: string | number | null;
|
|
323
|
+
jsonrpc: "2.0";
|
|
324
|
+
params: {
|
|
325
|
+
id: string;
|
|
326
|
+
};
|
|
327
|
+
}, {
|
|
328
|
+
method: import("@metamask/superstruct").Struct<"keyring_deleteAccount", "keyring_deleteAccount">;
|
|
329
|
+
params: import("@metamask/superstruct").Struct<{
|
|
330
|
+
id: string;
|
|
331
|
+
}, {
|
|
332
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
333
|
+
}>;
|
|
334
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
335
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
336
|
+
}>;
|
|
337
|
+
export type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
|
|
338
|
+
export declare const DeleteAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
|
|
339
|
+
export type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
|
|
340
|
+
export declare const ExportAccountRequestStruct: import("@metamask/superstruct").Struct<{
|
|
341
|
+
method: "keyring_exportAccount";
|
|
342
|
+
id: string | number | null;
|
|
343
|
+
jsonrpc: "2.0";
|
|
344
|
+
params: {
|
|
345
|
+
id: string;
|
|
346
|
+
options?: {
|
|
347
|
+
type: "private-key";
|
|
348
|
+
encoding: "hexadecimal" | "base58";
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
}, {
|
|
352
|
+
method: import("@metamask/superstruct").Struct<"keyring_exportAccount", "keyring_exportAccount">;
|
|
353
|
+
params: import("@metamask/superstruct").Struct<{
|
|
354
|
+
id: string;
|
|
355
|
+
options?: {
|
|
356
|
+
type: "private-key";
|
|
357
|
+
encoding: "hexadecimal" | "base58";
|
|
358
|
+
};
|
|
359
|
+
}, {
|
|
360
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
361
|
+
options: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
362
|
+
type: "private-key";
|
|
363
|
+
encoding: "hexadecimal" | "base58";
|
|
364
|
+
}, {
|
|
365
|
+
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
|
|
366
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
367
|
+
hexadecimal: "hexadecimal";
|
|
368
|
+
base58: "base58";
|
|
369
|
+
}>;
|
|
370
|
+
}>;
|
|
371
|
+
}>;
|
|
372
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
373
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
374
|
+
}>;
|
|
375
|
+
export type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
|
|
376
|
+
export declare const ExportAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
377
|
+
type: "private-key";
|
|
378
|
+
encoding: "hexadecimal" | "base58";
|
|
379
|
+
privateKey: string;
|
|
380
|
+
}, {
|
|
381
|
+
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
|
|
382
|
+
privateKey: import("@metamask/superstruct").Struct<string, null>;
|
|
383
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
384
|
+
hexadecimal: "hexadecimal";
|
|
385
|
+
base58: "base58";
|
|
386
|
+
}>;
|
|
387
|
+
}>;
|
|
388
|
+
export type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
|
|
389
|
+
export declare const SubmitRequestRequestStruct: import("@metamask/superstruct").Struct<{
|
|
390
|
+
method: "keyring_submitRequest";
|
|
391
|
+
id: string | number | null;
|
|
392
|
+
jsonrpc: "2.0";
|
|
393
|
+
params: {
|
|
394
|
+
id: string;
|
|
395
|
+
origin: string;
|
|
396
|
+
request: {
|
|
397
|
+
method: string;
|
|
398
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
399
|
+
};
|
|
400
|
+
scope: string;
|
|
401
|
+
account: string;
|
|
402
|
+
};
|
|
403
|
+
}, {
|
|
404
|
+
method: import("@metamask/superstruct").Struct<"keyring_submitRequest", "keyring_submitRequest">;
|
|
405
|
+
params: import("@metamask/superstruct").Struct<{
|
|
406
|
+
id: string;
|
|
407
|
+
origin: string;
|
|
408
|
+
request: {
|
|
409
|
+
method: string;
|
|
410
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
411
|
+
};
|
|
412
|
+
scope: string;
|
|
413
|
+
account: string;
|
|
414
|
+
}, {
|
|
415
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
416
|
+
scope: import("@metamask/superstruct").Struct<string, null>;
|
|
417
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
|
418
|
+
origin: import("@metamask/superstruct").Struct<string, null>;
|
|
419
|
+
request: import("@metamask/superstruct").Struct<{
|
|
420
|
+
method: string;
|
|
421
|
+
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
|
|
422
|
+
}, {
|
|
423
|
+
method: import("@metamask/superstruct").Struct<string, null>;
|
|
424
|
+
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
425
|
+
}>;
|
|
426
|
+
}>;
|
|
427
|
+
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
428
|
+
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
429
|
+
}>;
|
|
430
|
+
export type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
|
|
431
|
+
export declare const SubmitRequestResponseStruct: import("@metamask/superstruct").Struct<import("@metamask/utils").Json, unknown>;
|
|
432
|
+
export type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
|
|
433
|
+
/**
|
|
434
|
+
* Keyring RPC requests.
|
|
435
|
+
*/
|
|
436
|
+
export type KeyringRpcRequests = GetAccountsRequest | GetAccountRequest | CreateAccountsRequest | DeleteAccountRequest | ExportAccountRequest | SubmitRequestRequest;
|
|
437
|
+
/**
|
|
438
|
+
* Extract the proper request type for a given `KeyringRpcMethod`.
|
|
439
|
+
*/
|
|
440
|
+
export type KeyringRpcRequest<RpcMethod extends KeyringRpcMethod> = Extract<KeyringRpcRequests, {
|
|
441
|
+
method: `${RpcMethod}`;
|
|
442
|
+
}>;
|
|
443
|
+
//# sourceMappingURL=keyring-rpc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-rpc.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AASnD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AAIzC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACpC,cAAc,EAAE,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AAkB,EAClB;IAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAA;CAAE,CAC3B,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { object, exactOptional, UuidStruct } from "@metamask/keyring-utils";
|
|
2
|
+
import { array, literal, number, string, union } from "@metamask/superstruct";
|
|
3
|
+
import { JsonStruct } from "@metamask/utils";
|
|
4
|
+
import { CreateAccountOptionsStruct } from "./create-account/index.mjs";
|
|
5
|
+
import { ExportAccountOptionsStruct, PrivateKeyExportedAccountStruct } from "./export-account/index.mjs";
|
|
6
|
+
import { KeyringAccountStruct } from "../../api/account.mjs";
|
|
7
|
+
import { KeyringRequestStruct } from "../../api/request.mjs";
|
|
8
|
+
/**
|
|
9
|
+
* Keyring RPC methods used by the API.
|
|
10
|
+
*/
|
|
11
|
+
export const KeyringRpcMethod = {
|
|
12
|
+
GetAccounts: 'keyring_getAccounts',
|
|
13
|
+
CreateAccounts: 'keyring_createAccounts',
|
|
14
|
+
// Inherited from v1 (but method signatures may differ...):
|
|
15
|
+
// NOTE: We use literals here to avoid circular dependencies.
|
|
16
|
+
GetAccount: 'keyring_getAccount',
|
|
17
|
+
DeleteAccount: 'keyring_deleteAccount',
|
|
18
|
+
ExportAccount: 'keyring_exportAccount',
|
|
19
|
+
SubmitRequest: 'keyring_submitRequest',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Check if a method is a keyring RPC method (v2).
|
|
23
|
+
*
|
|
24
|
+
* @param method - Method to check.
|
|
25
|
+
* @returns Whether the method is a keyring RPC method (v2).
|
|
26
|
+
*/
|
|
27
|
+
export function isKeyringRpcMethod(method) {
|
|
28
|
+
return Object.values(KeyringRpcMethod).includes(method);
|
|
29
|
+
}
|
|
30
|
+
// ----------------------------------------------------------------------------
|
|
31
|
+
const CommonHeader = {
|
|
32
|
+
jsonrpc: literal('2.0'),
|
|
33
|
+
id: union([string(), number(), literal(null)]),
|
|
34
|
+
};
|
|
35
|
+
// ----------------------------------------------------------------------------
|
|
36
|
+
// Get accounts
|
|
37
|
+
export const GetAccountsRequestStruct = object({
|
|
38
|
+
...CommonHeader,
|
|
39
|
+
method: literal(`${KeyringRpcMethod.GetAccounts}`),
|
|
40
|
+
});
|
|
41
|
+
export const GetAccountsResponseStruct = array(KeyringAccountStruct);
|
|
42
|
+
// ----------------------------------------------------------------------------
|
|
43
|
+
// Get account
|
|
44
|
+
export const GetAccountRequestStruct = object({
|
|
45
|
+
...CommonHeader,
|
|
46
|
+
method: literal(`${KeyringRpcMethod.GetAccount}`),
|
|
47
|
+
params: object({
|
|
48
|
+
id: UuidStruct,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
export const GetAccountResponseStruct = KeyringAccountStruct;
|
|
52
|
+
// ----------------------------------------------------------------------------
|
|
53
|
+
// Create accounts
|
|
54
|
+
export const CreateAccountsRequestStruct = object({
|
|
55
|
+
...CommonHeader,
|
|
56
|
+
method: literal(`${KeyringRpcMethod.CreateAccounts}`),
|
|
57
|
+
params: CreateAccountOptionsStruct,
|
|
58
|
+
});
|
|
59
|
+
export const CreateAccountsResponseStruct = array(KeyringAccountStruct);
|
|
60
|
+
// ----------------------------------------------------------------------------
|
|
61
|
+
// Delete account
|
|
62
|
+
export const DeleteAccountRequestStruct = object({
|
|
63
|
+
...CommonHeader,
|
|
64
|
+
method: literal(`${KeyringRpcMethod.DeleteAccount}`),
|
|
65
|
+
params: object({
|
|
66
|
+
id: UuidStruct,
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
export const DeleteAccountResponseStruct = literal(null);
|
|
70
|
+
// ----------------------------------------------------------------------------
|
|
71
|
+
// Export account
|
|
72
|
+
export const ExportAccountRequestStruct = object({
|
|
73
|
+
...CommonHeader,
|
|
74
|
+
method: literal(`${KeyringRpcMethod.ExportAccount}`),
|
|
75
|
+
params: object({
|
|
76
|
+
id: UuidStruct,
|
|
77
|
+
options: exactOptional(ExportAccountOptionsStruct),
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
export const ExportAccountResponseStruct = PrivateKeyExportedAccountStruct;
|
|
81
|
+
// ----------------------------------------------------------------------------
|
|
82
|
+
// Submit request
|
|
83
|
+
export const SubmitRequestRequestStruct = object({
|
|
84
|
+
...CommonHeader,
|
|
85
|
+
method: literal(`${KeyringRpcMethod.SubmitRequest}`),
|
|
86
|
+
params: KeyringRequestStruct,
|
|
87
|
+
});
|
|
88
|
+
export const SubmitRequestResponseStruct = JsonStruct;
|
|
89
|
+
//# sourceMappingURL=keyring-rpc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-rpc.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC9E,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,0BAA0B,EAAE,mCAAyB;AAC9D,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAChC,mCAAyB;AAE1B,OAAO,EAAE,oBAAoB,EAAE,8BAA0B;AACzD,OAAO,EAAE,oBAAoB,EAAE,8BAA0B;AAezD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW,EAAE,qBAAqB;IAClC,cAAc,EAAE,wBAAwB;IACxC,2DAA2D;IAC3D,6DAA6D;IAC7D,UAAU,EAAE,oBAAoB;IAChC,aAAa,EAAE,uBAAuB;IACtC,aAAa,EAAE,uBAAuB;IACtC,aAAa,EAAE,uBAAuB;CAC9B,CAAC;AAQX;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,MAA0B,CAAC,CAAC;AAC9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E,MAAM,CAAC;QACb,EAAE,EAAE,UAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAIzD,+EAA+E;AAC/E,iBAAiB;AAEjB,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,UAAU;QACd,OAAO,EAAE,aAAa,CAAC,0BAA0B,CAAC;KACnD,CAAC;CACH,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AAI3E,+EAA+E;AAC/E,iBAAiB;AAEjB,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,oBAAoB;CAC7B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC","sourcesContent":["import { object, exactOptional, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, literal, number, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { CreateAccountOptionsStruct } from './create-account';\nimport {\n ExportAccountOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './export-account';\nimport type { Keyring } from './keyring';\nimport { KeyringAccountStruct } from '../../api/account';\nimport { KeyringRequestStruct } from '../../api/request';\n\n/**\n * Keyring interface for keyring methods that can be invoked through\n * RPC calls.\n */\nexport type KeyringRpc = {\n getAccount: Keyring['getAccount'];\n getAccounts: Keyring['getAccounts'];\n createAccounts: Keyring['createAccounts'];\n deleteAccount: Keyring['deleteAccount'];\n submitRequest: Keyring['submitRequest'];\n exportAccount?: Keyring['exportAccount'];\n};\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport const KeyringRpcMethod = {\n GetAccounts: 'keyring_getAccounts',\n CreateAccounts: 'keyring_createAccounts',\n // Inherited from v1 (but method signatures may differ...):\n // NOTE: We use literals here to avoid circular dependencies.\n GetAccount: 'keyring_getAccount',\n DeleteAccount: 'keyring_deleteAccount',\n ExportAccount: 'keyring_exportAccount',\n SubmitRequest: 'keyring_submitRequest',\n} as const;\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport type KeyringRpcMethod =\n (typeof KeyringRpcMethod)[keyof typeof KeyringRpcMethod];\n\n/**\n * Check if a method is a keyring RPC method (v2).\n *\n * @param method - Method to check.\n * @returns Whether the method is a keyring RPC method (v2).\n */\nexport function isKeyringRpcMethod(method: string): method is KeyringRpcMethod {\n return Object.values(KeyringRpcMethod).includes(method as KeyringRpcMethod);\n}\n\n// ----------------------------------------------------------------------------\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// Get accounts\n\nexport const GetAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccounts}`),\n});\n\nexport type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;\n\nexport const GetAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type GetAccountsResponse = Infer<typeof GetAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.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 accounts\n\nexport const CreateAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.CreateAccounts}`),\n params: CreateAccountOptionsStruct,\n});\n\nexport type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;\n\nexport const CreateAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type CreateAccountsResponse = Infer<typeof CreateAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.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(`${KeyringRpcMethod.ExportAccount}`),\n params: object({\n id: UuidStruct,\n options: exactOptional(ExportAccountOptionsStruct),\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = PrivateKeyExportedAccountStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.SubmitRequest}`),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = JsonStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n\n/**\n * Keyring RPC requests.\n */\nexport type KeyringRpcRequests =\n | GetAccountsRequest\n | GetAccountRequest\n | CreateAccountsRequest\n | DeleteAccountRequest\n | ExportAccountRequest\n | SubmitRequestRequest;\n\n/**\n * Extract the proper request type for a given `KeyringRpcMethod`.\n */\nexport type KeyringRpcRequest<RpcMethod extends KeyringRpcMethod> = Extract<\n KeyringRpcRequests,\n { method: `${RpcMethod}` }\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-type.cjs","sourceRoot":"","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"keyring-type.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-type.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WA+CX;AA/CD,WAAY,WAAW;IACrB;;OAEG;IACH,wBAAS,CAAA;IAET;;OAEG;IACH,yCAA0B,CAAA;IAE1B;;;;OAIG;IACH,wBAAS,CAAA;IAET;;OAEG;IACH,4BAAa,CAAA;IAEb;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,kCAAmB,CAAA;IAEnB;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,8BAAe,CAAA;AACjB,CAAC,EA/CW,WAAW,2BAAX,WAAW,QA+CtB","sourcesContent":["/**\n * Enum representing the different types of keyrings supported.\n */\nexport enum KeyringType {\n /**\n * Represents a hierarchical deterministic (HD) keyring.\n */\n Hd = 'hd',\n\n /**\n * Represents a keyring that directly stores private keys.\n */\n PrivateKey = 'private-key',\n\n /**\n * Represents a keyring that implements the QR protocol.\n *\n * See: https://eips.ethereum.org/EIPS/eip-4527\n */\n Qr = 'qr',\n\n /**\n * Represents keyring backed by a Snap.\n */\n Snap = 'snap',\n\n /**\n * Represents keyring backed by a Ledger hardware wallet.\n */\n Ledger = 'ledger',\n\n /**\n * Represents keyring backed by a Lattice hardware wallet.\n */\n Lattice = 'lattice',\n\n /**\n * Represents keyring backed by a Trezor hardware wallet.\n */\n Trezor = 'trezor',\n\n /**\n * Represents keyring backed by a OneKey hardware wallet.\n */\n OneKey = 'onekey',\n\n /**\n * Represents keyring for money accounts.\n */\n Money = 'money',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-type.d.cts","sourceRoot":"","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"keyring-type.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,UAAU,gBAAgB;IAE1B;;;;OAIG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,KAAK,UAAU;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-type.d.mts","sourceRoot":"","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"keyring-type.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,UAAU,gBAAgB;IAE1B;;;;OAIG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,KAAK,UAAU;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-type.mjs","sourceRoot":"","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"keyring-type.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WA+CX;AA/CD,WAAY,WAAW;IACrB;;OAEG;IACH,wBAAS,CAAA;IAET;;OAEG;IACH,yCAA0B,CAAA;IAE1B;;;;OAIG;IACH,wBAAS,CAAA;IAET;;OAEG;IACH,4BAAa,CAAA;IAEb;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,kCAAmB,CAAA;IAEnB;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,8BAAe,CAAA;AACjB,CAAC,EA/CW,WAAW,KAAX,WAAW,QA+CtB","sourcesContent":["/**\n * Enum representing the different types of keyrings supported.\n */\nexport enum KeyringType {\n /**\n * Represents a hierarchical deterministic (HD) keyring.\n */\n Hd = 'hd',\n\n /**\n * Represents a keyring that directly stores private keys.\n */\n PrivateKey = 'private-key',\n\n /**\n * Represents a keyring that implements the QR protocol.\n *\n * See: https://eips.ethereum.org/EIPS/eip-4527\n */\n Qr = 'qr',\n\n /**\n * Represents keyring backed by a Snap.\n */\n Snap = 'snap',\n\n /**\n * Represents keyring backed by a Ledger hardware wallet.\n */\n Ledger = 'ledger',\n\n /**\n * Represents keyring backed by a Lattice hardware wallet.\n */\n Lattice = 'lattice',\n\n /**\n * Represents keyring backed by a Trezor hardware wallet.\n */\n Trezor = 'trezor',\n\n /**\n * Represents keyring backed by a OneKey hardware wallet.\n */\n OneKey = 'onekey',\n\n /**\n * Represents keyring for money accounts.\n */\n Money = 'money',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
|
|
@@ -4,17 +4,17 @@ import type { CreateAccountOptions } from "./create-account/index.cjs";
|
|
|
4
4
|
import type { ExportedAccount, ExportAccountOptions } from "./export-account/index.cjs";
|
|
5
5
|
import type { KeyringCapabilities } from "./keyring-capabilities.cjs";
|
|
6
6
|
import type { KeyringType } from "./keyring-type.cjs";
|
|
7
|
-
import type { KeyringAccount } from "
|
|
8
|
-
import type { KeyringRequest } from "
|
|
7
|
+
import type { KeyringAccount } from "../../api/account.cjs";
|
|
8
|
+
import type { KeyringRequest } from "../../api/request.cjs";
|
|
9
9
|
/**
|
|
10
|
-
* The
|
|
10
|
+
* The Keyring interface defines methods for managing accounts and signing
|
|
11
11
|
* requests. This interface unifies the existing EVM and Snap keyring interfaces
|
|
12
12
|
* to provide a consistent API for all keyring type.
|
|
13
13
|
*
|
|
14
14
|
* This interface supports both EVM and non-EVM chains, and includes
|
|
15
15
|
* account metadata needed for features like Multi-SRP and Backup and Sync.
|
|
16
16
|
*/
|
|
17
|
-
export type
|
|
17
|
+
export type Keyring = {
|
|
18
18
|
/**
|
|
19
19
|
* Type of the keyring.
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gCAAgC;AACzD,O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