-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsolana-keyring-accounts.ts
More file actions
273 lines (249 loc) · 9.08 KB
/
Copy pathsolana-keyring-accounts.ts
File metadata and controls
273 lines (249 loc) · 9.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
import { mnemonicPhraseToBytes } from '@metamask/key-tree';
import { SolMethod, SolScope } from '@metamask/keyring-api';
import type { SolanaKeyringAccount } from '../../../domain';
export const MOCK_SEED_PHRASE =
'sugar interest animal afford dog imitate relief lizard width strategy embark midnight';
export const MOCK_SEED_PHRASE_BYTES = mnemonicPhraseToBytes(MOCK_SEED_PHRASE);
export const MOCK_SEED_PHRASE_ENTROPY_SOURCE = '01JR0PQ12DKG65S4ZX6EEF5PZ2';
export const MOCK_SEED_PHRASE_2 =
'flight baby section trick minute clog jar swear oblige expect start unlock';
export const MOCK_SEED_PHRASE_2_BYTES =
mnemonicPhraseToBytes(MOCK_SEED_PHRASE_2);
export const MOCK_SEED_PHRASE_2_ENTROPY_SOURCE = '01JR0PT6PNGBN7MRM3MPEVQPC0';
/**
* Solana account scopes.
*/
export const ALL_SCOPES = [SolScope.Mainnet, SolScope.Testnet, SolScope.Devnet];
/**
* Mock Solana Keyring Accounts as they would actually be generated by the Solana Keyring when using seed phrase:
*
* sugar interest animal afford dog imitate relief lizard width strategy embark midnight
*/
export const MOCK_SOLANA_KEYRING_ACCOUNT_0: SolanaKeyringAccount = {
address: 'BLw3RweJmfbTapJRgnPRvd962YDjFYAnVGd1p5hmZ5tP',
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/0'/0'`,
index: 0,
type: 'solana:data-account',
id: '4b445722-6766-4f99-ade5-c2c9295f21d0',
options: {
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/0'/0'`,
index: 0,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_KEYRING_ACCOUNT_0_PRIVATE_KEY_BYTES = Uint8Array.from([
201, 78, 195, 68, 173, 217, 17, 236, 239, 65, 202, 20, 18, 250, 160, 56, 151,
150, 31, 187, 150, 2, 50, 207, 153, 155, 163, 236, 59, 134, 83, 102,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNT_0_PUBLIC_KEY_BYTES = Uint8Array.from([
0, 153, 176, 2, 143, 157, 158, 175, 50, 134, 226, 145, 237, 10, 87, 130, 63,
185, 200, 241, 76, 205, 92, 21, 136, 75, 157, 88, 79, 89, 248, 223, 116,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNT_1: SolanaKeyringAccount = {
address: 'FvS1p2dQnhWNrHyuVpJRU5mkYRkSTrubXHs4XrAn3PGo',
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/1'/0'`,
index: 1,
type: 'solana:data-account',
id: '123e4567-e89b-12d3-a456-426614174001',
options: {
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/1'/0'`,
index: 1,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_KEYRING_ACCOUNT_1_PRIVATE_KEY_BYTES = Uint8Array.from([
58, 174, 98, 154, 253, 237, 125, 206, 109, 159, 134, 239, 189, 179, 106, 243,
179, 3, 131, 173, 86, 94, 23, 72, 63, 239, 110, 125, 30, 210, 84, 194,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNT_2: SolanaKeyringAccount = {
address: '27h6cm6S9ag5y4ASi1a1vbTSKEsQMjEdfvZ6atPjmbuD',
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/2'/0'`,
index: 2,
type: 'solana:data-account',
id: '123e4567-e89b-12d3-a456-426614174002',
options: {
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/2'/0'`,
index: 2,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_KEYRING_ACCOUNT_2_PRIVATE_KEY_BYTES = Uint8Array.from([
217, 83, 246, 6, 62, 72, 189, 87, 62, 43, 66, 168, 205, 49, 195, 7, 119, 128,
101, 85, 226, 215, 67, 23, 223, 247, 240, 157, 111, 214, 41, 42,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNT_3: SolanaKeyringAccount = {
address: '3SYHDFbhoxuTCYCGRw7KSL8GbwUoByjtvyy7pUZeAhh8',
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/3'/0'`,
index: 3,
type: 'solana:data-account',
id: '123e4567-e89b-12d3-a456-426614174003',
options: {
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/3'/0'`,
index: 3,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_KEYRING_ACCOUNT_3_PRIVATE_KEY_BYTES = Uint8Array.from([
197, 249, 13, 144, 108, 95, 220, 46, 159, 169, 72, 221, 192, 106, 72, 127, 10,
3, 95, 186, 173, 83, 212, 239, 180, 41, 7, 213, 92, 250, 122, 122,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNT_4: SolanaKeyringAccount = {
address: 'FDUGdV6bjhvw5gbirXCvqbTSWK9999kcrZcrHoCQzXJK',
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/4'/0'`,
index: 4,
type: 'solana:data-account',
id: '123e4567-e89b-12d3-a456-426614174004',
options: {
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/4'/0'`,
index: 4,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_KEYRING_ACCOUNT_4_PRIVATE_KEY_BYTES = Uint8Array.from([
182, 222, 182, 183, 103, 56, 65, 161, 67, 188, 55, 244, 249, 208, 7, 60, 253,
87, 234, 231, 209, 140, 109, 175, 247, 42, 249, 9, 224, 62, 60, 54,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNT_5: SolanaKeyringAccount = {
address: 'GN1DST49kafBmRDnKKwUbR6nJWoqzSJBPoHwcTXzgmkH',
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/5'/0'`,
index: 5,
type: 'solana:data-account',
id: '123e4567-e89b-12d3-a456-426614174005',
options: {
entropySource: MOCK_SEED_PHRASE_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/5'/0'`,
index: 5,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_KEYRING_ACCOUNT_5_PRIVATE_KEY_BYTES = Uint8Array.from([
130, 137, 152, 17, 6, 45, 56, 235, 140, 148, 107, 75, 184, 175, 54, 227, 184,
27, 142, 254, 188, 4, 157, 96, 132, 101, 35, 165, 225, 205, 245, 102,
]);
export const MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_0: SolanaKeyringAccount =
{
entropySource: MOCK_SEED_PHRASE_2_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/0'/0'`,
index: 0,
id: '123e4567-e89b-12d3-a456-426614174006',
type: 'solana:data-account',
address: '8fi28SQKWhzCaH5c2RrHLbpgQJctNG6NFrfZyCj51rJX',
options: {
entropySource: MOCK_SEED_PHRASE_2_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/0'/0'`,
index: 0,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_0_PRIVATE_KEY_BYTES =
Uint8Array.from([
35, 162, 118, 171, 62, 232, 249, 151, 226, 117, 248, 5, 74, 33, 76, 163,
204, 43, 227, 179, 113, 233, 221, 254, 63, 233, 35, 17, 13, 116, 143, 32,
]);
export const MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_1: SolanaKeyringAccount =
{
entropySource: MOCK_SEED_PHRASE_2_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/1'/0'`,
index: 1,
id: '123e4567-e89b-12d3-a456-426614174007',
type: 'solana:data-account',
address: '4yQr5hGkYfXykkv8Q7YxAGBxkB9bd9ntLL7hJaz1tGTv',
options: {
entropySource: MOCK_SEED_PHRASE_2_ENTROPY_SOURCE,
derivationPath: `m/44'/501'/1'/0'`,
index: 1,
},
methods: [
SolMethod.SignAndSendTransaction,
SolMethod.SignTransaction,
SolMethod.SignMessage,
SolMethod.SignIn,
],
scopes: ALL_SCOPES,
};
export const MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_1_PRIVATE_KEY_BYTES =
Uint8Array.from([
242, 217, 241, 193, 39, 45, 61, 75, 78, 249, 46, 188, 251, 118, 33, 4, 86,
81, 250, 148, 246, 106, 109, 244, 62, 17, 240, 246, 147, 126, 37, 10,
]);
export const MOCK_SOLANA_KEYRING_ACCOUNTS = [
MOCK_SOLANA_KEYRING_ACCOUNT_0,
MOCK_SOLANA_KEYRING_ACCOUNT_1,
MOCK_SOLANA_KEYRING_ACCOUNT_2,
MOCK_SOLANA_KEYRING_ACCOUNT_3,
MOCK_SOLANA_KEYRING_ACCOUNT_4,
MOCK_SOLANA_KEYRING_ACCOUNT_5,
MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_0,
MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_1,
] as const;
export const MOCK_SOLANA_KEYRING_ACCOUNTS_PRIVATE_KEY_BYTES = {
[MOCK_SOLANA_KEYRING_ACCOUNT_0.id]:
MOCK_SOLANA_KEYRING_ACCOUNT_0_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_KEYRING_ACCOUNT_1.id]:
MOCK_SOLANA_KEYRING_ACCOUNT_1_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_KEYRING_ACCOUNT_2.id]:
MOCK_SOLANA_KEYRING_ACCOUNT_2_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_KEYRING_ACCOUNT_3.id]:
MOCK_SOLANA_KEYRING_ACCOUNT_3_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_KEYRING_ACCOUNT_4.id]:
MOCK_SOLANA_KEYRING_ACCOUNT_4_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_KEYRING_ACCOUNT_5.id]:
MOCK_SOLANA_KEYRING_ACCOUNT_5_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_0.id]:
MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_0_PRIVATE_KEY_BYTES,
[MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_1.id]:
MOCK_SOLANA_SEED_PHRASE_2_KEYRING_ACCOUNT_1_PRIVATE_KEY_BYTES,
} as const;