@ledgerhq/cryptoassets 13.12.0 → 13.13.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/abandonseed.d.ts.map +1 -1
  3. package/lib/abandonseed.js +1 -0
  4. package/lib/abandonseed.js.map +1 -1
  5. package/lib/crypto-assets-importer/importers/esdt/esdt.test.js +4 -4
  6. package/lib/crypto-assets-importer/importers/esdt/esdt.test.js.map +1 -1
  7. package/lib/crypto-assets-importer/importers/esdt/index.d.ts.map +1 -1
  8. package/lib/crypto-assets-importer/importers/esdt/index.js +3 -2
  9. package/lib/crypto-assets-importer/importers/esdt/index.js.map +1 -1
  10. package/lib/currencies.d.ts.map +1 -1
  11. package/lib/currencies.js +28 -27
  12. package/lib/currencies.js.map +1 -1
  13. package/lib/data/esdt.d.ts +2 -2
  14. package/lib/data/esdt.d.ts.map +1 -1
  15. package/lib/data/esdt.js.map +1 -1
  16. package/lib/tokens.d.ts.map +1 -1
  17. package/lib/tokens.js +7 -6
  18. package/lib/tokens.js.map +1 -1
  19. package/lib/types.d.ts +1 -1
  20. package/lib/types.d.ts.map +1 -1
  21. package/lib-es/abandonseed.d.ts.map +1 -1
  22. package/lib-es/abandonseed.js +1 -0
  23. package/lib-es/abandonseed.js.map +1 -1
  24. package/lib-es/crypto-assets-importer/importers/esdt/esdt.test.js +4 -4
  25. package/lib-es/crypto-assets-importer/importers/esdt/esdt.test.js.map +1 -1
  26. package/lib-es/crypto-assets-importer/importers/esdt/index.d.ts.map +1 -1
  27. package/lib-es/crypto-assets-importer/importers/esdt/index.js +3 -2
  28. package/lib-es/crypto-assets-importer/importers/esdt/index.js.map +1 -1
  29. package/lib-es/currencies.d.ts.map +1 -1
  30. package/lib-es/currencies.js +28 -27
  31. package/lib-es/currencies.js.map +1 -1
  32. package/lib-es/data/esdt.d.ts +2 -2
  33. package/lib-es/data/esdt.d.ts.map +1 -1
  34. package/lib-es/data/esdt.js.map +1 -1
  35. package/lib-es/tokens.d.ts.map +1 -1
  36. package/lib-es/tokens.js +7 -6
  37. package/lib-es/tokens.js.map +1 -1
  38. package/lib-es/types.d.ts +1 -1
  39. package/lib-es/types.d.ts.map +1 -1
  40. package/package.json +3 -3
  41. package/src/__snapshots__/currencies.test.ts.snap +1 -1
  42. package/src/abandonseed.ts +1 -0
  43. package/src/crypto-assets-importer/importers/esdt/esdt.test.ts +4 -4
  44. package/src/crypto-assets-importer/importers/esdt/index.ts +5 -4
  45. package/src/currencies.ts +28 -27
  46. package/src/data/esdt.ts +2 -2
  47. package/src/tokens.ts +9 -8
  48. package/src/types.ts +1 -1
@@ -2,7 +2,7 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import { fetchTokensFromCALService } from "../../fetch";
4
4
 
