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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/{internal/api.js → api.cjs} +2 -2
  2. package/dist/api.cjs.map +1 -0
  3. package/dist/{internal/api.d.ts → api.d.cts} +46 -41
  4. package/dist/api.d.cts.map +1 -0
  5. package/dist/api.d.mts +420 -0
  6. package/dist/api.d.mts.map +1 -0
  7. package/dist/api.mjs +135 -0
  8. package/dist/api.mjs.map +1 -0
  9. package/dist/btc/{index.js → index.cjs} +2 -2
  10. package/dist/btc/index.cjs.map +1 -0
  11. package/dist/btc/index.d.cts +2 -0
  12. package/dist/btc/index.d.cts.map +1 -0
  13. package/dist/btc/index.d.mts +2 -0
  14. package/dist/btc/index.d.mts.map +1 -0
  15. package/dist/btc/index.mjs +2 -0
  16. package/dist/btc/index.mjs.map +1 -0
  17. package/dist/btc/{types.js → types.cjs} +4 -4
  18. package/dist/btc/types.cjs.map +1 -0
  19. package/dist/btc/{types.d.ts → types.d.cts} +8 -7
  20. package/dist/btc/types.d.cts.map +1 -0
  21. package/dist/btc/types.d.mts +34 -0
  22. package/dist/btc/types.d.mts.map +1 -0
  23. package/dist/btc/types.mjs +37 -0
  24. package/dist/btc/types.mjs.map +1 -0
  25. package/dist/{internal/eth/EthKeyring.js → eth/EthKeyring.cjs} +1 -1
  26. package/dist/eth/EthKeyring.cjs.map +1 -0
  27. package/dist/{internal/eth/EthKeyring.d.ts → eth/EthKeyring.d.cts} +5 -4
  28. package/dist/eth/EthKeyring.d.cts.map +1 -0
  29. package/dist/eth/EthKeyring.d.mts +34 -0
  30. package/dist/eth/EthKeyring.d.mts.map +1 -0
  31. package/dist/eth/EthKeyring.mjs +2 -0
  32. package/dist/eth/EthKeyring.mjs.map +1 -0
  33. package/dist/eth/erc4337/{index.js → index.cjs} +2 -2
  34. package/dist/eth/erc4337/index.cjs.map +1 -0
  35. package/dist/eth/erc4337/index.d.cts +2 -0
  36. package/dist/eth/erc4337/index.d.cts.map +1 -0
  37. package/dist/eth/erc4337/index.d.mts +2 -0
  38. package/dist/eth/erc4337/index.d.mts.map +1 -0
  39. package/dist/eth/erc4337/index.mjs +2 -0
  40. package/dist/eth/erc4337/index.mjs.map +1 -0
  41. package/dist/eth/erc4337/{types.js → types.cjs} +2 -2
  42. package/dist/eth/erc4337/types.cjs.map +1 -0
  43. package/dist/eth/erc4337/{types.d.ts → types.d.cts} +7 -6
  44. package/dist/eth/erc4337/types.d.cts.map +1 -0
  45. package/dist/eth/erc4337/types.d.mts +98 -0
  46. package/dist/eth/erc4337/types.d.mts.map +1 -0
  47. package/dist/eth/erc4337/types.mjs +58 -0
  48. package/dist/eth/erc4337/types.mjs.map +1 -0
  49. package/dist/{index.js → eth/index.cjs} +4 -4
  50. package/dist/eth/index.cjs.map +1 -0
  51. package/dist/eth/index.d.cts +5 -0
  52. package/dist/eth/index.d.cts.map +1 -0
  53. package/dist/eth/index.d.mts +5 -0
  54. package/dist/eth/index.d.mts.map +1 -0
  55. package/dist/eth/index.mjs +4 -0
  56. package/dist/eth/index.mjs.map +1 -0
  57. package/dist/eth/{types.js → types.cjs} +2 -2
  58. package/dist/eth/types.cjs.map +1 -0
  59. package/dist/eth/{types.d.ts → types.d.cts} +6 -5
  60. package/dist/eth/types.d.cts.map +1 -0
  61. package/dist/eth/types.d.mts +81 -0
  62. package/dist/eth/types.d.mts.map +1 -0
  63. package/dist/eth/types.mjs +70 -0
  64. package/dist/eth/types.mjs.map +1 -0
  65. package/dist/eth/{utils.js → utils.cjs} +2 -3
  66. package/dist/eth/{utils.js.map → utils.cjs.map} +1 -1
  67. package/dist/eth/{utils.d.ts → utils.d.cts} +2 -1
  68. package/dist/eth/utils.d.cts.map +1 -0
  69. package/dist/eth/utils.d.mts +9 -0
  70. package/dist/eth/utils.d.mts.map +1 -0
  71. package/dist/eth/utils.mjs +11 -0
  72. package/dist/eth/utils.mjs.map +1 -0
  73. package/dist/{internal/events.js → events.cjs} +2 -2
  74. package/dist/events.cjs.map +1 -0
  75. package/dist/{internal/events.d.ts → events.d.cts} +11 -8
  76. package/dist/events.d.cts.map +1 -0
  77. package/dist/events.d.mts +172 -0
  78. package/dist/events.d.mts.map +1 -0
  79. package/dist/events.mjs +80 -0
  80. package/dist/events.mjs.map +1 -0
  81. package/dist/{eth/index.js → index.cjs} +8 -4
  82. package/dist/index.cjs.map +1 -0
  83. package/dist/index.d.cts +8 -0
  84. package/dist/index.d.cts.map +1 -0
  85. package/dist/index.d.mts +8 -0
  86. package/dist/index.d.mts.map +1 -0
  87. package/dist/index.mjs +8 -0
  88. package/dist/index.mjs.map +1 -0
  89. package/dist/{internal/rpc.js → rpc.cjs} +4 -4
  90. package/dist/rpc.cjs.map +1 -0
  91. package/dist/{internal/rpc.d.ts → rpc.d.cts} +1 -0
  92. package/dist/rpc.d.cts.map +1 -0
  93. package/dist/rpc.d.mts +26 -0
  94. package/dist/rpc.d.mts.map +1 -0
  95. package/dist/rpc.mjs +29 -0
  96. package/dist/rpc.mjs.map +1 -0
  97. package/dist/{internal/eth/index.js → sol/index.cjs} +2 -2
  98. package/dist/sol/index.cjs.map +1 -0
  99. package/dist/sol/index.d.cts +2 -0
  100. package/dist/sol/index.d.cts.map +1 -0
  101. package/dist/sol/index.d.mts +2 -0
  102. package/dist/sol/index.d.mts.map +1 -0
  103. package/dist/sol/index.mjs +2 -0
  104. package/dist/sol/index.mjs.map +1 -0
  105. package/dist/sol/types.cjs +36 -0
  106. package/dist/sol/types.cjs.map +1 -0
  107. package/dist/sol/types.d.cts +39 -0
  108. package/dist/sol/types.d.cts.map +1 -0
  109. package/dist/sol/types.d.mts +39 -0
  110. package/dist/sol/types.d.mts.map +1 -0
  111. package/dist/sol/types.mjs +33 -0
  112. package/dist/sol/types.mjs.map +1 -0
  113. package/dist/{internal/types.js → types.cjs} +26 -19
  114. package/dist/types.cjs.map +1 -0
  115. package/dist/{internal/types.d.ts → types.d.cts} +106 -44
  116. package/dist/types.d.cts.map +1 -0
  117. package/dist/types.d.mts +392 -0
  118. package/dist/types.d.mts.map +1 -0
  119. package/dist/types.mjs +53 -0
  120. package/dist/types.mjs.map +1 -0
  121. package/package.json +30 -18
  122. package/dist/btc/index.d.ts +0 -1
  123. package/dist/btc/index.js.map +0 -1
  124. package/dist/btc/types.js.map +0 -1
  125. package/dist/eth/erc4337/index.d.ts +0 -1
  126. package/dist/eth/erc4337/index.js.map +0 -1
  127. package/dist/eth/erc4337/types.js.map +0 -1
  128. package/dist/eth/index.d.ts +0 -3
  129. package/dist/eth/index.js.map +0 -1
  130. package/dist/eth/types.js.map +0 -1
  131. package/dist/index.d.ts +0 -3
  132. package/dist/index.js.map +0 -1
  133. package/dist/internal/api.js.map +0 -1
  134. package/dist/internal/eth/EthKeyring.js.map +0 -1
  135. package/dist/internal/eth/index.d.ts +0 -1
  136. package/dist/internal/eth/index.js.map +0 -1
  137. package/dist/internal/events.js.map +0 -1
  138. package/dist/internal/index.d.ts +0 -5
  139. package/dist/internal/index.js +0 -22
  140. package/dist/internal/index.js.map +0 -1
  141. package/dist/internal/rpc.js.map +0 -1
  142. package/dist/internal/types.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { BtcAccountType, EthAccountType } from '@metamask/keyring-api';
