@ledgerhq/cryptoassets 13.26.0 → 13.27.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 +6 -0
- package/lib/abandonseed.d.ts.map +1 -1
- package/lib/abandonseed.js +2 -0
- package/lib/abandonseed.js.map +1 -1
- package/lib/api-asset-converter.d.ts +1 -1
- package/lib/api-asset-converter.d.ts.map +1 -1
- package/lib/crypto-assets-importer/importers/hedera/hedera.test.d.ts +2 -0
- package/lib/crypto-assets-importer/importers/hedera/hedera.test.d.ts.map +1 -0
- package/lib/crypto-assets-importer/importers/hedera/hedera.test.js +64 -0
- package/lib/crypto-assets-importer/importers/hedera/hedera.test.js.map +1 -0
- package/lib/crypto-assets-importer/importers/hedera/index.d.ts +2 -0
- package/lib/crypto-assets-importer/importers/hedera/index.d.ts.map +1 -0
- package/lib/crypto-assets-importer/importers/hedera/index.js +60 -0
- package/lib/crypto-assets-importer/importers/hedera/index.js.map +1 -0
- package/lib/crypto-assets-importer/index.js +2 -0
- package/lib/crypto-assets-importer/index.js.map +1 -1
- package/lib/currencies.d.ts.map +1 -1
- package/lib/currencies.js +65 -1
- package/lib/currencies.js.map +1 -1
- package/lib/data/hedera-hash.json +1 -0
- package/lib/data/hedera.d.ts +13 -0
- package/lib/data/hedera.d.ts.map +1 -0
- package/lib/data/hedera.js +11 -0
- package/lib/data/hedera.js.map +1 -0
- package/lib/data/hedera.json +1 -0
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js +23 -0
- package/lib/tokens.js.map +1 -1
- package/lib-es/abandonseed.d.ts.map +1 -1
- package/lib-es/abandonseed.js +2 -0
- package/lib-es/abandonseed.js.map +1 -1
- package/lib-es/api-asset-converter.d.ts +1 -1
- package/lib-es/api-asset-converter.d.ts.map +1 -1
- package/lib-es/crypto-assets-importer/importers/hedera/hedera.test.d.ts +2 -0
- package/lib-es/crypto-assets-importer/importers/hedera/hedera.test.d.ts.map +1 -0
- package/lib-es/crypto-assets-importer/importers/hedera/hedera.test.js +59 -0
- package/lib-es/crypto-assets-importer/importers/hedera/hedera.test.js.map +1 -0
- package/lib-es/crypto-assets-importer/importers/hedera/index.d.ts +2 -0
- package/lib-es/crypto-assets-importer/importers/hedera/index.d.ts.map +1 -0
- package/lib-es/crypto-assets-importer/importers/hedera/index.js +53 -0
- package/lib-es/crypto-assets-importer/importers/hedera/index.js.map +1 -0
- package/lib-es/crypto-assets-importer/index.js +2 -0
- package/lib-es/crypto-assets-importer/index.js.map +1 -1
- package/lib-es/currencies.d.ts.map +1 -1
- package/lib-es/currencies.js +65 -1
- package/lib-es/currencies.js.map +1 -1
- package/lib-es/data/hedera-hash.json +1 -0
- package/lib-es/data/hedera.d.ts +13 -0
- package/lib-es/data/hedera.d.ts.map +1 -0
- package/lib-es/data/hedera.js +4 -0
- package/lib-es/data/hedera.js.map +1 -0
- package/lib-es/data/hedera.json +1 -0
- package/lib-es/tokens.d.ts.map +1 -1
- package/lib-es/tokens.js +23 -0
- package/lib-es/tokens.js.map +1 -1
- package/package.json +4 -4
- package/src/abandonseed.ts +2 -0
- package/src/api-asset-converter.ts +1 -1
- package/src/crypto-assets-importer/importers/hedera/hedera.test.ts +75 -0
- package/src/crypto-assets-importer/importers/hedera/index.ts +69 -0
- package/src/crypto-assets-importer/index.ts +2 -0
- package/src/currencies.ts +65 -1
- package/src/data/hedera-hash.json +1 -0
- package/src/data/hedera.json +1 -0
- package/src/data/hedera.ts +15 -0
- package/src/tokens.ts +32 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/cryptoassets",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.27.0-nightly.0",
|
|
4
4
|
"description": "Ledger crypto-assets list",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger"
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"module": "lib-es/index.js",
|
|
21
21
|
"types": "lib/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"axios": "1.
|
|
23
|
+
"axios": "1.11.0",
|
|
24
24
|
"bs58check": "^2.1.2",
|
|
25
25
|
"invariant": "2",
|
|
26
|
-
"@ledgerhq/live-env": "^2.
|
|
26
|
+
"@ledgerhq/live-env": "^2.15.0-nightly.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/bs58check": "^2.1.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"source-map-support": "^0.5.21",
|
|
36
36
|
"ts-jest": "^29.1.1",
|
|
37
37
|
"ts-node": "^10.7.0",
|
|
38
|
-
"@ledgerhq/types-cryptoassets": "^7.
|
|
38
|
+
"@ledgerhq/types-cryptoassets": "^7.26.0-nightly.1"
|
|
39
39
|
},
|
|
40
40
|
"typesVersions": {
|
|
41
41
|
"*": {
|
package/src/abandonseed.ts
CHANGED
|
@@ -132,6 +132,8 @@ const abandonSeedAddresses: Partial<Record<CryptoCurrency["id"], string>> = {
|
|
|
132
132
|
sei_network_evm: EVM_DEAD_ADDRESS,
|
|
133
133
|
berachain: EVM_DEAD_ADDRESS,
|
|
134
134
|
canton_network: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
135
|
+
canton_network_devnet: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
136
|
+
canton_network_localnet: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
135
137
|
};
|
|
136
138
|
|
|
137
139
|
/**
|
|
@@ -24,7 +24,7 @@ export interface ApiCryptoCurrency {
|
|
|
24
24
|
name: string;
|
|
25
25
|
ticker: string;
|
|
26
26
|
units: Array<{ code: string; name: string; magnitude: number }>;
|
|
27
|
-
chainId?: string;
|
|
27
|
+
chainId?: string | null;
|
|
28
28
|
confirmationsNeeded?: number;
|
|
29
29
|
symbol?: string;
|
|
30
30
|
coinType?: number;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { importHederaTokens } from ".";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
|
|
5
|
+
const hederaTokens = [
|
|
6
|
+
{
|
|
7
|
+
id: "hedera/hts/hbark_0.0.5022567",
|
|
8
|
+
contract_address: "0.0.5022567",
|
|
9
|
+
decimals: 0,
|
|
10
|
+
network: "hedera",
|
|
11
|
+
delisted: false,
|
|
12
|
+
name: "hBARK",
|
|
13
|
+
ticker: "hBARK",
|
|
14
|
+
blockchain_name: "hedera",
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const mockedAxios = jest.spyOn(axios, "get");
|
|
19
|
+
|
|
20
|
+
describe("import Hedera tokens", () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
mockedAxios.mockImplementation(() =>
|
|
23
|
+
Promise.resolve({
|
|
24
|
+
data: hederaTokens,
|
|
25
|
+
headers: { ["etag"]: "commitHash" },
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
afterEach(() => {
|
|
31
|
+
jest.clearAllMocks();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should output the file in the correct format", async () => {
|
|
35
|
+
const expectedFile = `export type HederaToken = [
|
|
36
|
+
string, // id
|
|
37
|
+
string, // tokenId
|
|
38
|
+
string, // name
|
|
39
|
+
string, // ticker
|
|
40
|
+
string, // network
|
|
41
|
+
number, // decimals
|
|
42
|
+
boolean, // delisted
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
import tokens from "./hedera.json";
|
|
46
|
+
|
|
47
|
+
export { default as hash } from "./hedera-hash.json";
|
|
48
|
+
|
|
49
|
+
export default tokens as HederaToken[];
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
const mockedFs = (fs.writeFileSync = jest.fn());
|
|
53
|
+
|
|
54
|
+
await importHederaTokens(".");
|
|
55
|
+
|
|
56
|
+
expect(mockedAxios).toHaveBeenCalledWith(
|
|
57
|
+
"https://crypto-assets-service.api.ledger.com/v1/tokens",
|
|
58
|
+
{
|
|
59
|
+
params: {
|
|
60
|
+
blockchain_name: "hedera",
|
|
61
|
+
output: "id,contract_address,name,ticker,network,decimals,delisted",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
expect(mockedFs).toHaveBeenNthCalledWith(
|
|
66
|
+
1,
|
|
67
|
+
"hedera.json",
|
|
68
|
+
JSON.stringify([
|
|
69
|
+
["hedera/hts/hbark_0.0.5022567", "0.0.5022567", "hBARK", "hBARK", "hedera", 0, false],
|
|
70
|
+
]),
|
|
71
|
+
);
|
|
72
|
+
expect(mockedFs).toHaveBeenNthCalledWith(2, "hedera-hash.json", JSON.stringify("commitHash"));
|
|
73
|
+
expect(mockedFs).toHaveBeenNthCalledWith(3, "hedera.ts", expectedFile);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fetchTokensFromCALService } from "../../fetch";
|
|
4
|
+
|
|
5
|
+
type HederaToken = [
|
|
6
|
+
string, // id
|
|
7
|
+
string, // tokenId
|
|
8
|
+
string, // name
|
|
9
|
+
string, // ticker
|
|
10
|
+
string, // network
|
|
11
|
+
number, // decimals
|
|
12
|
+
boolean, // delisted
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export const importHederaTokens = async (outputDir: string) => {
|
|
16
|
+
try {
|
|
17
|
+
console.log("importing hedera tokens...");
|
|
18
|
+
const { tokens, hash } = await fetchTokensFromCALService({ blockchain_name: "hedera" }, [
|
|
19
|
+
"id",
|
|
20
|
+
"contract_address",
|
|
21
|
+
"name",
|
|
22
|
+
"ticker",
|
|
23
|
+
"network",
|
|
24
|
+
"decimals",
|
|
25
|
+
"delisted",
|
|
26
|
+
]);
|
|
27
|
+
const hederaTokens: HederaToken[] = tokens.map(token => [
|
|
28
|
+
token.id,
|
|
29
|
+
token.contract_address,
|
|
30
|
+
token.name,
|
|
31
|
+
token.ticker,
|
|
32
|
+
token.network,
|
|
33
|
+
token.decimals,
|
|
34
|
+
token.delisted,
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
const filePath = path.join(outputDir, "hedera");
|
|
38
|
+
const hederaTypeStringified = `export type HederaToken = [
|
|
39
|
+
string, // id
|
|
40
|
+
string, // tokenId
|
|
41
|
+
string, // name
|
|
42
|
+
string, // ticker
|
|
43
|
+
string, // network
|
|
44
|
+
number, // decimals
|
|
45
|
+
boolean, // delisted
|
|
46
|
+
];`;
|
|
47
|
+
|
|
48
|
+
fs.writeFileSync(`${filePath}.json`, JSON.stringify(hederaTokens));
|
|
49
|
+
if (hash) {
|
|
50
|
+
fs.writeFileSync(`${filePath}-hash.json`, JSON.stringify(hash));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
fs.writeFileSync(
|
|
54
|
+
`${filePath}.ts`,
|
|
55
|
+
`${hederaTypeStringified}
|
|
56
|
+
|
|
57
|
+
import tokens from "./hedera.json";
|
|
58
|
+
|
|
59
|
+
${hash ? `export { default as hash } from "./hedera-hash.json";` : ""}
|
|
60
|
+
|
|
61
|
+
export default tokens as HederaToken[];
|
|
62
|
+
`,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
console.log("importing hedera tokens sucess");
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.error(err);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
@@ -6,6 +6,7 @@ import { importEIP712, importEIP712v2 } from "./importers/eip712";
|
|
|
6
6
|
import { importESDTTokens } from "./importers/esdt";
|
|
7
7
|
import { importEVMTokens } from "./importers/evm";
|
|
8
8
|
import { importFilecoinERC20Tokens } from "./importers/filecoin";
|
|
9
|
+
import { importHederaTokens } from "./importers/hedera";
|
|
9
10
|
import { importSPLTokens } from "./importers/spl";
|
|
10
11
|
import { importSuiTokens } from "./importers/sui";
|
|
11
12
|
import { importStellarTokens } from "./importers/stellar";
|
|
@@ -31,6 +32,7 @@ const importTokens = async () => {
|
|
|
31
32
|
importAsaTokens(outputFolder),
|
|
32
33
|
importCardanoNativeTokens(outputFolder),
|
|
33
34
|
importESDTTokens(outputFolder),
|
|
35
|
+
importHederaTokens(outputFolder),
|
|
34
36
|
importSPLTokens(outputFolder),
|
|
35
37
|
importSuiTokens(outputFolder),
|
|
36
38
|
importStellarTokens(outputFolder),
|
package/src/currencies.ts
CHANGED
|
@@ -633,7 +633,71 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
|
|
|
633
633
|
address: "https://explorer-to-define.io/address/$address",
|
|
634
634
|
},
|
|
635
635
|
],
|
|
636
|
-
keywords: ["
|
|
636
|
+
keywords: ["canton_network"],
|
|
637
|
+
},
|
|
638
|
+
canton_network_localnet: {
|
|
639
|
+
type: "CryptoCurrency",
|
|
640
|
+
id: "canton_network_localnet",
|
|
641
|
+
coinType: CoinType.CANTON_NETWORK,
|
|
642
|
+
name: "Canton Network (Localnet)",
|
|
643
|
+
managerAppName: "Canton",
|
|
644
|
+
ticker: "CC",
|
|
645
|
+
scheme: "canton_network_localnet",
|
|
646
|
+
color: "#F8FFAE",
|
|
647
|
+
family: "canton",
|
|
648
|
+
blockAvgTime: 20,
|
|
649
|
+
isTestnetFor: "canton_network",
|
|
650
|
+
units: [
|
|
651
|
+
{
|
|
652
|
+
name: "cc",
|
|
653
|
+
code: "CC",
|
|
654
|
+
magnitude: 11,
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "ucc",
|
|
658
|
+
code: "ucc",
|
|
659
|
+
magnitude: 0,
|
|
660
|
+
},
|
|
661
|
+
],
|
|
662
|
+
explorerViews: [
|
|
663
|
+
{
|
|
664
|
+
tx: "https://explorer-to-define.io/transaction/$hash",
|
|
665
|
+
address: "https://explorer-to-define.io/address/$address",
|
|
666
|
+
},
|
|
667
|
+
],
|
|
668
|
+
keywords: ["canton_network_localnet"],
|
|
669
|
+
},
|
|
670
|
+
canton_network_devnet: {
|
|
671
|
+
type: "CryptoCurrency",
|
|
672
|
+
id: "canton_network_devnet",
|
|
673
|
+
coinType: CoinType.CANTON_NETWORK,
|
|
674
|
+
name: "Canton Network (Devnet)",
|
|
675
|
+
managerAppName: "Canton",
|
|
676
|
+
ticker: "CC",
|
|
677
|
+
scheme: "canton_network_devnet",
|
|
678
|
+
color: "#F8FFAE",
|
|
679
|
+
family: "canton",
|
|
680
|
+
blockAvgTime: 20,
|
|
681
|
+
isTestnetFor: "canton_network",
|
|
682
|
+
units: [
|
|
683
|
+
{
|
|
684
|
+
name: "cc",
|
|
685
|
+
code: "CC",
|
|
686
|
+
magnitude: 11,
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
name: "ucc",
|
|
690
|
+
code: "ucc",
|
|
691
|
+
magnitude: 0,
|
|
692
|
+
},
|
|
693
|
+
],
|
|
694
|
+
explorerViews: [
|
|
695
|
+
{
|
|
696
|
+
tx: "https://explorer-to-define.io/transaction/$hash",
|
|
697
|
+
address: "https://explorer-to-define.io/address/$address",
|
|
698
|
+
},
|
|
699
|
+
],
|
|
700
|
+
keywords: ["canton_network_devnet"],
|
|
637
701
|
},
|
|
638
702
|
cardano: {
|
|
639
703
|
type: "CryptoCurrency",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"W/\"f2c4f969855182d7c42817f8c1bfd0f2082f172e\""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[["hedera/hts/_0.0.7893707","0.0.7893707","༼ つ ◕_◕ ༽つ","gib","hedera",8,false],["hedera/hts/2fingersinu_0.0.7985880","0.0.7985880","2FingersInu","2FingersInu","hedera",8,false],["hedera/hts/aram_0.0.7893276","0.0.7893276","ĦARAM","HARAM","hedera",8,false],["hedera/hts/asim_0.0.7893873","0.0.7893873","Asim","AWESOME","hedera",8,false],["hedera/hts/banksocial_0.0.4431990","0.0.4431990","BankSocial","BSL","hedera",8,false],["hedera/hts/bitcoin_0.0.4873177","0.0.4873177","Bitcoin.ℏ","BTC.","hedera",8,false],["hedera/hts/bonzo_0.0.8279134","0.0.8279134","BONZO","BONZO","hedera",8,false],["hedera/hts/bored_hash_club_0.0.1111899","0.0.1111899","Bored Hash Club","BHC","hedera",4,false],["hedera/hts/bsl_defender_0.0.8102801","0.0.8102801","BSL Defender","BSLD","hedera",8,false],["hedera/hts/bullbar_0.0.3155326","0.0.3155326","BullBar","Bull","hedera",6,false],["hedera/hts/calaxy_tokens_0.0.859814","0.0.859814","Calaxy Tokens","CLXY","hedera",6,false],["hedera/hts/candy_0.0.4571363","0.0.4571363","CANDY","CANDY","hedera",8,false],["hedera/hts/chad_the_alien_0.0.8046957","0.0.8046957","CHAD THE ALIEN","$CHADALIEN","hedera",8,false],["hedera/hts/chainlink_token_0.0.1055495","0.0.1055495","ChainLink Token","LINK[hts]","hedera",8,false],["hedera/hts/claybar_0.0.5716858","0.0.5716858","ClayBar","Clay","hedera",8,false],["hedera/hts/corgi_coin_0.0.4814059","0.0.4814059","Corgi Coin","CORGI","hedera",5,false],["hedera/hts/dai_stablecoin_0.0.1055477","0.0.1055477","Dai Stablecoin","DAI[hts]","hedera",8,false],["hedera/hts/dank_wraps_0.0.7926062","0.0.7926062","Dank Wraps","WRAPS","hedera",8,false],["hedera/hts/davincigraph_0.0.3706639","0.0.3706639","Davincigraph","DAVINCI","hedera",9,false],["hedera/hts/deathn_0.0.8023834","0.0.8023834","DeathN","DEATH","hedera",8,false],["hedera/hts/defenderdoge_0.0.8143736","0.0.8143736","DefenderDoge🐾🛡️","DDOG","hedera",8,false],["hedera/hts/diamond_standard_carats_0.0.1958126","0.0.1958126","Diamond Standard Carats","CARAT","hedera",2,false],["hedera/hts/dick_coin_0.0.781589","0.0.781589","DICK COIN 🍆","DICK","hedera",0,false],["hedera/hts/digirev_0.0.1704513","0.0.1704513","DigiRev","REV","hedera",8,false],["hedera/hts/dino_0.0.7907968","0.0.7907968","DINO","DINO","hedera",8,false],["hedera/hts/dino_nugg_0.0.7972587","0.0.7972587","Dino Nugg","DNUGG","hedera",8,false],["hedera/hts/dinopack_0.0.7894172","0.0.7894172","DINOPACK","DINOPACK","hedera",8,false],["hedera/hts/doctor_who_worlds_apart_0.0.4189968","0.0.4189968","Doctor Who: Worlds Apart","DWWA","hedera",0,false],["hedera/hts/dogegraph_0.0.7593158","0.0.7593158","DogeGraph","HDOG","hedera",8,false],["hedera/hts/donald_pump_0.0.8054575","0.0.8054575","DONALD PUMP","DTP","hedera",8,false],["hedera/hts/dosa_the_demon_0.0.7894159","0.0.7894159","Dosa The Demon","DOSA","hedera",8,false],["hedera/hts/dovu_0.0.3716059","0.0.3716059","Dovu","DOVU","hedera",8,false],["hedera/hts/dragon_ball_0.0.5945921","0.0.5945921","Dragon Ball","DRAGONBALL","hedera",8,false],["hedera/hts/dude_coin_0.0.7915608","0.0.7915608","Dude coin","$DUDEs","hedera",8,false],["hedera/hts/earth_guild_token_0.0.2009716","0.0.2009716","Earth Guild Token","EARTH","hedera",6,false],["hedera/hts/eggz_of_hedera_0.0.7684069","0.0.7684069","EGGZ of HEDERA","EGGZ","hedera",9,false],["hedera/hts/energy_trade_token_0.0.784681","0.0.784681","Energy Trade Token","ETT","hedera",0,false],["hedera/hts/escohbar_0.0.7925466","0.0.7925466","escohbar","esco","hedera",8,false],["hedera/hts/fins_0.0.7893551","0.0.7893551","FINS","FINS","hedera",8,false],["hedera/hts/fofar_0.0.8027534","0.0.8027534","Fofar","Fofar","hedera",8,false],["hedera/hts/gcoin_0.0.3241481","0.0.3241481","GCoin","GC","hedera",6,false],["hedera/hts/gct_token_0.0.6076224","0.0.6076224","GCT Token","GCT","hedera",8,false],["hedera/hts/goku_0.0.8046326","0.0.8046326","GOKU","GOKU","hedera",8,false],["hedera/hts/gold_standard_0.0.4365564","0.0.4365564","Gold Standard","AuBAR","hedera",6,false],["hedera/hts/g_raff_0.0.7915979","0.0.7915979","G-RAFF","GRAFF","hedera",8,false],["hedera/hts/greek_god_koala_peen_0.0.8051572","0.0.8051572","Greek God Koala Peen","GGKP","hedera",8,false],["hedera/hts/grelf_0.0.1159074","0.0.1159074","GRELF","GRELF","hedera",8,false],["hedera/hts/handtoken_0.0.1604668","0.0.1604668","HandToken","HJOB","hedera",0,false],["hedera/hts/hashgirl_0.0.7957904","0.0.7957904","Hashgirl","$Hgirl","hedera",8,false],["hedera/hts/hashman_0.0.7947081","0.0.7947081","Hashman","Hman","hedera",8,false],["hedera/hts/hash_monkey_0.0.7993971","0.0.7993971","Hash Monkey","#Monkey","hedera",8,false],["hedera/hts/hbarbarian_0.0.4816828","0.0.4816828","HBARbarian","HBARbarian","hedera",0,false],["hedera/hts/hbarboy_0.0.8033281","0.0.8033281","HbarBoy","$HB","hedera",8,false],["hedera/hts/hbark_0.0.5022567","0.0.5022567","hBARK","hBARK","hedera",0,false],["hedera/hts/hbar_soot_sprites_0.0.7893006","0.0.7893006","HBAR SOOT SPRITES","SOOT","hedera",8,false],["hedera/hts/hbarsuite_0.0.786931","0.0.786931","HbarSuite","HSUITE","hedera",4,false],["hedera/hts/hbarx_0.0.834116","0.0.834116","HBARX","HBARX","hedera",8,false],["hedera/hts/hchf_stablecoin_0.0.6070123","0.0.6070123","HCHF Stablecoin","HCHF","hedera",8,false],["hedera/hts/headstarter_0.0.968069","0.0.968069","HeadStarter","HST","hedera",8,false],["hedera/hts/hedera_guild_game_0.0.6722561","0.0.6722561","Hedera Guild Game","HGG","hedera",6,false],["hedera/hts/hedera_hashcraft_0.0.7926409","0.0.7926409","Hedera Hashcraft","CRAFT","hedera",8,false],["hedera/hts/hederahub_0.0.8192403","0.0.8192403","HederaHub","ALPHA","hedera",8,false],["hedera/hts/heliswap_0.0.1937609","0.0.1937609","HeliSwap","HELI","hedera",8,false],["hedera/hts/hert_0.0.7893347","0.0.7893347","HERT","HERT","hedera",8,false],["hedera/hts/hlqt_0.0.6070128","0.0.6070128","HLQT","HLQT","hedera",8,false],["hedera/hts/hoker_hbar_0.0.8113846","0.0.8113846","Hoker Hbar","H_K","hedera",8,false],["hedera/hts/honk_0.0.8090666","0.0.8090666","HONK","HONK","hedera",8,false],["hedera/hts/hoodie_0.0.8064144","0.0.8064144","HOODIE","HOODIE","hedera",8,false],["hedera/hts/hyzen_ai_0.0.5364570","0.0.5364570","hyzen.ai","HAI","hedera",6,false],["hedera/hts/iassets_0.0.1991880","0.0.1991880","iAssets","ASSET","hedera",6,false],["hedera/hts/ingwe_0.0.4047553","0.0.4047553","INGWE","INGWE","hedera",6,false],["hedera/hts/islas_canarias_0.0.4817159","0.0.4817159","ISLAS CANARIAS","CAN","hedera",0,false],["hedera/hts/ivy_0.0.8105204","0.0.8105204","IVY","IVY","hedera",8,false],["hedera/hts/kanary_0.0.7973590","0.0.7973590","KANARY","KANARY","hedera",8,false],["hedera/hts/karate_0.0.2283230","0.0.2283230","Karate","KARATE","hedera",8,false],["hedera/hts/karate_kitties_0.0.8146609","0.0.8146609","Karate Kitties","KITTY","hedera",8,false],["hedera/hts/kbl_0.0.5989978","0.0.5989978","KBL","KBL","hedera",6,false],["hedera/hts/kekius_maximus_0.0.8016734","0.0.8016734","Kekius Maximus","KEK","hedera",8,false],["hedera/hts/kgbp_23_0.0.3833795","0.0.3833795","KGBP-23","KGBP","hedera",6,false],["hedera/hts/koko_0.0.8026412","0.0.8026412","KOKO","KOKO","hedera",8,false],["hedera/hts/lari_0.0.7893583","0.0.7893583","LARI","LARI","hedera",8,false],["hedera/hts/lcx_0.0.1304772","0.0.1304772","LCX","LCX[hts]","hedera",8,false],["hedera/hts/leemonhead_0.0.7974354","0.0.7974354","LeemonHead","Leemon","hedera",8,false],["hedera/hts/lkr_0.0.8149762","0.0.8149762","LKR","LKR","hedera",2,false],["hedera/hts/love_0.0.2125082","0.0.2125082","love","LOVE","hedera",11,false],["hedera/hts/mantra_0.0.1080694","0.0.1080694","MANTRA","OM[hts]","hedera",8,false],["hedera/hts/mingo_0.0.632593","0.0.632593","Mingo","MINGO","hedera",4,false],["hedera/hts/mouth_0.0.4929186","0.0.4929186","MOUTH","MOUTH","hedera",8,false],["hedera/hts/nada_slime_world_nft_0.0.4152516","0.0.4152516","NADA Slime World NFT","SWF","hedera",0,false],["hedera/hts/nu_0.0.1244965","0.0.1244965","nu","nu","hedera",0,false],["hedera/hts/nyan_cat_0.0.7930961","0.0.7930961","Nyan Cat","NYAN","hedera",8,false],["hedera/hts/ok_0.0.7944722","0.0.7944722","Ok.","Ok.","hedera",8,false],["hedera/hts/pack_0.0.4794920","0.0.4794920","PACK","PACK","hedera",6,false],["hedera/hts/packtrick_0.0.7986018","0.0.7986018","PACKtrick","PACKT","hedera",8,false],["hedera/hts/pbar_0.0.1738930","0.0.1738930","PBAR","PBAR","hedera",8,false],["hedera/hts/pepe_the_king_prawn_0.0.8002934","0.0.8002934","Pepe' the King Prawn","$prawn","hedera",8,false],["hedera/hts/petal_0.0.1285191","0.0.1285191","Petal","PETAL","hedera",0,false],["hedera/hts/quant_0.0.1304757","0.0.1304757","Quant","QNT[hts]","hedera",8,false],["hedera/hts/sara_adkins_0.0.7893764","0.0.7893764","SARA ADKINS","SARA","hedera",8,false],["hedera/hts/sauce_0.0.731861","0.0.731861","SAUCE","SAUCE","hedera",6,false],["hedera/hts/sauceinu_0.0.2964435","0.0.2964435","SAUCEINU","SAUCEINU","hedera",7,false],["hedera/hts/sentx_0.0.2672057","0.0.2672057","SENTX","SENTX","hedera",8,false],["hedera/hts/shen1_0.0.3069558","0.0.3069558","SHEN1","SHEN1","hedera",4,false],["hedera/hts/shen2_0.0.3069594","0.0.3069594","SHEN2","SHEN2","hedera",4,false],["hedera/hts/shibar_0.0.751086","0.0.751086","Shibar","SHIBR","hedera",4,false],["hedera/hts/skux_token_0.0.485527","0.0.485527","SKUx Token","SKUX","hedera",2,false],["hedera/hts/slothbar_0.0.7917527","0.0.7917527","Slothbar","SLOTH","hedera",8,false],["hedera/hts/slug_0.0.7988483","0.0.7988483","SLUG","SLUG","hedera",8,false],["hedera/hts/smackm_0.0.8041571","0.0.8041571","SMACKM","SMACKM","hedera",8,false],["hedera/hts/sonichuinu_0.0.8015606","0.0.8015606","SONICHUINU","CWC","hedera",8,false],["hedera/hts/spaceape_0.0.3176721","0.0.3176721","SpaceApe","SpaceApe","hedera",7,false],["hedera/hts/steam_0.0.3210123","0.0.3210123","STEAM","STEAM","hedera",2,false],["hedera/hts/student_ikad_vc_0.0.6220586","0.0.6220586","Student Ikad VC","IKAD","hedera",0,false],["hedera/hts/tether_usd_0.0.1055472","0.0.1055472","Tether USD","USDT[hts]","hedera",6,false],["hedera/hts/timmyai_0.0.8098607","0.0.8098607","TimmyAI","Tim","hedera",8,false],["hedera/hts/tin_foil_hat_0.0.5700284","0.0.5700284","Tin Foil Hat","TFH","hedera",2,false],["hedera/hts/tomu_0.0.8108066","0.0.8108066","TOMU","TOMU","hedera",8,false],["hedera/hts/trash_artists_0.0.7927678","0.0.7927678","Trash Artists","TRASH","hedera",8,false],["hedera/hts/trippy_ape_coin_0.0.785041","0.0.785041","TRIPPY APE COIN 🐵","TRAPE","hedera",0,false],["hedera/hts/trump_0.0.8115822","0.0.8115822","TRUMP","HEDERA4TRUMP","hedera",8,false],["hedera/hts/trumpius_maximus_0.0.8023201","0.0.8023201","Trumpius Maximus","$TMax","hedera",8,false],["hedera/hts/tune_fm_0.0.127877","0.0.127877","Tune.FM","JAM","hedera",8,false],["hedera/hts/usd_coin_0.0.1055459","0.0.1055459","USD Coin","USDC[hts]","hedera",6,false],["hedera/hts/usd_coin_0.0.456858","0.0.456858","USD Coin","USDC","hedera",6,false],["hedera/hts/vemouth_0.0.4850949","0.0.4850949","veMOUTH","veMOUTH","hedera",8,false],["hedera/hts/war_0.0.2453465","0.0.2453465","WAR","WAR","hedera",4,false],["hedera/hts/wojak_0.0.4615071","0.0.4615071","Wojak","WOJAK","hedera",6,false],["hedera/hts/wrap_indonesian_rupiah_token_0.0.1993493","0.0.1993493","Wrap Indonesian Rupiah Token","WIDR","hedera",0,false],["hedera/hts/wrapped_avax_hts_0.0.1157020","0.0.1157020","Wrapped AVAX[hts]","WAVAX[hts]","hedera",8,false],["hedera/hts/wrapped_bnb_hts_0.0.1157005","0.0.1157005","Wrapped BNB[hts]","WBNB[hts]","hedera",8,false],["hedera/hts/wrapped_btc_0.0.1055483","0.0.1055483","Wrapped BTC","WBTC[hts]","hedera",8,false],["hedera/hts/wrapped_ether_hts_0.0.541564","0.0.541564","Wrapped Ether[hts]","WETH[hts]","hedera",8,false],["hedera/hts/wrapped_hbar_0.0.1062664","0.0.1062664","Wrapped Hbar","WHBAR","hedera",8,false],["hedera/hts/wrapped_hbar_0.0.1456986","0.0.1456986","Wrapped Hbar","WHBAR","hedera",8,false],["hedera/hts/wrapped_hedera_0.0.1738807","0.0.1738807","Wrapped Hedera","WHBAR","hedera",8,false],["hedera/hts/xbonzo_0.0.8490541","0.0.8490541","xBONZO","xBONZO","hedera",8,false],["hedera/hts/xbucks_0.0.1719227","0.0.1719227","Xbucks","Xbucks","hedera",2,false],["hedera/hts/xkbl_0.0.8061363","0.0.8061363","xKBL","XKBL","hedera",6,false],["hedera/hts/xpack_0.0.7243470","0.0.7243470","xPACK","XPACK","hedera",6,false],["hedera/hts/xphoton_0.0.4351436","0.0.4351436","XPHOTON","XPH","hedera",17,false],["hedera/hts/xsauce_0.0.1460200","0.0.1460200","xSAUCE","XSAUCE","hedera",6,false],["hedera/hts/yamgo_0.0.1391075","0.0.1391075","YAMGO","YAMGO","hedera",9,false],["hedera/hts/zer0_0.0.2085473","0.0.2085473","ZER0","ZER0","hedera",8,false]]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type HederaToken = [
|
|
2
|
+
string, // id
|
|
3
|
+
string, // tokenId
|
|
4
|
+
string, // name
|
|
5
|
+
string, // ticker
|
|
6
|
+
string, // network
|
|
7
|
+
number, // decimals
|
|
8
|
+
boolean, // delisted
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
import tokens from "./hedera.json";
|
|
12
|
+
|
|
13
|
+
export { default as hash } from "./hedera-hash.json";
|
|
14
|
+
|
|
15
|
+
export default tokens as HederaToken[];
|
package/src/tokens.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { findCryptoCurrencyById, getCryptoCurrencyById } from "./currencies";
|
|
|
4
4
|
import jettonTokens, { TonJettonToken } from "./data/ton-jetton";
|
|
5
5
|
import { tokens as sepoliaTokens } from "./data/evm/11155111";
|
|
6
6
|
import stellarTokens, { StellarToken } from "./data/stellar";
|
|
7
|
+
import hederaTokens, { HederaToken } from "./data/hedera";
|
|
7
8
|
import vechainTokens, { Vip180Token } from "./data/vip180";
|
|
8
9
|
import esdttokens, { MultiversXESDTToken } from "./data/esdt";
|
|
9
10
|
import asatokens, { AlgorandASAToken } from "./data/asa";
|
|
@@ -38,6 +39,8 @@ addTokens(mainnetTokens.map(convertERC20));
|
|
|
38
39
|
addTokens(sepoliaTokens.map(convertERC20));
|
|
39
40
|
// Polygon tokens
|
|
40
41
|
addTokens(polygonTokens.map(convertERC20));
|
|
42
|
+
// Hedera tokens
|
|
43
|
+
addTokens(hederaTokens.map(convertHederaTokens));
|
|
41
44
|
// Binance Smart Chain tokens
|
|
42
45
|
addTokens(bnbTokens.map(convertERC20));
|
|
43
46
|
// Tron tokens
|
|
@@ -501,6 +504,35 @@ export function convertSuiTokens([id, name, ticker, address, decimals]: SuiToken
|
|
|
501
504
|
};
|
|
502
505
|
}
|
|
503
506
|
|
|
507
|
+
function convertHederaTokens([
|
|
508
|
+
id,
|
|
509
|
+
tokenId,
|
|
510
|
+
name,
|
|
511
|
+
ticker,
|
|
512
|
+
network,
|
|
513
|
+
decimals,
|
|
514
|
+
delisted,
|
|
515
|
+
]: HederaToken): TokenCurrency {
|
|
516
|
+
return {
|
|
517
|
+
type: "TokenCurrency",
|
|
518
|
+
id,
|
|
519
|
+
contractAddress: tokenId,
|
|
520
|
+
parentCurrency: getCryptoCurrencyById(network),
|
|
521
|
+
tokenType: "hts",
|
|
522
|
+
name,
|
|
523
|
+
ticker,
|
|
524
|
+
delisted,
|
|
525
|
+
disableCountervalue: false,
|
|
526
|
+
units: [
|
|
527
|
+
{
|
|
528
|
+
name,
|
|
529
|
+
code: ticker,
|
|
530
|
+
magnitude: decimals,
|
|
531
|
+
},
|
|
532
|
+
],
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
|
|
504
536
|
export function convertCardanoNativeTokens([
|
|
505
537
|
parentCurrencyId,
|
|
506
538
|
policyId,
|