@metamask-previews/keyring-internal-api 6.0.1-286566a → 6.0.1-33a98a2

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/types.cjs CHANGED
@@ -14,8 +14,6 @@ exports.InternalAccountMetadataStruct = (0, keyring_utils_1.object)({
14
14
  nameLastUpdatedAt: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
15
15
  snap: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
16
16
  id: (0, superstruct_1.string)(),
17
- enabled: (0, superstruct_1.boolean)(),
18
- name: (0, superstruct_1.string)(),
19
17
  })),
20
18
  lastSelected: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
21
19
  importTime: (0, superstruct_1.number)(),
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAS+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AAOnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;YACZ,OAAO,EAAE,IAAA,qBAAO,GAAE;YAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,GAAG,iCAAmB,CAAC,MAAM;IAC7B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sBAAM,EAAC;IACpD,GAAG,qCAAuB,CAAC,MAAM;IACjC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,IAAA,sBAAM,EAAC;IACnD,GAAG,oCAAsB,CAAC,MAAM;IAChC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,sBAAM,EAAC;IACjD,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcU,QAAA,sBAAsB,GAM/B;IACF,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;IACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,uCAA+B;IAC9D,CAAC,GAAG,4BAAc,CAAC,MAAM,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;CAChE,CAAC;AAQW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: 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"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAS+B;AAC/B,2DAAgE;AAEhE,uDAAuD;AAO1C,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;SACb,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,GAAG,iCAAmB,CAAC,MAAM;IAC7B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sBAAM,EAAC;IACpD,GAAG,qCAAuB,CAAC,MAAM;IACjC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,IAAA,sBAAM,EAAC;IACnD,GAAG,oCAAsB,CAAC,MAAM;IAChC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,sBAAM,EAAC;IACjD,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcU,QAAA,sBAAsB,GAM/B;IACF,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;IACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,uCAA+B;IAC9D,CAAC,GAAG,4BAAc,CAAC,MAAM,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;CAChE,CAAC;AAQW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: 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 { 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 }),\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/dist/types.d.cts CHANGED
@@ -10,9 +10,7 @@ export declare const InternalAccountMetadataStruct: Struct<{
10
10
  };
11
11
  nameLastUpdatedAt?: number;
12
12
  snap?: {
13
- name: string;
14
13
  id: string;
15
- enabled: boolean;
16
14
  };
17
15
  lastSelected?: number;
18
16
  };
@@ -25,22 +23,16 @@ export declare const InternalAccountMetadataStruct: Struct<{
25
23
  };
26
24
  nameLastUpdatedAt?: number;
27
25
  snap?: {
28
- name: string;
29
26
  id: string;
30
- enabled: boolean;
31
27
  };
32
28
  lastSelected?: number;
33
29
  }, {
34
30
  name: Struct<string, null>;
35
31
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
36
32
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
37
- name: string;
38
33
  id: string;
39
- enabled: boolean;
40
34
  }, {
41
35
  id: Struct<string, null>;
42
- enabled: Struct<boolean, null>;
43
- name: Struct<string, null>;
44
36
  }>;
45
37
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
46
38
  importTime: Struct<number, null>;
@@ -63,9 +55,7 @@ export declare const InternalEthEoaAccountStruct: Struct<{
63
55
  };
64
56
  nameLastUpdatedAt?: number;
65
57
  snap?: {
66
- name: string;
67
58
  id: string;
68
- enabled: boolean;
69
59
  };
70
60
  lastSelected?: number;
71
61
  };
@@ -81,22 +71,16 @@ export declare const InternalEthEoaAccountStruct: Struct<{
81
71
  };
82
72
  nameLastUpdatedAt?: number;
83
73
  snap?: {
84
- name: string;
85
74
  id: string;
86
- enabled: boolean;
87
75
  };
88
76
  lastSelected?: number;