2
- import type { Infer, Struct } from '@metamask/superstruct';
3
- export declare type InternalAccountType = EthAccountType | BtcAccountType;
1
+ import { BtcAccountType, EthAccountType, SolAccountType } from "@metamask/keyring-api";
2
+ import type { Infer, Struct } from "@metamask/superstruct";
3
+ export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType;
4
4
  export declare const InternalAccountMetadataStruct: Struct<{
5
5
  metadata: {
6
6
  name: string;
@@ -54,8 +54,8 @@ export declare const InternalAccountMetadataStruct: Struct<{
54
54
  export declare const InternalEthEoaAccountStruct: Struct<{
55
55
  id: string;
56
56
  options: Record<string, import("@metamask/utils").Json>;
57
- address: string;
58
57
  type: "eip155:eoa";
58
+ address: string;
59
59
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
60
60
  metadata: {
61
61
  name: string;
@@ -72,19 +72,6 @@ export declare const InternalEthEoaAccountStruct: Struct<{
72
72
  lastSelected?: number;
73
73
  };
74
74
  }, {
75
- address: Struct<string, null>;
76
- type: Struct<"eip155:eoa", "eip155:eoa">;
77
- 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", {
78
- personal_sign: "personal_sign";
79
- eth_sign: "eth_sign";
80
- eth_signTransaction: "eth_signTransaction";
81
- eth_signTypedData_v1: "eth_signTypedData_v1";
82
- eth_signTypedData_v3: "eth_signTypedData_v3";
83
- eth_signTypedData_v4: "eth_signTypedData_v4";
84
- }>>;
85
- id: Struct<string, null>;
86
- options: Struct<Record<string, import("@metamask/utils").Json>, null>;
87
- } & {
88
75
  metadata: Struct<{
89
76
  name: string;
90
77
  importTime: number;
@@ -118,12 +105,24 @@ export declare const InternalEthEoaAccountStruct: Struct<{
118
105
  type: Struct<string, null>;
119
106
  }>;
120
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", {
111
+ personal_sign: "personal_sign";
112
+ eth_sign: "eth_sign";
113
+ eth_signTransaction: "eth_signTransaction";
114
+ eth_signTypedData_v1: "eth_signTypedData_v1";
115
+ eth_signTypedData_v3: "eth_signTypedData_v3";
116
+ eth_signTypedData_v4: "eth_signTypedData_v4";
117
+ }>>;
118
+ id: import("@metamask/superstruct").Struct<string, null>;
119
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
121
120
  }>;
122
121
  export declare const InternalEthErc4337AccountStruct: Struct<{
123
122
  id: string;
124
123
  options: Record<string, import("@metamask/utils").Json>;
125
- address: string;
126
124
  type: "eip155:erc4337";
125
+ address: string;
127
126
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
128
127
  metadata: {
129
128
  name: string;
@@ -140,6 +139,39 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
140
139
  lastSelected?: number;
141
140
  };
142
141
  }, {
142
+ metadata: Struct<{
143
+ name: string;
144
+ importTime: number;
145
+ keyring: {
146
+ type: string;
147
+ };
148
+ nameLastUpdatedAt?: number;
149
+ snap?: {
150
+ id: string;
151
+ name: string;
152
+ enabled: boolean;
153
+ };
154
+ lastSelected?: number;
155
+ }, {
156
+ name: Struct<string, null>;
157
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
158
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
159
+ id: string;
160
+ name: string;
161
+ enabled: boolean;
162
+ }, {
163
+ id: Struct<string, null>;
164
+ enabled: Struct<boolean, null>;
165
+ name: Struct<string, null>;
166
+ }>;
167
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
168
+ importTime: Struct<number, null>;
169
+ keyring: Struct<{
170
+ type: string;
171
+ }, {
172
+ type: Struct<string, null>;
173
+ }>;
174
+ }>;
143
175
  address: Struct<string, null>;
144
176
  type: Struct<"eip155:erc4337", "eip155:erc4337">;
145
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", {
@@ -152,9 +184,30 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
152
184
  eth_patchUserOperation: "eth_patchUserOperation";
153
185
  eth_signUserOperation: "eth_signUserOperation";
154
186
  }>>;
155
- id: Struct<string, null>;
156
- options: Struct<Record<string, import("@metamask/utils").Json>, null>;
157
- } & {
187
+ id: import("@metamask/superstruct").Struct<string, null>;
188
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
189
+ }>;
190
+ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
191
+ id: string;
192
+ options: Record<string, import("@metamask/utils").Json>;
193
+ type: "bip122:p2wpkh";
194
+ address: string;
195
+ methods: "sendBitcoin"[];
196
+ metadata: {
197
+ name: string;
198
+ importTime: number;
199
+ keyring: {
200
+ type: string;
201
+ };
202
+ nameLastUpdatedAt?: number;
203
+ snap?: {
204
+ id: string;
205
+ name: string;
206
+ enabled: boolean;
207
+ };
208
+ lastSelected?: number;
209
+ };
210
+ }, {
158
211
  metadata: Struct<{
159
212
  name: string;
160
213
  importTime: number;
@@ -188,13 +241,20 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
188
241
  type: Struct<string, null>;
189
242
  }>;
190
243
  }>;
