@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.
- package/CHANGELOG.md +13 -0
- package/lib/account.test.js +1 -0
- package/lib/account.test.js.map +1 -1
- package/lib/mocks/account.d.ts.map +1 -1
- package/lib/mocks/account.js +6 -0
- package/lib/mocks/account.js.map +1 -1
- package/lib/mocks/helpers.js +1 -1
- package/lib/mocks/helpers.js.map +1 -1
- package/lib/nft/support.js +1 -1
- package/lib/nft/support.js.map +1 -1
- package/lib-es/account.test.js +1 -0
- package/lib-es/account.test.js.map +1 -1
- package/lib-es/mocks/account.d.ts.map +1 -1
- package/lib-es/mocks/account.js +6 -0
- package/lib-es/mocks/account.js.map +1 -1
- package/lib-es/mocks/helpers.js +1 -1
- package/lib-es/mocks/helpers.js.map +1 -1
- package/lib-es/nft/support.js +1 -1
- package/lib-es/nft/support.js.map +1 -1
- package/package.json +4 -4
- package/src/__snapshots__/account.test.ts.snap +1134 -1166
- package/src/account.test.ts +1 -0
- package/src/mocks/account.ts +6 -0
- package/src/mocks/helpers.ts +1 -1
- package/src/nft/support.ts +1 -1
package/src/account.test.ts
CHANGED
|
@@ -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, {
|
package/src/mocks/account.ts
CHANGED
|
@@ -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]);
|
package/src/mocks/helpers.ts
CHANGED
|
@@ -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
|
|
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)}`;
|
package/src/nft/support.ts
CHANGED
|
@@ -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[]> = {
|