@ledgerhq/vault-common 2.1.1 → 2.1.2

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 (42) hide show
  1. package/.turbo/turbo-build.log +20 -60
  2. package/CHANGELOG.md +6 -0
  3. package/package.json +8 -9
  4. package/tsup.config.ts +1 -1
  5. package/lib/chunk-54MXA3ZY.mjs +0 -14
  6. package/lib/chunk-54MXA3ZY.mjs.map +0 -1
  7. package/lib/chunk-6TT6A6YA.mjs +0 -1176
  8. package/lib/chunk-6TT6A6YA.mjs.map +0 -1
  9. package/lib/chunk-HU7O2ZFW.mjs +0 -249
  10. package/lib/chunk-HU7O2ZFW.mjs.map +0 -1
  11. package/lib/chunk-J5LGTIGS.mjs +0 -10
  12. package/lib/chunk-J5LGTIGS.mjs.map +0 -1
  13. package/lib/chunk-MNUHUKY3.mjs +0 -503
  14. package/lib/chunk-MNUHUKY3.mjs.map +0 -1
  15. package/lib/chunk-QNNV5GBH.mjs +0 -1261
  16. package/lib/chunk-QNNV5GBH.mjs.map +0 -1
  17. package/lib/chunk-VOB7PA3G.mjs +0 -97
  18. package/lib/chunk-VOB7PA3G.mjs.map +0 -1
  19. package/lib/chunk-ZJCMYPBL.mjs +0 -83
  20. package/lib/chunk-ZJCMYPBL.mjs.map +0 -1
  21. package/lib/createHSMBridge.d.mts +0 -27
  22. package/lib/createHSMBridge.mjs +0 -10
  23. package/lib/createHSMBridge.mjs.map +0 -1
  24. package/lib/crypto/utils.d.mts +0 -14
  25. package/lib/crypto/utils.mjs +0 -12
  26. package/lib/crypto/utils.mjs.map +0 -1
  27. package/lib/index-Cm_O9VIx.d.mts +0 -2010
  28. package/lib/index.d.mts +0 -161
  29. package/lib/index.mjs +0 -3252
  30. package/lib/index.mjs.map +0 -1
  31. package/lib/recipeManifest.d.mts +0 -6
  32. package/lib/recipeManifest.mjs +0 -11
  33. package/lib/recipeManifest.mjs.map +0 -1
  34. package/lib/reviewAPIRequest.d.mts +0 -20
  35. package/lib/reviewAPIRequest.mjs +0 -11
  36. package/lib/reviewAPIRequest.mjs.map +0 -1
  37. package/lib/types/index.d.mts +0 -6
  38. package/lib/types/index.mjs +0 -10
  39. package/lib/types/index.mjs.map +0 -1
  40. package/lib/utils.d.mts +0 -29
  41. package/lib/utils.mjs +0 -38
  42. package/lib/utils.mjs.map +0 -1
