@ledgerhq/cryptoassets 13.30.0 → 13.31.0-nightly.0
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 +8 -0
- package/README.md +0 -257
- package/lib/abandonseed.d.ts.map +1 -1
- package/lib/abandonseed.js +4 -1
- package/lib/abandonseed.js.map +1 -1
- package/lib/api-token-converter.js +14 -14
- package/lib/api-token-converter.js.map +1 -1
- package/lib/currencies.d.ts.map +1 -1
- package/lib/currencies.js +92 -10
- package/lib/currencies.js.map +1 -1
- package/lib/legacy/legacy-data.d.ts +25 -0
- package/lib/legacy/legacy-data.d.ts.map +1 -0
- package/lib/legacy/legacy-data.js +102 -0
- package/lib/legacy/legacy-data.js.map +1 -0
- package/lib/legacy/legacy-state.d.ts +11 -0
- package/lib/legacy/legacy-state.d.ts.map +1 -0
- package/lib/legacy/legacy-state.js +14 -0
- package/lib/legacy/legacy-state.js.map +1 -0
- package/lib/legacy/legacy-utils.d.ts +89 -0
- package/lib/legacy/legacy-utils.d.ts.map +1 -0
- package/lib/legacy/legacy-utils.js +455 -0
- package/lib/legacy/legacy-utils.js.map +1 -0
- package/lib/legacy/legacy.test.d.ts +2 -0
- package/lib/legacy/legacy.test.d.ts.map +1 -0
- package/lib/legacy/legacy.test.js +470 -0
- package/lib/legacy/legacy.test.js.map +1 -0
- package/lib/tokens.d.ts +27 -49
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js +55 -490
- package/lib/tokens.js.map +1 -1
- package/lib/tokens.test.js +4 -3
- package/lib/tokens.test.js.map +1 -1
- package/lib-es/abandonseed.d.ts.map +1 -1
- package/lib-es/abandonseed.js +4 -1
- package/lib-es/abandonseed.js.map +1 -1
- package/lib-es/api-token-converter.js +1 -1
- package/lib-es/api-token-converter.js.map +1 -1
- package/lib-es/currencies.d.ts.map +1 -1
- package/lib-es/currencies.js +92 -10
- package/lib-es/currencies.js.map +1 -1
- package/lib-es/legacy/legacy-data.d.ts +25 -0
- package/lib-es/legacy/legacy-data.d.ts.map +1 -0
- package/lib-es/legacy/legacy-data.js +76 -0
- package/lib-es/legacy/legacy-data.js.map +1 -0
- package/lib-es/legacy/legacy-state.d.ts +11 -0
- package/lib-es/legacy/legacy-state.d.ts.map +1 -0
- package/lib-es/legacy/legacy-state.js +11 -0
- package/lib-es/legacy/legacy-state.js.map +1 -0
- package/lib-es/legacy/legacy-utils.d.ts +89 -0
- package/lib-es/legacy/legacy-utils.d.ts.map +1 -0
- package/lib-es/legacy/legacy-utils.js +434 -0
- package/lib-es/legacy/legacy-utils.js.map +1 -0
- package/lib-es/legacy/legacy.test.d.ts +2 -0
- package/lib-es/legacy/legacy.test.d.ts.map +1 -0
- package/lib-es/legacy/legacy.test.js +468 -0
- package/lib-es/legacy/legacy.test.js.map +1 -0
- package/lib-es/tokens.d.ts +27 -49
- package/lib-es/tokens.d.ts.map +1 -1
- package/lib-es/tokens.js +31 -462
- package/lib-es/tokens.js.map +1 -1
- package/lib-es/tokens.test.js +2 -1
- package/lib-es/tokens.test.js.map +1 -1
- package/package.json +2 -4
- package/src/abandonseed.ts +4 -1
- package/src/api-token-converter.ts +1 -1
- package/src/currencies.ts +92 -10
- package/src/legacy/legacy-data.ts +119 -0
- package/src/legacy/legacy-state.ts +12 -0
- package/src/legacy/legacy-utils.ts +574 -0
- package/src/legacy/legacy.test.ts +586 -0
- package/src/tokens.test.ts +1 -1
- package/src/tokens.ts +76 -573
package/src/currencies.ts
CHANGED
|
@@ -614,7 +614,7 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
614
614
|
managerAppName: "Canton",
|
|
615
615
|
ticker: "CC",
|
|
616
616
|
scheme: "canton_network",
|
|
617
|
-
color: "#
|
|
617
|
+
color: "#F3FF97",
|
|
618
618
|
family: "canton",
|
|
619
619
|
blockAvgTime: 100,
|
|
620
620
|
units: [
|
|
@@ -637,15 +637,15 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
637
637
|
],
|
|
638
638
|
keywords: ["canton_network"],
|
|
639
639
|
},
|
|
640
|
-
|
|
640
|
+
canton_network_testnet: {
|
|
641
641
|
type: "CryptoCurrency",
|
|
642
|
-
id: "
|
|
642
|
+
id: "canton_network_testnet",
|
|
643
643
|
coinType: CoinType.CANTON_NETWORK,
|
|
644
|
-
name: "Canton Network (
|
|
644
|
+
name: "Canton Network (Testnet)",
|
|
645
645
|
managerAppName: "Canton",
|
|
646
646
|
ticker: "CC",
|
|
647
|
-
scheme: "
|
|
648
|
-
color: "#
|
|
647
|
+
scheme: "canton_network_testnet",
|
|
648
|
+
color: "#F3FF97",
|
|
649
649
|
family: "canton",
|
|
650
650
|
blockAvgTime: 100,
|
|
651
651
|
isTestnetFor: "canton_network",
|
|
@@ -663,11 +663,11 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
663
663
|
],
|
|
664
664
|
explorerViews: [
|
|
665
665
|
{
|
|
666
|
-
tx: "https://
|
|
667
|
-
address: "https://
|
|
666
|
+
tx: "https://lighthouse.testnet.cantonloop.com/transactions/$hash",
|
|
667
|
+
address: "https://lighthouse.testnet.cantonloop.com/party/$address",
|
|
668
668
|
},
|
|
669
669
|
],
|
|
670
|
-
keywords: ["
|
|
670
|
+
keywords: ["canton_network_testnet"],
|
|
671
671
|
},
|
|
672
672
|
canton_network_devnet: {
|
|
673
673
|
type: "CryptoCurrency",
|
|
@@ -677,7 +677,7 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
677
677
|
managerAppName: "Canton",
|
|
678
678
|
ticker: "CC",
|
|
679
679
|
scheme: "canton_network_devnet",
|
|
680
|
-
color: "#
|
|
680
|
+
color: "#F3FF97",
|
|
681
681
|
family: "canton",
|
|
682
682
|
blockAvgTime: 100,
|
|
683
683
|
isTestnetFor: "canton_network",
|
|
@@ -2349,6 +2349,37 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
2349
2349
|
],
|
|
2350
2350
|
keywords: ["dot", "polkadot"],
|
|
2351
2351
|
},
|
|
2352
|
+
assethub_polkadot: {
|
|
2353
|
+
type: "CryptoCurrency",
|
|
2354
|
+
id: "assethub_polkadot",
|
|
2355
|
+
coinType: CoinType.POLKADOT,
|
|
2356
|
+
name: "Polkadot",
|
|
2357
|
+
managerAppName: "Polkadot",
|
|
2358
|
+
ticker: "DOT",
|
|
2359
|
+
deviceTicker: "DOT",
|
|
2360
|
+
scheme: "assethub_polkadot",
|
|
2361
|
+
color: "#E6007A",
|
|
2362
|
+
family: "polkadot",
|
|
2363
|
+
units: [
|
|
2364
|
+
{
|
|
2365
|
+
name: "DOT",
|
|
2366
|
+
code: "DOT",
|
|
2367
|
+
magnitude: 10,
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
name: "planck",
|
|
2371
|
+
code: "PLANCK",
|
|
2372
|
+
magnitude: 0,
|
|
2373
|
+
},
|
|
2374
|
+
],
|
|
2375
|
+
explorerViews: [
|
|
2376
|
+
{
|
|
2377
|
+
address: "https://assethub-polkadot.subscan.io/account/$address",
|
|
2378
|
+
tx: "https://assethub-polkadot.subscan.io/extrinsic/$hash",
|
|
2379
|
+
},
|
|
2380
|
+
],
|
|
2381
|
+
keywords: ["assethub"],
|
|
2382
|
+
},
|
|
2352
2383
|
polygon: {
|
|
2353
2384
|
type: "CryptoCurrency",
|
|
2354
2385
|
id: "polygon",
|
|
@@ -3374,6 +3405,57 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
3374
3405
|
],
|
|
3375
3406
|
},
|
|
3376
3407
|
// Testnets
|
|
3408
|
+
westend: {
|
|
3409
|
+
type: "CryptoCurrency",
|
|
3410
|
+
id: "westend",
|
|
3411
|
+
coinType: CoinType.POLKADOT,
|
|
3412
|
+
name: "Westend",
|
|
3413
|
+
managerAppName: "Polkadot",
|
|
3414
|
+
ticker: "WND",
|
|
3415
|
+
deviceTicker: "DOT",
|
|
3416
|
+
scheme: "westend",
|
|
3417
|
+
color: "#00ff00",
|
|
3418
|
+
units: [
|
|
3419
|
+
{
|
|
3420
|
+
code: "WND",
|
|
3421
|
+
name: "WND",
|
|
3422
|
+
magnitude: 12,
|
|
3423
|
+
},
|
|
3424
|
+
],
|
|
3425
|
+
isTestnetFor: "polkadot",
|
|
3426
|
+
family: "polkadot",
|
|
3427
|
+
explorerViews: [
|
|
3428
|
+
{
|
|
3429
|
+
address: "https://westend.subscan.io/account/$address",
|
|
3430
|
+
tx: "https://westend.subscan.io/extrinsic/$hash",
|
|
3431
|
+
},
|
|
3432
|
+
],
|
|
3433
|
+
},
|
|
3434
|
+
assethub_westend: {
|
|
3435
|
+
type: "CryptoCurrency",
|
|
3436
|
+
id: "assethub_westend",
|
|
3437
|
+
coinType: CoinType.POLKADOT,
|
|
3438
|
+
name: "Assethub Westend",
|
|
3439
|
+
managerAppName: "Polkadot",
|
|
3440
|
+
ticker: "WND",
|
|
3441
|
+
deviceTicker: "DOT",
|
|
3442
|
+
scheme: "assethub_westend",
|
|
3443
|
+
color: "#00ff00",
|
|
3444
|
+
units: [
|
|
3445
|
+
{
|
|
3446
|
+
code: "WND",
|
|
3447
|
+
name: "WND",
|
|
3448
|
+
magnitude: 12,
|
|
3449
|
+
},
|
|
3450
|
+
],
|
|
3451
|
+
family: "polkadot",
|
|
3452
|
+
explorerViews: [
|
|
3453
|
+
{
|
|
3454
|
+
address: "https://assethub-westend.subscan.io/account/$address",
|
|
3455
|
+
tx: "https://assethub-westend.subscan.io/extrinsic/$hash",
|
|
3456
|
+
},
|
|
3457
|
+
],
|
|
3458
|
+
},
|
|
3377
3459
|
bitcoin_testnet: {
|
|
3378
3460
|
type: "CryptoCurrency",
|
|
3379
3461
|
id: "bitcoin_testnet",
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// This file contains the legacy token data imports and state management
|
|
2
|
+
// All convert functions have been moved to legacy-utils.ts to make it more modular
|
|
3
|
+
|
|
4
|
+
import type { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
5
|
+
import { getEnv } from "@ledgerhq/live-env";
|
|
6
|
+
import cardanoNativeTokens from "../data/cardanoNative";
|
|
7
|
+
import jettonTokens from "../data/ton-jetton";
|
|
8
|
+
import { tokens as sepoliaTokens } from "../data/evm/11155111";
|
|
9
|
+
import stellarTokens from "../data/stellar";
|
|
10
|
+
import hederaTokens from "../data/hedera";
|
|
11
|
+
import vechainTokens from "../data/vip180";
|
|
12
|
+
import esdttokens from "../data/esdt";
|
|
13
|
+
import asatokens from "../data/asa";
|
|
14
|
+
import { tokens as polygonTokens } from "../data/evm/137";
|
|
15
|
+
import { tokens as sonicTokens } from "../data/evm/146";
|
|
16
|
+
import { tokens as coreTokens } from "../data/evm/1116";
|
|
17
|
+
import trc10tokens from "../data/trc10";
|
|
18
|
+
import trc20tokens from "../data/trc20";
|
|
19
|
+
import { tokens as mainnetTokens } from "../data/evm/1";
|
|
20
|
+
import { tokens as bnbTokens } from "../data/evm/56";
|
|
21
|
+
import { tokens as celoTokens } from "../data/evm/42220";
|
|
22
|
+
import filecoinTokens from "../data/filecoin-erc20";
|
|
23
|
+
import spltokens from "../data/spl";
|
|
24
|
+
import aptCoinTokens from "../data/apt_coin";
|
|
25
|
+
import aptFATokens from "../data/apt_fungible_asset";
|
|
26
|
+
import suitokens from "../data/sui";
|
|
27
|
+
import {
|
|
28
|
+
convertERC20,
|
|
29
|
+
convertAlgorandASATokens,
|
|
30
|
+
convertVechainToken,
|
|
31
|
+
convertTRONTokens,
|
|
32
|
+
convertMultiversXESDTTokens,
|
|
33
|
+
convertCardanoNativeTokens,
|
|
34
|
+
convertStellarTokens,
|
|
35
|
+
convertJettonToken,
|
|
36
|
+
convertSplTokens,
|
|
37
|
+
convertSuiTokens,
|
|
38
|
+
convertAptCoinTokens,
|
|
39
|
+
convertAptFaTokens,
|
|
40
|
+
convertHederaTokens,
|
|
41
|
+
} from "./legacy-utils";
|
|
42
|
+
|
|
43
|
+
// Export the legacy token data for use by initializeLegacyTokens in legacy-utils.ts
|
|
44
|
+
export {
|
|
45
|
+
mainnetTokens,
|
|
46
|
+
sepoliaTokens,
|
|
47
|
+
polygonTokens,
|
|
48
|
+
hederaTokens,
|
|
49
|
+
bnbTokens,
|
|
50
|
+
trc10tokens,
|
|
51
|
+
trc20tokens,
|
|
52
|
+
asatokens,
|
|
53
|
+
esdttokens,
|
|
54
|
+
cardanoNativeTokens,
|
|
55
|
+
stellarTokens,
|
|
56
|
+
vechainTokens,
|
|
57
|
+
jettonTokens,
|
|
58
|
+
filecoinTokens,
|
|
59
|
+
spltokens,
|
|
60
|
+
sonicTokens,
|
|
61
|
+
coreTokens,
|
|
62
|
+
celoTokens,
|
|
63
|
+
suitokens,
|
|
64
|
+
aptCoinTokens,
|
|
65
|
+
aptFATokens,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Function to initialize legacy tokens (using the actual data imports)
|
|
69
|
+
export function initializeLegacyTokens(
|
|
70
|
+
addTokens: (tokens: (TokenCurrency | undefined)[]) => void,
|
|
71
|
+
): void {
|
|
72
|
+
// Ethereum mainnet tokens
|
|
73
|
+
addTokens(mainnetTokens.map(convertERC20));
|
|
74
|
+
// Ethereum Sepolia testnet tokens
|
|
75
|
+
addTokens(sepoliaTokens.map(convertERC20));
|
|
76
|
+
// Polygon tokens
|
|
77
|
+
addTokens(polygonTokens.map(convertERC20));
|
|
78
|
+
// Hedera tokens
|
|
79
|
+
addTokens(hederaTokens.map(convertHederaTokens));
|
|
80
|
+
// Binance Smart Chain tokens
|
|
81
|
+
addTokens(bnbTokens.map(convertERC20));
|
|
82
|
+
// Tron tokens
|
|
83
|
+
addTokens(trc10tokens.map(convertTRONTokens("trc10")));
|
|
84
|
+
addTokens(trc20tokens.map(convertTRONTokens("trc20")));
|
|
85
|
+
// Algoland tokens
|
|
86
|
+
addTokens(asatokens.map(convertAlgorandASATokens));
|
|
87
|
+
// MultiversX tokens
|
|
88
|
+
addTokens(esdttokens.map(convertMultiversXESDTTokens));
|
|
89
|
+
// Cardano tokens
|
|
90
|
+
addTokens(cardanoNativeTokens.map(convertCardanoNativeTokens));
|
|
91
|
+
// Stellar tokens
|
|
92
|
+
addTokens(stellarTokens.map(convertStellarTokens));
|
|
93
|
+
// VeChain tokens
|
|
94
|
+
addTokens(vechainTokens.map(convertVechainToken));
|
|
95
|
+
// Ton tokens
|
|
96
|
+
addTokens(jettonTokens.map(convertJettonToken));
|
|
97
|
+
// Filecoin tokens
|
|
98
|
+
addTokens(filecoinTokens.map(convertERC20));
|
|
99
|
+
// Solana tokens
|
|
100
|
+
addTokens(spltokens.map(convertSplTokens));
|
|
101
|
+
// Sonic
|
|
102
|
+
addTokens(sonicTokens.map(convertERC20));
|
|
103
|
+
// Core
|
|
104
|
+
addTokens(coreTokens.map(convertERC20));
|
|
105
|
+
// Celo
|
|
106
|
+
addTokens(celoTokens.map(convertERC20));
|
|
107
|
+
|
|
108
|
+
if (getEnv("SUI_ENABLE_TOKENS")) {
|
|
109
|
+
// Sui tokens
|
|
110
|
+
addTokens(suitokens.map(convertSuiTokens));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (getEnv("APTOS_ENABLE_TOKENS")) {
|
|
114
|
+
// Aptos Legacy Coin tokens
|
|
115
|
+
// Aptos fungible assets tokens
|
|
116
|
+
addTokens(aptCoinTokens.map(convertAptCoinTokens));
|
|
117
|
+
addTokens(aptFATokens.map(convertAptFaTokens));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
|
+
|
|
3
|
+
// Legacy state variables that are used for the legacy implementation of CryptoAssetsStore contract
|
|
4
|
+
export const tokensByTicker: Record<string, TokenCurrency> = {};
|
|
5
|
+
export const tokensByAddress: Record<string, TokenCurrency> = {};
|
|
6
|
+
export const tokensArray: TokenCurrency[] = [];
|
|
7
|
+
export const tokensArrayWithDelisted: TokenCurrency[] = [];
|
|
8
|
+
export const tokensByCryptoCurrency: Record<string, TokenCurrency[]> = {};
|
|
9
|
+
export const tokensByCryptoCurrencyWithDelisted: Record<string, TokenCurrency[]> = {};
|
|
10
|
+
export const tokensById: Record<string, TokenCurrency> = {};
|
|
11
|
+
export const tokensByCurrencyAddress: Record<string, TokenCurrency> = {};
|
|
12
|
+
export const tokenListHashes = new Set();
|