244
+ address: Struct<string, null>;
245
+ type: Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
246
+ methods: Struct<"sendBitcoin"[], Struct<"sendBitcoin", {
247
+ sendBitcoin: "sendBitcoin";
248
+ }>>;
249
+ id: import("@metamask/superstruct").Struct<string, null>;
250
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
191
251
  }>;
192
- export declare const InternalBtcP2wpkhAccountStruct: Struct<{
252
+ export declare const InternalSolDataAccountStruct: Struct<{
193
253
  id: string;
194
254
  options: Record<string, import("@metamask/utils").Json>;
255
+ type: "solana:data-account";
195
256
  address: string;
196
- type: "bip122:p2wpkh";
197
- methods: "btc_sendmany"[];
257
+ methods: "sendAndConfirmTransaction"[];
198
258
  metadata: {
199
259
  name: string;
200
260
  importTime: number;
@@ -210,14 +270,6 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
210
270
  lastSelected?: number;
211
271
  };
212
272
  }, {
213
- address: Struct<string, null>;
214
- type: Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
215
- methods: Struct<"btc_sendmany"[], Struct<"btc_sendmany", {
216
- btc_sendmany: "btc_sendmany";
217
- }>>;
218
- id: Struct<string, null>;
219
- options: Struct<Record<string, import("@metamask/utils").Json>, null>;
220
- } & {
221
273
  metadata: Struct<{
222
274
  name: string;
223
275
  importTime: number;
@@ -251,17 +303,25 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
251
303
  type: Struct<string, null>;
252
304
  }>;
253
305
  }>;
306
+ address: Struct<string, null>;
307
+ type: Struct<"solana:data-account", "solana:data-account">;
308
+ methods: Struct<"sendAndConfirmTransaction"[], Struct<"sendAndConfirmTransaction", {
309
+ sendAndConfirmTransaction: "sendAndConfirmTransaction";
310
+ }>>;
311
+ id: import("@metamask/superstruct").Struct<string, null>;
312
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
254
313
  }>;
