@ledgerhq/coin-framework 0.5.1 → 0.5.2-next.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.
@@ -18,6 +18,7 @@ setSupportedCurrencies(["ethereum", "ethereum_classic", "tron"]);
18
18
  describe("groupAccountOperationsByDay", () => {
19
19
  test("basic", () => {
20
20
  const account = genAccount("seed_7", {
21
+ currency: getCryptoCurrencyById("zcash"),
21
22
  operationsSize: 20,
22
23
  });
23
24
  const res1 = groupAccountOperationsByDay(account, {
@@ -66,6 +66,8 @@ const hardcodedMarketcap = [
66
66
  "qtum",
67
67
  "ethereum/erc20/huobitoken",
68
68
  "bitcoin_gold",
69
+ "kava_evm",
70
+ "optimism",
69
71
  "ethereum/erc20/paxos_standard__pax_",
70
72
  "ethereum/erc20/trueusd",
71
73
  "ethereum/erc20/omg",
@@ -177,6 +179,10 @@ const currencyIdApproxMarketPrice: Record<string, number> = {
177
179
  dash: 0.0003367,
178
180
  peercoin: 0.000226,
179
181
  zcash: 0.000205798,
182
+ polygon: 1.0e-15,
183
+ bsc: 5.0e-14,
184
+ optimism: 2.0e-15,
185
+ kava_evm: 2.0e-16,
180
186
  };
181
187
  // mock only use subset of cryptocurrencies to not affect tests when adding coins
182
188
  const currencies = listCryptoCurrencies().filter(c => currencyIdApproxMarketPrice[c.id]);
@@ -22,7 +22,7 @@ export function genHex(length: number, rng: Prando): string {
22
22
  export function genAddress(currency: CryptoCurrency | TokenCurrency, rng: Prando): string {
23
23
  if (
24
24
  currency.type === "CryptoCurrency"
25
- ? currency.family === "ethereum" // all eth family
25
+ ? currency.family === "ethereum" || currency.family === "evm" // all evm family
26
26
  : currency.id.startsWith("ethereum") // erc20 case
27
27
  ) {
28
28
  return `0x${genHex(40, rng)}`;
@@ -10,7 +10,7 @@ import { CollectionMetadataInput, NftMetadataInput, NftRequestsBatcher } from ".
10
10
  import { makeBatcher } from "../batcher";
11
11
 
12
12
  export function isNFTActive(currency: CryptoCurrency | undefined | null): boolean {
13
- return getEnv("NFT_CURRENCIES").split(",").includes(currency?.id);
13
+ return !!currency && getEnv("NFT_CURRENCIES").split(",").includes(currency?.id);
14
14
  }
15
15
 
16
16
  const nftCapabilities: Record<string, NFTStandard[]> = {