@ledgerhq/live-common 34.35.0-nightly.3 → 34.35.1-hotfix.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/lib/e2e/enum/Swap.d.ts +1 -2
- package/lib/e2e/enum/Swap.d.ts.map +1 -1
- package/lib/e2e/enum/Swap.js +10 -12
- package/lib/e2e/enum/Swap.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +26 -55
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +1 -2
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +2 -5
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/speculos.d.ts +0 -2
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +32 -48
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/families/evm/config.js +2 -2
- package/lib/families/evm/config.js.map +1 -1
- package/lib/market/hooks/useLargeMoverDataProvider.d.ts +17 -0
- package/lib/market/hooks/useLargeMoverDataProvider.d.ts.map +1 -0
- package/lib/market/hooks/useLargeMoverDataProvider.js +48 -0
- package/lib/market/hooks/useLargeMoverDataProvider.js.map +1 -0
- package/lib-es/e2e/enum/Swap.d.ts +1 -2
- package/lib-es/e2e/enum/Swap.d.ts.map +1 -1
- package/lib-es/e2e/enum/Swap.js +10 -12
- package/lib-es/e2e/enum/Swap.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +27 -56
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +1 -2
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +2 -5
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts +0 -2
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +31 -45
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/families/evm/config.js +2 -2
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/market/hooks/useLargeMoverDataProvider.d.ts +17 -0
- package/lib-es/market/hooks/useLargeMoverDataProvider.d.ts.map +1 -0
- package/lib-es/market/hooks/useLargeMoverDataProvider.js +44 -0
- package/lib-es/market/hooks/useLargeMoverDataProvider.js.map +1 -0
- package/package.json +64 -64
- package/src/e2e/enum/Swap.ts +9 -10
- package/src/e2e/families/cardano.ts +28 -63
- package/src/e2e/families/evm.ts +1 -2
- package/src/e2e/families/solana.ts +2 -5
- package/src/e2e/speculos.ts +31 -46
- package/src/families/evm/config.ts +2 -2
- package/src/market/hooks/useLargeMoverDataProvider.ts +70 -0
- package/lib/e2e/enum/Device.d.ts +0 -8
- package/lib/e2e/enum/Device.d.ts.map +0 -1
- package/lib/e2e/enum/Device.js +0 -14
- package/lib/e2e/enum/Device.js.map +0 -1
- package/lib/families/hedera/logic.d.ts +0 -2
- package/lib/families/hedera/logic.d.ts.map +0 -1
- package/lib/families/hedera/logic.js +0 -19
- package/lib/families/hedera/logic.js.map +0 -1
- package/lib/market/hooks/useLargeMoverChartData.d.ts +0 -18
- package/lib/market/hooks/useLargeMoverChartData.d.ts.map +0 -1
- package/lib/market/hooks/useLargeMoverChartData.js +0 -28
- package/lib/market/hooks/useLargeMoverChartData.js.map +0 -1
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts +0 -13
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts.map +0 -1
- package/lib/market/hooks/useLargeMoverCurrencies.js +0 -29
- package/lib/market/hooks/useLargeMoverCurrencies.js.map +0 -1
- package/lib-es/e2e/enum/Device.d.ts +0 -8
- package/lib-es/e2e/enum/Device.d.ts.map +0 -1
- package/lib-es/e2e/enum/Device.js +0 -10
- package/lib-es/e2e/enum/Device.js.map +0 -1
- package/lib-es/families/hedera/logic.d.ts +0 -2
- package/lib-es/families/hedera/logic.d.ts.map +0 -1
- package/lib-es/families/hedera/logic.js +0 -3
- package/lib-es/families/hedera/logic.js.map +0 -1
- package/lib-es/market/hooks/useLargeMoverChartData.d.ts +0 -18
- package/lib-es/market/hooks/useLargeMoverChartData.d.ts.map +0 -1
- package/lib-es/market/hooks/useLargeMoverChartData.js +0 -24
- package/lib-es/market/hooks/useLargeMoverChartData.js.map +0 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts +0 -13
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts.map +0 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.js +0 -25
- package/lib-es/market/hooks/useLargeMoverCurrencies.js.map +0 -1
- package/src/e2e/enum/Device.ts +0 -7
- package/src/families/hedera/logic.ts +0 -2
- package/src/market/hooks/useLargeMoverChartData.ts +0 -38
- package/src/market/hooks/useLargeMoverCurrencies.ts +0 -36
@@ -0,0 +1,70 @@
|
|
1
|
+
import { useQueries } from "@tanstack/react-query";
|
2
|
+
import { fetchCurrency, fetchCurrencyChartData } from "../api";
|
3
|
+
import { QUERY_KEY } from "../utils/queryKeys";
|
4
|
+
import { REFETCH_TIME_ONE_MINUTE, BASIC_REFETCH } from "../utils/timers";
|
5
|
+
import { CurrencyData, MarketCoinDataChart, MarketItemResponse } from "../utils/types";
|
6
|
+
import { format } from "../utils/currencyFormatter";
|
7
|
+
import { listCryptoCurrencies } from "@ledgerhq/cryptoassets/currencies";
|
8
|
+
|
9
|
+
const cryptoCurrenciesList = [...listCryptoCurrencies()];
|
10
|
+
|
11
|
+
type UseLargeMoverDataProviderParams = {
|
12
|
+
ids: string[];
|
13
|
+
counterCurrency: string;
|
14
|
+
range: string;
|
15
|
+
};
|
16
|
+
|
17
|
+
function mapIdsToQueries<T>(ids: string[], queries: T[]): Record<string, T> {
|
18
|
+
return Object.fromEntries(ids.map((id, index) => [id, queries[index]]));
|
19
|
+
}
|
20
|
+
|
21
|
+
export const useLargeMoverDataProvider = ({
|
22
|
+
ids,
|
23
|
+
counterCurrency,
|
24
|
+
range,
|
25
|
+
}: UseLargeMoverDataProviderParams): {
|
26
|
+
currencies: {
|
27
|
+
id: string;
|
28
|
+
data?: CurrencyData;
|
29
|
+
chartData?: MarketCoinDataChart;
|
30
|
+
isLoading: boolean;
|
31
|
+
isError: boolean;
|
32
|
+
}[];
|
33
|
+
} => {
|
34
|
+
const currencyQueries = useQueries({
|
35
|
+
queries: ids.map(id => ({
|
36
|
+
queryKey: [QUERY_KEY.CurrencyDataRaw, id, counterCurrency],
|
37
|
+
queryFn: () => fetchCurrency({ id, counterCurrency }),
|
38
|
+
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
39
|
+
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
40
|
+
select: (data: MarketItemResponse) => format(data, cryptoCurrenciesList),
|
41
|
+
})),
|
42
|
+
});
|
43
|
+
|
44
|
+
const chartQueries = useQueries({
|
45
|
+
queries: ids.map(id => ({
|
46
|
+
queryKey: [QUERY_KEY.CurrencyChartData, id, counterCurrency, range],
|
47
|
+
queryFn: () => fetchCurrencyChartData({ id, counterCurrency, range }),
|
48
|
+
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
49
|
+
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
50
|
+
})),
|
51
|
+
});
|
52
|
+
|
53
|
+
const currencyQueryMap = mapIdsToQueries(ids, currencyQueries);
|
54
|
+
const chartQueryMap = mapIdsToQueries(ids, chartQueries);
|
55
|
+
|
56
|
+
const currencies = ids.map(id => {
|
57
|
+
const currencyQuery = currencyQueryMap[id];
|
58
|
+
const chartQuery = chartQueryMap[id];
|
59
|
+
|
60
|
+
return {
|
61
|
+
id,
|
62
|
+
data: currencyQuery?.data,
|
63
|
+
chartData: chartQuery?.data,
|
64
|
+
isLoading: currencyQuery?.isLoading || chartQuery?.isLoading || false,
|
65
|
+
isError: currencyQuery?.isError || chartQuery?.isError || false,
|
66
|
+
};
|
67
|
+
});
|
68
|
+
|
69
|
+
return { currencies };
|
70
|
+
};
|
package/lib/e2e/enum/Device.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/Device.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;aACW,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;IAExC,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW;IAC9B,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;CACjC"}
|
package/lib/e2e/enum/Device.js
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Device = void 0;
|
4
|
-
class Device {
|
5
|
-
name;
|
6
|
-
constructor(name) {
|
7
|
-
this.name = name;
|
8
|
-
}
|
9
|
-
static LNS = "nanoS";
|
10
|
-
static LNX = "nanoX";
|
11
|
-
static LNSP = "nanoSP";
|
12
|
-
}
|
13
|
-
exports.Device = Device;
|
14
|
-
//# sourceMappingURL=Device.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Device.js","sourceRoot":"","sources":["../../../src/e2e/enum/Device.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACW;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE5C,MAAM,CAAU,GAAG,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAU,GAAG,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAU,IAAI,GAAG,QAAQ,CAAC;;AALlC,wBAMC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"logic.d.ts","sourceRoot":"","sources":["../../../src/families/hedera/logic.ts"],"names":[],"mappings":"AACA,cAAc,6BAA6B,CAAC"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
// Encapsulate for LLD & LLM
|
18
|
-
__exportStar(require("@ledgerhq/coin-hedera/logic"), exports);
|
19
|
-
//# sourceMappingURL=logic.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../src/families/hedera/logic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,8DAA4C"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { MarketCoinDataChart } from "../utils/types";
|
2
|
-
type UseLargeMoverChartDataParams = {
|
3
|
-
ids: string[];
|
4
|
-
counterCurrency: string;
|
5
|
-
range: string;
|
6
|
-
};
|
7
|
-
export declare const useLargeMoverChartData: ({ ids, counterCurrency, range, }: UseLargeMoverChartDataParams) => {
|
8
|
-
chartDataArray: {
|
9
|
-
idChartData: string;
|
10
|
-
chartData: MarketCoinDataChart | undefined;
|
11
|
-
isLoading: boolean;
|
12
|
-
isError: boolean;
|
13
|
-
}[];
|
14
|
-
loadingChart: boolean;
|
15
|
-
errorChart: boolean;
|
16
|
-
};
|
17
|
-
export {};
|
18
|
-
//# sourceMappingURL=useLargeMoverChartData.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverChartData.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,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,28 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.useLargeMoverChartData = void 0;
|
4
|
-
const react_query_1 = require("@tanstack/react-query");
|
5
|
-
const api_1 = require("../api");
|
6
|
-
const queryKeys_1 = require("../utils/queryKeys");
|
7
|
-
const timers_1 = require("../utils/timers");
|
8
|
-
const useLargeMoverChartData = ({ ids, counterCurrency, range, }) => {
|
9
|
-
const chartQueries = (0, react_query_1.useQueries)({
|
10
|
-
queries: ids.map(id => ({
|
11
|
-
queryKey: [queryKeys_1.QUERY_KEY.CurrencyChartData, id, counterCurrency, range],
|
12
|
-
queryFn: () => (0, api_1.fetchCurrencyChartData)({ id, counterCurrency, range }),
|
13
|
-
refetchInterval: timers_1.REFETCH_TIME_ONE_MINUTE * timers_1.BASIC_REFETCH,
|
14
|
-
staleTime: timers_1.REFETCH_TIME_ONE_MINUTE * timers_1.BASIC_REFETCH,
|
15
|
-
})),
|
16
|
-
});
|
17
|
-
const loadingChart = chartQueries.some(query => query.isLoading);
|
18
|
-
const errorChart = chartQueries.every(query => query.isError);
|
19
|
-
const chartDataArray = ids.map((id, index) => ({
|
20
|
-
idChartData: id,
|
21
|
-
chartData: chartQueries[index]?.data,
|
22
|
-
isLoading: chartQueries[index]?.isLoading || false,
|
23
|
-
isError: chartQueries[index]?.isError || false,
|
24
|
-
}));
|
25
|
-
return { chartDataArray, loadingChart, errorChart };
|
26
|
-
};
|
27
|
-
exports.useLargeMoverChartData = useLargeMoverChartData;
|
28
|
-
//# sourceMappingURL=useLargeMoverChartData.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverChartData.js","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,gCAAgD;AAChD,kDAA+C;AAC/C,4CAAyE;AASlE,MAAM,sBAAsB,GAAG,CAAC,EACrC,GAAG,EACH,eAAe,EACf,KAAK,GACwB,EAAE,EAAE;IACjC,MAAM,YAAY,GAAG,IAAA,wBAAU,EAAC;QAC9B,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACtB,QAAQ,EAAE,CAAC,qBAAS,CAAC,iBAAiB,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC;YACnE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAA,4BAAsB,EAAC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;YACrE,eAAe,EAAE,gCAAuB,GAAG,sBAAa;YACxD,SAAS,EAAE,gCAAuB,GAAG,sBAAa;SACnD,CAAC,CAAC;KACJ,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE9D,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7C,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,IAAuC;QACvE,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,KAAK;QAClD,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI,KAAK;KAC/C,CAAC,CAAC,CAAC;IAEJ,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACtD,CAAC,CAAC;AAzBW,QAAA,sBAAsB,0BAyBjC"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { CurrencyData } from "../utils/types";
|
2
|
-
type UseLargeMoverCurrenciesParams = {
|
3
|
-
ids: string[];
|
4
|
-
counterCurrency: string;
|
5
|
-
};
|
6
|
-
export declare const useLargeMoverCurrencies: ({ ids, counterCurrency, }: UseLargeMoverCurrenciesParams) => {
|
7
|
-
id: string;
|
8
|
-
data: CurrencyData | undefined;
|
9
|
-
isLoading: boolean;
|
10
|
-
isError: boolean;
|
11
|
-
}[];
|
12
|
-
export {};
|
13
|
-
//# sourceMappingURL=useLargeMoverCurrencies.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverCurrencies.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMlE,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"}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.useLargeMoverCurrencies = void 0;
|
4
|
-
const react_query_1 = require("@tanstack/react-query");
|
5
|
-
const api_1 = require("../api");
|
6
|
-
const queryKeys_1 = require("../utils/queryKeys");
|
7
|
-
const timers_1 = require("../utils/timers");
|
8
|
-
const currencyFormatter_1 = require("../utils/currencyFormatter");
|
9
|
-
const currencies_1 = require("@ledgerhq/cryptoassets/currencies");
|
10
|
-
const cryptoCurrenciesList = [...(0, currencies_1.listCryptoCurrencies)()];
|
11
|
-
const useLargeMoverCurrencies = ({ ids, counterCurrency, }) => {
|
12
|
-
const currencyQueries = (0, react_query_1.useQueries)({
|
13
|
-
queries: ids.map(id => ({
|
14
|
-
queryKey: [queryKeys_1.QUERY_KEY.CurrencyDataRaw, id, counterCurrency],
|
15
|
-
queryFn: () => (0, api_1.fetchCurrency)({ id, counterCurrency }),
|
16
|
-
refetchInterval: timers_1.REFETCH_TIME_ONE_MINUTE * timers_1.BASIC_REFETCH,
|
17
|
-
staleTime: timers_1.REFETCH_TIME_ONE_MINUTE * timers_1.BASIC_REFETCH,
|
18
|
-
select: (data) => (0, currencyFormatter_1.format)(data, cryptoCurrenciesList),
|
19
|
-
})),
|
20
|
-
});
|
21
|
-
return ids.map((id, index) => ({
|
22
|
-
id,
|
23
|
-
data: currencyQueries[index]?.data,
|
24
|
-
isLoading: currencyQueries[index]?.isLoading || false,
|
25
|
-
isError: currencyQueries[index]?.isError || false,
|
26
|
-
}));
|
27
|
-
};
|
28
|
-
exports.useLargeMoverCurrencies = useLargeMoverCurrencies;
|
29
|
-
//# sourceMappingURL=useLargeMoverCurrencies.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverCurrencies.js","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,gCAAuC;AACvC,kDAA+C;AAC/C,4CAAyE;AAEzE,kEAAoD;AACpD,kEAAyE;AA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AAQ,CAAC,GAAG,WAAW;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;CACjC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Device.js","sourceRoot":"","sources":["../../../src/e2e/enum/Device.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,MAAM;IACW;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE5C,MAAM,CAAU,GAAG,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAU,GAAG,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAU,IAAI,GAAG,QAAQ,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"logic.d.ts","sourceRoot":"","sources":["../../../src/families/hedera/logic.ts"],"names":[],"mappings":"AACA,cAAc,6BAA6B,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../src/families/hedera/logic.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,cAAc,6BAA6B,CAAC"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { MarketCoinDataChart } from "../utils/types";
|
2
|
-
type UseLargeMoverChartDataParams = {
|
3
|
-
ids: string[];
|
4
|
-
counterCurrency: string;
|
5
|
-
range: string;
|
6
|
-
};
|
7
|
-
export declare const useLargeMoverChartData: ({ ids, counterCurrency, range, }: UseLargeMoverChartDataParams) => {
|
8
|
-
chartDataArray: {
|
9
|
-
idChartData: string;
|
10
|
-
chartData: MarketCoinDataChart | undefined;
|
11
|
-
isLoading: boolean;
|
12
|
-
isError: boolean;
|
13
|
-
}[];
|
14
|
-
loadingChart: boolean;
|
15
|
-
errorChart: boolean;
|
16
|
-
};
|
17
|
-
export {};
|
18
|
-
//# sourceMappingURL=useLargeMoverChartData.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverChartData.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverChartData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,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,24 +0,0 @@
|
|
1
|
-
import { useQueries } from "@tanstack/react-query";
|
2
|
-
import { fetchCurrencyChartData } from "../api";
|
3
|
-
import { QUERY_KEY } from "../utils/queryKeys";
|
4
|
-
import { REFETCH_TIME_ONE_MINUTE, BASIC_REFETCH } from "../utils/timers";
|
5
|
-
export const useLargeMoverChartData = ({ ids, counterCurrency, range, }) => {
|
6
|
-
const chartQueries = useQueries({
|
7
|
-
queries: ids.map(id => ({
|
8
|
-
queryKey: [QUERY_KEY.CurrencyChartData, id, counterCurrency, range],
|
9
|
-
queryFn: () => fetchCurrencyChartData({ id, counterCurrency, range }),
|
10
|
-
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
11
|
-
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
12
|
-
})),
|
13
|
-
});
|
14
|
-
const loadingChart = chartQueries.some(query => query.isLoading);
|
15
|
-
const errorChart = chartQueries.every(query => query.isError);
|
16
|
-
const chartDataArray = ids.map((id, index) => ({
|
17
|
-
idChartData: id,
|
18
|
-
chartData: chartQueries[index]?.data,
|
19
|
-
isLoading: chartQueries[index]?.isLoading || false,
|
20
|
-
isError: chartQueries[index]?.isError || false,
|
21
|
-
}));
|
22
|
-
return { chartDataArray, loadingChart, errorChart };
|
23
|
-
};
|
24
|
-
//# sourceMappingURL=useLargeMoverChartData.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverChartData.js","sourceRoot":"","s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EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI,KAAK;KAC/C,CAAC,CAAC,CAAC;IAEJ,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACtD,CAAC,CAAC"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { CurrencyData } from "../utils/types";
|
2
|
-
type UseLargeMoverCurrenciesParams = {
|
3
|
-
ids: string[];
|
4
|
-
counterCurrency: string;
|
5
|
-
};
|
6
|
-
export declare const useLargeMoverCurrencies: ({ ids, counterCurrency, }: UseLargeMoverCurrenciesParams) => {
|
7
|
-
id: string;
|
8
|
-
data: CurrencyData | undefined;
|
9
|
-
isLoading: boolean;
|
10
|
-
isError: boolean;
|
11
|
-
}[];
|
12
|
-
export {};
|
13
|
-
//# sourceMappingURL=useLargeMoverCurrencies.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useLargeMoverCurrencies.d.ts","sourceRoot":"","sources":["../../../src/market/hooks/useLargeMoverCurrencies.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMlE,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"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { useQueries } from "@tanstack/react-query";
|
2
|
-
import { fetchCurrency } from "../api";
|
3
|
-
import { QUERY_KEY } from "../utils/queryKeys";
|
4
|
-
import { REFETCH_TIME_ONE_MINUTE, BASIC_REFETCH } from "../utils/timers";
|
5
|
-
import { format } from "../utils/currencyFormatter";
|
6
|
-
import { listCryptoCurrencies } from "@ledgerhq/cryptoassets/currencies";
|
7
|
-
const cryptoCurrenciesList = [...listCryptoCurrencies()];
|
8
|
-
export const useLargeMoverCurrencies = ({ ids, counterCurrency, }) => {
|
9
|
-
const currencyQueries = useQueries({
|
10
|
-
queries: ids.map(id => ({
|
11
|
-
queryKey: [QUERY_KEY.CurrencyDataRaw, id, counterCurrency],
|
12
|
-
queryFn: () => fetchCurrency({ id, counterCurrency }),
|
13
|
-
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
14
|
-
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
15
|
-
select: (data) => format(data, cryptoCurrenciesList),
|
16
|
-
})),
|
17
|
-
});
|
18
|
-
return ids.map((id, index) => ({
|
19
|
-
id,
|
20
|
-
data: currencyQueries[index]?.data,
|
21
|
-
isLoading: currencyQueries[index]?.isLoading || false,
|
22
|
-
isError: currencyQueries[index]?.isError || false,
|
23
|
-
}));
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=useLargeMoverCurrencies.js.map
|
@@ -1 +0,0 @@
|
|
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;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,oBAAoB,GAAG,CAAC,GAAG,oBAAoB,EAAE,CAAC,CAAC;AAOzD,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,EAAE,oBAAoB,CAAC;SACzE,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,IAAgC;QAC9D,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"}
|
package/src/e2e/enum/Device.ts
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import { useQueries } from "@tanstack/react-query";
|
2
|
-
import { fetchCurrencyChartData } from "../api";
|
3
|
-
import { QUERY_KEY } from "../utils/queryKeys";
|
4
|
-
import { REFETCH_TIME_ONE_MINUTE, BASIC_REFETCH } from "../utils/timers";
|
5
|
-
import { MarketCoinDataChart } from "../utils/types";
|
6
|
-
|
7
|
-
type UseLargeMoverChartDataParams = {
|
8
|
-
ids: string[];
|
9
|
-
counterCurrency: string;
|
10
|
-
range: string;
|
11
|
-
};
|
12
|
-
|
13
|
-
export const useLargeMoverChartData = ({
|
14
|
-
ids,
|
15
|
-
counterCurrency,
|
16
|
-
range,
|
17
|
-
}: UseLargeMoverChartDataParams) => {
|
18
|
-
const chartQueries = useQueries({
|
19
|
-
queries: ids.map(id => ({
|
20
|
-
queryKey: [QUERY_KEY.CurrencyChartData, id, counterCurrency, range],
|
21
|
-
queryFn: () => fetchCurrencyChartData({ id, counterCurrency, range }),
|
22
|
-
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
23
|
-
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
24
|
-
})),
|
25
|
-
});
|
26
|
-
|
27
|
-
const loadingChart = chartQueries.some(query => query.isLoading);
|
28
|
-
const errorChart = chartQueries.every(query => query.isError);
|
29
|
-
|
30
|
-
const chartDataArray = ids.map((id, index) => ({
|
31
|
-
idChartData: id,
|
32
|
-
chartData: chartQueries[index]?.data as MarketCoinDataChart | undefined,
|
33
|
-
isLoading: chartQueries[index]?.isLoading || false,
|
34
|
-
isError: chartQueries[index]?.isError || false,
|
35
|
-
}));
|
36
|
-
|
37
|
-
return { chartDataArray, loadingChart, errorChart };
|
38
|
-
};
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { useQueries } from "@tanstack/react-query";
|
2
|
-
import { fetchCurrency } from "../api";
|
3
|
-
import { QUERY_KEY } from "../utils/queryKeys";
|
4
|
-
import { REFETCH_TIME_ONE_MINUTE, BASIC_REFETCH } from "../utils/timers";
|
5
|
-
import { MarketItemResponse, CurrencyData } from "../utils/types";
|
6
|
-
import { format } from "../utils/currencyFormatter";
|
7
|
-
import { listCryptoCurrencies } from "@ledgerhq/cryptoassets/currencies";
|
8
|
-
|
9
|
-
const cryptoCurrenciesList = [...listCryptoCurrencies()];
|
10
|
-
|
11
|
-
type UseLargeMoverCurrenciesParams = {
|
12
|
-
ids: string[];
|
13
|
-
counterCurrency: string;
|
14
|
-
};
|
15
|
-
|
16
|
-
export const useLargeMoverCurrencies = ({
|
17
|
-
ids,
|
18
|
-
counterCurrency,
|
19
|
-
}: UseLargeMoverCurrenciesParams) => {
|
20
|
-
const currencyQueries = useQueries({
|
21
|
-
queries: ids.map(id => ({
|
22
|
-
queryKey: [QUERY_KEY.CurrencyDataRaw, id, counterCurrency],
|
23
|
-
queryFn: () => fetchCurrency({ id, counterCurrency }),
|
24
|
-
refetchInterval: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
25
|
-
staleTime: REFETCH_TIME_ONE_MINUTE * BASIC_REFETCH,
|
26
|
-
select: (data: MarketItemResponse) => format(data, cryptoCurrenciesList),
|
27
|
-
})),
|
28
|
-
});
|
29
|
-
|
30
|
-
return ids.map((id, index) => ({
|
31
|
-
id,
|
32
|
-
data: currencyQueries[index]?.data as CurrencyData | undefined,
|
33
|
-
isLoading: currencyQueries[index]?.isLoading || false,
|
34
|
-
isError: currencyQueries[index]?.isError || false,
|
35
|
-
}));
|
36
|
-
};
|