5
- type ElrondESDTToken = [
5
+ type MultiversXESDTToken = [
6
6
  string, // ticker
7
7
  string, // identifier
8
8
  number, // decimals
@@ -13,6 +13,7 @@ type ElrondESDTToken = [
13
13
  export const importESDTTokens = async (outputDir: string) => {
14
14
  try {
15
15
  console.log("importing esdt tokens...");
16
+ // const { tokens, hash } = await fetchTokensFromCALService({ blockchain_name: "multiversx" }, [
16
17
  const { tokens, hash } = await fetchTokensFromCALService({ blockchain_name: "elrond" }, [
17
18
  "ticker",
18
19
  "id",
@@ -20,7 +21,7 @@ export const importESDTTokens = async (outputDir: string) => {
20
21
  "live_signature",
21
22
  "name",
22
23
  ]);
23
- const esdtTokens: ElrondESDTToken[] = tokens.map(token => {
24
+ const esdtTokens: MultiversXESDTToken[] = tokens.map(token => {
24
25
  // This shouldn't be necessary, we should consumme the ID directly
25
26
  // but for now, I'll keep this to maintain a compatibility layer
26
27
  // with the content of the CDN (which should be removed soon)
@@ -30,7 +31,7 @@ export const importESDTTokens = async (outputDir: string) => {
30
31
  });
31
32
 
32
33
  const filePath = path.join(outputDir, "esdt");
33
- const estTypeStringified = `export type ElrondESDTToken = [
34
+ const estTypeStringified = `export type MultiversXESDTToken = [
34
35
  string, // ticker
35
36
  string, // identifier
36
37
  number, // decimals
@@ -51,7 +52,7 @@ import tokens from "./esdt.json";
51
52
 
52
53
  ${hash ? `export { default as hash } from "./esdt-hash.json";` : ""}
53
54
 
54
- export default tokens as ElrondESDTToken[];
55
+ export default tokens as MultiversXESDTToken[];
55
56
  `,
56
57
  );
57
58
 
package/src/currencies.ts CHANGED
@@ -1080,33 +1080,6 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
1080
1080
  ],
1081
1081
  explorerViews: [],
1082
1082
  },
1083
- elrond: {
1084
- type: "CryptoCurrency",
1085
- id: "elrond",
1086
- coinType: CoinType.MULTIVERSX,
1087
- name: "MultiversX",
1088
- managerAppName: "MultiversX",
1089
- ticker: "EGLD",
1090
- scheme: "elrond",
1091
- color: "#23F7DD",
1092
- family: "elrond",
1093
- blockAvgTime: 6,
1094
- deviceTicker: "EGLD",
1095
- units: [
1096
- {
1097
- name: "EGLD",
1098
- code: "EGLD",
1099
- magnitude: 18,
1100
- },
1101
- ],
1102
- explorerViews: [
1103
- {
1104
- tx: "https://explorer.elrond.com/transactions/$hash",
1105
- address: "https://explorer.elrond.com/accounts/$address",
1106
- },
1107
- ],
1108
- keywords: ["elrond"],
1109
- },
1110
1083
  eos: {
1111
1084
  type: "CryptoCurrency",
1112
1085
  id: "eos",
@@ -1793,6 +1766,34 @@ export const cryptocurrenciesById: Record<CryptoCurrencyId, CryptoCurrency> = {
1793
1766
  ],
1794
1767
  keywords: ["xmr", "monero"],
1795
1768
  },
1769
+ elrond: {
1770
+ type: "CryptoCurrency",
1771
+ // id: "multiversx",
1772
+ id: "elrond",
1773
+ coinType: CoinType.MULTIVERSX,
1774
+ name: "MultiversX",
1775
+ managerAppName: "MultiversX",
1776
+ ticker: "EGLD",
1777
+ scheme: "multiversx",
1778
+ color: "#23F7DD",
1779
+ family: "multiversx",
1780
+ blockAvgTime: 6,
1781
+ deviceTicker: "EGLD",
1782
+ units: [
1783
+ {
1784
+ name: "EGLD",
1785
+ code: "EGLD",
1786
+ magnitude: 18,
1787
+ },
1788
+ ],
1789
+ explorerViews: [
1790
+ {
1791
+ tx: "https://explorer.multiversx.com/transactions/$hash",
1792
+ address: "https://explorer.multiversx.com/accounts/$address",
1793
+ },
1794
+ ],
1795
+ keywords: ["multiversx"],
1796
+ },
1796
1797
  musicoin: {
1797
1798
  type: "CryptoCurrency",
1798
1799
  id: "musicoin",
package/src/data/esdt.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type ElrondESDTToken = [
1
+ export type MultiversXESDTToken = [
2
2
  string, // ticker
3
3
  string, // identifier
4
4
  number, // decimals
@@ -10,4 +10,4 @@ import tokens from "./esdt.json";
10
10
 
11
11
  export { default as hash } from "./esdt-hash.json";
12
12
 
13
- export default tokens as ElrondESDTToken[];
13
+ export default tokens as MultiversXESDTToken[];
package/src/tokens.ts CHANGED
@@ -5,7 +5,7 @@ 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
7
  import vechainTokens, { Vip180Token } from "./data/vip180";
8
- import esdttokens, { ElrondESDTToken } from "./data/esdt";
8
+ import esdttokens, { MultiversXESDTToken } from "./data/esdt";
9
9
  import asatokens, { AlgorandASAToken } from "./data/asa";
10
10
  import { tokens as polygonTokens } from "./data/evm/137";
11
11
  import trc10tokens, { TRC10Token } from "./data/trc10";
@@ -40,8 +40,8 @@ addTokens(trc10tokens.map(convertTRONTokens("trc10")));
40
40
  addTokens(trc20tokens.map(convertTRONTokens("trc20")));
41
41
  // Algoland tokens
42
42
  addTokens(asatokens.map(convertAlgorandASATokens));
43
- // Elrond tokens
44
- addTokens(esdttokens.map(convertElrondESDTTokens));
43
+ // MultiversX tokens
44
+ addTokens(esdttokens.map(convertMultiversXESDTTokens));
45
45
  // Cardano tokens
46
46
  addTokens(cardanoNativeTokens.map(convertCardanoNativeTokens));
47
47
  // Stellar tokens
@@ -373,20 +373,21 @@ function convertTRONTokens(type: "trc10" | "trc20") {
373
373
  };
374
374
  }
375
375
 
376
- function convertElrondESDTTokens([
376
+ function convertMultiversXESDTTokens([
377
377
  ticker,
378
378
  identifier,
379
379
  decimals,
380
380
  signature,
381
381
  name,
382
- ]: ElrondESDTToken): TokenCurrency {
383
- const ELROND_ESDT_CONTRACT = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u";
382
+ ]: MultiversXESDTToken): TokenCurrency {
383
+ const MULTIVERSX_ESDT_CONTRACT = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u";
384
+ // const parentCurrency = getCryptoCurrencyById("multiversx");
384
385
  const parentCurrency = getCryptoCurrencyById("elrond");
385
386
 
386
387
  return {
387
388
  type: "TokenCurrency",
388
- id: `elrond/esdt/${identifier}`,
389
- contractAddress: ELROND_ESDT_CONTRACT,
389
+ id: `multiversx/esdt/${identifier}`,
390
+ contractAddress: MULTIVERSX_ESDT_CONTRACT,
390
391
  ledgerSignature: signature,
391
392
  parentCurrency,
392
393
  tokenType: "esdt",
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { CardanoNativeToken } from "./data/cardanoNative";
2
2
  export type { AlgorandASAToken } from "./data/asa";
3
- export type { ElrondESDTToken } from "./data/esdt";
3
+ export type { MultiversXESDTToken } from "./data/esdt";
4
4
  export type { StellarToken } from "./data/stellar";
5
5
  export type { TRC10Token } from "./data/trc10";
6
6
  export type { TRC20Token } from "./data/trc20";