255
- export declare type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
256
- export declare type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
257
- export declare type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
258
- export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2wpkhAccount>>;
259
- export declare type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2wpkhAccount;
314
+ export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
315
+ export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
316
+ export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
317
+ export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
318
+ export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalSolDataAccount>>;
319
+ export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2wpkhAccount | InternalSolDataAccount;
260
320
  export declare const InternalAccountStruct: Struct<{
261
321
  id: string;
262
322
  options: Record<string, import("@metamask/utils").Json>;
323
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
263
324
  address: string;
264
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
265
325
  methods: string[];
266
326
  metadata: {
267
327
  name: string;
@@ -311,15 +371,16 @@ export declare const InternalAccountStruct: Struct<{
311
371
  type: Struct<string, null>;
312
372
  }>;
313
373
  }>;
314
- id: Struct<string, null>;
315
- type: Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh", {
374
+ id: import("@metamask/superstruct").Struct<string, null>;
375
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
316
376
  "eip155:eoa": "eip155:eoa";
317
377
  "eip155:erc4337": "eip155:erc4337";
318
378
  "bip122:p2wpkh": "bip122:p2wpkh";
379
+ "solana:data-account": "solana:data-account";
319
380
  }>;
320
- address: Struct<string, null>;
321
- options: Struct<Record<string, import("@metamask/utils").Json>, null>;
322
- methods: Struct<string[], Struct<string, null>>;
381
+ address: import("@metamask/superstruct").Struct<string, null>;
382
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
383
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
323
384
  }>;
