@ledgerhq/live-common 34.51.0-nightly.11 → 34.51.0-nightly.12
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/lib/config/index.d.ts +2 -2
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js.map +1 -1
- package/lib/exchange/index.d.ts.map +1 -1
- package/lib/exchange/index.js +4 -15
- package/lib/exchange/index.js.map +1 -1
- package/lib/exchange/swap/getCompleteSwapHistory.d.ts +1 -1
- package/lib/exchange/swap/getCompleteSwapHistory.d.ts.map +1 -1
- package/lib/exchange/swap/getCompleteSwapHistory.js +5 -5
- package/lib/exchange/swap/getCompleteSwapHistory.js.map +1 -1
- package/lib/exchange/swap/hooks/useSelectableCurrencies.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/useSelectableCurrencies.js +16 -4
- package/lib/exchange/swap/hooks/useSelectableCurrencies.js.map +1 -1
- package/lib/generated/specs.d.ts +1 -1
- package/lib/market/hooks/useLargeMoverChartData.d.ts +1 -2
- package/lib/market/hooks/useLargeMoverChartData.d.ts.map +1 -1
- package/lib/market/hooks/useLargeMoverChartData.js.map +1 -1
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts +1 -2
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts.map +1 -1
- package/lib/market/hooks/useLargeMoverCurrencies.js +1 -3
- package/lib/market/hooks/useLargeMoverCurrencies.js.map +1 -1
- package/lib/market/utils/currencyFormatter.d.ts +1 -1
- package/lib/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib/market/utils/currencyFormatter.js +1 -1
- package/lib/market/utils/currencyFormatter.js.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts +1 -1
- package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +1 -2
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +1 -1
- package/lib/wallet-api/constants.d.ts +2 -2
- package/lib-es/config/index.d.ts +2 -2
- package/lib-es/config/index.d.ts.map +1 -1
- package/lib-es/config/index.js.map +1 -1
- package/lib-es/exchange/index.d.ts.map +1 -1
- package/lib-es/exchange/index.js +4 -15
- package/lib-es/exchange/index.js.map +1 -1
- package/lib-es/exchange/swap/getCompleteSwapHistory.d.ts +1 -1
- package/lib-es/exchange/swap/getCompleteSwapHistory.d.ts.map +1 -1
- package/lib-es/exchange/swap/getCompleteSwapHistory.js +5 -5
- package/lib-es/exchange/swap/getCompleteSwapHistory.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useSelectableCurrencies.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/useSelectableCurrencies.js +18 -6
- package/lib-es/exchange/swap/hooks/useSelectableCurrencies.js.map +1 -1
- package/lib-es/generated/specs.d.ts +1 -1
- package/lib-es/market/hooks/useLargeMoverChartData.d.ts +1 -2
- package/lib-es/market/hooks/useLargeMoverChartData.d.ts.map +1 -1
- package/lib-es/market/hooks/useLargeMoverChartData.js.map +1 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts +1 -2
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts.map +1 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.js +1 -3
- package/lib-es/market/hooks/useLargeMoverCurrencies.js.map +1 -1
- package/lib-es/market/utils/currencyFormatter.d.ts +1 -1
- package/lib-es/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib-es/market/utils/currencyFormatter.js +1 -1
- package/lib-es/market/utils/currencyFormatter.js.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts +1 -1
- package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +1 -2
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +1 -1
- package/lib-es/wallet-api/constants.d.ts +2 -2
- package/package.json +40 -40
- package/src/bridge/cache.test.ts +2 -2
- package/src/config/index.ts +2 -4
- package/src/currencies/sortByMarketcap.test.ts +10 -7
- package/src/exchange/index.ts +4 -15
- package/src/exchange/swap/getCompleteSwapHistory.ts +5 -5
- package/src/exchange/swap/hooks/useFromState.test.ts +11 -4
- package/src/exchange/swap/hooks/useReverseAccounts.test.ts +11 -4
- package/src/exchange/swap/hooks/useSelectableCurrencies.test.ts +14 -8
- package/src/exchange/swap/hooks/useSelectableCurrencies.ts +23 -6
- package/src/exchange/swap/hooks/useToState.test.ts +11 -4
- package/src/exchange/swap/hooks/useUpdateMaxAmount.test.ts +11 -4
- package/src/exchange/swap/utils/index.test.ts +10 -4
- package/src/market/hooks/useLargeMoverChartData.ts +1 -2
- package/src/market/hooks/useLargeMoverCurrencies.ts +3 -6
- package/src/market/utils/currencyFormatter.ts +2 -2
|
@@ -660,7 +660,7 @@ declare const _default: {
|
|
|
660
660
|
}) => Promise<void>) | undefined;
|
|
661
661
|
};
|
|
662
662
|
};
|
|
663
|
-
evm: Partial<Record<
|
|
663
|
+
evm: Partial<Record<string, import("@ledgerhq/coin-framework/lib/bot/types").AppSpec<import("@ledgerhq/coin-evm/lib/types/transaction").Transaction>>>;
|
|
664
664
|
hedera: {
|
|
665
665
|
hedera: import("@ledgerhq/coin-framework/lib/bot/types").AppSpec<import("@ledgerhq/coin-hedera/lib/types/bridge").Transaction>;
|
|
666
666
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MarketCoinDataChart } from "../utils/types";
|
|
2
1
|
type UseLargeMoverChartDataParams = {
|
|
3
2
|
ids: string[];
|
|
4
3
|
counterCurrency: string;
|
|
@@ -7,7 +6,7 @@ type UseLargeMoverChartDataParams = {
|
|
|
7
6
|
export declare const useLargeMoverChartData: ({ ids, counterCurrency, range, }: UseLargeMoverChartDataParams) => {
|
|
8
7
|
chartDataArray: {
|
|
9
8
|
idChartData: string;
|
|
10
|
-
chartData: MarketCoinDataChart | undefined;
|
|
9
|
+
chartData: import("../utils").MarketCoinDataChart | undefined;
|
|
11
10
|
isLoading: boolean;
|
|
12
11
|
isError: boolean;
|
|
13
12
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLargeMoverChartData.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLargeMoverChartData.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":"AAKA,KAAK,4BAA4B,GAAG;IAClC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,sBAAsB,qCAIhC,4BAA4B;;;;;;;;;CAqB9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLargeMoverChartData.js","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLargeMoverChartData.js","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAA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EJ,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { CurrencyData } from "../utils/types";
|
|
2
1
|
type UseLargeMoverCurrenciesParams = {
|
|
3
2
|
ids: string[];
|
|
4
3
|
counterCurrency: string;
|
|
5
4
|
};
|
|
6
5
|
export declare const useLargeMoverCurrencies: ({ ids, counterCurrency, }: UseLargeMoverCurrenciesParams) => {
|
|
7
6
|
id: string;
|
|
8
|
-
data: CurrencyData | undefined;
|
|
7
|
+
data: import("../utils/types").CurrencyData | undefined;
|
|
9
8
|
isLoading: boolean;
|
|
10
9
|
isError: boolean;
|
|
11
10
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLargeMoverCurrencies.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLargeMoverCurrencies.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":"AAOA,KAAK,6BAA6B,GAAG;IACnC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,uBAAuB,8BAGjC,6BAA6B;;;;;GAiB/B,CAAC"}
|
|
@@ -3,8 +3,6 @@ import { fetchCurrency } from "../api";
|
|
|
3
3
|
import { QUERY_KEY } from "../utils/queryKeys";
|
|
4
4
|
import { REFETCH_TIME_ONE_MINUTE, BASIC_REFETCH } from "../utils/timers";
|
|
5
5
|
import { format } from "../utils/currencyFormatter";
|
|
6
|
-
import { listCryptoCurrencies } from "@ledgerhq/cryptoassets/currencies";
|
|
7
|
-
const cryptoCurrenciesList = [...listCryptoCurrencies()];
|
|
8
6
|
export const useLargeMoverCurrencies = ({ ids, counterCurrency, }) => {
|
|
9
7
|
const currencyQueries = useQueries({
|
|
10
8
|
queries: ids.map(id => ({
|
|
@@ -12,7 +10,7 @@ export const useLargeMoverCurrencies = ({ ids, counterCurrency, }) => {
|
|
|
12
10
|
queryFn: () => fetchCurrency({ id, counterCurrency }),
|
|
13
11
|
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
|
14
12
|
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
|
15
|
-
select: (data) => format(data
|
|
13
|
+
select: (data) => format(data),
|
|
16
14
|
})),
|
|
17
15
|
});
|
|
18
16
|
return ids.map((id, index) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLargeMoverCurrencies.js","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"useLargeMoverCurrencies.js","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAOpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,GAAG,EACH,eAAe,GACe,EAAE,EAAE;IAClC,MAAM,eAAe,GAAG,UAAU,CAAC;QACjC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACtB,QAAQ,EAAE,CAAC,SAAS,CAAC,eAAe,EAAE,EAAE,EAAE,eAAe,CAAC;YAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC;YACrD,eAAe,EAAE,uBAAuB,GAAG,aAAa;YACxD,SAAS,EAAE,uBAAuB,GAAG,aAAa;YAClD,MAAM,EAAE,CAAC,IAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SACnD,CAAC,CAAC;KACJ,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7B,EAAE;QACF,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,IAAI;QAClC,SAAS,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,KAAK;QACrD,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI,KAAK;KAClD,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
2
|
import { CurrencyData, MarketItemPerformer, MarketItemResponse } from "./types";
|
|
3
3
|
export declare function currencyFormatter(data: MarketItemResponse[], cryptoCurrenciesList: (CryptoCurrency | TokenCurrency)[]): CurrencyData[];
|
|
4
|
-
export declare const format: (currency: MarketItemResponse, cryptoCurrenciesList
|
|
4
|
+
export declare const format: (currency: MarketItemResponse, cryptoCurrenciesList?: (CryptoCurrency | TokenCurrency)[]) => CurrencyData;
|
|
5
5
|
export declare const formatPerformer: (currency: MarketItemResponse) => MarketItemPerformer;
|
|
6
6
|
//# sourceMappingURL=currencyFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencyFormatter.d.ts","sourceRoot":"","sources":["../../../src/market/utils/currencyFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EACL,YAAY,EAEZ,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAwCjB,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,kBAAkB,EAAE,EAC1B,oBAAoB,EAAE,CAAC,cAAc,GAAG,aAAa,CAAC,EAAE,GACvD,YAAY,EAAE,CAEhB;AAED,eAAO,MAAM,MAAM,aACP,kBAAkB,
|
|
1
|
+
{"version":3,"file":"currencyFormatter.d.ts","sourceRoot":"","sources":["../../../src/market/utils/currencyFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EACL,YAAY,EAEZ,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAwCjB,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,kBAAkB,EAAE,EAC1B,oBAAoB,EAAE,CAAC,cAAc,GAAG,aAAa,CAAC,EAAE,GACvD,YAAY,EAAE,CAEhB;AAED,eAAO,MAAM,MAAM,aACP,kBAAkB,yBACL,CAAC,cAAc,GAAG,aAAa,CAAC,EAAE,KACxD,YAwCF,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,kBAAkB,KAAG,mBAY7D,CAAC"}
|
|
@@ -39,7 +39,7 @@ export function currencyFormatter(data, cryptoCurrenciesList) {
|
|
|
39
39
|
}
|
|
40
40
|
export const format = (currency, cryptoCurrenciesList) => {
|
|
41
41
|
const ledgerIdsSet = new Set(currency.ledgerIds.map(id => id.toLowerCase()));
|
|
42
|
-
const internalCurrency = cryptoCurrenciesList
|
|
42
|
+
const internalCurrency = cryptoCurrenciesList?.find(({ id }) => ledgerIdsSet.has(id.toLowerCase()));
|
|
43
43
|
return {
|
|
44
44
|
id: currency.id,
|
|
45
45
|
ledgerIds: currency.ledgerIds,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencyFormatter.js","sourceRoot":"","sources":["../../../src/market/utils/currencyFormatter.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,GAIhB,MAAM,SAAS,CAAC;AAEjB,SAAS,eAAe,CAAC,KAAe,EAAE,CAAS;IACjD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;KACpC;IACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,SAAS,kBAAkB,CAAC,MAAgB;IAC1C,MAAM,WAAW,GAAG,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI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AI,EAAE,QAAQ,CAAC,IAAI;IACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,uBAAuB,EAAE,QAAQ,CAAC,uBAAuB;IACzD,wBAAwB,EAAE,QAAQ,CAAC,wBAAwB;IAC3D,uBAAuB,EAAE,QAAQ,CAAC,uBAAuB;IACzD,wBAAwB,EAAE,QAAQ,CAAC,wBAAwB;IAC3D,uBAAuB,EAAE,QAAQ,CAAC,uBAAuB;IACzD,KAAK,EAAE,QAAQ,CAAC,KAAK;CACtB,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ export declare const useLeftApyModule: (currencies: CryptoOrTokenCurrency[], Apy
|
|
|
14
14
|
delisted?: boolean | undefined;
|
|
15
15
|
keywords?: string[] | undefined;
|
|
16
16
|
type: "CryptoCurrency";
|
|
17
|
-
id:
|
|
17
|
+
id: string;
|
|
18
18
|
forkedFrom?: string | undefined;
|
|
19
19
|
managerAppName: string;
|
|
20
20
|
coinType: import("@ledgerhq/types-cryptoassets").CoinType;
|
|
@@ -12,7 +12,7 @@ export declare const useLeftMarketTrendModule: (currencies: CryptoOrTokenCurrenc
|
|
|
12
12
|
delisted?: boolean | undefined;
|
|
13
13
|
keywords?: string[] | undefined;
|
|
14
14
|
type: "CryptoCurrency";
|
|
15
|
-
id:
|
|
15
|
+
id: string;
|
|
16
16
|
forkedFrom?: string | undefined;
|
|
17
17
|
managerAppName: string;
|
|
18
18
|
coinType: import("@ledgerhq/types-cryptoassets").CoinType;
|
|
@@ -18,7 +18,7 @@ export declare const useRightMarketTrendModule: ({ currencies, useBalanceDeps, M
|
|
|
18
18
|
delisted?: boolean | undefined;
|
|
19
19
|
keywords?: string[] | undefined;
|
|
20
20
|
type: "CryptoCurrency";
|
|
21
|
-
id:
|
|
21
|
+
id: string;
|
|
22
22
|
forkedFrom?: string | undefined;
|
|
23
23
|
managerAppName: string;
|
|
24
24
|
coinType: import("@ledgerhq/types-cryptoassets").CoinType;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
|
|
2
1
|
import { Feature } from "@ledgerhq/types-live";
|
|
3
2
|
export declare function useCurrenciesUnderFeatureFlag(): {
|
|
4
|
-
featureFlaggedCurrencies: Partial<Record<
|
|
3
|
+
featureFlaggedCurrencies: Partial<Record<string, Feature<unknown> | null>>;
|
|
5
4
|
deactivatedCurrencyIds: Set<string>;
|
|
6
5
|
};
|
|
7
6
|
//# sourceMappingURL=useCurrenciesUnderFeatureFlag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrenciesUnderFeatureFlag.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrenciesUnderFeatureFlag.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,wBAAgB,6BAA6B;;;EAyO5C"}
|
|
@@ -20,7 +20,7 @@ export declare function createUseRightBalanceAsset({ useBalanceDeps, balanceItem
|
|
|
20
20
|
delisted?: boolean | undefined;
|
|
21
21
|
keywords?: string[] | undefined;
|
|
22
22
|
type: "CryptoCurrency";
|
|
23
|
-
id:
|
|
23
|
+
id: string;
|
|
24
24
|
forkedFrom?: string | undefined;
|
|
25
25
|
managerAppName: string;
|
|
26
26
|
coinType: import("@ledgerhq/types-cryptoassets").CoinType;
|
|
@@ -5,13 +5,13 @@ export declare const FAMILIES_MAPPING_WAPI_TO_LL: {
|
|
|
5
5
|
readonly ripple: "xrp";
|
|
6
6
|
readonly elrond: "multiversx";
|
|
7
7
|
};
|
|
8
|
-
export declare const FAMILIES_MAPPING_LL_TO_WAPI: Record<"evm" | "multiversx" | "xrp", "ethereum" | "
|
|
8
|
+
export declare const FAMILIES_MAPPING_LL_TO_WAPI: Record<"evm" | "multiversx" | "xrp", "ethereum" | "ripple" | "elrond">;
|
|
9
9
|
/**
|
|
10
10
|
* FIXME
|
|
11
11
|
* This is not robust, we should have an explicit adapter between the wallet API currencies (families) and live currencies (families)
|
|
12
12
|
* For example here, the `ethereum` family on `wallet-api` should be mapped to the `evm` family on LL
|
|
13
13
|
*/
|
|
14
|
-
export declare const WALLET_API_FAMILIES: ("
|
|
14
|
+
export declare const WALLET_API_FAMILIES: ("bitcoin" | "cardano" | "aptos" | "crypto_org" | "evm" | "ethereum" | "vechain" | "internet_computer" | "ton" | "sui" | "casper" | "cosmos" | "near" | "solana" | "tron" | "polkadot" | "tezos" | "algorand" | "multiversx" | "stellar" | "xrp" | "ripple" | "elrond" | "celo" | "filecoin" | "hedera" | "kaspa" | "neo" | "stacks")[];
|
|
15
15
|
export declare const WALLET_API_VERSION = "2.0.0";
|
|
16
16
|
export declare const BROWSE_SEARCH_OPTIONS: Fuse.IFuseOptions<AppManifest>;
|
|
17
17
|
export declare const HTTP_REGEX: RegExp;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-common",
|
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
|
4
|
-
"version": "34.51.0-nightly.
|
|
4
|
+
"version": "34.51.0-nightly.12",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -163,36 +163,36 @@
|
|
|
163
163
|
"xstate": "^5.19.2",
|
|
164
164
|
"yargs": "^17.0.0",
|
|
165
165
|
"zod": "^3.22.4",
|
|
166
|
-
"@ledgerhq/coin-algorand": "^0.11.0-nightly.
|
|
167
|
-
"@ledgerhq/coin-aptos": "^3.4.0-nightly.
|
|
168
|
-
"@ledgerhq/coin-bitcoin": "^0.23.0-nightly.
|
|
169
|
-
"@ledgerhq/coin-canton": "^0.8.0-nightly.
|
|
170
|
-
"@ledgerhq/coin-cardano": "^0.13.0-nightly.
|
|
171
|
-
"@ledgerhq/coin-casper": "^2.2.0-nightly.
|
|
172
|
-
"@ledgerhq/coin-celo": "^1.6.0-nightly.
|
|
173
|
-
"@ledgerhq/coin-cosmos": "^0.18.0-nightly.
|
|
174
|
-
"@ledgerhq/coin-evm": "^2.33.0-nightly.
|
|
175
|
-
"@ledgerhq/coin-filecoin": "^1.13.0-nightly.
|
|
176
|
-
"@ledgerhq/coin-framework": "^6.7.0-nightly.
|
|
177
|
-
"@ledgerhq/coin-hedera": "^1.12.0-nightly.
|
|
178
|
-
"@ledgerhq/coin-icon": "^0.13.0-nightly.
|
|
179
|
-
"@ledgerhq/coin-internet_computer": "^1.9.0-nightly.
|
|
180
|
-
"@ledgerhq/coin-kaspa": "^1.3.0-nightly.
|
|
181
|
-
"@ledgerhq/coin-mina": "^1.3.0-nightly.
|
|
182
|
-
"@ledgerhq/coin-multiversx": "^0.6.0-nightly.
|
|
183
|
-
"@ledgerhq/coin-near": "^0.14.0-nightly.
|
|
184
|
-
"@ledgerhq/coin-polkadot": "^6.11.0-nightly.
|
|
185
|
-
"@ledgerhq/coin-solana": "^0.35.0-nightly.
|
|
186
|
-
"@ledgerhq/coin-stacks": "^0.10.0-nightly.
|
|
187
|
-
"@ledgerhq/coin-stellar": "^6.5.0-nightly.
|
|
188
|
-
"@ledgerhq/coin-sui": "^0.16.0-nightly.
|
|
189
|
-
"@ledgerhq/coin-tezos": "^6.7.0-nightly.
|
|
190
|
-
"@ledgerhq/coin-ton": "^0.15.0-nightly.
|
|
191
|
-
"@ledgerhq/coin-tron": "^5.5.0-nightly.
|
|
192
|
-
"@ledgerhq/coin-vechain": "^2.11.0-nightly.
|
|
193
|
-
"@ledgerhq/coin-xrp": "^7.6.0-nightly.
|
|
166
|
+
"@ledgerhq/coin-algorand": "^0.11.0-nightly.9",
|
|
167
|
+
"@ledgerhq/coin-aptos": "^3.4.0-nightly.9",
|
|
168
|
+
"@ledgerhq/coin-bitcoin": "^0.23.0-nightly.9",
|
|
169
|
+
"@ledgerhq/coin-canton": "^0.8.0-nightly.9",
|
|
170
|
+
"@ledgerhq/coin-cardano": "^0.13.0-nightly.9",
|
|
171
|
+
"@ledgerhq/coin-casper": "^2.2.0-nightly.9",
|
|
172
|
+
"@ledgerhq/coin-celo": "^1.6.0-nightly.10",
|
|
173
|
+
"@ledgerhq/coin-cosmos": "^0.18.0-nightly.9",
|
|
174
|
+
"@ledgerhq/coin-evm": "^2.33.0-nightly.10",
|
|
175
|
+
"@ledgerhq/coin-filecoin": "^1.13.0-nightly.9",
|
|
176
|
+
"@ledgerhq/coin-framework": "^6.7.0-nightly.9",
|
|
177
|
+
"@ledgerhq/coin-hedera": "^1.12.0-nightly.9",
|
|
178
|
+
"@ledgerhq/coin-icon": "^0.13.0-nightly.9",
|
|
179
|
+
"@ledgerhq/coin-internet_computer": "^1.9.0-nightly.9",
|
|
180
|
+
"@ledgerhq/coin-kaspa": "^1.3.0-nightly.9",
|
|
181
|
+
"@ledgerhq/coin-mina": "^1.3.0-nightly.9",
|
|
182
|
+
"@ledgerhq/coin-multiversx": "^0.6.0-nightly.9",
|
|
183
|
+
"@ledgerhq/coin-near": "^0.14.0-nightly.9",
|
|
184
|
+
"@ledgerhq/coin-polkadot": "^6.11.0-nightly.10",
|
|
185
|
+
"@ledgerhq/coin-solana": "^0.35.0-nightly.9",
|
|
186
|
+
"@ledgerhq/coin-stacks": "^0.10.0-nightly.9",
|
|
187
|
+
"@ledgerhq/coin-stellar": "^6.5.0-nightly.9",
|
|
188
|
+
"@ledgerhq/coin-sui": "^0.16.0-nightly.11",
|
|
189
|
+
"@ledgerhq/coin-tezos": "^6.7.0-nightly.9",
|
|
190
|
+
"@ledgerhq/coin-ton": "^0.15.0-nightly.9",
|
|
191
|
+
"@ledgerhq/coin-tron": "^5.5.0-nightly.9",
|
|
192
|
+
"@ledgerhq/coin-vechain": "^2.11.0-nightly.9",
|
|
193
|
+
"@ledgerhq/coin-xrp": "^7.6.0-nightly.9",
|
|
194
194
|
"@ledgerhq/crypto-icons-ui": "^1.21.0-nightly.2",
|
|
195
|
-
"@ledgerhq/cryptoassets": "^13.31.0-nightly.
|
|
195
|
+
"@ledgerhq/cryptoassets": "^13.31.0-nightly.8",
|
|
196
196
|
"@ledgerhq/device-core": "^0.6.6-nightly.6",
|
|
197
197
|
"@ledgerhq/devices": "8.6.2-nightly.0",
|
|
198
198
|
"@ledgerhq/errors": "^6.27.0-nightly.0",
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
"@ledgerhq/hw-app-btc": "^10.11.3-nightly.0",
|
|
202
202
|
"@ledgerhq/hw-app-celo": "^6.35.1-nightly.6",
|
|
203
203
|
"@ledgerhq/hw-app-cosmos": "^6.32.9-nightly.0",
|
|
204
|
-
"@ledgerhq/hw-app-eth": "^6.46.1-nightly.6",
|
|
205
204
|
"@ledgerhq/hw-app-exchange": "^0.15.1-nightly.1",
|
|
205
|
+
"@ledgerhq/hw-app-eth": "^6.46.1-nightly.6",
|
|
206
206
|
"@ledgerhq/hw-app-hedera": "^1.2.9-nightly.0",
|
|
207
207
|
"@ledgerhq/hw-app-icon": "^1.3.9-nightly.0",
|
|
208
208
|
"@ledgerhq/hw-app-kaspa": "^1.3.2-nightly.0",
|
|
@@ -210,7 +210,6 @@
|
|
|
210
210
|
"@ledgerhq/hw-app-near": "^6.31.9-nightly.0",
|
|
211
211
|
"@ledgerhq/hw-app-polkadot": "^6.34.9-nightly.0",
|
|
212
212
|
"@ledgerhq/hw-app-str": "^7.2.9-nightly.0",
|
|
213
|
-
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
214
213
|
"@ledgerhq/hw-app-tezos": "^6.31.9-nightly.0",
|
|
215
214
|
"@ledgerhq/hw-app-trx": "^6.31.9-nightly.0",
|
|
216
215
|
"@ledgerhq/hw-app-vet": "^0.7.0-nightly.4",
|
|
@@ -221,17 +220,18 @@
|
|
|
221
220
|
"@ledgerhq/ledger-cal-service": "^1.7.0-nightly.3",
|
|
222
221
|
"@ledgerhq/ledger-trust-service": "^0.3.15-nightly.3",
|
|
223
222
|
"@ledgerhq/live-config": "^3.2.0",
|
|
224
|
-
"@ledgerhq/live-countervalues": "^0.8.0-nightly.
|
|
225
|
-
"@ledgerhq/live-countervalues-react": "^0.7.0-nightly.
|
|
226
|
-
"@ledgerhq/live-dmk-shared": "^0.14.0-nightly.2",
|
|
223
|
+
"@ledgerhq/live-countervalues": "^0.8.0-nightly.9",
|
|
224
|
+
"@ledgerhq/live-countervalues-react": "^0.7.0-nightly.9",
|
|
227
225
|
"@ledgerhq/live-env": "^2.19.0-nightly.2",
|
|
226
|
+
"@ledgerhq/live-dmk-shared": "^0.14.0-nightly.2",
|
|
227
|
+
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
228
228
|
"@ledgerhq/live-hooks": "0.2.0-nightly.0",
|
|
229
229
|
"@ledgerhq/live-network": "^2.0.20-nightly.3",
|
|
230
230
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
231
|
-
"@ledgerhq/live-signer-canton": "^0.4.2-nightly.
|
|
232
|
-
"@ledgerhq/live-signer-evm": "^0.8.2-nightly.
|
|
233
|
-
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.
|
|
234
|
-
"@ledgerhq/live-wallet": "^0.14.3-nightly.
|
|
231
|
+
"@ledgerhq/live-signer-canton": "^0.4.2-nightly.9",
|
|
232
|
+
"@ledgerhq/live-signer-evm": "^0.8.2-nightly.10",
|
|
233
|
+
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.9",
|
|
234
|
+
"@ledgerhq/live-wallet": "^0.14.3-nightly.9",
|
|
235
235
|
"@ledgerhq/logs": "^6.13.0",
|
|
236
236
|
"@ledgerhq/speculos-transport": "^0.2.13-nightly.3",
|
|
237
237
|
"@ledgerhq/wallet-api-acre-module": "^0.8.0-nightly.3",
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
"uuid": "^8.3.2",
|
|
285
285
|
"ws": "7",
|
|
286
286
|
"@ledgerhq/device-react": "^0.3.0-nightly.6",
|
|
287
|
-
"@ledgerhq/types-cryptoassets": "^7.29.0-nightly.
|
|
287
|
+
"@ledgerhq/types-cryptoassets": "^7.29.0-nightly.1",
|
|
288
288
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
289
289
|
"@ledgerhq/types-live": "^6.87.0-nightly.5"
|
|
290
290
|
},
|
package/src/bridge/cache.test.ts
CHANGED
|
@@ -28,7 +28,7 @@ describe("Bridge Cache", () => {
|
|
|
28
28
|
|
|
29
29
|
await prepareCurrency(getCryptoCurrencyById("solana"));
|
|
30
30
|
expect(makeLRUCache).toHaveBeenCalledTimes(1);
|
|
31
|
-
});
|
|
31
|
+
}, 10000);
|
|
32
32
|
|
|
33
33
|
it("forces the LRU cache to be re-generated", async () => {
|
|
34
34
|
const makeLRUCache = jest.spyOn(cacheModule, "makeLRUCache");
|
|
@@ -42,5 +42,5 @@ describe("Bridge Cache", () => {
|
|
|
42
42
|
|
|
43
43
|
await prepareCurrency(getCryptoCurrencyById("solana"), { forceUpdate: true });
|
|
44
44
|
expect(makeLRUCache).toHaveBeenCalledTimes(2);
|
|
45
|
-
});
|
|
45
|
+
}, 10000);
|
|
46
46
|
});
|
package/src/config/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { CryptoCurrency
|
|
1
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
2
|
import { ConfigInfo, LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
3
3
|
import { CurrencyConfig } from "@ledgerhq/coin-framework/config";
|
|
4
4
|
|
|
5
|
-
export type CurrencyLiveConfigDefinition =
|
|
6
|
-
Record<`config_currency_${CryptoCurrencyId}`, ConfigInfo>
|
|
7
|
-
>;
|
|
5
|
+
export type CurrencyLiveConfigDefinition = Record<`config_currency_${string}`, ConfigInfo>;
|
|
8
6
|
|
|
9
7
|
const getCurrencyConfiguration = <T extends CurrencyConfig>(
|
|
10
8
|
currency: CryptoCurrency,
|
|
@@ -2,18 +2,21 @@ import { sortCurrenciesByIds } from "./sortByMarketcap";
|
|
|
2
2
|
import { listCryptoCurrencies, listTokens } from ".";
|
|
3
3
|
import { getBTCValues } from "@ledgerhq/live-countervalues/mock";
|
|
4
4
|
import { CURRENCIES_LIST, IDS } from "./mock";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
5
|
+
import { findCryptoCurrencyByTicker, findFiatCurrencyByTicker } from "@ledgerhq/cryptoassets/index";
|
|
6
|
+
import { getCryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/index";
|
|
7
|
+
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/tokens";
|
|
8
|
+
import { setup } from "../bridge/impl";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
setCryptoAssetsStoreForCoinFramework({} as CryptoAssetsStore);
|
|
10
|
+
setup(legacyCryptoAssetsStore);
|
|
11
11
|
|
|
12
|
-
test("sortCurrenciesByIds snapshot", () => {
|
|
12
|
+
test("sortCurrenciesByIds snapshot", async () => {
|
|
13
13
|
const list = [...listCryptoCurrencies(), ...listTokens()];
|
|
14
14
|
const ids: string[] = [];
|
|
15
15
|
for (const k in getBTCValues()) {
|
|
16
|
-
const c =
|
|
16
|
+
const c =
|
|
17
|
+
findCryptoCurrencyByTicker(k) ||
|
|
18
|
+
findFiatCurrencyByTicker(k) ||
|
|
19
|
+
(await getCryptoAssetsStore().findTokenById(k));
|
|
17
20
|
if (c && (c.type == "CryptoCurrency" || c.type == "TokenCurrency")) {
|
|
18
21
|
ids.push(c.id);
|
|
19
22
|
}
|
package/src/exchange/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { valid, gte } from "semver";
|
|
2
2
|
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
3
|
import { getEnv } from "@ledgerhq/live-env";
|
|
4
|
-
import { findExchangeCurrencyConfig as findProdExchangeCurrencyConfig } from "@ledgerhq/cryptoassets";
|
|
5
4
|
import calService from "@ledgerhq/ledger-cal-service";
|
|
6
5
|
// Minimum version of a currency app which has exchange capabilities, meaning it can be used
|
|
7
6
|
// for sell/swap, and do silent signing.
|
|
@@ -40,21 +39,11 @@ export const isExchangeSupportedByApp = (appName: string, appVersion: string): b
|
|
|
40
39
|
export const getCurrencyExchangeConfig = async (
|
|
41
40
|
currency: CryptoCurrency | TokenCurrency,
|
|
42
41
|
): Promise<ExchangeCurrencyNameAndSignature> => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const env = getEnv("MOCK_EXCHANGE_TEST_CONFIG") ? "test" : "prod";
|
|
46
|
-
res = await calService.findCurrencyData(currency.id, { env });
|
|
42
|
+
const env = getEnv("MOCK_EXCHANGE_TEST_CONFIG") ? "test" : "prod";
|
|
43
|
+
const res = await calService.findCurrencyData(currency.id, { env });
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
} catch (error) {
|
|
52
|
-
// Fallback to old production config if the primary fetch fails, should be removed when we have a HA CAL
|
|
53
|
-
res = await findProdExchangeCurrencyConfig(currency.id);
|
|
54
|
-
|
|
55
|
-
if (!res) {
|
|
56
|
-
throw new Error(`Exchange, missing configuration for ${currency.id}`);
|
|
57
|
-
}
|
|
45
|
+
if (!res) {
|
|
46
|
+
throw new Error(`Exchange, missing configuration for ${currency.id}`);
|
|
58
47
|
}
|
|
59
48
|
|
|
60
49
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCryptoAssetsStore } from "../../bridge/crypto-assets/index";
|
|
2
2
|
import type { AccountLike, SwapOperation } from "@ledgerhq/types-live";
|
|
3
3
|
import { accountWithMandatoryTokens, getAccountCurrency } from "../../account";
|
|
4
4
|
import type { MappedSwapOperation, SwapHistorySection } from "./types";
|
|
5
5
|
|
|
6
6
|
const getSwapOperationMap =
|
|
7
7
|
(account: AccountLike, accounts: AccountLike[]) =>
|
|
8
|
-
(swapOperation: SwapOperation): MappedSwapOperation | null | undefined => {
|
|
8
|
+
async (swapOperation: SwapOperation): Promise<MappedSwapOperation | null | undefined> => {
|
|
9
9
|
const {
|
|
10
10
|
provider,
|
|
11
11
|
swapId,
|
|
@@ -34,7 +34,7 @@ const getSwapOperationMap =
|
|
|
34
34
|
toExists = true;
|
|
35
35
|
}
|
|
36
36
|
if (toAccount && tokenId) {
|
|
37
|
-
const token = findTokenById(tokenId);
|
|
37
|
+
const token = await getCryptoAssetsStore().findTokenById(tokenId);
|
|
38
38
|
|
|
39
39
|
if (token && toAccount.type === "Account") {
|
|
40
40
|
toParentAccount = toAccount;
|
|
@@ -74,7 +74,7 @@ function startOfDay(t) {
|
|
|
74
74
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate());
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const getCompleteSwapHistory = (accounts: AccountLike[]): SwapHistorySection[] => {
|
|
77
|
+
const getCompleteSwapHistory = async (accounts: AccountLike[]): Promise<SwapHistorySection[]> => {
|
|
78
78
|
const swaps: MappedSwapOperation[] = [];
|
|
79
79
|
|
|
80
80
|
for (const account of accounts) {
|
|
@@ -83,7 +83,7 @@ const getCompleteSwapHistory = (accounts: AccountLike[]): SwapHistorySection[] =
|
|
|
83
83
|
const mapFn = getSwapOperationMap(account, accounts);
|
|
84
84
|
|
|
85
85
|
if (swapHistory) {
|
|
86
|
-
const mappedSwapHistory = swapHistory.map(mapFn);
|
|
86
|
+
const mappedSwapHistory = await Promise.all(swapHistory.map(mapFn));
|
|
87
87
|
|
|
88
88
|
if (mappedSwapHistory) {
|
|
89
89
|
const filteredMappdSwapOperations = <MappedSwapOperation[]>(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById
|
|
5
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import { Account } from "@ledgerhq/types-live";
|
|
7
7
|
import { renderHook, act } from "@testing-library/react";
|
|
8
8
|
import BigNumber from "bignumber.js";
|
|
@@ -14,9 +14,16 @@ import { useFromState } from "./useFromState";
|
|
|
14
14
|
|
|
15
15
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
16
16
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const USDT = {
|
|
18
|
+
type: "TokenCurrency" as const,
|
|
19
|
+
id: "ethereum/erc20/usd_tether__erc20_",
|
|
20
|
+
name: "Tether USD (ERC-20)",
|
|
21
|
+
ticker: "USDT",
|
|
22
|
+
units: [{ name: "Tether USD", code: "USDT", magnitude: 6 }],
|
|
23
|
+
contractAddress: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
24
|
+
parentCurrency: ETH,
|
|
25
|
+
tokenType: "erc20" as const,
|
|
26
|
+
};
|
|
20
27
|
|
|
21
28
|
jest.useFakeTimers();
|
|
22
29
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById
|
|
5
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import type { Account } from "@ledgerhq/types-live";
|
|
7
7
|
import { renderHook, act } from "@testing-library/react";
|
|
8
8
|
import { genTokenAccount } from "@ledgerhq/coin-framework/mocks/account";
|
|
@@ -11,9 +11,16 @@ import { useReverseAccounts } from "./useReverseAccounts";
|
|
|
11
11
|
|
|
12
12
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
13
13
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const USDT = {
|
|
15
|
+
type: "TokenCurrency" as const,
|
|
16
|
+
id: "ethereum/erc20/usd_tether__erc20_",
|
|
17
|
+
name: "Tether USD (ERC-20)",
|
|
18
|
+
ticker: "USDT",
|
|
19
|
+
units: [{ name: "Tether USD", code: "USDT", magnitude: 6 }],
|
|
20
|
+
contractAddress: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
21
|
+
parentCurrency: ETH,
|
|
22
|
+
tokenType: "erc20" as const,
|
|
23
|
+
};
|
|
17
24
|
|
|
18
25
|
const fromParentAccount = genAccount("mocked-account-2", {
|
|
19
26
|
currency: ETH,
|
|
@@ -1,36 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
|
-
import { renderHook } from "@testing-library/react";
|
|
4
|
+
import { renderHook, waitFor } from "@testing-library/react";
|
|
5
5
|
|
|
6
6
|
import { useSelectableCurrencies } from "./useSelectableCurrencies";
|
|
7
7
|
import { getCryptoCurrencyById } from "../../../currencies";
|
|
8
8
|
|
|
9
9
|
describe("useSelectableCurrencies", () => {
|
|
10
|
-
test("returns an empty array when empty list are passed", () => {
|
|
10
|
+
test("returns an empty array when empty list are passed", async () => {
|
|
11
11
|
const allCurrencies = [];
|
|
12
12
|
|
|
13
13
|
const { result } = renderHook(() => useSelectableCurrencies({ allCurrencies }));
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
await waitFor(() => {
|
|
16
|
+
expect(result.current).toEqual([]);
|
|
17
|
+
});
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
test("returns an empty array when incorrect ids are passed", () => {
|
|
20
|
+
test("returns an empty array when incorrect ids are passed", async () => {
|
|
19
21
|
const allCurrencies = ["ethercoin", "bitether", "polkamos"];
|
|
20
22
|
|
|
21
23
|
const { result } = renderHook(() => useSelectableCurrencies({ allCurrencies }));
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
await waitFor(() => {
|
|
26
|
+
expect(result.current).toEqual([]);
|
|
27
|
+
});
|
|
24
28
|
});
|
|
25
29
|
|
|
26
|
-
test("returns correct currencies for all correct ids, in the same order", () => {
|
|
30
|
+
test("returns correct currencies for all correct ids, in the same order", async () => {
|
|
27
31
|
const allCurrencies = ["ethereum", "bitcoin", "polkamos"];
|
|
28
32
|
const ethereumCurrency = getCryptoCurrencyById("ethereum");
|
|
29
33
|
const bitcoinCurrency = getCryptoCurrencyById("bitcoin");
|
|
30
34
|
|
|
31
35
|
const { result } = renderHook(() => useSelectableCurrencies({ allCurrencies }));
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
await waitFor(() => {
|
|
38
|
+
expect(result.current).toHaveLength(2);
|
|
39
|
+
expect(result.current).toEqual([ethereumCurrency, bitcoinCurrency]);
|
|
40
|
+
});
|
|
35
41
|
});
|
|
36
42
|
});
|