@@ -1,1261 +0,0 @@
1
- // src/utils.ts
2
- import { BigNumber } from "bignumber.js";
3
- import bs58 from "bs58";
4
-
5
- // src/currencies.ts
6
- import {
7
- getCryptoCurrencyById as byId,
8
- listCryptoCurrencies as listCC
9
- } from "@ledgerhq/cryptoassets/lib/currencies";
10
- var vaultCoins = [
11
- {
12
- type: "CryptoCurrency",
13
- // @ts-expect-error
14
- id: "sonic",
15
- coinType: 60,
16
- name: "Sonic",
17
- managerAppName: "Sonic",
18
- ticker: "S",
19
- countervalueTicker: "S",
20
- scheme: "sonic",
21
- color: "#FE7823",
22
- family: "evm",
23
- ethereumLikeInfo: {
24
- // @ts-expect-error
25
- baseChain: "mainnet",
26
- chainId: 146,
27
- networkId: 146
28
- },
29
- units: [
30
- {
31
- name: "S",
32
- code: "S",
33
- magnitude: 18
34
- }
35
- ],
36
- explorerViews: [
37
- {
38
- tx: "https://sonicscan.org/tx/$hash",
39
- address: "https://sonicscan.org/address/$address",
40
- token: "https://sonicscan.org/token/$address"
41
- }
42
- ]
43
- },
44
- {
45
- type: "CryptoCurrency",
46
- // @ts-expect-error
47
- id: "mantle",
48
- coinType: 60,
49
- name: "Mantle",
50
- managerAppName: "Mantle",
51
- ticker: "MNT",
52
- countervalueTicker: "MNT",
53
- scheme: "mantle",
54
- color: "#003827",
55
- family: "evm",
56
- ethereumLikeInfo: {
57
- // @ts-expect-error
58
- baseChain: "mainnet",
59
- chainId: 5e3,
60
- networkId: 5e3
61
- },
62
- units: [
63
- {
64
- name: "MNT",
65
- code: "MNT",
66
- magnitude: 18
67
- }
68
- ],
69
- explorerViews: [
70
- {
71
- tx: "https://https://explorer.mantle.xyz/tx/$hash",
72
- address: "https://https://explorer.mantle.xyz/address/$address",
73
- token: "https://explorer.mantle.xyz/token/$address"
74
- }
75
- ]
76
- },
77
- {
78
- type: "CryptoCurrency",
79
- // @ts-expect-error
80
- id: "viction",
81
- coinType: 60,
82
- name: "Viction",
83
- managerAppName: "Viction",
84
- ticker: "VIC",
85
- countervalueTicker: "VIC",
86
- scheme: "viction",
87
- color: "#101010",
88
- family: "evm",
89
- ethereumLikeInfo: {
90
- // @ts-expect-error
91
- baseChain: "mainnet",
92
- chainId: 88,
93
- networkId: 88
94
- },
95
- units: [
96
- {
97
- name: "VIC",
98
- code: "VIC",
99
- magnitude: 18
100
- }
101
- ],
102
- explorerViews: [
103
- {
104
- tx: "https://vicscan.xyz/tx/$hash",
105
- address: "https://vicscan.xyz/address/$address",
106
- token: "https://vicscan.xyz/token/$address"
107
- }
108
- ]
109
- },
110
- {
111
- type: "CryptoCurrency",
112
- // @ts-expect-error
113
- id: "viction_testnet",
114
- coinType: 60,
115
- name: "VictionTestnet",
116
- managerAppName: "VictionTestnet",
117
- ticker: "tVIC",
118
- countervalueTicker: "tVIC",
119
- scheme: "viction_testnet",
120
- color: "#A020F0",
121
- family: "evm",
122
- ethereumLikeInfo: {
123
- // @ts-expect-error
124
- baseChain: "testnet",
125
- chainId: 89,
126
- networkId: 89
127
- },
128
- units: [
129
- {
130
- name: "tVIC",
131
- code: "tVIC",
132
- magnitude: 18
133
- }
134
- ],
135
- explorerViews: [
136
- {
137
- tx: "https://testnet.vicscan.xyz/tx/$hash",
138
- address: "https://testnet.vicscan.xyz/address/$address",
139
- token: "https://testnet.vicscan.xyz/token/$address"
140
- }
141
- ]
142
- },
143
- {
144
- type: "CryptoCurrency",
145
- // @ts-expect-error
146
- id: "polygon_amoy",
147
- coinType: 60,
148
- name: "Polygon Amoy",
149
- managerAppName: "Polygon Amoy",
150
- ticker: "tPOL",
151
- countervalueTicker: "POL",
152
- scheme: "polygon_amoy",
153
- color: "#A020F0",
154
- family: "evm",
155
- ethereumLikeInfo: {
156
- // @ts-expect-error
157
- baseChain: "testnet",
158
- chainId: 80002,
159
- networkId: 80002
160
- },
161
- units: [
162
- {
163
- name: "tPOL",
164
- code: "tPOL",
165
- magnitude: 18
166
- }
167
- ],
168
- explorerViews: [
169
- {
170
- tx: "https://amoy.polygonscan.com/tx/$hash",
171
- address: "https://amoy.polygonscan.com/address/$address",
172
- token: "https://amoy.polygonscan.com//token/$address"
173
- }
174
- ]
175
- },
176
- {
177
- type: "CryptoCurrency",
178
- // @ts-expect-error
179
- id: "ethereum_hoodi",
180
- coinType: 60,
181
- name: "Ethereum Hoodi",
182
- managerAppName: "Ethereum Hoodi",
183
- ticker: "tETH",
184
- countervalueTicker: "tETH",
185
- scheme: "ethereum_hoodi",
186
- color: "#A020F0",
187
- family: "evm",
188
- ethereumLikeInfo: {
189
- // @ts-expect-error
190
- baseChain: "testnet",
191
- chainId: 560048,
192
- networkId: 560048
193
- },
194
- units: [
195
- {
196
- name: "ether",
197
- code: "tETH",
198
- magnitude: 18
199
- }
200
- ],
201
- explorerViews: [
202
- {
203
- tx: "https://hoodi.etherscan.io/tx/$hash",
204
- address: "https://hoodi.etherscan.io/account/$address",
205
- token: "https://hoodi.etherscan.io/token/$address"
206
- }
207
- ]
208
- },
209
- {
210
- type: "CryptoCurrency",
211
- // @ts-expect-error
212
- id: "polymesh",
213
- // @ts-expect-error
214
- coinType: 595,
215
- name: "Polymesh",
216
- managerAppName: "Polymesh",
217
- ticker: "POLYX",
218
- scheme: "polymesh",
219
- color: "#ff2e72",
220
- family: "polymesh",
221
- units: [
222
- {
223
- name: "polyx",
224
- code: "POLYX",
225
- magnitude: 8
226
- }
227
- ],
228
- explorerViews: [
229
- {
230
- address: "https://polymesh.subscan.io/account/$address",
231
- tx: "https://polymesh.subscan.io/extrinsic/$hash"
232
- }
233
- ],
234
- // @ts-expect-error
235
- explorerId: "polymesh"
236
- },
237
- {
238
- type: "CryptoCurrency",
239
- // @ts-expect-error
240
- id: "pivx",
241
- // @ts-expect-error
242
- coinType: 77,
243
- name: "PivX",
244
- managerAppName: "PivX",
245
- ticker: "PIVX",
246
- scheme: "pivx",
247
- color: "#46385d",
248
- family: "bitcoin",
249
- blockAvgTime: 150,
250
- bitcoinLikeInfo: {
251
- P2PKH: 30,
252
- P2SH: 13,
253
- XPUBVersion: 36513075
254
- },
255
- units: [
256
- {
257
- name: "pivx",
258
- code: "PIVX",
259
- magnitude: 8
260
- },
261
- {
262
- name: "satoshi",
263
- code: "sat",
264
- magnitude: 0
265
- }
266
- ],
267
- explorerViews: [
268
- {
269
- tx: "https://chainz.cryptoid.info/pivx/tx.dws?$hash.htm",
270
- address: "https://chainz.cryptoid.info/pivx/address.dws?$address.htm"
271
- }
272
- ],
273
- // @ts-expect-error
274
- explorerId: "pivx"
275
- },
276
- {
277
- type: "CryptoCurrency",
278
- // @ts-expect-error
279
- id: "westend",
280
- // @ts-expect-error
281
- coinType: 23519,
282
- name: "Westend",
283
- managerAppName: "Polkadot",
284
- ticker: "WND",
285
- countervalueTicker: "PDOT",
286
- scheme: "polkadot",
287
- color: "#E6007A",
288
- family: "polkadot",
289
- units: [
290
- {
291
- name: "WND",
292
- code: "WND",
293
- magnitude: 12
294
- }
295
- ],
296
- explorerViews: [
297
- {
298
- address: "https://westend.subscan.io/account/$address",
299
- tx: "https://westend.subscan.io/extrinsic/$hash"
300
- }
301
- ]
302
- },
303
- {
304
- type: "CryptoCurrency",
305
- // @ts-expect-error
306
- id: "ethereum_pow",
307
- coinType: 60,
308
- name: "Ethereum PoW",
309
- managerAppName: "Ethereum PoW",
310
- ticker: "ETHW",
311
- countervalueTicker: "ETHW",
312
- scheme: "ethereum_pow",
313
- color: "#6E89D5",
314
- family: "ethereum",
315
- ethereumLikeInfo: {
316
- // @ts-expect-error
317
- baseChain: "mainnet",
318
- chainId: 10001,
319
- networkId: 10001
320
- },
321
- units: [
322
- {
323
- name: "ETHW",
324
- code: "ETHW",
325
- magnitude: 18
326
- }
327
- ],
328
- explorerViews: [
329
- {
330
- tx: "https://www.oklink.com/en/ethw/tx/$hash",
331
- address: "https://www.oklink.com/en/ethw/address/$address",
332
- token: "https://www.oklink.com/en/ethw/token/$address"
333
- }
334
- ]
335
- },
336
- {
337
- type: "CryptoCurrency",
338
- id: "klaytn",
339
- // @ts-expect-error
340
- coinType: 8217,
341
- name: "Klaytn",
342
- managerAppName: "Klaytn",
343
- ticker: "KLAY",
344
- countervalueTicker: "KLAY",
345
- scheme: "klaytn",
346
- color: "#A020F0",
347
- family: "evm",
348
- ethereumLikeInfo: {
349
- // @ts-expect-error
350
- baseChain: "mainnet",
351
- chainId: 8217,
352
- networkId: 8217
353
- },
354
- units: [
355
- {
356
- name: "KLAY",
357
- code: "KLAY",
358
- magnitude: 18
359
- }
360
- ],
361
- explorerViews: [
362
- {
363
- tx: "https://scope.klaytn.com/tx/$hash",
364
- address: "https://scope.klaytn.com/account/$address",
365
- token: "https://scope.klaytn.com/token/$address"
366
- }
367
- ]
368
- },
369
- {
370
- type: "CryptoCurrency",
371
- // @ts-expect-error
372
- id: "klaytn_baobab",
373
- // @ts-expect-error
374
- coinType: 8217,
375
- name: "Klaytn Baobab",
376
- managerAppName: "Klaytn Baobab",
377
- ticker: "tKLAY",
378
- countervalueTicker: "tKLAY",
379
- scheme: "klaytn",
380
- color: "#A020F0",
381
- family: "evm",
382
- ethereumLikeInfo: {
383
- // @ts-expect-error
384
- baseChain: "testnet",
385
- chainId: 1001,
386
- networkId: 1001
387
- },
388
- units: [
389
- {
390
- name: "tKLAY",
391
- code: "tKLAY",
392
- magnitude: 18
393
- }
394
- ],
395
- explorerViews: [
396
- {
397
- tx: "https://baobab.scope.klaytn.com/tx/$hash",
398
- address: "https://baobab.scope.klaytn.com/account/$address",
399
- token: "https://baobab.scope.klaytn.com/token/$address"
400
- }
401
- ]
402
- },
403
- {
404
- type: "CryptoCurrency",
405
- id: "ethereum_holesky",
406
- coinType: 60,
407
- name: "Ethereum Holesky",
408
- managerAppName: "Ethereum Holesky",
409
- ticker: "tETH",
410
- countervalueTicker: "tETH",
411
- scheme: "ethereum_holesky",
412
- color: "#A020F0",
413
- family: "evm",
414
- ethereumLikeInfo: {
415
- // @ts-expect-error
416
- baseChain: "testnet",
417
- chainId: 17e3,
418
- networkId: 17e3
419
- },
420
- units: [
421
- {
422
- name: "ether",
423
- code: "tETH",
424
- magnitude: 18
425
- }
426
- ],
427
- explorerViews: [
428
- {
429
- tx: "https://holesky.etherscan.io/tx/$hash",
430
- address: "https://holesky.etherscan.io/account/$address",
431
- token: "https://holesky.etherscan.io/token/$address"
432
- }
433
- ]
434
- },
435
- {
436
- type: "CryptoCurrency",
437
- id: "ethereum_sepolia",
438
- coinType: 60,
439
- name: "Ethereum Sepolia",
440
- managerAppName: "Ethereum Sepolia",
441
- ticker: "sETH",
442
- countervalueTicker: "sETH",
443
- scheme: "ethereum_sepolia",
444
- color: "#A020F0",
445
- family: "evm",
446
- ethereumLikeInfo: {
447
- // @ts-expect-error
448
- baseChain: "testnet",
449
- chainId: 11155111,
450
- networkId: 11155111
451
- },
452
- units: [
453
- {
454
- name: "ether",
455
- code: "sETH",
456
- magnitude: 18
457
- }
458
- ],
459
- explorerViews: [
460
- {
461
- tx: "https://sepolia.etherscan.io/tx/$hash",
462
- address: "https://sepolia.etherscan.io/account/$address",
463
- token: "https://sepolia.etherscan.io/token/$address"
464
- }
465
- ]
466
- },
467
- {
468
- type: "CryptoCurrency",
469
- // @ts-expect-error
470
- id: "base_goerli",
471
- // @ts-expect-error
472
- coinType: 614,
473
- name: "Base Goerli",
474
- managerAppName: "Base Goerli",
475
- ticker: "gETH",
476
- countervalueTicker: "gETH",
477
- scheme: "base_goerli",
478
- color: "#A020F0",
479
- family: "evm",
480
- ethereumLikeInfo: {
481
- // @ts-expect-error
482
- baseChain: "testnet",
483
- chainId: 84531,
484
- networkId: 84531
485
- },
486
- units: [
487
- {
488
- name: "ether",
489
- code: "gETH",
490
- magnitude: 18
491
- }
492
- ],
493
- explorerViews: [
494
- {
495
- tx: "https://base-goerli.blockscout.com/tx/$hash",
496
- address: "https://base-goerli.blockscout.com/account/$address",
497
- token: "https://base-goerli.blockscout.com/token/$address"
498
- }
499
- ]
500
- },
501
- {
502
- type: "CryptoCurrency",
503
- // @ts-expect-error
504
- id: "arbitrum_goerli",
505
- // @ts-expect-error
506
- coinType: 9001,
507
- name: "Arbitrum Goerli",
508
- managerAppName: "Arbitrum Goerli",
509
- ticker: "gETH",
510
- countervalueTicker: "gETH",
511
- scheme: "arbitrum_goerli",
512
- color: "#A020F0",
513
- family: "evm",
514
- ethereumLikeInfo: {
515
- // @ts-expect-error
516
- baseChain: "testnet",
517
- chainId: 421611,
518
- networkId: 421611
519
- },
520
- units: [
521
- {
522
- name: "ether",
523
- code: "gETH",
524
- magnitude: 18
525
- }
526
- ],
527
- explorerViews: [
528
- {
529
- tx: "https://testnet.arbiscan.io/tx/$hash",
530
- address: "https://testnet.arbiscan.io/account/$address",
531
- token: "https://testnet.arbiscan.io/token/$address"
532
- }
533
- ]
534
- },
535
- {
536
- type: "CryptoCurrency",
537
- id: "avalanche_c_chain",
538
- // @ts-expect-error
539
- coinType: 9005,
540
- name: "Aavalanche C Chain",
541
- managerAppName: "Aavalanche C Chain",
542
- ticker: "AVAX",
543
- countervalueTicker: "AVAX",
544
- scheme: "avalanche_c_chain",
545
- color: "#A020F0",
546
- family: "evm",
547
- ethereumLikeInfo: {
548
- // @ts-expect-error
549
- baseChain: "mainnet",
550
- chainId: 43114,
551
- networkId: 43114
552
- },
553
- units: [
554
- {
555
- name: "AVAX",
556
- code: "AVAX",
557
- magnitude: 18
558
- }
559
- ],
560
- explorerViews: [
561
- {
562
- tx: "https://snowtrace.io/tx/$hash",
563
- address: "https://snowtrace.io/address/$address",
564
- token: "https://snowtrace.io/token/$address"
565
- }
566
- ]
567
- },
568
- {
569
- type: "CryptoCurrency",
570
- // @ts-expect-error
571
- id: "avalanche_c_chain_fuji",
572
- // @ts-expect-error
573
- coinType: 9005,
574
- name: "Aavalanche C Chain Fuji",
575
- managerAppName: "Aavalanche C Chain Fuji",
576
- ticker: "AVAX",
577
- countervalueTicker: "AVAX",
578
- scheme: "avalanche_c_chain_fuji",
579
- color: "#A020F0",
580
- family: "evm",
581
- ethereumLikeInfo: {
582
- // @ts-expect-error
583
- baseChain: "testnet",
584
- chainId: 43113,
585
- networkId: 43113
586
- },
587
- units: [
588
- {
589
- name: "fAVAX",
590
- code: "fAVAX",
591
- magnitude: 18
592
- }
593
- ],
594
- explorerViews: [
595
- {
596
- tx: "https://testnet.snowtrace.io/tx/$hash",
597
- address: "https://testnet.snowtrace.io/address/$address",
598
- token: "https://testnet.snowtrace.io/token/$address"
599
- }
600
- ]
601
- },
602
- {
603
- type: "CryptoCurrency",
604
- // @ts-expect-error
605
- id: "fantom_testnet",
606
- // @ts-expect-error
607
- coinType: 1007,
608
- name: "Fantom Testnet",
609
- managerAppName: "Fantom Testnet",
610
- ticker: "tFTM",
611
- countervalueTicker: "tFTM",
612
- scheme: "fantom_testnet",
613
- color: "#A020F0",
614
- family: "evm",
615
- ethereumLikeInfo: {
616
- // @ts-expect-error
617
- baseChain: "testnet",
618
- chainId: 4002,
619
- networkId: 4002
620
- },
621
- units: [
622
- {
623
- name: "tFTM",
624
- code: "tFTM",
625
- magnitude: 18
626
- }
627
- ],
628
- explorerViews: [
629
- {
630
- tx: "https://testnet.ftmscan.com/tx/$hash",
631
- address: "https://testnet.ftmscan.com/address/$address",
632
- token: "https://testnet.ftmscan.com/token/$address"
633
- }
634
- ]
635
- },
636
- {
637
- type: "CryptoCurrency",
638
- // @ts-expect-error
639
- id: "flare_coston",
640
- coinType: 60,
641
- name: "Flare Coston",
642
- managerAppName: "Flare Coston",
643
- ticker: "tFLR",
644
- countervalueTicker: "tFLR",
645
- scheme: "flare_coston",
646
- color: "#A020F0",
647
- family: "evm",
648
- ethereumLikeInfo: {
649
- // @ts-expect-error
650
- baseChain: "testnet",
651
- chainId: 16,
652
- networkId: 16
653
- },
654
- units: [
655
- {
656
- name: "tFLR",
657
- code: "tFLR",
658
- magnitude: 18
659
- }
660
- ],
661
- explorerViews: [
662
- {
663
- tx: "https://coston-explorer.flare.network/tx/$hash",
664
- address: "https://coston-explorer.flare.network/$address",
665
- token: "https://coston-explorer.flare.network/token/$address"
666
- }
667
- ]
668
- },
669
- {
670
- type: "CryptoCurrency",
671
- id: "optimism",
672
- // @ts-expect-error
673
- coinType: 614,
674
- name: "Optimism",
675
- managerAppName: "Optimism",
676
- ticker: "ETH",
677
- countervalueTicker: "ETH",
678
- scheme: "optimism",
679
- color: "#A020F0",
680
- family: "evm",
681
- ethereumLikeInfo: {
682
- // @ts-expect-error
683
- baseChain: "mainnet",
684
- chainId: 10,
685
- networkId: 10
686
- },
687
- units: [
688
- {
689
- name: "ether",
690
- code: "ETH",
691
- magnitude: 18
692
- }
693
- ],
694
- explorerViews: [
695
- {
696
- tx: "https://optimistic.etherscan.io/tx/$hash",
697
- address: "https://optimistic.etherscan.io/account/$address",
698
- token: "https://optimistic.etherscan.io/token/$address"
699
- }
700
- ]
701
- },
702
- {
703
- type: "CryptoCurrency",
704
- // @ts-expect-error
705
- id: "polygon_mumbai",
706
- coinType: 60,
707
- name: "Polygon Mumbai",
708
- managerAppName: "Polygon Mumbai",
709
- ticker: "tMATIC",
710
- countervalueTicker: "MATIC",
711
- scheme: "polygon_mumbai",
712
- color: "#A020F0",
713
- family: "evm",
714
- ethereumLikeInfo: {
715
- // @ts-expect-error
716
- baseChain: "testnet",
717
- chainId: 80001,
718
- networkId: 80001
719
- },
720
- units: [
721
- {
722
- name: "tMATIC",
723
- code: "tMATIC",
724
- magnitude: 18
725
- }
726
- ],
727
- explorerViews: [
728
- {
729
- tx: "https://mumbai.polygonscan.com/tx/$hash",
730
- address: "https://mumbai.polygonscan.com/address/$address",
731
- token: "https://mumbai.polygonscan.com//token/$address"
732
- }
733
- ]
734
- },
735
- {
736
- type: "CryptoCurrency",
737
- // @ts-expect-error
738
- id: "optimism_goerli",
739
- // @ts-expect-error
740
- coinType: 614,
741
- name: "Optimism Goerli",
742
- managerAppName: "Optimism Goerli",
743
- ticker: "gETH",
744
- countervalueTicker: "gETH",
745
- scheme: "optimism_goerli",
746
- color: "#A020F0",
747
- family: "evm",
748
- ethereumLikeInfo: {
749
- // @ts-expect-error
750
- baseChain: "testnet",
751
- chainId: 420,
752
- networkId: 420
753
- },
754
- units: [
755
- {
756
- name: "gether",
757
- code: "gETH",
758
- magnitude: 18
759
- }
760
- ],
761
- explorerViews: [
762
- {
763
- tx: "https://goerli-optimism.etherscan.io/tx/$hash",
764
- address: "https://goerli-optimism.etherscan.io/account/$address",
765
- token: "https://goerli-optimism.etherscan.io/token/$address"
766
- }
767
- ]
768
- },
769
- {
770
- type: "CryptoCurrency",
771
- // @ts-expect-error
772
- id: "celo_alfajores",
773
- coinType: 60,
774
- name: "Celo Alfajores",
775
- managerAppName: "Celo Alfajores",
776
- ticker: "tCELO",
777
- countervalueTicker: "tCELO",
778
- scheme: "celo_alfojores",
779
- color: "#A020F0",
780
- family: "evm",
781
- ethereumLikeInfo: {
782
- // @ts-expect-error
783
- baseChain: "testnet",
784
- chainId: 44787,
785
- networkId: 44787
786
- },
787
- units: [
788
- {
789
- name: "tCELO",
790
- code: "tCELO",
791
- magnitude: 18
792
- }
793
- ],
794
- explorerViews: [
795
- {
796
- tx: "https://alfajores.celoscan.io/tx/$hash",
797
- address: "https://alfajores.celoscan.io/address/$address",
798
- token: "https://alfajores.celoscan.io/token/$address"
799
- }
800
- ]
801
- },
802
- {
803
- type: "CryptoCurrency",
804
- // @ts-expect-error
805
- id: "cronos_testnet",
806
- coinType: 60,
807
- name: "Cronos Testnet",
808
- managerAppName: "Cronos Testnet",
809
- ticker: "tCRO",
810
- countervalueTicker: "tCRO",
811
- scheme: "cronos_testnet",
812
- color: "#A020F0",
813
- family: "evm",
814
- ethereumLikeInfo: {
815
- // @ts-expect-error
816
- baseChain: "testnet",
817
- chainId: 338,
818
- networkId: 338
819
- },
820
- units: [
821
- {
822
- name: "tCRO",
823
- code: "tCRO",
824
- magnitude: 18
825
- }
826
- ],
827
- explorerViews: [
828
- {
829
- tx: "https://cronos.org/explorer/testnet3/tx/$hash",
830
- address: "https://cronos.org/explorer/testnet3/address/$address",
831
- token: "https://cronos.org/explorer/testnet3/token/$address"
832
- }
833
- ]
834
- },
835
- {
836
- type: "CryptoCurrency",
837
- // @ts-expect-error
838
- id: "kava_evm",
839
- coinType: 60,
840
- name: "Kava EVM",
841
- managerAppName: "Kava EVM",
842
- ticker: "KAVA",
843
- countervalueTicker: "KAVA",
844
- scheme: "kava_evm",
845
- color: "#A020F0",
846
- family: "evm",
847
- ethereumLikeInfo: {
848
- // @ts-expect-error
849
- baseChain: "mainnet",
850
- chainId: 2222,
851
- networkId: 2222
852
- },
853
- units: [
854
- {
855
- name: "KAVA",
856
- code: "KAVA",
857
- magnitude: 18
858
- }
859
- ],
860
- explorerViews: [
861
- {
862
- tx: "https://explorer.kava.io/tx/$hash",
863
- address: "https://explorer.kava.io/address/$address",
864
- token: "https://explorer.kava.io/token/$address"
865
- }
866
- ]
867
- },
868
- {
869
- type: "CryptoCurrency",
870
- // @ts-expect-error
871
- id: "kava_evm_testnet",
872
- coinType: 60,
873
- name: "Kava EVM Testnet",
874
- managerAppName: "Kava EVM Testnet",
875
- ticker: "tKAVA",
876
- countervalueTicker: "tKAVA",
877
- scheme: "kava_evm_testnet",
878
- color: "#A020F0",
879
- family: "evm",
880
- ethereumLikeInfo: {
881
- // @ts-expect-error
882
- baseChain: "testnet",
883
- chainId: 2221,
884
- networkId: 2221
885
- },
886
- units: [
887
- {
888
- name: "tKAVA",
889
- code: "tKAVA",
890
- magnitude: 18
891
- }
892
- ],
893
- explorerViews: [
894
- {
895
- tx: "https://explorer.testnet.kava.io/tx/$hash",
896
- address: "https://explorer.testnet.kava.io/address/$address",
897
- token: "https://explorer.testnet.kava.io/token/$address"
898
- }
899
- ]
900
- },
901
- {
902
- type: "CryptoCurrency",
903
- // @ts-expect-error
904
- id: "tomo_testnet",
905
- coinType: 60,
906
- name: "TomoTestnet",
907
- managerAppName: "TomoTestnet",
908
- ticker: "tTOMO",
909
- countervalueTicker: "tTOMO",
910
- scheme: "tomo_testnet",
911
- color: "#A020F0",
912
- family: "evm",
913
- ethereumLikeInfo: {
914
- // @ts-expect-error
915
- baseChain: "testnet",
916
- chainId: 88,
917
- networkId: 88
918
- },
919
- units: [
920
- {
921
- name: "tTOMO",
922
- code: "tTOMO",
923
- magnitude: 18
924
- }
925
- ],
926
- explorerViews: [
927
- {
928
- tx: "https://scan.testnet.tomochain.com/txs/$hash",
929
- address: "https://scan.testnet.tomochain.com/address/$address",
930
- token: "https://scan.testnet.tomochain.com/tokens/$address"
931
- }
932
- ]
933
- },
934
- {
935
- type: "CryptoCurrency",
936
- // @ts-expect-error
937
- id: "ethereum_goerli",
938
- name: "Ethereum Goerli",
939
- family: "ethereum",
940
- coinType: 1,
941
- ethereumLikeInfo: {
942
- // @ts-expect-error
943
- baseChain: "goerli",
944
- chainId: 5,
945
- // goerli
946
- networkId: 5,
947
- hardfork: "petersburg"
948
- },
949
- units: [
950
- {
951
- code: "wei",
952
- magnitude: 0,
953
- name: "wei"
954
- },
955
- {
956
- code: "Kwei",
957
- magnitude: 3,
958
- name: "Kwei"
959
- },
960
- {
961
- code: "Mwei",
962
- magnitude: 6,
963
- name: "Mwei"
964
- },
965
- {
966
- code: "Gwei",
967
- magnitude: 9,
968
- name: "Gwei"
969
- },
970
- {
971
- code: "ether",
972
- magnitude: 18,
973
- name: "ether"
974
- }
975
- ],
976
- explorerViews: [
977
- {
978
- tx: "https://goerli.etherscan.io/tx/$hash",
979
- address: "https://goerli.etherscan.io/address/$address"
980
- }
981
- ]
982
- },
983
- {
984
- type: "CryptoCurrency",
985
- // @ts-expect-error
986
- id: "ethereum_ropsten",
987
- name: "Ethereum Ropsten",
988
- cointype: 60,
989
- family: "ethereum",
990
- units: [
991
- {
992
- code: "wei",
993
- magnitude: 0,
994
- name: "wei"
995
- },
996
- {
997
- code: "Kwei",
998
- magnitude: 3,
999
- name: "Kwei"
1000
- },
1001
- {
1002
- code: "Mwei",
1003
- magnitude: 6,
1004
- name: "Mwei"
1005
- },
1006
- {
1007
- code: "Gwei",
1008
- magnitude: 9,
1009
- name: "Gwei"
1010
- },
1011
- {
1012
- code: "ether",
1013
- magnitude: 18,
1014
- name: "ether"
1015
- }
1016
- ],
1017
- ethereumLikeInfo: {
1018
- // @ts-expect-error
1019
- baseChain: "ropsten",
1020
- chainId: 3,
1021
- // ropsten
1022
- networkId: 3,
1023
- hardfork: "petersburg"
1024
- },
1025
- explorerViews: [
1026
- {
1027
- tx: "https://ropsten.etherscan.io/tx/$hash",
1028
- address: "https://ropsten.etherscan.io/address/$address"
1029
- }
1030
- ]
1031
- },
1032
- {
1033
- type: "CryptoCurrency",
1034
- // @ts-expect-error
1035
- id: "vertcoin",
1036
- // @ts-expect-error
1037
- coinType: 28,
1038
- name: "Vertcoin",
1039
- managerAppName: "Vertcoin",
1040
- ticker: "VTC",
1041
- scheme: "vertcoin",
1042
- color: "#1b5c2e",
1043
- supportsSegwit: true,
1044
- family: "bitcoin",
1045
- blockAvgTime: 150,
1046
- bitcoinLikeInfo: {
1047
- P2PKH: 71,
1048
- P2SH: 5,
1049
- XPUBVersion: 76067358
1050
- },
1051
- units: [
1052
- {
1053
- name: "vertcoin",
1054
- code: "VTC",
1055
- magnitude: 8
1056
- },
1057
- {
1058
- name: "satoshi",
1059
- code: "sat",
1060
- magnitude: 0
1061
- }
1062
- ],
1063
- explorerViews: [
1064
- {
1065
- tx: "https://vtcblocks.com/tx/$hash",
1066
- address: "https://vtcblocks.com/address/$address"
1067
- }
1068
- ]
1069
- },
1070
- {
1071
- type: "CryptoCurrency",
1072
- // @ts-expect-error
1073
- id: "viacoin",
1074
- // @ts-expect-error
1075
- coinType: 14,
1076
- name: "Viacoin",
1077
- managerAppName: "Viacoin",
1078
- ticker: "VIA",
1079
- scheme: "viacoin",
1080
- color: "#414141",
1081
- supportsSegwit: true,
1082
- family: "bitcoin",
1083
- blockAvgTime: 24,
1084
- bitcoinLikeInfo: {
1085
- P2PKH: 71,
1086
- P2SH: 33,
1087
- XPUBVersion: 76067358
1088
- },
1089
- units: [
1090
- {
1091
- name: "viacoin",
1092
- code: "VIA",
1093
- magnitude: 8
1094
- },
1095
- {
1096
- name: "satoshi",
1097
- code: "sat",
1098
- magnitude: 0
1099
- }
1100
- ],
1101
- explorerViews: [
1102
- {
1103
- tx: "https://explorer.viacoin.org/tx/$hash",
1104
- address: "https://explorer.viacoin.org/address/$address"
1105
- }
1106
- ]
1107
- }
1108
- ];
1109
- function getCryptoCurrencyById(id) {
1110
- return vaultCoins.find((currency) => currency.id === id) || byId(id);
1111
- }
1112
- var listCryptoCurrencies = listCC;
1113
-
1114
- // src/utils.ts
1115
- function getWorkspaceFromGate(gate) {
1116
- const s = gate.split("/");
1117
- const workspace = s[s.length - 1];
1118
- if (!workspace) throw new Error(`Could not extract workspace from gate ${gate}`);
1119
- return workspace;
1120
- }
1121
- function xpubToExtendedPubKey(xpub) {
1122
- const decoded = bs58.decode(xpub);
1123
- const extendedPubKey = {
1124
- chain_code: decoded.slice(13, 13 + 32).toString("hex").toUpperCase(),
1125
- public_key: decoded.slice(13 + 32, 13 + 32 + 33).toString("hex").toUpperCase()
1126
- };
1127
- return extendedPubKey;
1128
- }
1129
- var queue = (items, job) => items.reduce((promise, item) => promise.then(() => job(item)), Promise.resolve());
1130
- function serializeUnitValue(unit, value) {
1131
- const multi = new BigNumber(10).exponentiatedBy(unit.magnitude);
1132
- return new BigNumber(value).times(multi).toFixed();
1133
- }
1134
- function getAccountUnit(account, tokens) {
1135
- const unit = "contractAddress" in account ? getTokenUnit(account.contractAddress, tokens) : getCurrencyUnit(account.currency);
1136
- return unit;
1137
- }
1138
- function getGateAccountUnit(account, tokens) {
1139
- const unit = account.contract_address ? getTokenUnit(account.contract_address, tokens) : getCurrencyUnit(account.currency);
1140
- return unit;
1141
- }
1142
- function getTokenUnit(contractAddress, tokens) {
1143
- const token = tokens.find((t) => t.contract_address === contractAddress);
1144
- if (!token) {
1145
- throw new Error(`Can't find token with contract address ${contractAddress}`);
1146
- }
1147
- return token.units[0];
1148
- }
1149
- function getCurrencyUnit(currencyName) {
1150
- const currency = getCryptoCurrencyById(currencyName);
1151
- return currency.units[0];
1152
- }
1153
- function deserializeUnitValue(unit, value) {
1154
- const multi = new BigNumber(10).exponentiatedBy(unit.magnitude);
1155
- return new BigNumber(value).div(multi).toNumber();
1156
- }
1157
- var LIGHT_EVM_CURRENCIES = [
1158
- "ethereum_sepolia",
1159
- "polygon_mumbai",
1160
- "klaytn",
1161
- "klaytn_baobab",
1162
- "arbitrum",
1163
- "arbitrum_goerli",
1164
- "base_goerli",
1165
- "optimism",
1166
- "optimism_goerli",
1167
- "flare",
1168
- "flare_coston",
1169
- "fantom",
1170
- "fantom_testnet",
1171
- "avalanche_c_chain",
1172
- "avalanche_c_chain_fuji",
1173
- "celo",
1174
- "celo_alfajores",
1175
- "cronos",
1176
- "cronos_testnet",
1177
- "filecoin",
1178
- "filecoin_calibration",
1179
- "kava_evm",
1180
- "kava_evm_testnet",
1181
- "tomo",
1182
- "tomo_testnet",
1183
- "viction",
1184
- "viction_testnet",
1185
- "sonic",
1186
- "mantle"
1187
- ];
1188
- var ETHEREUM_LIKE_CURRENCIES = [
1189
- "ethereum",
1190
- "ethereum_ropsten",
1191
- "ethereum_goerli",
1192
- "ethereum_classic",
1193
- "ethereum_holesky",
1194
- "ethereum_hoodi",
1195
- "polygon_amoy",
1196
- "polygon",
1197
- "bsc",
1198
- ...LIGHT_EVM_CURRENCIES
1199
- ];
1200
- var getAccountTypeByCurrency = (currency) => {
1201
- return ETHEREUM_LIKE_CURRENCIES.includes(currency) ? "Ethereum" : currency === "ripple" ? "Ripple" : currency === "stellar" ? "Stellar" : currency === "tezos" ? "Tezos" : currency === "polkadot" || currency == "westend" ? "Polkadot" : currency === "solana" || currency === "solana_testnet" || currency === "solana_devnet" ? "Solana" : currency === "cardano" || currency === "cardano_testnet" || currency === "cardano_devnet" ? "Cardano" : currency === "tron" ? "Tron" : "Bitcoin";
1202
- };
1203
- var toToken = (t) => {
1204
- const parentCurrency = getCryptoCurrencyById(t.parent_currency);
1205
- return {
1206
- type: "TokenCurrency",
1207
- id: t.ticker,
1208
- name: t.name,
1209
- ticker: t.ticker,
1210
- units: t.units,
1211
- contractAddress: t.contract_address,
1212
- // the currency it belongs to. e.g. 'ethereum,
1213
- parentCurrency,
1214
- // the type of token in the blockchain it belongs. e.g. 'erc20,
1215
- tokenType: t.token_type
1216
- };
1217
- };
1218
- function getCurrencyOrToken(account, tokens) {
1219
- const isTokenAccount = !!account.contract_address;
1220
- if (isTokenAccount) {
1221
- const token = tokens.find((t) => t.contract_address === account.contract_address);
1222
- if (!token) {
1223
- throw new Error(`Cannot find token with contract address: ${account.contract_address}`);
1224
- }
1225
- return toToken(token);
1226
- }
1227
- return getCryptoCurrencyById(account.currency);
1228
- }
1229
- function getDefaultUsername(role, device) {
1230
- return `${role === "admin" ? "Admin" : "Operator"} ${role === "admin" ? device < 10 ? device - 3 : device : device}`;
1231
- }
1232
- var unwrapConnection = (c) => c.edges.map((n) => n.node);
1233
- function extractSecureChannel(object, pub_key) {
1234
- if (object.request_id) return object;
1235
- if (object[pub_key]) return object[pub_key];
1236
- throw new Error("No channel found");
1237
- }
1238
- var wait = (duration) => new Promise((resolve) => setTimeout(resolve, duration));
1239
-
1240
- export {
1241
- vaultCoins,
1242
- getCryptoCurrencyById,
1243
- listCryptoCurrencies,
1244
- getWorkspaceFromGate,
1245
- xpubToExtendedPubKey,
1246
- queue,
1247
- serializeUnitValue,
1248
- getAccountUnit,
1249
- getGateAccountUnit,
1250
- getTokenUnit,
1251
- getCurrencyUnit,
1252
- deserializeUnitValue,
1253
- LIGHT_EVM_CURRENCIES,
1254
- getAccountTypeByCurrency,
1255
- getCurrencyOrToken,
1256
- getDefaultUsername,
1257
- unwrapConnection,
1258
- extractSecureChannel,
1259
- wait
1260
- };
1261
- //# sourceMappingURL=chunk-QNNV5GBH.mjs.map