89
77
  }, {
90
78
  name: Struct<string, null>;
91
79
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
92
80
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
93
- name: string;
94
81
  id: string;
95
- enabled: boolean;
96
82
  }, {
97
83
  id: Struct<string, null>;
98
- enabled: Struct<boolean, null>;
99
- name: Struct<string, null>;
100
84
  }>;
101
85
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
102
86
  importTime: Struct<number, null>;
@@ -132,9 +116,7 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
132
116
  };
133
117
  nameLastUpdatedAt?: number;
134
118
  snap?: {
135
- name: string;
136
119
  id: string;
137
- enabled: boolean;
138
120
  };
139
121
  lastSelected?: number;
140
122
  };
@@ -150,22 +132,16 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
150
132
  };
151
133
  nameLastUpdatedAt?: number;
152
134
  snap?: {
153
- name: string;
154
135
  id: string;
155
- enabled: boolean;
156
136
  };
157
137
  lastSelected?: number;
158
138
  }, {
159
139
  name: Struct<string, null>;
160
140
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
161
141
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
162
- name: string;
163
142
  id: string;
164
- enabled: boolean;
165
143
  }, {
166
144
  id: Struct<string, null>;
167
- enabled: Struct<boolean, null>;
168
- name: Struct<string, null>;
169
145
  }>;
170
146
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
171
147
  importTime: Struct<number, null>;
@@ -203,9 +179,7 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
203
179
  };
204
180
  nameLastUpdatedAt?: number;
205
181
  snap?: {
206
- name: string;
207
182
  id: string;
208
- enabled: boolean;
209
183
  };
210
184
  lastSelected?: number;
211
185
  };
@@ -221,22 +195,16 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
221
195
  };
222
196
  nameLastUpdatedAt?: number;
223
197
  snap?: {
224
- name: string;
225
198
  id: string;
226
- enabled: boolean;
227
199
  };
228
200
  lastSelected?: number;
229
201
  }, {
230
202
  name: Struct<string, null>;
231
203
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
232
204
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
233
- name: string;
234
205
  id: string;
235
- enabled: boolean;
236
206
  }, {
237
207
  id: Struct<string, null>;
238
- enabled: Struct<boolean, null>;
239
- name: Struct<string, null>;
240
208
  }>;
241
209
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
242
210
  importTime: Struct<number, null>;
@@ -267,9 +235,7 @@ export declare const InternalSolDataAccountStruct: Struct<{
267
235
  };
268
236
  nameLastUpdatedAt?: number;
269
237
  snap?: {
270
- name: string;
271
238
  id: string;
272
- enabled: boolean;
273
239
  };
274
240
  lastSelected?: number;
275
241
  };
@@ -285,22 +251,16 @@ export declare const InternalSolDataAccountStruct: Struct<{
285
251
  };
286
252
  nameLastUpdatedAt?: number;
287
253
  snap?: {
288
- name: string;
289
254
  id: string;
290
- enabled: boolean;
291
255
  };
292
256
  lastSelected?: number;
293
257
  }, {
294
258
  name: Struct<string, null>;
295
259
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
296
260
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
297
- name: string;
298
261
  id: string;
299
- enabled: boolean;
300
262
  }, {
301
263
  id: Struct<string, null>;
302
- enabled: Struct<boolean, null>;
303
- name: Struct<string, null>;
304
264
  }>;
305
265
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
306
266
  importTime: Struct<number, null>;
@@ -341,9 +301,7 @@ export declare const InternalAccountStruct: Struct<{
341
301
  };
342
302
  nameLastUpdatedAt?: number;
343
303
  snap?: {
344
- name: string;
345
304
  id: string;
346
- enabled: boolean;
347
305
  };
348
306
  lastSelected?: number;
349
307
  };
@@ -359,22 +317,16 @@ export declare const InternalAccountStruct: Struct<{
359
317
  };
360
318
  nameLastUpdatedAt?: number;
361
319
  snap?: {
362
- name: string;
363
320
  id: string;
364
- enabled: boolean;
365
321
  };
366
322
  lastSelected?: number;
