@metamask-previews/multichain-account-service 0.3.0-preview-0910ff0 → 0.3.0-preview-98faf75a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/MultichainAccountGroup.cjs +192 -0
- package/dist/MultichainAccountGroup.cjs.map +1 -0
- package/dist/MultichainAccountGroup.d.cts +84 -0
- package/dist/MultichainAccountGroup.d.cts.map +1 -0
- package/dist/MultichainAccountGroup.d.mts +84 -0
- package/dist/MultichainAccountGroup.d.mts.map +1 -0
- package/dist/MultichainAccountGroup.mjs +188 -0
- package/dist/MultichainAccountGroup.mjs.map +1 -0
- package/dist/MultichainAccountService.cjs +36 -23
- package/dist/MultichainAccountService.cjs.map +1 -1
- package/dist/MultichainAccountService.d.cts +26 -15
- package/dist/MultichainAccountService.d.cts.map +1 -1
- package/dist/MultichainAccountService.d.mts +26 -15
- package/dist/MultichainAccountService.d.mts.map +1 -1
- package/dist/MultichainAccountService.mjs +35 -22
- package/dist/MultichainAccountService.mjs.map +1 -1
- package/dist/MultichainAccountWallet.cjs +237 -0
- package/dist/MultichainAccountWallet.cjs.map +1 -0
- package/dist/MultichainAccountWallet.d.cts +91 -0
- package/dist/MultichainAccountWallet.d.cts.map +1 -0
- package/dist/MultichainAccountWallet.d.mts +91 -0
- package/dist/MultichainAccountWallet.d.mts.map +1 -0
- package/dist/MultichainAccountWallet.mjs +233 -0
- package/dist/MultichainAccountWallet.mjs.map +1 -0
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/providers/BaseAccountProvider.cjs +20 -1
- package/dist/providers/BaseAccountProvider.cjs.map +1 -1
- package/dist/providers/BaseAccountProvider.d.cts +25 -5
- package/dist/providers/BaseAccountProvider.d.cts.map +1 -1
- package/dist/providers/BaseAccountProvider.d.mts +25 -5
- package/dist/providers/BaseAccountProvider.d.mts.map +1 -1
- package/dist/providers/BaseAccountProvider.mjs +18 -0
- package/dist/providers/BaseAccountProvider.mjs.map +1 -1
- package/dist/providers/EvmAccountProvider.cjs +35 -0
- package/dist/providers/EvmAccountProvider.cjs.map +1 -1
- package/dist/providers/EvmAccountProvider.d.cts +66 -0
- package/dist/providers/EvmAccountProvider.d.cts.map +1 -1
- package/dist/providers/EvmAccountProvider.d.mts +66 -0
- package/dist/providers/EvmAccountProvider.d.mts.map +1 -1
- package/dist/providers/EvmAccountProvider.mjs +36 -1
- package/dist/providers/EvmAccountProvider.mjs.map +1 -1
- package/dist/providers/SolAccountProvider.cjs +35 -0
- package/dist/providers/SolAccountProvider.cjs.map +1 -1
- package/dist/providers/SolAccountProvider.d.cts +27 -1
- package/dist/providers/SolAccountProvider.d.cts.map +1 -1
- package/dist/providers/SolAccountProvider.d.mts +27 -1
- package/dist/providers/SolAccountProvider.d.mts.map +1 -1
- package/dist/providers/SolAccountProvider.mjs +37 -2
- package/dist/providers/SolAccountProvider.mjs.map +1 -1
- package/dist/tests/accounts.cjs +89 -4
- package/dist/tests/accounts.cjs.map +1 -1
- package/dist/tests/accounts.d.cts +235 -36
- package/dist/tests/accounts.d.cts.map +1 -1
- package/dist/tests/accounts.d.mts +235 -36
- package/dist/tests/accounts.d.mts.map +1 -1
- package/dist/tests/accounts.mjs +89 -4
- package/dist/tests/accounts.mjs.map +1 -1
- package/dist/tests/index.cjs +1 -0
- package/dist/tests/index.cjs.map +1 -1
- package/dist/tests/index.d.cts +1 -0
- package/dist/tests/index.d.cts.map +1 -1
- package/dist/tests/index.d.mts +1 -0
- package/dist/tests/index.d.mts.map +1 -1
- package/dist/tests/index.mjs +1 -0
- package/dist/tests/index.mjs.map +1 -1
- package/dist/tests/providers.cjs +28 -0
- package/dist/tests/providers.cjs.map +1 -0
- package/dist/tests/providers.d.cts +16 -0
- package/dist/tests/providers.d.cts.map +1 -0
- package/dist/tests/providers.d.mts +16 -0
- package/dist/tests/providers.d.mts.map +1 -0
- package/dist/tests/providers.mjs +23 -0
- package/dist/tests/providers.mjs.map +1 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +11 -7
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +11 -7
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +7 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Bip44Account } from "@metamask/account-api";
|
|
2
|
+
import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
|
|
2
3
|
import { KeyringTypes } from "@metamask/keyring-controller";
|
|
3
4
|
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
4
5
|
export declare const MOCK_SNAP_1: {
|
|
@@ -35,49 +36,247 @@ export declare const MOCK_HD_KEYRING_2: {
|
|
|
35
36
|
};
|
|
36
37
|
accounts: string[];
|
|
37
38
|
};
|
|
38
|
-
export declare const MOCK_HD_ACCOUNT_1: InternalAccount
|
|
39
|
-
export declare const MOCK_HD_ACCOUNT_2: InternalAccount
|
|
40
|
-
export declare const
|
|
39
|
+
export declare const MOCK_HD_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
40
|
+
export declare const MOCK_HD_ACCOUNT_2: Bip44Account<InternalAccount>;
|
|
41
|
+
export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
42
|
+
export declare const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
43
|
+
export declare const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
44
|
+
export declare const MOCK_SNAP_ACCOUNT_1: Bip44Account<{
|
|
45
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
46
|
+
id: string;
|
|
47
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
48
|
+
entropy?: {
|
|
49
|
+
type: "mnemonic";
|
|
50
|
+
id: string;
|
|
51
|
+
derivationPath: string;
|
|
52
|
+
groupIndex: number;
|
|
53
|
+
} | {
|
|
54
|
+
type: "private-key";
|
|
55
|
+
} | undefined;
|
|
56
|
+
exportable?: boolean | undefined;
|
|
57
|
+
};
|
|
58
|
+
metadata: {
|
|
59
|
+
name: string;
|
|
60
|
+
importTime: number;
|
|
61
|
+
keyring: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
nameLastUpdatedAt?: number | undefined;
|
|
65
|
+
snap?: {
|
|
66
|
+
name: string;
|
|
67
|
+
id: string;
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
} | undefined;
|
|
70
|
+
lastSelected?: number | undefined;
|
|
71
|
+
};
|
|
72
|
+
address: string;
|
|
73
|
+
scopes: `${string}:${string}`[];
|
|
74
|
+
methods: string[];
|
|
75
|
+
}>;
|
|
41
76
|
export declare const MOCK_SNAP_ACCOUNT_2: InternalAccount;
|
|
77
|
+
export declare const MOCK_SNAP_ACCOUNT_3: Bip44Account<{
|
|
78
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
79
|
+
id: string;
|
|
80
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
81
|
+
entropy?: {
|
|
82
|
+
type: "mnemonic";
|
|
83
|
+
id: string;
|
|
84
|
+
derivationPath: string;
|
|
85
|
+
groupIndex: number;
|
|
86
|
+
} | {
|
|
87
|
+
type: "private-key";
|
|
88
|
+
} | undefined;
|
|
89
|
+
exportable?: boolean | undefined;
|
|
90
|
+
};
|
|
91
|
+
metadata: {
|
|
92
|
+
name: string;
|
|
93
|
+
importTime: number;
|
|
94
|
+
keyring: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
nameLastUpdatedAt?: number | undefined;
|
|
98
|
+
snap?: {
|
|
99
|
+
name: string;
|
|
100
|
+
id: string;
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
} | undefined;
|
|
103
|
+
lastSelected?: number | undefined;
|
|
104
|
+
};
|
|
105
|
+
address: string;
|
|
106
|
+
scopes: `${string}:${string}`[];
|
|
107
|
+
methods: string[];
|
|
108
|
+
}>;
|
|
109
|
+
export declare const MOCK_SNAP_ACCOUNT_4: Bip44Account<{
|
|
110
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
111
|
+
id: string;
|
|
112
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
113
|
+
entropy?: {
|
|
114
|
+
type: "mnemonic";
|
|
115
|
+
id: string;
|
|
116
|
+
derivationPath: string;
|
|
117
|
+
groupIndex: number;
|
|
118
|
+
} | {
|
|
119
|
+
type: "private-key";
|
|
120
|
+
} | undefined;
|
|
121
|
+
exportable?: boolean | undefined;
|
|
122
|
+
};
|
|
123
|
+
metadata: {
|
|
124
|
+
name: string;
|
|
125
|
+
importTime: number;
|
|
126
|
+
keyring: {
|
|
127
|
+
type: string;
|
|
128
|
+
};
|
|
129
|
+
nameLastUpdatedAt?: number | undefined;
|
|
130
|
+
snap?: {
|
|
131
|
+
name: string;
|
|
132
|
+
id: string;
|
|
133
|
+
enabled: boolean;
|
|
134
|
+
} | undefined;
|
|
135
|
+
lastSelected?: number | undefined;
|
|
136
|
+
};
|
|
137
|
+
address: string;
|
|
138
|
+
scopes: `${string}:${string}`[];
|
|
139
|
+
methods: string[];
|
|
140
|
+
}>;
|
|
42
141
|
export declare const MOCK_HARDWARE_ACCOUNT_1: InternalAccount;
|
|
43
|
-
export declare class MockAccountBuilder {
|
|
142
|
+
export declare class MockAccountBuilder<Account extends KeyringAccount> {
|
|
44
143
|
#private;
|
|
45
|
-
constructor(account:
|
|
46
|
-
static from(account:
|
|
144
|
+
constructor(account: Account);
|
|
145
|
+
static from<Account extends KeyringAccount>(account: Account): MockAccountBuilder<Account>;
|
|
47
146
|
withId(id: InternalAccount['id']): this;
|
|
147
|
+
withUuid(): this;
|
|
148
|
+
withAddressSuffix(suffix: string): this;
|
|
48
149
|
withEntropySource(entropySource: EntropySourceId): this;
|
|
49
150
|
withGroupIndex(groupIndex: number): this;
|
|
50
|
-
get():
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
151
|
+
get(): Account;
|
|
152
|
+
}
|
|
153
|
+
export declare const MOCK_WALLET_1_ENTROPY_SOURCE = "mock-keyring-id-1";
|
|
154
|
+
export declare const MOCK_WALLET_1_EVM_ACCOUNT: Bip44Account<{
|
|
155
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
156
|
+
id: string;
|
|
157
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
158
|
+
entropy?: {
|
|
159
|
+
type: "mnemonic";
|
|
160
|
+
id: string;
|
|
161
|
+
derivationPath: string;
|
|
162
|
+
groupIndex: number;
|
|
163
|
+
} | {
|
|
164
|
+
type: "private-key";
|
|
165
|
+
} | undefined;
|
|
166
|
+
exportable?: boolean | undefined;
|
|
167
|
+
};
|
|
168
|
+
metadata: {
|
|
169
|
+
name: string;
|
|
170
|
+
importTime: number;
|
|
171
|
+
keyring: {
|
|
172
|
+
type: string;
|
|
63
173
|
};
|
|
64
|
-
|
|
174
|
+
nameLastUpdatedAt?: number | undefined;
|
|
175
|
+
snap?: {
|
|
65
176
|
name: string;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
177
|
+
id: string;
|
|
178
|
+
enabled: boolean;
|
|
179
|
+
} | undefined;
|
|
180
|
+
lastSelected?: number | undefined;
|
|
181
|
+
};
|
|
182
|
+
address: string;
|
|
183
|
+
scopes: `${string}:${string}`[];
|
|
184
|
+
methods: string[];
|
|
185
|
+
}>;
|
|
186
|
+
export declare const MOCK_WALLET_1_SOL_ACCOUNT: Bip44Account<{
|
|
187
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
188
|
+
id: string;
|
|
189
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
190
|
+
entropy?: {
|
|
191
|
+
type: "mnemonic";
|
|
192
|
+
id: string;
|
|
193
|
+
derivationPath: string;
|
|
194
|
+
groupIndex: number;
|
|
195
|
+
} | {
|
|
196
|
+
type: "private-key";
|
|
197
|
+
} | undefined;
|
|
198
|
+
exportable?: boolean | undefined;
|
|
199
|
+
};
|
|
200
|
+
metadata: {
|
|
201
|
+
name: string;
|
|
202
|
+
importTime: number;
|
|
203
|
+
keyring: {
|
|
204
|
+
type: string;
|
|
77
205
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
206
|
+
nameLastUpdatedAt?: number | undefined;
|
|
207
|
+
snap?: {
|
|
208
|
+
name: string;
|
|
209
|
+
id: string;
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
} | undefined;
|
|
212
|
+
lastSelected?: number | undefined;
|
|
81
213
|
};
|
|
82
|
-
|
|
214
|
+
address: string;
|
|
215
|
+
scopes: `${string}:${string}`[];
|
|
216
|
+
methods: string[];
|
|
217
|
+
}>;
|
|
218
|
+
export declare const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT: Bip44Account<{
|
|
219
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
220
|
+
id: string;
|
|
221
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
222
|
+
entropy?: {
|
|
223
|
+
type: "mnemonic";
|
|
224
|
+
id: string;
|
|
225
|
+
derivationPath: string;
|
|
226
|
+
groupIndex: number;
|
|
227
|
+
} | {
|
|
228
|
+
type: "private-key";
|
|
229
|
+
} | undefined;
|
|
230
|
+
exportable?: boolean | undefined;
|
|
231
|
+
};
|
|
232
|
+
metadata: {
|
|
233
|
+
name: string;
|
|
234
|
+
importTime: number;
|
|
235
|
+
keyring: {
|
|
236
|
+
type: string;
|
|
237
|
+
};
|
|
238
|
+
nameLastUpdatedAt?: number | undefined;
|
|
239
|
+
snap?: {
|
|
240
|
+
name: string;
|
|
241
|
+
id: string;
|
|
242
|
+
enabled: boolean;
|
|
243
|
+
} | undefined;
|
|
244
|
+
lastSelected?: number | undefined;
|
|
245
|
+
};
|
|
246
|
+
address: string;
|
|
247
|
+
scopes: `${string}:${string}`[];
|
|
248
|
+
methods: string[];
|
|
249
|
+
}>;
|
|
250
|
+
export declare const MOCK_WALLET_1_BTC_P2TR_ACCOUNT: Bip44Account<{
|
|
251
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
252
|
+
id: string;
|
|
253
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
254
|
+
entropy?: {
|
|
255
|
+
type: "mnemonic";
|
|
256
|
+
id: string;
|
|
257
|
+
derivationPath: string;
|
|
258
|
+
groupIndex: number;
|
|
259
|
+
} | {
|
|
260
|
+
type: "private-key";
|
|
261
|
+
} | undefined;
|
|
262
|
+
exportable?: boolean | undefined;
|
|
263
|
+
};
|
|
264
|
+
metadata: {
|
|
265
|
+
name: string;
|
|
266
|
+
importTime: number;
|
|
267
|
+
keyring: {
|
|
268
|
+
type: string;
|
|
269
|
+
};
|
|
270
|
+
nameLastUpdatedAt?: number | undefined;
|
|
271
|
+
snap?: {
|
|
272
|
+
name: string;
|
|
273
|
+
id: string;
|
|
274
|
+
enabled: boolean;
|
|
275
|
+
} | undefined;
|
|
276
|
+
lastSelected?: number | undefined;
|
|
277
|
+
};
|
|
278
|
+
address: string;
|
|
279
|
+
scopes: `${string}:${string}`[];
|
|
280
|
+
methods: string[];
|
|
281
|
+
}>;
|
|
83
282
|
//# sourceMappingURL=accounts.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.cts","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accounts.d.cts","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,8BAA8B;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,8BAA8B;AAa7E,OAAO,EAAE,YAAY,EAAE,qCAAqC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AActE,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,iBAAiB;;;;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,eAAe,CAqB3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,eAAe,CAqB3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,eAAe,CAsB5D,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,eAAe,CA2BnE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,eAAe,CA2BjE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqB,CAAC;AAEtD,eAAO,MAAM,mBAAmB,EAAE,eAcjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAC;AAC7D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0B,CAAC;AAE3D,eAAO,MAAM,uBAAuB,EAAE,eAarC,CAAC;AAEF,qBAAa,kBAAkB,CAAC,OAAO,SAAS,cAAc;;gBAGhD,OAAO,EAAE,OAAO;IAK5B,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,cAAc,EACxC,OAAO,EAAE,OAAO,GACf,kBAAkB,CAAC,OAAO,CAAC;IAI9B,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;IAKhC,QAAQ;IAKR,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAKhC,iBAAiB,CAAC,aAAa,EAAE,eAAe;IAOhD,cAAc,CAAC,UAAU,EAAE,MAAM;IAOjC,GAAG;CAGJ;AAED,eAAO,MAAM,4BAA4B,sBAAwB,CAAC;AAElE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AACT,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AACT,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKrC,CAAC;AACT,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKnC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Bip44Account } from "@metamask/account-api";
|
|
2
|
+
import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
|
|
2
3
|
import { KeyringTypes } from "@metamask/keyring-controller";
|
|
3
4
|
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
4
5
|
export declare const MOCK_SNAP_1: {
|
|
@@ -35,49 +36,247 @@ export declare const MOCK_HD_KEYRING_2: {
|
|
|
35
36
|
};
|
|
36
37
|
accounts: string[];
|
|
37
38
|
};
|
|
38
|
-
export declare const MOCK_HD_ACCOUNT_1: InternalAccount
|
|
39
|
-
export declare const MOCK_HD_ACCOUNT_2: InternalAccount
|
|
40
|
-
export declare const
|
|
39
|
+
export declare const MOCK_HD_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
40
|
+
export declare const MOCK_HD_ACCOUNT_2: Bip44Account<InternalAccount>;
|
|
41
|
+
export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
42
|
+
export declare const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
43
|
+
export declare const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<InternalAccount>;
|
|
44
|
+
export declare const MOCK_SNAP_ACCOUNT_1: Bip44Account<{
|
|
45
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
46
|
+
id: string;
|
|
47
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
48
|
+
entropy?: {
|
|
49
|
+
type: "mnemonic";
|
|
50
|
+
id: string;
|
|
51
|
+
derivationPath: string;
|
|
52
|
+
groupIndex: number;
|
|
53
|
+
} | {
|
|
54
|
+
type: "private-key";
|
|
55
|
+
} | undefined;
|
|
56
|
+
exportable?: boolean | undefined;
|
|
57
|
+
};
|
|
58
|
+
metadata: {
|
|
59
|
+
name: string;
|
|
60
|
+
importTime: number;
|
|
61
|
+
keyring: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
nameLastUpdatedAt?: number | undefined;
|
|
65
|
+
snap?: {
|
|
66
|
+
name: string;
|
|
67
|
+
id: string;
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
} | undefined;
|
|
70
|
+
lastSelected?: number | undefined;
|
|
71
|
+
};
|
|
72
|
+
address: string;
|
|
73
|
+
scopes: `${string}:${string}`[];
|
|
74
|
+
methods: string[];
|
|
75
|
+
}>;
|
|
41
76
|
export declare const MOCK_SNAP_ACCOUNT_2: InternalAccount;
|
|
77
|
+
export declare const MOCK_SNAP_ACCOUNT_3: Bip44Account<{
|
|
78
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
79
|
+
id: string;
|
|
80
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
81
|
+
entropy?: {
|
|
82
|
+
type: "mnemonic";
|
|
83
|
+
id: string;
|
|
84
|
+
derivationPath: string;
|
|
85
|
+
groupIndex: number;
|
|
86
|
+
} | {
|
|
87
|
+
type: "private-key";
|
|
88
|
+
} | undefined;
|
|
89
|
+
exportable?: boolean | undefined;
|
|
90
|
+
};
|
|
91
|
+
metadata: {
|
|
92
|
+
name: string;
|
|
93
|
+
importTime: number;
|
|
94
|
+
keyring: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
nameLastUpdatedAt?: number | undefined;
|
|
98
|
+
snap?: {
|
|
99
|
+
name: string;
|
|
100
|
+
id: string;
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
} | undefined;
|
|
103
|
+
lastSelected?: number | undefined;
|
|
104
|
+
};
|
|
105
|
+
address: string;
|
|
106
|
+
scopes: `${string}:${string}`[];
|
|
107
|
+
methods: string[];
|
|
108
|
+
}>;
|
|
109
|
+
export declare const MOCK_SNAP_ACCOUNT_4: Bip44Account<{
|
|
110
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
111
|
+
id: string;
|
|
112
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
113
|
+
entropy?: {
|
|
114
|
+
type: "mnemonic";
|
|
115
|
+
id: string;
|
|
116
|
+
derivationPath: string;
|
|
117
|
+
groupIndex: number;
|
|
118
|
+
} | {
|
|
119
|
+
type: "private-key";
|
|
120
|
+
} | undefined;
|
|
121
|
+
exportable?: boolean | undefined;
|
|
122
|
+
};
|
|
123
|
+
metadata: {
|
|
124
|
+
name: string;
|
|
125
|
+
importTime: number;
|
|
126
|
+
keyring: {
|
|
127
|
+
type: string;
|
|
128
|
+
};
|
|
129
|
+
nameLastUpdatedAt?: number | undefined;
|
|
130
|
+
snap?: {
|
|
131
|
+
name: string;
|
|
132
|
+
id: string;
|
|
133
|
+
enabled: boolean;
|
|
134
|
+
} | undefined;
|
|
135
|
+
lastSelected?: number | undefined;
|
|
136
|
+
};
|
|
137
|
+
address: string;
|
|
138
|
+
scopes: `${string}:${string}`[];
|
|
139
|
+
methods: string[];
|
|
140
|
+
}>;
|
|
42
141
|
export declare const MOCK_HARDWARE_ACCOUNT_1: InternalAccount;
|
|
43
|
-
export declare class MockAccountBuilder {
|
|
142
|
+
export declare class MockAccountBuilder<Account extends KeyringAccount> {
|
|
44
143
|
#private;
|
|
45
|
-
constructor(account:
|
|
46
|
-
static from(account:
|
|
144
|
+
constructor(account: Account);
|
|
145
|
+
static from<Account extends KeyringAccount>(account: Account): MockAccountBuilder<Account>;
|
|
47
146
|
withId(id: InternalAccount['id']): this;
|
|
147
|
+
withUuid(): this;
|
|
148
|
+
withAddressSuffix(suffix: string): this;
|
|
48
149
|
withEntropySource(entropySource: EntropySourceId): this;
|
|
49
150
|
withGroupIndex(groupIndex: number): this;
|
|
50
|
-
get():
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
151
|
+
get(): Account;
|
|
152
|
+
}
|
|
153
|
+
export declare const MOCK_WALLET_1_ENTROPY_SOURCE = "mock-keyring-id-1";
|
|
154
|
+
export declare const MOCK_WALLET_1_EVM_ACCOUNT: Bip44Account<{
|
|
155
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
156
|
+
id: string;
|
|
157
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
158
|
+
entropy?: {
|
|
159
|
+
type: "mnemonic";
|
|
160
|
+
id: string;
|
|
161
|
+
derivationPath: string;
|
|
162
|
+
groupIndex: number;
|
|
163
|
+
} | {
|
|
164
|
+
type: "private-key";
|
|
165
|
+
} | undefined;
|
|
166
|
+
exportable?: boolean | undefined;
|
|
167
|
+
};
|
|
168
|
+
metadata: {
|
|
169
|
+
name: string;
|
|
170
|
+
importTime: number;
|
|
171
|
+
keyring: {
|
|
172
|
+
type: string;
|
|
63
173
|
};
|
|
64
|
-
|
|
174
|
+
nameLastUpdatedAt?: number | undefined;
|
|
175
|
+
snap?: {
|
|
65
176
|
name: string;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
177
|
+
id: string;
|
|
178
|
+
enabled: boolean;
|
|
179
|
+
} | undefined;
|
|
180
|
+
lastSelected?: number | undefined;
|
|
181
|
+
};
|
|
182
|
+
address: string;
|
|
183
|
+
scopes: `${string}:${string}`[];
|
|
184
|
+
methods: string[];
|
|
185
|
+
}>;
|
|
186
|
+
export declare const MOCK_WALLET_1_SOL_ACCOUNT: Bip44Account<{
|
|
187
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
188
|
+
id: string;
|
|
189
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
190
|
+
entropy?: {
|
|
191
|
+
type: "mnemonic";
|
|
192
|
+
id: string;
|
|
193
|
+
derivationPath: string;
|
|
194
|
+
groupIndex: number;
|
|
195
|
+
} | {
|
|
196
|
+
type: "private-key";
|
|
197
|
+
} | undefined;
|
|
198
|
+
exportable?: boolean | undefined;
|
|
199
|
+
};
|
|
200
|
+
metadata: {
|
|
201
|
+
name: string;
|
|
202
|
+
importTime: number;
|
|
203
|
+
keyring: {
|
|
204
|
+
type: string;
|
|
77
205
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
206
|
+
nameLastUpdatedAt?: number | undefined;
|
|
207
|
+
snap?: {
|
|
208
|
+
name: string;
|
|
209
|
+
id: string;
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
} | undefined;
|
|
212
|
+
lastSelected?: number | undefined;
|
|
81
213
|
};
|
|
82
|
-
|
|
214
|
+
address: string;
|
|
215
|
+
scopes: `${string}:${string}`[];
|
|
216
|
+
methods: string[];
|
|
217
|
+
}>;
|
|
218
|
+
export declare const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT: Bip44Account<{
|
|
219
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
220
|
+
id: string;
|
|
221
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
222
|
+
entropy?: {
|
|
223
|
+
type: "mnemonic";
|
|
224
|
+
id: string;
|
|
225
|
+
derivationPath: string;
|
|
226
|
+
groupIndex: number;
|
|
227
|
+
} | {
|
|
228
|
+
type: "private-key";
|
|
229
|
+
} | undefined;
|
|
230
|
+
exportable?: boolean | undefined;
|
|
231
|
+
};
|
|
232
|
+
metadata: {
|
|
233
|
+
name: string;
|
|
234
|
+
importTime: number;
|
|
235
|
+
keyring: {
|
|
236
|
+
type: string;
|
|
237
|
+
};
|
|
238
|
+
nameLastUpdatedAt?: number | undefined;
|
|
239
|
+
snap?: {
|
|
240
|
+
name: string;
|
|
241
|
+
id: string;
|
|
242
|
+
enabled: boolean;
|
|
243
|
+
} | undefined;
|
|
244
|
+
lastSelected?: number | undefined;
|
|
245
|
+
};
|
|
246
|
+
address: string;
|
|
247
|
+
scopes: `${string}:${string}`[];
|
|
248
|
+
methods: string[];
|
|
249
|
+
}>;
|
|
250
|
+
export declare const MOCK_WALLET_1_BTC_P2TR_ACCOUNT: Bip44Account<{
|
|
251
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
|
|
252
|
+
id: string;
|
|
253
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
254
|
+
entropy?: {
|
|
255
|
+
type: "mnemonic";
|
|
256
|
+
id: string;
|
|
257
|
+
derivationPath: string;
|
|
258
|
+
groupIndex: number;
|
|
259
|
+
} | {
|
|
260
|
+
type: "private-key";
|
|
261
|
+
} | undefined;
|
|
262
|
+
exportable?: boolean | undefined;
|
|
263
|
+
};
|
|
264
|
+
metadata: {
|
|
265
|
+
name: string;
|
|
266
|
+
importTime: number;
|
|
267
|
+
keyring: {
|
|
268
|
+
type: string;
|
|
269
|
+
};
|
|
270
|
+
nameLastUpdatedAt?: number | undefined;
|
|
271
|
+
snap?: {
|
|
272
|
+
name: string;
|
|
273
|
+
id: string;
|
|
274
|
+
enabled: boolean;
|
|
275
|
+
} | undefined;
|
|
276
|
+
lastSelected?: number | undefined;
|
|
277
|
+
};
|
|
278
|
+
address: string;
|
|
279
|
+
scopes: `${string}:${string}`[];
|
|
280
|
+
methods: string[];
|
|
281
|
+
}>;
|
|
83
282
|
//# sourceMappingURL=accounts.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,8BAA8B;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,8BAA8B;AAa7E,OAAO,EAAE,YAAY,EAAE,qCAAqC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AActE,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,iBAAiB;;;;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,eAAe,CAqB3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,eAAe,CAqB3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,eAAe,CAsB5D,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,eAAe,CA2BnE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,eAAe,CA2BjE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqB,CAAC;AAEtD,eAAO,MAAM,mBAAmB,EAAE,eAcjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAC;AAC7D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0B,CAAC;AAE3D,eAAO,MAAM,uBAAuB,EAAE,eAarC,CAAC;AAEF,qBAAa,kBAAkB,CAAC,OAAO,SAAS,cAAc;;gBAGhD,OAAO,EAAE,OAAO;IAK5B,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,cAAc,EACxC,OAAO,EAAE,OAAO,GACf,kBAAkB,CAAC,OAAO,CAAC;IAI9B,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;IAKhC,QAAQ;IAKR,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAKhC,iBAAiB,CAAC,aAAa,EAAE,eAAe;IAOhD,cAAc,CAAC,UAAU,EAAE,MAAM;IAOjC,GAAG;CAGJ;AAED,eAAO,MAAM,4BAA4B,sBAAwB,CAAC;AAElE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AACT,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AACT,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKrC,CAAC;AACT,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKnC,CAAC"}
|