@metamask-previews/keyring-internal-api 0.0.1-11541a9 → 0.0.1-1c468fa
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/dist/eth/EthKeyring.cjs.map +1 -1
- package/dist/eth/EthKeyring.d.cts +1 -2
- package/dist/eth/EthKeyring.d.cts.map +1 -1
- package/dist/eth/EthKeyring.d.mts +1 -2
- package/dist/eth/EthKeyring.d.mts.map +1 -1
- package/dist/eth/EthKeyring.mjs.map +1 -1
- package/dist/eth/index.cjs +0 -17
- package/dist/eth/index.cjs.map +1 -1
- package/dist/eth/index.d.cts +0 -3
- package/dist/eth/index.d.cts.map +1 -1
- package/dist/eth/index.d.mts +0 -3
- package/dist/eth/index.d.mts.map +1 -1
- package/dist/eth/index.mjs +1 -3
- package/dist/eth/index.mjs.map +1 -1
- package/dist/index.cjs +1 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -6
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs +4 -7
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +45 -45
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +45 -45
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +1 -4
- package/dist/types.mjs.map +1 -1
- package/package.json +5 -6
- package/dist/api.cjs +0 -138
- package/dist/api.cjs.map +0 -1
- package/dist/api.d.cts +0 -420
- package/dist/api.d.cts.map +0 -1
- package/dist/api.d.mts +0 -420
- package/dist/api.d.mts.map +0 -1
- package/dist/api.mjs +0 -135
- package/dist/api.mjs.map +0 -1
- package/dist/btc/index.cjs +0 -18
- package/dist/btc/index.cjs.map +0 -1
- package/dist/btc/index.d.cts +0 -2
- package/dist/btc/index.d.cts.map +0 -1
- package/dist/btc/index.d.mts +0 -2
- package/dist/btc/index.d.mts.map +0 -1
- package/dist/btc/index.mjs +0 -2
- package/dist/btc/index.mjs.map +0 -1
- package/dist/btc/types.cjs +0 -40
- package/dist/btc/types.cjs.map +0 -1
- package/dist/btc/types.d.cts +0 -34
- package/dist/btc/types.d.cts.map +0 -1
- package/dist/btc/types.d.mts +0 -34
- package/dist/btc/types.d.mts.map +0 -1
- package/dist/btc/types.mjs +0 -37
- package/dist/btc/types.mjs.map +0 -1
- package/dist/eth/erc4337/index.cjs +0 -18
- package/dist/eth/erc4337/index.cjs.map +0 -1
- package/dist/eth/erc4337/index.d.cts +0 -2
- package/dist/eth/erc4337/index.d.cts.map +0 -1
- package/dist/eth/erc4337/index.d.mts +0 -2
- package/dist/eth/erc4337/index.d.mts.map +0 -1
- package/dist/eth/erc4337/index.mjs +0 -2
- package/dist/eth/erc4337/index.mjs.map +0 -1
- package/dist/eth/erc4337/types.cjs +0 -61
- package/dist/eth/erc4337/types.cjs.map +0 -1
- package/dist/eth/erc4337/types.d.cts +0 -98
- package/dist/eth/erc4337/types.d.cts.map +0 -1
- package/dist/eth/erc4337/types.d.mts +0 -98
- package/dist/eth/erc4337/types.d.mts.map +0 -1
- package/dist/eth/erc4337/types.mjs +0 -58
- package/dist/eth/erc4337/types.mjs.map +0 -1
- package/dist/eth/types.cjs +0 -73
- package/dist/eth/types.cjs.map +0 -1
- package/dist/eth/types.d.cts +0 -81
- package/dist/eth/types.d.cts.map +0 -1
- package/dist/eth/types.d.mts +0 -81
- package/dist/eth/types.d.mts.map +0 -1
- package/dist/eth/types.mjs +0 -70
- package/dist/eth/types.mjs.map +0 -1
- package/dist/eth/utils.cjs +0 -14
- package/dist/eth/utils.cjs.map +0 -1
- package/dist/eth/utils.d.cts +0 -9
- package/dist/eth/utils.d.cts.map +0 -1
- package/dist/eth/utils.d.mts +0 -9
- package/dist/eth/utils.d.mts.map +0 -1
- package/dist/eth/utils.mjs +0 -11
- package/dist/eth/utils.mjs.map +0 -1
- package/dist/events.cjs +0 -83
- package/dist/events.cjs.map +0 -1
- package/dist/events.d.cts +0 -172
- package/dist/events.d.cts.map +0 -1
- package/dist/events.d.mts +0 -172
- package/dist/events.d.mts.map +0 -1
- package/dist/events.mjs +0 -80
- package/dist/events.mjs.map +0 -1
- package/dist/rpc.cjs +0 -33
- package/dist/rpc.cjs.map +0 -1
- package/dist/rpc.d.cts +0 -26
- package/dist/rpc.d.cts.map +0 -1
- package/dist/rpc.d.mts +0 -26
- package/dist/rpc.d.mts.map +0 -1
- package/dist/rpc.mjs +0 -29
- package/dist/rpc.mjs.map +0 -1
- package/dist/sol/index.cjs +0 -18
- package/dist/sol/index.cjs.map +0 -1
- package/dist/sol/index.d.cts +0 -2
- package/dist/sol/index.d.cts.map +0 -1
- package/dist/sol/index.d.mts +0 -2
- package/dist/sol/index.d.mts.map +0 -1
- package/dist/sol/index.mjs +0 -2
- package/dist/sol/index.mjs.map +0 -1
- package/dist/sol/types.cjs +0 -36
- package/dist/sol/types.cjs.map +0 -1
- package/dist/sol/types.d.cts +0 -39
- package/dist/sol/types.d.cts.map +0 -1
- package/dist/sol/types.d.mts +0 -39
- package/dist/sol/types.d.mts.map +0 -1
- package/dist/sol/types.mjs +0 -33
- package/dist/sol/types.mjs.map +0 -1
package/dist/types.d.mts
CHANGED
|
@@ -10,8 +10,8 @@ export declare const InternalAccountMetadataStruct: Struct<{
|
|
|
10
10
|
};
|
|
11
11
|
nameLastUpdatedAt?: number;
|
|
12
12
|
snap?: {
|
|
13
|
-
id: string;
|
|
14
13
|
name: string;
|
|
14
|
+
id: string;
|
|
15
15
|
enabled: boolean;
|
|
16
16
|
};
|
|
17
17
|
lastSelected?: number;
|
|
@@ -25,8 +25,8 @@ export declare const InternalAccountMetadataStruct: Struct<{
|
|
|
25
25
|
};
|
|
26
26
|
nameLastUpdatedAt?: number;
|
|
27
27
|
snap?: {
|
|
28
|
-
id: string;
|
|
29
28
|
name: string;
|
|
29
|
+
id: string;
|
|
30
30
|
enabled: boolean;
|
|
31
31
|
};
|
|
32
32
|
lastSelected?: number;
|
|
@@ -34,8 +34,8 @@ export declare const InternalAccountMetadataStruct: Struct<{
|
|
|
34
34
|
name: Struct<string, null>;
|
|
35
35
|
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
36
36
|
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
37
|
-
id: string;
|
|
38
37
|
name: string;
|
|
38
|
+
id: string;
|
|
39
39
|
enabled: boolean;
|
|
40
40
|
}, {
|
|
41
41
|
id: Struct<string, null>;
|
|
@@ -52,11 +52,9 @@ export declare const InternalAccountMetadataStruct: Struct<{
|
|
|
52
52
|
}>;
|
|
53
53
|
}>;
|
|
54
54
|
export declare const InternalEthEoaAccountStruct: Struct<{
|
|
55
|
+
type: "eip155:eoa";
|
|
55
56
|
id: string;
|
|
56
57
|
options: Record<string, import("@metamask/utils").Json>;
|
|
57
|
-
type: "eip155:eoa";
|
|
58
|
-
address: string;
|
|
59
|
-
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
60
58
|
metadata: {
|
|
61
59
|
name: string;
|
|
62
60
|
importTime: number;
|
|
@@ -65,12 +63,14 @@ export declare const InternalEthEoaAccountStruct: Struct<{
|
|
|
65
63
|
};
|
|
66
64
|
nameLastUpdatedAt?: number;
|
|
67
65
|
snap?: {
|
|
68
|
-
id: string;
|
|
69
66
|
name: string;
|
|
67
|
+
id: string;
|
|
70
68
|
enabled: boolean;
|
|
71
69
|
};
|
|
72
70
|
lastSelected?: number;
|
|
73
71
|
};
|
|
72
|
+
address: string;
|
|
73
|
+
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
74
74
|
}, {
|
|
75
75
|
metadata: Struct<{
|
|
76
76
|
name: string;
|
|
@@ -80,8 +80,8 @@ export declare const InternalEthEoaAccountStruct: Struct<{
|
|
|
80
80
|
};
|
|
81
81
|
nameLastUpdatedAt?: number;
|
|
82
82
|
snap?: {
|
|
83
|
-
id: string;
|
|
84
83
|
name: string;
|
|
84
|
+
id: string;
|
|
85
85
|
enabled: boolean;
|
|
86
86
|
};
|
|
87
87
|
lastSelected?: number;
|
|
@@ -89,8 +89,8 @@ export declare const InternalEthEoaAccountStruct: Struct<{
|
|
|
89
89
|
name: Struct<string, null>;
|
|
90
90
|
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
91
91
|
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
92
|
-
id: string;
|
|
93
92
|
name: string;
|
|
93
|
+
id: string;
|
|
94
94
|
enabled: boolean;
|
|
95
95
|
}, {
|
|
96
96
|
id: Struct<string, null>;
|
|
@@ -105,9 +105,9 @@ export declare const InternalEthEoaAccountStruct: Struct<{
|
|
|
105
105
|
type: Struct<string, null>;
|
|
106
106
|
}>;
|
|
107
107
|
}>;
|
|
108
|
-
address: Struct<string, null>;
|
|
109
|
-
type: Struct<"eip155:eoa", "eip155:eoa">;
|
|
110
|
-
methods: Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
|
|
108
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
109
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa", "eip155:eoa">;
|
|
110
|
+
methods: import("@metamask/superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], import("@metamask/superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
|
|
111
111
|
personal_sign: "personal_sign";
|
|
112
112
|
eth_sign: "eth_sign";
|
|
113
113
|
eth_signTransaction: "eth_signTransaction";
|
|
@@ -119,11 +119,9 @@ export declare const InternalEthEoaAccountStruct: Struct<{
|
|
|
119
119
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
120
120
|
}>;
|
|
121
121
|
export declare const InternalEthErc4337AccountStruct: Struct<{
|
|
122
|
+
type: "eip155:erc4337";
|
|
122
123
|
id: string;
|
|
123
124
|
options: Record<string, import("@metamask/utils").Json>;
|
|
124
|
-
type: "eip155:erc4337";
|
|
125
|
-
address: string;
|
|
126
|
-
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
127
125
|
metadata: {
|
|
128
126
|
name: string;
|
|
129
127
|
importTime: number;
|
|
@@ -132,12 +130,14 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
|
|
|
132
130
|
};
|
|
133
131
|
nameLastUpdatedAt?: number;
|
|
134
132
|
snap?: {
|
|
135
|
-
id: string;
|
|
136
133
|
name: string;
|
|
134
|
+
id: string;
|
|
137
135
|
enabled: boolean;
|
|
138
136
|
};
|
|
139
137
|
lastSelected?: number;
|
|
140
138
|
};
|
|
139
|
+
address: string;
|
|
140
|
+
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
141
141
|
}, {
|
|
142
142
|
metadata: Struct<{
|
|
143
143
|
name: string;
|
|
@@ -147,8 +147,8 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
|
|
|
147
147
|
};
|
|
148
148
|
nameLastUpdatedAt?: number;
|
|
149
149
|
snap?: {
|
|
150
|
-
id: string;
|
|
151
150
|
name: string;
|
|
151
|
+
id: string;
|
|
152
152
|
enabled: boolean;
|
|
153
153
|
};
|
|
154
154
|
lastSelected?: number;
|
|
@@ -156,8 +156,8 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
|
|
|
156
156
|
name: Struct<string, null>;
|
|
157
157
|
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
158
158
|
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
159
|
-
id: string;
|
|
160
159
|
name: string;
|
|
160
|
+
id: string;
|
|
161
161
|
enabled: boolean;
|
|
162
162
|
}, {
|
|
163
163
|
id: Struct<string, null>;
|
|
@@ -172,9 +172,9 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
|
|
|
172
172
|
type: Struct<string, null>;
|
|
173
173
|
}>;
|
|
174
174
|
}>;
|
|
175
|
-
address: Struct<string, null>;
|
|
176
|
-
type: Struct<"eip155:erc4337", "eip155:erc4337">;
|
|
177
|
-
methods: Struct<("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], Struct<"personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
|
|
175
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
176
|
+
type: import("@metamask/superstruct").Struct<"eip155:erc4337", "eip155:erc4337">;
|
|
177
|
+
methods: import("@metamask/superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], import("@metamask/superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
|
|
178
178
|
personal_sign: "personal_sign";
|
|
179
179
|
eth_sign: "eth_sign";
|
|
180
180
|
eth_signTypedData_v1: "eth_signTypedData_v1";
|
|
@@ -188,11 +188,9 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
|
|
|
188
188
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
189
189
|
}>;
|
|
190
190
|
export declare const InternalBtcP2wpkhAccountStruct: Struct<{
|
|
191
|
+
type: "bip122:p2wpkh";
|
|
191
192
|
id: string;
|
|
192
193
|
options: Record<string, import("@metamask/utils").Json>;
|
|
193
|
-
type: "bip122:p2wpkh";
|
|
194
|
-
address: string;
|
|
195
|
-
methods: "sendBitcoin"[];
|
|
196
194
|
metadata: {
|
|
197
195
|
name: string;
|
|
198
196
|
importTime: number;
|
|
@@ -201,12 +199,14 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
|
|
|
201
199
|
};
|
|
202
200
|
nameLastUpdatedAt?: number;
|
|
203
201
|
snap?: {
|
|
204
|
-
id: string;
|
|
205
202
|
name: string;
|
|
203
|
+
id: string;
|
|
206
204
|
enabled: boolean;
|
|
207
205
|
};
|
|
208
206
|
lastSelected?: number;
|
|
209
207
|
};
|
|
208
|
+
address: string;
|
|
209
|
+
methods: "sendBitcoin"[];
|
|
210
210
|
}, {
|
|
211
211
|
metadata: Struct<{
|
|
212
212
|
name: string;
|
|
@@ -216,8 +216,8 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
|
|
|
216
216
|
};
|
|
217
217
|
nameLastUpdatedAt?: number;
|
|
218
218
|
snap?: {
|
|
219
|
-
id: string;
|
|
220
219
|
name: string;
|
|
220
|
+
id: string;
|
|
221
221
|
enabled: boolean;
|
|
222
222
|
};
|
|
223
223
|
lastSelected?: number;
|
|
@@ -225,8 +225,8 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
|
|
|
225
225
|
name: Struct<string, null>;
|
|
226
226
|
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
227
227
|
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
228
|
-
id: string;
|
|
229
228
|
name: string;
|
|
229
|
+
id: string;
|
|
230
230
|
enabled: boolean;
|
|
231
231
|
}, {
|
|
232
232
|
id: Struct<string, null>;
|
|
@@ -241,20 +241,18 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
|
|
|
241
241
|
type: Struct<string, null>;
|
|
242
242
|
}>;
|
|
243
243
|
}>;
|
|
244
|
-
address: Struct<string, null>;
|
|
245
|
-
type: Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
|
|
246
|
-
methods: Struct<"sendBitcoin"[], Struct<"sendBitcoin", {
|
|
244
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
245
|
+
type: import("@metamask/superstruct").Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
|
|
246
|
+
methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
|
|
247
247
|
sendBitcoin: "sendBitcoin";
|
|
248
248
|
}>>;
|
|
249
249
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
250
250
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
251
251
|
}>;
|
|
252
252
|
export declare const InternalSolDataAccountStruct: Struct<{
|
|
253
|
+
type: "solana:data-account";
|
|
253
254
|
id: string;
|
|
254
255
|
options: Record<string, import("@metamask/utils").Json>;
|
|
255
|
-
type: "solana:data-account";
|
|
256
|
-
address: string;
|
|
257
|
-
methods: "sendAndConfirmTransaction"[];
|
|
258
256
|
metadata: {
|
|
259
257
|
name: string;
|
|
260
258
|
importTime: number;
|
|
@@ -263,12 +261,14 @@ export declare const InternalSolDataAccountStruct: Struct<{
|
|
|
263
261
|
};
|
|
264
262
|
nameLastUpdatedAt?: number;
|
|
265
263
|
snap?: {
|
|
266
|
-
id: string;
|
|
267
264
|
name: string;
|
|
265
|
+
id: string;
|
|
268
266
|
enabled: boolean;
|
|
269
267
|
};
|
|
270
268
|
lastSelected?: number;
|
|
271
269
|
};
|
|
270
|
+
address: string;
|
|
271
|
+
methods: "sendAndConfirmTransaction"[];
|
|
272
272
|
}, {
|
|
273
273
|
metadata: Struct<{
|
|
274
274
|
name: string;
|
|
@@ -278,8 +278,8 @@ export declare const InternalSolDataAccountStruct: Struct<{
|
|
|
278
278
|
};
|
|
279
279
|
nameLastUpdatedAt?: number;
|
|
280
280
|
snap?: {
|
|
281
|
-
id: string;
|
|
282
281
|
name: string;
|
|
282
|
+
id: string;
|
|
283
283
|
enabled: boolean;
|
|
284
284
|
};
|
|
285
285
|
lastSelected?: number;
|
|
@@ -287,8 +287,8 @@ export declare const InternalSolDataAccountStruct: Struct<{
|
|
|
287
287
|
name: Struct<string, null>;
|
|
288
288
|
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
289
289
|
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
290
|
-
id: string;
|
|
291
290
|
name: string;
|
|
291
|
+
id: string;
|
|
292
292
|
enabled: boolean;
|
|
293
293
|
}, {
|
|
294
294
|
id: Struct<string, null>;
|
|
@@ -303,9 +303,9 @@ export declare const InternalSolDataAccountStruct: Struct<{
|
|
|
303
303
|
type: Struct<string, null>;
|
|
304
304
|
}>;
|
|
305
305
|
}>;
|
|
306
|
-
address: Struct<string, null>;
|
|
307
|
-
type: Struct<"solana:data-account", "solana:data-account">;
|
|
308
|
-
methods: Struct<"sendAndConfirmTransaction"[], Struct<"sendAndConfirmTransaction", {
|
|
306
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
307
|
+
type: import("@metamask/superstruct").Struct<"solana:data-account", "solana:data-account">;
|
|
308
|
+
methods: import("@metamask/superstruct").Struct<"sendAndConfirmTransaction"[], import("@metamask/superstruct").Struct<"sendAndConfirmTransaction", {
|
|
309
309
|
sendAndConfirmTransaction: "sendAndConfirmTransaction";
|
|
310
310
|
}>>;
|
|
311
311
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -318,11 +318,9 @@ export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
|
|
|
318
318
|
export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalSolDataAccount>>;
|
|
319
319
|
export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2wpkhAccount | InternalSolDataAccount;
|
|
320
320
|
export declare const InternalAccountStruct: Struct<{
|
|
321
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
321
322
|
id: string;
|
|
322
323
|
options: Record<string, import("@metamask/utils").Json>;
|
|
323
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
324
|
-
address: string;
|
|
325
|
-
methods: string[];
|
|
326
324
|
metadata: {
|
|
327
325
|
name: string;
|
|
328
326
|
importTime: number;
|
|
@@ -331,12 +329,14 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
331
329
|
};
|
|
332
330
|
nameLastUpdatedAt?: number;
|
|
333
331
|
snap?: {
|
|
334
|
-
id: string;
|
|
335
332
|
name: string;
|
|
333
|
+
id: string;
|
|
336
334
|
enabled: boolean;
|
|
337
335
|
};
|
|
338
336
|
lastSelected?: number;
|
|
339
337
|
};
|
|
338
|
+
address: string;
|
|
339
|
+
methods: string[];
|
|
340
340
|
}, {
|
|
341
341
|
metadata: Struct<{
|
|
342
342
|
name: string;
|
|
@@ -346,8 +346,8 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
346
346
|
};
|
|
347
347
|
nameLastUpdatedAt?: number;
|
|
348
348
|
snap?: {
|
|
349
|
-
id: string;
|
|
350
349
|
name: string;
|
|
350
|
+
id: string;
|
|
351
351
|
enabled: boolean;
|
|
352
352
|
};
|
|
353
353
|
lastSelected?: number;
|
|
@@ -355,8 +355,8 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
355
355
|
name: Struct<string, null>;
|
|
356
356
|
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
357
357
|
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
358
|
-
id: string;
|
|
359
358
|
name: string;
|
|
359
|
+
id: string;
|
|
360
360
|
enabled: boolean;
|
|
361
361
|
}, {
|
|
362
362
|
id: Struct<string, null>;
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAKf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG1C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAC1C,OAAO,8BAA8B,CACtC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEhF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACJ,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,yBAAyB,CAAC,GACjC,MAAM,CAAC,wBAAwB,CAAC,GAChC,MAAM,CAAC,sBAAsB,CAAC,CAMjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,CAAC;AAE3B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/types.mjs
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
|
|
3
3
|
// Those rules seem to be triggering a false positive on the `InternalAccountStructs`
|
|
4
4
|
// and `InternalAccountTypes`.
|
|
5
|
-
import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType } from "@metamask/keyring-api";
|
|
5
|
+
import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2wpkhAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct } from "@metamask/keyring-api";
|
|
6
6
|
import { exactOptional, object } from "@metamask/keyring-utils";
|
|
7
7
|
import { boolean, string, number } from "@metamask/superstruct";
|
|
8
|
-
import { BtcP2wpkhAccountStruct } from "./btc/types.mjs";
|
|
9
|
-
import { EthEoaAccountStruct, EthErc4337AccountStruct } from "./eth/types.mjs";
|
|
10
|
-
import { SolDataAccountStruct } from "./sol/types.mjs";
|
|
11
8
|
export const InternalAccountMetadataStruct = object({
|
|
12
9
|
metadata: object({
|
|
13
10
|
name: string(),
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,qFAAqF;AACrF,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,qFAAqF;AACrF,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAOhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;IAClD,QAAQ,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,EAAE;QACd,iBAAiB,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;QAC1C,IAAI,EAAE,aAAa,CACjB,MAAM,CAAC;YACL,EAAE,EAAE,MAAM,EAAE;YACZ,OAAO,EAAE,OAAO,EAAE;YAClB,IAAI,EAAE,MAAM,EAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;QACrC,UAAU,EAAE,MAAM,EAAE;QACpB,OAAO,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,EAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,GAAG,mBAAmB,CAAC,MAAM;IAC7B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;IACpD,GAAG,uBAAuB,CAAC,MAAM;IACjC,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;IACnD,GAAG,sBAAsB,CAAC,MAAM;IAChC,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcH,MAAM,CAAC,MAAM,sBAAsB,GAM/B;IACF,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;IACtD,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,+BAA+B;IAC9D,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;CAChE,CAAC;AAQF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/keyring-internal-api",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-1c468fa",
|
|
4
4
|
"description": "MetaMask Keyring Internal API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metamask",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"main": "./dist/index.
|
|
29
|
+
"main": "./dist/index.cjs",
|
|
30
30
|
"types": "./dist/index.d.cts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist/"
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
"test:watch": "jest --watch"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@metamask/keyring-api": "11.
|
|
48
|
+
"@metamask/keyring-api": "11.1.0",
|
|
49
49
|
"@metamask/keyring-utils": "0.0.1",
|
|
50
50
|
"@metamask/superstruct": "^3.1.0",
|
|
51
|
-
"@metamask/utils": "^9.
|
|
52
|
-
"bech32": "^2.0.0",
|
|
53
|
-
"deepmerge": "^4.2.2"
|
|
51
|
+
"@metamask/utils": "^9.3.0"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@lavamoat/allow-scripts": "^3.2.1",
|
|
@@ -59,6 +57,7 @@
|
|
|
59
57
|
"@ts-bridge/cli": "^0.6.0",
|
|
60
58
|
"@types/jest": "^29.5.12",
|
|
61
59
|
"@types/node": "^20.12.12",
|
|
60
|
+
"deepmerge": "^4.2.2",
|
|
62
61
|
"depcheck": "^1.4.7",
|
|
63
62
|
"jest": "^29.5.0",
|
|
64
63
|
"jest-it-up": "^3.1.0",
|
package/dist/api.cjs
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
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.cjs");
|
|
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.cjs.map
|
package/dist/api.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.cjs","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAC/B,2DAA6D;AAE7D,uDAO+B;AAC/B,2CAA6C;AAE7C,mCAAyC;AAEzC,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IACvB,EAAE,EAAE,IAAA,mBAAK,EAAC,CAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,+EAA+E;AAC/E,gBAAgB;AAEH,QAAA,yBAAyB,GAAG,IAAA,sBAAM,EAAC;IAC9C,GAAG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AAE,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"]}
|