367
323
  }, {
368
324
  name: Struct<string, null>;
369
325
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
370
326
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
371
- name: string;
372
327
  id: string;
373
- enabled: boolean;
374
328
  }, {
375
329
  id: Struct<string, null>;
376
- enabled: Struct<boolean, null>;
377
- name: Struct<string, null>;
378
330
  }>;
379
331
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
380
332
  importTime: Struct<number, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","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,C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A8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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.d.mts CHANGED
@@ -10,9 +10,7 @@ export declare const InternalAccountMetadataStruct: Struct<{
10
10
  };
11
11
  nameLastUpdatedAt?: number;
12
12
  snap?: {
13
- name: string;
14
13
  id: string;
15
- enabled: boolean;
16
14
  };
17
15
  lastSelected?: number;
18
16
  };
@@ -25,22 +23,16 @@ export declare const InternalAccountMetadataStruct: Struct<{
25
23
  };
26
24
  nameLastUpdatedAt?: number;
27
25
  snap?: {
28
- name: string;
29
26
  id: string;
30
- enabled: boolean;
31
27
  };
32
28
  lastSelected?: number;
33
29
  }, {
34
30
  name: Struct<string, null>;
35
31
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
36
32
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
37
- name: string;
38
33
  id: string;
39
- enabled: boolean;
40
34
  }, {
41
35
  id: Struct<string, null>;
42
- enabled: Struct<boolean, null>;
43
- name: Struct<string, null>;
44
36
  }>;
45
37
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
46
38
  importTime: Struct<number, null>;
@@ -63,9 +55,7 @@ export declare const InternalEthEoaAccountStruct: Struct<{
63
55
  };
64
56
  nameLastUpdatedAt?: number;
65
57
  snap?: {
66
- name: string;
67
58
  id: string;
68
- enabled: boolean;
69
59
  };
70
60
  lastSelected?: number;
71
61
  };
@@ -81,22 +71,16 @@ export declare const InternalEthEoaAccountStruct: Struct<{
81
71
  };
82
72
  nameLastUpdatedAt?: number;
83
73
  snap?: {
84
- name: string;
85
74
  id: string;
86
- enabled: boolean;
87
75
  };
88
76
  lastSelected?: number;
89
77
  }, {
90
78
  name: Struct<string, null>;
91
79
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
92
80
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
93
- name: string;
94
81
  id: string;
95
- enabled: boolean;
96
82
  }, {
97
83
  id: Struct<string, null>;
98
- enabled: Struct<boolean, null>;
99
- name: Struct<string, null>;
100
84
  }>;
101
85
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
102
86
  importTime: Struct<number, null>;
@@ -132,9 +116,7 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
132
116
  };
133
117
  nameLastUpdatedAt?: number;
134
118
  snap?: {
135
- name: string;
136
119
  id: string;
137
- enabled: boolean;
138
120
  };
139
121
  lastSelected?: number;
140
122
  };
@@ -150,22 +132,16 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
150
132
  };
151
133
  nameLastUpdatedAt?: number;
152
134
  snap?: {
153
- name: string;
154
135
  id: string;
155
- enabled: boolean;
156
136
  };
157
137
  lastSelected?: number;
158
138
  }, {
159
139
  name: Struct<string, null>;
160
140
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
161
141
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
162
- name: string;
163
142
  id: string;
164
- enabled: boolean;
165
143
  }, {
166
144
  id: Struct<string, null>;
167
- enabled: Struct<boolean, null>;
168
- name: Struct<string, null>;
169
145
  }>;
170
146
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
171
147
  importTime: Struct<number, null>;
@@ -203,9 +179,7 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
203
179
  };
204
180
  nameLastUpdatedAt?: number;
205
181
  snap?: {
206
- name: string;
207
182
  id: string;
208
- enabled: boolean;
209
183
  };
210
184
  lastSelected?: number;
211
185
  };
@@ -221,22 +195,16 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
221
195
  };
222
196
  nameLastUpdatedAt?: number;
223
197
  snap?: {
224
- name: string;
225
198
  id: string;
226
- enabled: boolean;
227
199
  };