324
385
  /**
325
386
  * Internal account representation.
@@ -327,4 +388,5 @@ export declare const InternalAccountStruct: Struct<{
327
388
  * This type is used internally by MetaMask to add additional metadata to the
328
389
  * account object. It's should not be used by external applications.
329
390
  */
330
- export declare type InternalAccount = Infer<typeof InternalAccountStruct>;
391
+ export type InternalAccount = Infer<typeof InternalAccountStruct>;
392
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EACf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAO3D,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"}
@@ -0,0 +1,392 @@
1
+ import { BtcAccountType, EthAccountType, SolAccountType } from "@metamask/keyring-api";
2
+ import type { Infer, Struct } from "@metamask/superstruct";
3
+ export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType;
4
+ export declare const InternalAccountMetadataStruct: Struct<{
5
+ metadata: {
6
+ name: string;
7
+ importTime: number;
8
+ keyring: {
9
+ type: string;
10
+ };
11
+ nameLastUpdatedAt?: number;
12
+ snap?: {
13
+ id: string;
14
+ name: string;
15
+ enabled: boolean;
16
+ };
17
+ lastSelected?: number;
18
+ };
19
+ }, {
20
+ metadata: Struct<{
21
+ name: string;
22
+ importTime: number;
23
+ keyring: {
24
+ type: string;
25
+ };
26
+ nameLastUpdatedAt?: number;
27
+ snap?: {
28
+ id: string;
29
+ name: string;
30
+ enabled: boolean;
31
+ };
32
+ lastSelected?: number;
33
+ }, {
34
+ name: Struct<string, null>;
35
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
36
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
37
+ id: string;
38
+ name: string;
39
+ enabled: boolean;
40
+ }, {
41
+ id: Struct<string, null>;
42
+ enabled: Struct<boolean, null>;
43
+ name: Struct<string, null>;
44
+ }>;
45
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
46
+ importTime: Struct<number, null>;
47
+ keyring: Struct<{
48
+ type: string;
49
+ }, {
50
+ type: Struct<string, null>;
51
+ }>;
52
+ }>;
53
+ }>;
54
+ export declare const InternalEthEoaAccountStruct: Struct<{
55
+ id: string;
56
+ 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
+ metadata: {
61
+ name: string;
62
+ importTime: number;
63
+ keyring: {
64
+ type: string;
65
+ };
66
+ nameLastUpdatedAt?: number;
67
+ snap?: {
68
+ id: string;
69
+ name: string;
70
+ enabled: boolean;
71
+ };
72
+ lastSelected?: number;
73
+ };
74
+ }, {
75
+ metadata: Struct<{
76
+ name: string;
77
+ importTime: number;
78
+ keyring: {
79
+ type: string;
80
+ };
81
+ nameLastUpdatedAt?: number;
82
+ snap?: {
83
+ id: string;
84
+ name: string;
85
+ enabled: boolean;
86
+ };
87
+ lastSelected?: number;
88
+ }, {
89
+ name: Struct<string, null>;
90
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
91
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
92
+ id: string;
93
+ name: string;
94
+ enabled: boolean;
95
+ }, {
96
+ id: Struct<string, null>;
97
+ enabled: Struct<boolean, null>;
98
+ name: Struct<string, null>;
99
+ }>;
100
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
101
+ importTime: Struct<number, null>;
102
+ keyring: Struct<{
103
+ type: string;
104
+ }, {
105
+ type: Struct<string, null>;
106
+ }>;
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", {
111
+ personal_sign: "personal_sign";
112
+ eth_sign: "eth_sign";
113
+ eth_signTransaction: "eth_signTransaction";
114
+ eth_signTypedData_v1: "eth_signTypedData_v1";
115
+ eth_signTypedData_v3: "eth_signTypedData_v3";
116
+ eth_signTypedData_v4: "eth_signTypedData_v4";
117
+ }>>;
118
+ id: import("@metamask/superstruct").Struct<string, null>;
119
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
120
+ }>;
121
+ export declare const InternalEthErc4337AccountStruct: Struct<{
122
+ id: string;
123
+ 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
+ metadata: {
128
+ name: string;
129
+ importTime: number;
130
+ keyring: {
131
+ type: string;
132
+ };
133
+ nameLastUpdatedAt?: number;
134
+ snap?: {
135
+ id: string;
136
+ name: string;
137
+ enabled: boolean;
138
+ };
139
+ lastSelected?: number;
140
+ };
141
+ }, {
142
+ metadata: Struct<{
143
+ name: string;
144
+ importTime: number;
145
+ keyring: {
146
+ type: string;
147
+ };
148
+ nameLastUpdatedAt?: number;
149
+ snap?: {
150
+ id: string;
151
+ name: string;
152
+ enabled: boolean;
153
+ };
154
+ lastSelected?: number;
155
+ }, {
156
+ name: Struct<string, null>;
157
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
158
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
159
+ id: string;
160
+ name: string;
161
+ enabled: boolean;
162
+ }, {
163
+ id: Struct<string, null>;
164
+ enabled: Struct<boolean, null>;
165
+ name: Struct<string, null>;
166
+ }>;
167
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
168
+ importTime: Struct<number, null>;
169
+ keyring: Struct<{
170
+ type: string;
171
+ }, {
172
+ type: Struct<string, null>;
173
+ }>;
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", {
178
+ personal_sign: "personal_sign";
179
+ eth_sign: "eth_sign";
180
+ eth_signTypedData_v1: "eth_signTypedData_v1";
181
+ eth_signTypedData_v3: "eth_signTypedData_v3";
182
+ eth_signTypedData_v4: "eth_signTypedData_v4";
183
+ eth_prepareUserOperation: "eth_prepareUserOperation";
184
+ eth_patchUserOperation: "eth_patchUserOperation";
185
+ eth_signUserOperation: "eth_signUserOperation";
186
+ }>>;
187
+ id: import("@metamask/superstruct").Struct<string, null>;
188
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
189
+ }>;
190
+ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
191
+ id: string;
192
+ options: Record<string, import("@metamask/utils").Json>;
193
+ type: "bip122:p2wpkh";
194
+ address: string;
195
+ methods: "sendBitcoin"[];
196
+ metadata: {
197
+ name: string;
198
+ importTime: number;
199
+ keyring: {
200
+ type: string;
201
+ };
202
+ nameLastUpdatedAt?: number;
203
+ snap?: {
204
+ id: string;
205
+ name: string;
206
+ enabled: boolean;
207
+ };
208
+ lastSelected?: number;
209
+ };
210
+ }, {
211
+ metadata: Struct<{
212
+ name: string;
213
+ importTime: number;
214
+ keyring: {
215
+ type: string;
216
+ };
217
+ nameLastUpdatedAt?: number;
218
+ snap?: {
219
+ id: string;
220
+ name: string;
221
+ enabled: boolean;
222
+ };
223
+ lastSelected?: number;
224
+ }, {
225
+ name: Struct<string, null>;
226
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
227
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
228
+ id: string;
229
+ name: string;
230
+ enabled: boolean;
231
+ }, {
232
+ id: Struct<string, null>;
233
+ enabled: Struct<boolean, null>;
234
+ name: Struct<string, null>;
235
+ }>;
236
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
237
+ importTime: Struct<number, null>;
238
+ keyring: Struct<{
239
+ type: string;
240
+ }, {
241
+ type: Struct<string, null>;
242
+ }>;
243
+ }>;
244
+ address: Struct<string, null>;
245
+ type: Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
246
+ methods: Struct<"sendBitcoin"[], Struct<"sendBitcoin", {
247
+ sendBitcoin: "sendBitcoin";
248
+ }>>;
249
+ id: import("@metamask/superstruct").Struct<string, null>;
250
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
251
+ }>;
252
+ export declare const InternalSolDataAccountStruct: Struct<{
253
+ id: string;
254
+ options: Record<string, import("@metamask/utils").Json>;
255
+ type: "solana:data-account";
256
+ address: string;
257
+ methods: "sendAndConfirmTransaction"[];
258
+ metadata: {
259
+ name: string;
260
+ importTime: number;
261
+ keyring: {
262
+ type: string;
263
+ };
264
+ nameLastUpdatedAt?: number;
265
+ snap?: {
266
+ id: string;
267
+ name: string;
268
+ enabled: boolean;
269
+ };
270
+ lastSelected?: number;
271
+ };
272
+ }, {
273
+ metadata: Struct<{
274
+ name: string;
275
+ importTime: number;
276
+ keyring: {
277
+ type: string;
278
+ };
279
+ nameLastUpdatedAt?: number;
280
+ snap?: {
281
+ id: string;
282
+ name: string;
283
+ enabled: boolean;
284
+ };
285
+ lastSelected?: number;
286
+ }, {
287
+ name: Struct<string, null>;
288
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
289
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
290
+ id: string;
291
+ name: string;
292
+ enabled: boolean;
293
+ }, {
294
+ id: Struct<string, null>;
295
+ enabled: Struct<boolean, null>;
296
+ name: Struct<string, null>;
297
+ }>;
298
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
299
+ importTime: Struct<number, null>;
300
+ keyring: Struct<{
301
+ type: string;
302
+ }, {
303
+ type: Struct<string, null>;
304
+ }>;
305
+ }>;
306
+ address: Struct<string, null>;
307
+ type: Struct<"solana:data-account", "solana:data-account">;
308
+ methods: Struct<"sendAndConfirmTransaction"[], Struct<"sendAndConfirmTransaction", {
309
+ sendAndConfirmTransaction: "sendAndConfirmTransaction";
310
+ }>>;
311
+ id: import("@metamask/superstruct").Struct<string, null>;
312
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
313
+ }>;
314
+ export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
315
+ export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
316
+ export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
317
+ export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
318
+ export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalSolDataAccount>>;
319
+ export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2wpkhAccount | InternalSolDataAccount;
320
+ export declare const InternalAccountStruct: Struct<{
321
+ id: string;
322
+ 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
+ metadata: {
327
+ name: string;
328
+ importTime: number;
329
+ keyring: {
330
+ type: string;
331
+ };
332
+ nameLastUpdatedAt?: number;
333
+ snap?: {
334
+ id: string;
335
+ name: string;
336
+ enabled: boolean;
337
+ };
338
+ lastSelected?: number;
339
+ };
340
+ }, {
341
+ metadata: Struct<{
342
+ name: string;
343
+ importTime: number;
344
+ keyring: {
345
+ type: string;
346
+ };
347
+ nameLastUpdatedAt?: number;
348
+ snap?: {
349
+ id: string;
350
+ name: string;
351
+ enabled: boolean;
352
+ };
353
+ lastSelected?: number;
354
+ }, {
355
+ name: Struct<string, null>;
356
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
357
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
358
+ id: string;
359
+ name: string;
360
+ enabled: boolean;
361
+ }, {
362
+ id: Struct<string, null>;
363
+ enabled: Struct<boolean, null>;
364
+ name: Struct<string, null>;
365
+ }>;
366
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
367
+ importTime: Struct<number, null>;
368
+ keyring: Struct<{
369
+ type: string;
370
+ }, {
371
+ type: Struct<string, null>;
372
+ }>;
373
+ }>;
374
+ id: import("@metamask/superstruct").Struct<string, null>;
375
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
376
+ "eip155:eoa": "eip155:eoa";
377
+ "eip155:erc4337": "eip155:erc4337";
378
+ "bip122:p2wpkh": "bip122:p2wpkh";
379
+ "solana:data-account": "solana:data-account";
380
+ }>;
381
+ address: import("@metamask/superstruct").Struct<string, null>;
382
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
383
+ methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
384
+ }>;
385
+ /**
386
+ * Internal account representation.
387
+ *
388
+ * This type is used internally by MetaMask to add additional metadata to the
389
+ * account object. It's should not be used by external applications.
390
+ */
391
+ export type InternalAccount = Infer<typeof InternalAccountStruct>;
392
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EACf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAO3D,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"}