@ledgerhq/live-common 34.47.0-nightly.5 → 34.47.0-nightly.7
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/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -1
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.test.js +37 -0
- package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +2 -1
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +1 -0
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/speculos.d.ts +1 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +10 -2
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts +16 -0
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +1 -0
- package/lib/modularDrawer/data/entities/interestRateSelectors.js +21 -0
- package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +1 -0
- package/lib/modularDrawer/data/state-manager/api.d.ts +1 -16
- package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.js +11 -8
- package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib/modularDrawer/data/state-manager/types.d.ts +24 -0
- package/lib/modularDrawer/data/state-manager/types.d.ts.map +1 -0
- package/lib/modularDrawer/data/state-manager/types.js +13 -0
- package/lib/modularDrawer/data/state-manager/types.js.map +1 -0
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +6 -6
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +59 -10
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib/modularDrawer/hooks/{modules/useAssetAccountCounts.d.ts → useAssetAccountCounts.d.ts} +1 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/{modules/useAssetAccountCounts.js → useAssetAccountCounts.js} +1 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -0
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +8 -3
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.js +7 -3
- package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib/modularDrawer/hooks/useLeftAccounts.d.ts +13 -0
- package/lib/modularDrawer/hooks/useLeftAccounts.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useLeftAccounts.js +15 -0
- package/lib/modularDrawer/hooks/useLeftAccounts.js.map +1 -0
- package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts +6 -0
- package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js +19 -0
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -0
- package/lib/modularDrawer/hooks/useLeftApy.d.ts +54 -0
- package/lib/modularDrawer/hooks/useLeftApy.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useLeftApy.js +15 -0
- package/lib/modularDrawer/hooks/useLeftApy.js.map +1 -0
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +57 -0
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +87 -0
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -0
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +63 -0
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +66 -0
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -0
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts +4 -0
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -0
- package/lib/modularDrawer/modules/createAssetConfiguration.js +41 -0
- package/lib/modularDrawer/modules/createAssetConfiguration.js.map +1 -0
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +6 -0
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -0
- package/lib/modularDrawer/modules/createNetworkConfiguration.js +56 -0
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -0
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +9 -0
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +1 -0
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +17 -0
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +1 -0
- package/lib/modularDrawer/utils/sortByBalance.d.ts +6 -0
- package/lib/modularDrawer/utils/sortByBalance.d.ts.map +1 -0
- package/lib/modularDrawer/utils/sortByBalance.js +32 -0
- package/lib/modularDrawer/utils/sortByBalance.js.map +1 -0
- package/lib/modularDrawer/utils/type.d.ts +89 -1
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +2 -2
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/react.d.ts +2 -0
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +3 -1
- package/lib/wallet-api/react.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.test.js +37 -0
- package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +2 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +1 -0
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts +1 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +8 -1
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts +16 -0
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +1 -0
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js +18 -0
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +1 -0
- package/lib-es/modularDrawer/data/state-manager/api.d.ts +1 -16
- package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.js +8 -5
- package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/types.d.ts +24 -0
- package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +1 -0
- package/lib-es/modularDrawer/data/state-manager/types.js +10 -0
- package/lib-es/modularDrawer/data/state-manager/types.js.map +1 -0
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +6 -6
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +37 -8
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib-es/modularDrawer/hooks/{modules/useAssetAccountCounts.d.ts → useAssetAccountCounts.d.ts} +1 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/{modules/useAssetAccountCounts.js → useAssetAccountCounts.js} +1 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +8 -3
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js +7 -3
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts +13 -0
- package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useLeftAccounts.js +11 -0
- package/lib-es/modularDrawer/hooks/useLeftAccounts.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts +6 -0
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +15 -0
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useLeftApy.d.ts +54 -0
- package/lib-es/modularDrawer/hooks/useLeftApy.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useLeftApy.js +11 -0
- package/lib-es/modularDrawer/hooks/useLeftApy.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +57 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +83 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +63 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +62 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -0
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts +4 -0
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -0
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js +39 -0
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +1 -0
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +6 -0
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -0
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +50 -0
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -0
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +9 -0
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +13 -0
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +1 -0
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts +6 -0
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/sortByBalance.js +25 -0
- package/lib-es/modularDrawer/utils/sortByBalance.js.map +1 -0
- package/lib-es/modularDrawer/utils/type.d.ts +89 -1
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +2 -2
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +2 -0
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +3 -1
- package/lib-es/wallet-api/react.js.map +1 -1
- package/package.json +14 -14
- package/src/bridge/generic-alpaca/utils.test.ts +40 -0
- package/src/bridge/generic-alpaca/utils.ts +4 -3
- package/src/e2e/enum/DeviceLabels.ts +1 -0
- package/src/e2e/speculos.ts +9 -1
- package/src/modularDrawer/data/entities/interestRateSelectors.ts +39 -0
- package/src/modularDrawer/data/state-manager/api.ts +15 -21
- package/src/modularDrawer/data/state-manager/types.ts +28 -0
- package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +6 -6
- package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +42 -9
- package/src/modularDrawer/hooks/{modules/useAssetAccountCounts.tsx → useAssetAccountCounts.tsx} +2 -2
- package/src/modularDrawer/hooks/useAssetsData.ts +19 -5
- package/src/modularDrawer/hooks/useLeftAccounts.tsx +23 -0
- package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +28 -0
- package/src/modularDrawer/hooks/useLeftApy.tsx +19 -0
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +140 -0
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +116 -0
- package/src/modularDrawer/modules/createAssetConfiguration.ts +61 -0
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +79 -0
- package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +25 -0
- package/src/modularDrawer/utils/sortByBalance.tsx +32 -0
- package/src/modularDrawer/utils/type.ts +97 -0
- package/src/wallet-api/Exchange/server.ts +2 -2
- package/src/wallet-api/react.ts +5 -1
- package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +0 -1
- package/lib/modularDrawer/types.d.ts +0 -2
- package/lib/modularDrawer/types.d.ts.map +0 -1
- package/lib/modularDrawer/types.js +0 -3
- package/lib/modularDrawer/types.js.map +0 -1
- package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +0 -1
- package/lib-es/modularDrawer/types.d.ts +0 -2
- package/lib-es/modularDrawer/types.d.ts.map +0 -1
- package/lib-es/modularDrawer/types.js +0 -2
- package/lib-es/modularDrawer/types.js.map +0 -1
- package/src/modularDrawer/types.ts +0 -1
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
|
+
import { ReactNode } from "react";
|
3
|
+
import { ApyType } from "../utils/type";
|
4
|
+
|
5
|
+
export const createUseLeftApyModule = ({
|
6
|
+
ApyIndicator,
|
7
|
+
}: {
|
8
|
+
ApyIndicator: (args: { value: number; type: ApyType }) => ReactNode;
|
9
|
+
}) => {
|
10
|
+
return (assets: CryptoOrTokenCurrency[]) => {
|
11
|
+
const value = 5.11; // TODO: fetch DADA
|
12
|
+
const type: ApyType = "APY"; // TODO: fetch DADA
|
13
|
+
|
14
|
+
return assets.map(asset => ({
|
15
|
+
...asset,
|
16
|
+
leftElement: ApyIndicator({ value, type }),
|
17
|
+
}));
|
18
|
+
};
|
19
|
+
};
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import { useMemo } from "react";
|
2
|
+
import type { ReactNode } from "react";
|
3
|
+
import type { CryptoOrTokenCurrency, Currency } from "@ledgerhq/types-cryptoassets";
|
4
|
+
import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/formatCurrencyUnit";
|
5
|
+
import BigNumber from "bignumber.js";
|
6
|
+
import { counterValueFormatter } from "../utils/counterValueFormatter";
|
7
|
+
import { compareByBalanceThenFiat } from "../utils/sortByBalance";
|
8
|
+
import { UseBalanceDeps } from "../utils/type";
|
9
|
+
import { buildProviderCurrenciesMap } from "../utils/buildProviderCurrenciesMap";
|
10
|
+
import { CurrenciesByProviderId } from "../../deposit/type";
|
11
|
+
import { calculateProviderTotals } from "../utils/calculateProviderTotal";
|
12
|
+
import { getProviderCurrency } from "../utils/getProviderCurrency";
|
13
|
+
import { getBalanceAndFiatValueByAssets } from "../utils/getBalanceAndFiatValueByAssets";
|
14
|
+
import { groupAccountsByAsset } from "../utils/groupAccountsByAsset";
|
15
|
+
|
16
|
+
export type AssetDeps = {
|
17
|
+
useBalanceDeps: UseBalanceDeps;
|
18
|
+
balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
|
19
|
+
};
|
20
|
+
|
21
|
+
export function createUseRightBalanceAsset({ useBalanceDeps, balanceItem }: AssetDeps) {
|
22
|
+
const formatProviderResult = (
|
23
|
+
providerCurrency: CryptoOrTokenCurrency,
|
24
|
+
totalBalance: BigNumber,
|
25
|
+
totalFiatValue: BigNumber,
|
26
|
+
counterValueCurrency: Currency,
|
27
|
+
locale: string,
|
28
|
+
discreet: boolean,
|
29
|
+
) => {
|
30
|
+
const unit = providerCurrency.units?.[0];
|
31
|
+
const balance = unit
|
32
|
+
? formatCurrencyUnit(unit, totalBalance, { showCode: true, discreet })
|
33
|
+
: `${totalBalance.toFixed()} ${providerCurrency.ticker ?? providerCurrency.symbol}`;
|
34
|
+
const fiatValue = counterValueFormatter({
|
35
|
+
currency: counterValueCurrency.ticker,
|
36
|
+
value: totalFiatValue.toNumber(),
|
37
|
+
locale,
|
38
|
+
allowZeroValue: true,
|
39
|
+
});
|
40
|
+
return { balance, fiatValue };
|
41
|
+
};
|
42
|
+
|
43
|
+
return function useRightBalanceAsset(
|
44
|
+
assets: CryptoOrTokenCurrency[],
|
45
|
+
currenciesByProvider: CurrenciesByProviderId[],
|
46
|
+
) {
|
47
|
+
const { flattenedAccounts, discreet, state, counterValueCurrency, locale } = useBalanceDeps();
|
48
|
+
|
49
|
+
const grouped = useMemo(
|
50
|
+
() => groupAccountsByAsset(flattenedAccounts, state, counterValueCurrency, discreet),
|
51
|
+
[flattenedAccounts, state, counterValueCurrency, discreet],
|
52
|
+
);
|
53
|
+
|
54
|
+
const providerMap = useMemo(
|
55
|
+
() => buildProviderCurrenciesMap(currenciesByProvider),
|
56
|
+
[currenciesByProvider],
|
57
|
+
);
|
58
|
+
|
59
|
+
return useMemo(() => {
|
60
|
+
if (!providerMap) {
|
61
|
+
const allBalance = getBalanceAndFiatValueByAssets(
|
62
|
+
flattenedAccounts,
|
63
|
+
assets,
|
64
|
+
state,
|
65
|
+
counterValueCurrency,
|
66
|
+
discreet,
|
67
|
+
locale,
|
68
|
+
);
|
69
|
+
const balanceMap = new Map(allBalance.map(b => [b.id, b]));
|
70
|
+
const assetsWithBalanceData = assets.map(asset => {
|
71
|
+
const balanceData = balanceMap.get(asset.id) || {};
|
72
|
+
return {
|
73
|
+
asset,
|
74
|
+
balanceData,
|
75
|
+
};
|
76
|
+
});
|
77
|
+
|
78
|
+
assetsWithBalanceData.sort((a, b) =>
|
79
|
+
compareByBalanceThenFiat(a.balanceData, b.balanceData, discreet),
|
80
|
+
);
|
81
|
+
|
82
|
+
return assetsWithBalanceData.map(({ asset, balanceData }) => ({
|
83
|
+
...asset,
|
84
|
+
rightElement: balanceItem(balanceData),
|
85
|
+
}));
|
86
|
+
}
|
87
|
+
|
88
|
+
const assetsSet = new Set(assets.map(a => a.id));
|
89
|
+
const providerResultsMap = new Map<string, { balance?: string; fiatValue?: string }>();
|
90
|
+
|
91
|
+
for (const [, { currencies, mainCurrency }] of providerMap) {
|
92
|
+
if (!assetsSet.has(mainCurrency.id)) continue;
|
93
|
+
const providerCurrency = getProviderCurrency(mainCurrency, currencies);
|
94
|
+
if (!providerCurrency) continue;
|
95
|
+
|
96
|
+
const { totalBalance, totalFiatValue, hasAccounts } = calculateProviderTotals(
|
97
|
+
currencies,
|
98
|
+
grouped,
|
99
|
+
);
|
100
|
+
if (!hasAccounts) continue;
|
101
|
+
|
102
|
+
const { balance, fiatValue } = formatProviderResult(
|
103
|
+
providerCurrency,
|
104
|
+
totalBalance,
|
105
|
+
totalFiatValue,
|
106
|
+
counterValueCurrency,
|
107
|
+
locale,
|
108
|
+
discreet,
|
109
|
+
);
|
110
|
+
providerResultsMap.set(mainCurrency.id, { balance, fiatValue });
|
111
|
+
}
|
112
|
+
|
113
|
+
const assetsWithBalanceData = assets.map(asset => {
|
114
|
+
const balanceData = providerResultsMap.get(asset.id) || {};
|
115
|
+
return {
|
116
|
+
asset,
|
117
|
+
balanceData,
|
118
|
+
};
|
119
|
+
});
|
120
|
+
|
121
|
+
assetsWithBalanceData.sort((a, b) =>
|
122
|
+
compareByBalanceThenFiat(a.balanceData, b.balanceData, discreet),
|
123
|
+
);
|
124
|
+
|
125
|
+
return assetsWithBalanceData.map(({ asset, balanceData }) => ({
|
126
|
+
...asset,
|
127
|
+
rightElement: balanceItem(balanceData),
|
128
|
+
}));
|
129
|
+
}, [
|
130
|
+
assets,
|
131
|
+
providerMap,
|
132
|
+
flattenedAccounts,
|
133
|
+
state,
|
134
|
+
counterValueCurrency,
|
135
|
+
discreet,
|
136
|
+
locale,
|
137
|
+
grouped,
|
138
|
+
]);
|
139
|
+
};
|
140
|
+
}
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import { useMemo, type ReactNode } from "react";
|
2
|
+
import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
3
|
+
import { compareByBalanceThenFiat } from "../utils/sortByBalance";
|
4
|
+
import { BalanceUI, UseBalanceDeps } from "../utils/type";
|
5
|
+
import { CurrenciesByProviderId } from "../../deposit/type";
|
6
|
+
import { getBalanceAndFiatValueByAssets } from "../utils/getBalanceAndFiatValueByAssets";
|
7
|
+
|
8
|
+
export type NetworkDeps = {
|
9
|
+
balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
|
10
|
+
useBalanceDeps: UseBalanceDeps;
|
11
|
+
};
|
12
|
+
|
13
|
+
type Params = {
|
14
|
+
assets: CryptoOrTokenCurrency[];
|
15
|
+
selectedAssetId: string;
|
16
|
+
currenciesByProvider: CurrenciesByProviderId[];
|
17
|
+
};
|
18
|
+
|
19
|
+
export function createUseRightBalanceNetwork({ useBalanceDeps, balanceItem }: NetworkDeps) {
|
20
|
+
return function useRightBalanceNetwork({
|
21
|
+
assets: networks,
|
22
|
+
selectedAssetId,
|
23
|
+
currenciesByProvider,
|
24
|
+
}: Params) {
|
25
|
+
const { flattenedAccounts, discreet, state, counterValueCurrency, locale } = useBalanceDeps();
|
26
|
+
|
27
|
+
return useMemo(() => {
|
28
|
+
if (currenciesByProvider && currenciesByProvider.length > 0) {
|
29
|
+
const providerOfSelectedAsset = currenciesByProvider.find(provider =>
|
30
|
+
provider.currenciesByNetwork.some(currency => currency.id === selectedAssetId),
|
31
|
+
);
|
32
|
+
|
33
|
+
if (providerOfSelectedAsset) {
|
34
|
+
const pairs = networks.map(network => ({
|
35
|
+
network,
|
36
|
+
asset: providerOfSelectedAsset.currenciesByNetwork.find(currency =>
|
37
|
+
currency.type === "TokenCurrency"
|
38
|
+
? currency.parentCurrency.id === network.id
|
39
|
+
: currency.id === network.id,
|
40
|
+
),
|
41
|
+
}));
|
42
|
+
|
43
|
+
const validAssets = pairs.filter(p => p.asset).map(p => p.asset!);
|
44
|
+
|
45
|
+
const allBalanceData =
|
46
|
+
validAssets.length > 0
|
47
|
+
? getBalanceAndFiatValueByAssets(
|
48
|
+
flattenedAccounts,
|
49
|
+
validAssets,
|
50
|
+
state,
|
51
|
+
counterValueCurrency,
|
52
|
+
discreet,
|
53
|
+
locale,
|
54
|
+
)
|
55
|
+
: [];
|
56
|
+
|
57
|
+
const balanceMap = new Map(allBalanceData.map(b => [b.id, b]));
|
58
|
+
|
59
|
+
const networkWithBalanceData = pairs.map(({ network, asset }) => {
|
60
|
+
const balanceData: BalanceUI = asset ? balanceMap.get(asset.id) || {} : {};
|
61
|
+
return {
|
62
|
+
network,
|
63
|
+
balanceData,
|
64
|
+
};
|
65
|
+
});
|
66
|
+
|
67
|
+
networkWithBalanceData.sort((a, b) =>
|
68
|
+
compareByBalanceThenFiat(a.balanceData, b.balanceData, discreet),
|
69
|
+
);
|
70
|
+
|
71
|
+
return networkWithBalanceData.map(({ network, balanceData }) => ({
|
72
|
+
...network,
|
73
|
+
rightElement: balanceItem(balanceData),
|
74
|
+
}));
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
const networkBalanceData = getBalanceAndFiatValueByAssets(
|
79
|
+
flattenedAccounts,
|
80
|
+
networks,
|
81
|
+
state,
|
82
|
+
counterValueCurrency,
|
83
|
+
discreet,
|
84
|
+
locale,
|
85
|
+
);
|
86
|
+
|
87
|
+
const balanceMap = new Map(networkBalanceData.map(b => [b.id, b]));
|
88
|
+
|
89
|
+
const networksWithBalance = networks.map(network => {
|
90
|
+
const balanceData = balanceMap.get(network.id) || {};
|
91
|
+
return {
|
92
|
+
network,
|
93
|
+
balanceData,
|
94
|
+
};
|
95
|
+
});
|
96
|
+
|
97
|
+
networksWithBalance.sort((a, b) =>
|
98
|
+
compareByBalanceThenFiat(a.balanceData, b.balanceData, discreet),
|
99
|
+
);
|
100
|
+
|
101
|
+
return networksWithBalance.map(({ network, balanceData }) => ({
|
102
|
+
...network,
|
103
|
+
rightElement: balanceItem(balanceData),
|
104
|
+
}));
|
105
|
+
}, [
|
106
|
+
networks,
|
107
|
+
selectedAssetId,
|
108
|
+
currenciesByProvider,
|
109
|
+
flattenedAccounts,
|
110
|
+
state,
|
111
|
+
counterValueCurrency,
|
112
|
+
discreet,
|
113
|
+
locale,
|
114
|
+
]);
|
115
|
+
};
|
116
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
|
+
import { AssetType, CreateAssetConfigurationHook, AssetConfigurationDeps } from "../utils/type";
|
3
|
+
import { CurrenciesByProviderId } from "../../deposit/type";
|
4
|
+
import { composeHooks } from "../../utils/composeHooks";
|
5
|
+
import { createUseLeftApyModule } from "../hooks/useLeftApy";
|
6
|
+
import { createUseRightBalanceAsset } from "../hooks/useRightBalanceAsset";
|
7
|
+
|
8
|
+
const getRightElement =
|
9
|
+
(AssetConfigurationDeps: AssetConfigurationDeps) => (rightElement: string) => {
|
10
|
+
switch (rightElement) {
|
11
|
+
case "balance":
|
12
|
+
return createUseRightBalanceAsset({
|
13
|
+
useBalanceDeps: AssetConfigurationDeps.useBalanceDeps,
|
14
|
+
balanceItem: AssetConfigurationDeps.balanceItem,
|
15
|
+
});
|
16
|
+
case "marketTrend":
|
17
|
+
case "undefined":
|
18
|
+
default:
|
19
|
+
return undefined;
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
const getLeftElement =
|
24
|
+
(AssetConfigurationDeps: AssetConfigurationDeps) => (leftElement: string) => {
|
25
|
+
switch (leftElement) {
|
26
|
+
case "apy":
|
27
|
+
return createUseLeftApyModule({ ApyIndicator: AssetConfigurationDeps.ApyIndicator });
|
28
|
+
case "priceVariation":
|
29
|
+
case "undefined":
|
30
|
+
default:
|
31
|
+
return undefined;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
const createAssetConfigurationHook: CreateAssetConfigurationHook =
|
36
|
+
deps =>
|
37
|
+
({ assetsConfiguration, currenciesByProvider }) => {
|
38
|
+
const { rightElement = "undefined", leftElement = "undefined" } = assetsConfiguration ?? {};
|
39
|
+
|
40
|
+
const rightHook = getRightElement(deps)(rightElement);
|
41
|
+
const leftHook = getLeftElement(deps)(leftElement);
|
42
|
+
|
43
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
44
|
+
const hooks = [rightHook, leftHook].filter(Boolean) as Array<
|
45
|
+
(
|
46
|
+
assets: CryptoOrTokenCurrency[],
|
47
|
+
currenciesByProvider?: CurrenciesByProviderId[],
|
48
|
+
) => AssetType[]
|
49
|
+
>;
|
50
|
+
|
51
|
+
return (assets: CryptoOrTokenCurrency[]) => {
|
52
|
+
const composedHook = composeHooks<CryptoOrTokenCurrency, AssetType>(
|
53
|
+
...hooks.map(
|
54
|
+
hook => (assets: CryptoOrTokenCurrency[]) => hook(assets, currenciesByProvider),
|
55
|
+
),
|
56
|
+
);
|
57
|
+
return composedHook(assets);
|
58
|
+
};
|
59
|
+
};
|
60
|
+
|
61
|
+
export default createAssetConfigurationHook;
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import type { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
|
+
import { createUseLeftAccountsModule } from "../hooks/useLeftAccounts";
|
3
|
+
import { createUseLeftAccountsApyModule } from "../hooks/useLeftAccountsApy";
|
4
|
+
import { createUseRightBalanceNetwork } from "../hooks/useRightBalanceNetwork";
|
5
|
+
import {
|
6
|
+
CreateNetworkConfigurationHookProps,
|
7
|
+
NetworkConfigurationDeps,
|
8
|
+
LeftElementKind,
|
9
|
+
Network,
|
10
|
+
NetworkHook,
|
11
|
+
RightElementKind,
|
12
|
+
} from "../utils/type";
|
13
|
+
import { composeHooks } from "../../utils/composeHooks";
|
14
|
+
|
15
|
+
export const getLeftElement =
|
16
|
+
(NetworkConfigurationDeps: NetworkConfigurationDeps) =>
|
17
|
+
(leftElement: LeftElementKind): NetworkHook | undefined => {
|
18
|
+
switch (leftElement) {
|
19
|
+
case "numberOfAccounts":
|
20
|
+
return createUseLeftAccountsModule({
|
21
|
+
useAccountData: NetworkConfigurationDeps.useAccountData,
|
22
|
+
accountsCount: NetworkConfigurationDeps.accountsCount,
|
23
|
+
});
|
24
|
+
case "numberOfAccountsAndApy":
|
25
|
+
return createUseLeftAccountsApyModule({
|
26
|
+
useAccountData: NetworkConfigurationDeps.useAccountData,
|
27
|
+
accountsCountAndApy: NetworkConfigurationDeps.accountsCountAndApy,
|
28
|
+
});
|
29
|
+
case "undefined":
|
30
|
+
default:
|
31
|
+
return undefined;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
export const getRightElement =
|
36
|
+
(NetworkConfigurationDeps: NetworkConfigurationDeps) =>
|
37
|
+
(rightElement: RightElementKind): NetworkHook | undefined => {
|
38
|
+
switch (rightElement) {
|
39
|
+
case "balance":
|
40
|
+
return createUseRightBalanceNetwork({
|
41
|
+
useBalanceDeps: NetworkConfigurationDeps.useBalanceDeps,
|
42
|
+
balanceItem: NetworkConfigurationDeps.balanceItem,
|
43
|
+
});
|
44
|
+
case "undefined":
|
45
|
+
default:
|
46
|
+
return undefined;
|
47
|
+
}
|
48
|
+
};
|
49
|
+
|
50
|
+
export const createNetworkConfigurationHook =
|
51
|
+
(NetworkConfigurationDeps: NetworkConfigurationDeps) =>
|
52
|
+
({
|
53
|
+
networksConfig,
|
54
|
+
selectedAssetId,
|
55
|
+
currenciesByProvider,
|
56
|
+
accounts$,
|
57
|
+
}: CreateNetworkConfigurationHookProps) => {
|
58
|
+
const { leftElement = "undefined", rightElement = "undefined" } = networksConfig ?? {};
|
59
|
+
const leftHook = getLeftElement(NetworkConfigurationDeps)(leftElement);
|
60
|
+
const rightHook = getRightElement(NetworkConfigurationDeps)(rightElement);
|
61
|
+
|
62
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
63
|
+
const hooks = [rightHook, leftHook].filter(Boolean) as NetworkHook[];
|
64
|
+
|
65
|
+
return (assets: CryptoOrTokenCurrency[]): Array<CryptoOrTokenCurrency & Network> => {
|
66
|
+
const composedHook = composeHooks<CryptoOrTokenCurrency, Network>(
|
67
|
+
...hooks.map(
|
68
|
+
hook => (assets: CryptoOrTokenCurrency[]) =>
|
69
|
+
hook({
|
70
|
+
assets,
|
71
|
+
selectedAssetId,
|
72
|
+
currenciesByProvider: currenciesByProvider || [],
|
73
|
+
accounts$,
|
74
|
+
}),
|
75
|
+
),
|
76
|
+
);
|
77
|
+
return composedHook(assets);
|
78
|
+
};
|
79
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
|
+
|
3
|
+
export const buildProviderCurrenciesMap = (
|
4
|
+
currenciesByProvider?: Array<{
|
5
|
+
providerId: string;
|
6
|
+
currenciesByNetwork?: CryptoOrTokenCurrency[];
|
7
|
+
}>,
|
8
|
+
) => {
|
9
|
+
if (!currenciesByProvider?.length) return null;
|
10
|
+
|
11
|
+
const map = new Map<
|
12
|
+
string,
|
13
|
+
{ mainCurrency: CryptoOrTokenCurrency; currencies: CryptoOrTokenCurrency[] }
|
14
|
+
>();
|
15
|
+
|
16
|
+
currenciesByProvider.forEach(({ providerId, currenciesByNetwork = [] }) => {
|
17
|
+
if (currenciesByNetwork.length > 0) {
|
18
|
+
const mainCurrency =
|
19
|
+
currenciesByNetwork.find(c => c.id === providerId) ?? currenciesByNetwork[0];
|
20
|
+
map.set(providerId, { mainCurrency, currencies: currenciesByNetwork });
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
return map;
|
25
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { BalanceUI } from "./type";
|
2
|
+
|
3
|
+
export const parseFiatValue = (value?: string, discreet?: boolean) => {
|
4
|
+
if (!value || discreet) return -1;
|
5
|
+
return parseFloat(value.replace(/[^0-9.-]+/g, "")) || -1;
|
6
|
+
};
|
7
|
+
|
8
|
+
export function toFiatString(x?: BalanceUI): string | undefined {
|
9
|
+
return x && "fiatValue" in x ? String(x.fiatValue) : undefined;
|
10
|
+
}
|
11
|
+
|
12
|
+
export function hasBalance(balanceData?: BalanceUI): boolean {
|
13
|
+
return (
|
14
|
+
!!balanceData &&
|
15
|
+
(("fiatValue" in balanceData && !!balanceData.fiatValue) ||
|
16
|
+
("balance" in balanceData && !!balanceData.balance))
|
17
|
+
);
|
18
|
+
}
|
19
|
+
|
20
|
+
export function compareByBalanceThenFiat(
|
21
|
+
a: BalanceUI | undefined,
|
22
|
+
b: BalanceUI | undefined,
|
23
|
+
discreet: boolean,
|
24
|
+
): number {
|
25
|
+
const ah = hasBalance(a);
|
26
|
+
const bh = hasBalance(b);
|
27
|
+
if (ah && !bh) return -1;
|
28
|
+
if (!ah && bh) return 1;
|
29
|
+
const af = parseFiatValue(toFiatString(a), discreet);
|
30
|
+
const bf = parseFiatValue(toFiatString(b), discreet);
|
31
|
+
return bf - af;
|
32
|
+
}
|
@@ -1,3 +1,14 @@
|
|
1
|
+
import { CounterValuesState } from "@ledgerhq/live-countervalues/lib/types";
|
2
|
+
import { CryptoOrTokenCurrency, Currency } from "@ledgerhq/types-cryptoassets";
|
3
|
+
import { AccountLike } from "@ledgerhq/types-live";
|
4
|
+
import { ReactNode } from "react";
|
5
|
+
import { Observable } from "rxjs";
|
6
|
+
import { WalletAPIAccount } from "../../wallet-api/types";
|
7
|
+
import { CurrenciesByProviderId } from "../../deposit/type";
|
8
|
+
import { EnhancedModularDrawerConfiguration } from "../../wallet-api/ModularDrawer/types";
|
9
|
+
|
10
|
+
export type ApyType = "NRR" | "APY" | "APR";
|
11
|
+
|
1
12
|
export type AssetType = {
|
2
13
|
name: string;
|
3
14
|
ticker: string;
|
@@ -20,3 +31,89 @@ export type ProviderBalanceResultsMap = Map<string, ProviderBalanceAsset>;
|
|
20
31
|
export type AssetWithBalance = AssetType & {
|
21
32
|
sortValue?: number;
|
22
33
|
};
|
34
|
+
|
35
|
+
export type UseBalanceDeps = () => {
|
36
|
+
flattenedAccounts: AccountLike[];
|
37
|
+
discreet: boolean;
|
38
|
+
state: CounterValuesState;
|
39
|
+
counterValueCurrency: Currency;
|
40
|
+
locale: string;
|
41
|
+
};
|
42
|
+
|
43
|
+
export type BalanceUI = { balance?: string; fiatValue?: string };
|
44
|
+
export type CreateBalanceItem = (x: BalanceUI) => React.ReactNode;
|
45
|
+
|
46
|
+
export type CreateAccountsCountAndApy = (args: {
|
47
|
+
label: string;
|
48
|
+
value: number;
|
49
|
+
type: ApyType;
|
50
|
+
}) => ReactNode;
|
51
|
+
|
52
|
+
export type NetworkWithCount = CryptoOrTokenCurrency & {
|
53
|
+
leftElement?: ReactNode;
|
54
|
+
count: number;
|
55
|
+
};
|
56
|
+
|
57
|
+
export type AccountDataItem = {
|
58
|
+
asset: CryptoOrTokenCurrency;
|
59
|
+
label: string;
|
60
|
+
count: number;
|
61
|
+
};
|
62
|
+
|
63
|
+
export type AccountModuleParams = {
|
64
|
+
assets: CryptoOrTokenCurrency[];
|
65
|
+
accounts$?: Observable<WalletAPIAccount[]>;
|
66
|
+
};
|
67
|
+
|
68
|
+
export type CreateAccountsCount = (args: { label: string }) => ReactNode;
|
69
|
+
|
70
|
+
export type UseAccountData = (params: AccountModuleParams) => AccountDataItem[];
|
71
|
+
|
72
|
+
export type NetworkHookParams = {
|
73
|
+
assets: CryptoOrTokenCurrency[];
|
74
|
+
selectedAssetId: string;
|
75
|
+
currenciesByProvider: CurrenciesByProviderId[];
|
76
|
+
accounts$?: Observable<WalletAPIAccount[]>;
|
77
|
+
};
|
78
|
+
export type NetworkHook = (params: NetworkHookParams) => Array<CryptoOrTokenCurrency & Network>;
|
79
|
+
|
80
|
+
export type NetworkConfigurationDeps = {
|
81
|
+
useAccountData: UseAccountData;
|
82
|
+
accountsCount: CreateAccountsCount;
|
83
|
+
accountsCountAndApy: CreateAccountsCountAndApy;
|
84
|
+
useBalanceDeps: UseBalanceDeps;
|
85
|
+
balanceItem: CreateBalanceItem;
|
86
|
+
};
|
87
|
+
|
88
|
+
export type LeftElementKind = "numberOfAccounts" | "numberOfAccountsAndApy" | "undefined";
|
89
|
+
export type RightElementKind = "balance" | "undefined";
|
90
|
+
|
91
|
+
export type Network = {
|
92
|
+
name: string;
|
93
|
+
id: string;
|
94
|
+
ticker: string;
|
95
|
+
leftElement?: React.ReactNode;
|
96
|
+
rightElement?: React.ReactNode;
|
97
|
+
};
|
98
|
+
|
99
|
+
export type CreateNetworkConfigurationHookProps = {
|
100
|
+
networksConfig: EnhancedModularDrawerConfiguration["networks"];
|
101
|
+
currenciesByProvider?: CurrenciesByProviderId[];
|
102
|
+
selectedAssetId: string;
|
103
|
+
accounts$?: Observable<WalletAPIAccount[]>;
|
104
|
+
};
|
105
|
+
|
106
|
+
type Props = {
|
107
|
+
assetsConfiguration: EnhancedModularDrawerConfiguration["assets"];
|
108
|
+
currenciesByProvider?: CurrenciesByProviderId[];
|
109
|
+
};
|
110
|
+
|
111
|
+
export type AssetConfigurationDeps = {
|
112
|
+
ApyIndicator: (args: { value: number; type: ApyType }) => ReactNode;
|
113
|
+
useBalanceDeps: UseBalanceDeps;
|
114
|
+
balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
|
115
|
+
};
|
116
|
+
|
117
|
+
export type CreateAssetConfigurationHook = (
|
118
|
+
AssetConfigurationDeps: AssetConfigurationDeps,
|
119
|
+
) => (props: Props) => (assets: CryptoOrTokenCurrency[]) => (CryptoOrTokenCurrency & AssetType)[];
|
@@ -666,8 +666,8 @@ function extractSwapStartParam(
|
|
666
666
|
fromParentAccount,
|
667
667
|
fromCurrency: getCurrencyForAccount(fromAccount),
|
668
668
|
toAccount: newTokenAccount ? newTokenAccount : toAccount,
|
669
|
-
toParentAccount:
|
670
|
-
toCurrency: getCurrencyForAccount(toAccount),
|
669
|
+
toParentAccount: toParentAccount,
|
670
|
+
toCurrency: getCurrencyForAccount(newTokenAccount ? newTokenAccount : toAccount),
|
671
671
|
},
|
672
672
|
};
|
673
673
|
}
|
package/src/wallet-api/react.ts
CHANGED
@@ -130,6 +130,8 @@ export interface UiHook {
|
|
130
130
|
"account.request": (params: {
|
131
131
|
accounts$?: Observable<WalletAPIAccount[]>;
|
132
132
|
currencies: CryptoOrTokenCurrency[];
|
133
|
+
areCurrenciesFiltered?: boolean;
|
134
|
+
useCase?: string;
|
133
135
|
drawerConfiguration?: ModularDrawerConfiguration;
|
134
136
|
onSuccess: (account: AccountLike, parentAccount: Account | undefined) => void;
|
135
137
|
onCancel: () => void;
|
@@ -358,7 +360,7 @@ export function useWalletAPIServer({
|
|
358
360
|
|
359
361
|
server.setHandler(
|
360
362
|
"account.request",
|
361
|
-
async ({ accounts$, currencies$, drawerConfiguration }) => {
|
363
|
+
async ({ accounts$, currencies$, drawerConfiguration, areCurrenciesFiltered, useCase }) => {
|
362
364
|
tracking.requestAccountRequested(manifest);
|
363
365
|
const currencies = await firstValueFrom(currencies$);
|
364
366
|
|
@@ -377,6 +379,8 @@ export function useWalletAPIServer({
|
|
377
379
|
accounts$,
|
378
380
|
currencies: currencyList,
|
379
381
|
drawerConfiguration,
|
382
|
+
areCurrenciesFiltered,
|
383
|
+
useCase,
|
380
384
|
onSuccess: (account: AccountLike, parentAccount: Account | undefined) => {
|
381
385
|
if (done) return;
|
382
386
|
done = true;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAssetAccountCounts.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,SAAS,CAAC,EAAE,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,yDAK/B,mBAAmB,KAAG,cAAc,EAUD,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAssetAccountCounts.js","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx"],"names":[],"mappings":";;;AAEA,4FAAyF;AAkBlF,MAAM,qBAAqB,GAAG,CAAC,EACpC,MAAM,EACN,cAAc,EACd,UAAU,EACV,WAAW,GACS,EAAoB,EAAE,CAC1C,MAAM;KACH,GAAG,CAAC,KAAK,CAAC,EAAE;IACX,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,yDAA2B,EAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO;QACL,KAAK;QACL,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC,CAAC;KACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAf1B,QAAA,qBAAqB,yBAeK"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/modularDrawer/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/modularDrawer/types.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAssetAccountCounts.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,SAAS,CAAC,EAAE,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,yDAK/B,mBAAmB,KAAG,cAAc,EAUD,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useAssetAccountCounts.js","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAkBzF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,MAAM,EACN,cAAc,EACd,UAAU,EACV,WAAW,GACS,EAAoB,EAAE,CAC1C,MAAM;KACH,GAAG,CAAC,KAAK,CAAC,EAAE;IACX,MAAM,EAAE,MAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO;QACL,KAAK;QACL,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC,CAAC;KACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/modularDrawer/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/modularDrawer/types.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
export type ApyType = "NRR" | "APY" | "APR";
|