228
200
  lastSelected?: number;
229
201
  }, {
230
202
  name: Struct<string, null>;
231
203
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
232
204
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
233
- name: string;
234
205
  id: string;
235
- enabled: boolean;
236
206
  }, {
237
207
  id: Struct<string, null>;
238
- enabled: Struct<boolean, null>;
239
- name: Struct<string, null>;
240
208
  }>;
241
209
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
242
210
  importTime: Struct<number, null>;
@@ -267,9 +235,7 @@ export declare const InternalSolDataAccountStruct: Struct<{
267
235
  };
268
236
  nameLastUpdatedAt?: number;
269
237
  snap?: {
270
- name: string;
271
238
  id: string;
272
- enabled: boolean;
273
239
  };
274
240
  lastSelected?: number;
275
241
  };
@@ -285,22 +251,16 @@ export declare const InternalSolDataAccountStruct: Struct<{
285
251
  };
286
252
  nameLastUpdatedAt?: number;
287
253
  snap?: {
288
- name: string;
289
254
  id: string;
290
- enabled: boolean;
291
255
  };
292
256
  lastSelected?: number;
293
257
  }, {
294
258
  name: Struct<string, null>;
295
259
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
296
260
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
297
- name: string;
298
261
  id: string;
299
- enabled: boolean;
300
262
  }, {
301
263
  id: Struct<string, null>;
302
- enabled: Struct<boolean, null>;
303
- name: Struct<string, null>;
304
264
  }>;
305
265
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
306
266
  importTime: Struct<number, null>;
@@ -341,9 +301,7 @@ export declare const InternalAccountStruct: Struct<{
341
301
  };
342
302
  nameLastUpdatedAt?: number;
343
303
  snap?: {
344
- name: string;
345
304
  id: string;
346
- enabled: boolean;
347
305
  };
348
306
  lastSelected?: number;
349
307
  };
@@ -359,22 +317,16 @@ export declare const InternalAccountStruct: Struct<{
359
317
  };
360
318
  nameLastUpdatedAt?: number;
361
319
  snap?: {
362
- name: string;
363
320
  id: string;
364
- enabled: boolean;
365
321
  };
366
322
  lastSelected?: number;
367
323
  }, {
368
324
  name: Struct<string, null>;
369
325
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
370
326
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
371
- name: string;
372
327
  id: string;
373
- enabled: boolean;
374
328
  }, {
375
329
  id: Struct<string, null>;
376
- enabled: Struct<boolean, null>;
377
- name: Struct<string, null>;
378
330
  }>;
379
331
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
380
332
  importT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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
@@ -4,15 +4,13 @@
4
4
  // and `InternalAccountTypes`.
5
5
  import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2wpkhAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct } from "@metamask/keyring-api";
6
6
  import { exactOptional, object } from "@metamask/keyring-utils";
7
- import { boolean, string, number } from "@metamask/superstruct";
7
+ import { string, number } from "@metamask/superstruct";
8
8
  export const InternalAccountMetadataStruct = object({
9
9
  metadata: object({
10
10
  name: string(),
11
11
  nameLastUpdatedAt: exactOptional(number()),
12
12
  snap: exactOptional(object({
13
13
  id: string(),
14
- enabled: boolean(),
15
- name: string(),
16
14
  })),
17
15
  lastSelected: exactOptional(number()),
18
16
  importTime: number(),
@@ -1 +1 @@
1
- {"version":3,"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AC,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// FIXME: 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"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AAC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M,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// FIXME: 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 { 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 }),\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": "6.0.1-286566a",
3
+ "version": "6.0.1-33a98a2",
4
4
  "description": "MetaMask Keyring Internal API",
5
5
  "keywords": [
6
6
  "metamask",
@@ -45,7 +45,7 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@metamask/keyring-api": "17.4.0",
48
+ "@metamask/keyring-api": "17.5.0",
49
49
  "@metamask/keyring-utils": "3.0.0",
50
50
  "@metamask/superstruct": "^3.1.0"
51
51
  },