@gearbox-protocol/ui-kit 3.6.0-next.2 → 3.6.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/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/composites/pool-table/columns.js +175 -128
- package/dist/esm/components/compound-apy/compound-apy.js +1 -1
- package/dist/esm/components/graph/graph-view.js +38 -38
- package/dist/esm/components/index.js +378 -386
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +75 -69
- package/dist/esm/index.js +481 -489
- package/dist/esm/locale/en.json.js +25 -10
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/pool-table/columns.d.ts +18 -18
- package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +168 -17
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +2 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/locale/en.json.d.ts +23 -9
- package/package.json +2 -2
- package/dist/cjs/components/PoolCreditManagersTable/PoolCreditManagersLine.cjs +0 -1
- package/dist/cjs/components/PoolCreditManagersTable/TableHead.cjs +0 -1
- package/dist/cjs/components/PoolCreditManagersTable/constants.cjs +0 -1
- package/dist/cjs/components/PoolCreditManagersTable/index.cjs +0 -1
- package/dist/cjs/components/PoolCreditManagersTable/types.cjs +0 -1
- package/dist/cjs/components/PoolsAssetsTable/PoolAssetsLine.cjs +0 -1
- package/dist/cjs/components/PoolsAssetsTable/TableHead.cjs +0 -1
- package/dist/cjs/components/PoolsAssetsTable/index.cjs +0 -1
- package/dist/cjs/components/PoolsAssetsTable/types.cjs +0 -1
- package/dist/esm/components/PoolCreditManagersTable/PoolCreditManagersLine.js +0 -71
- package/dist/esm/components/PoolCreditManagersTable/TableHead.js +0 -52
- package/dist/esm/components/PoolCreditManagersTable/constants.js +0 -7
- package/dist/esm/components/PoolCreditManagersTable/index.js +0 -45
- package/dist/esm/components/PoolCreditManagersTable/types.js +0 -1
- package/dist/esm/components/PoolsAssetsTable/PoolAssetsLine.js +0 -107
- package/dist/esm/components/PoolsAssetsTable/TableHead.js +0 -52
- package/dist/esm/components/PoolsAssetsTable/index.js +0 -43
- package/dist/esm/components/PoolsAssetsTable/types.js +0 -1
- package/dist/types/components/PoolCreditManagersTable/PoolCreditManagersLine.d.ts +0 -11
- package/dist/types/components/PoolCreditManagersTable/TableHead.d.ts +0 -7
- package/dist/types/components/PoolCreditManagersTable/constants.d.ts +0 -4
- package/dist/types/components/PoolCreditManagersTable/index.d.ts +0 -14
- package/dist/types/components/PoolCreditManagersTable/types.d.ts +0 -22
- package/dist/types/components/PoolsAssetsTable/PoolAssetsLine.d.ts +0 -12
- package/dist/types/components/PoolsAssetsTable/TableHead.d.ts +0 -7
- package/dist/types/components/PoolsAssetsTable/index.d.ts +0 -13
- package/dist/types/components/PoolsAssetsTable/types.d.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard","components.poolTable.pool":"Pool","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}"};module.exports=o;
|
|
@@ -1,51 +1,66 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { AssetsListCell as
|
|
3
|
-
import { CompoundAPY as
|
|
4
|
-
import { Description as
|
|
5
|
-
import { NetworkIcon as
|
|
6
|
-
import { PercentIndicator as
|
|
7
|
-
import { PoolAPYTooltip as
|
|
8
|
-
import { PoolIndicatorIcon as
|
|
9
|
-
import { PoolPointsIndicator as
|
|
10
|
-
import { Skeleton as
|
|
1
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { AssetsListCell as A } from "../../assets-list-cell/assets-list-cell.js";
|
|
3
|
+
import { CompoundAPY as P } from "../../compound-apy/compound-apy.js";
|
|
4
|
+
import { Description as m } from "../../description/description.js";
|
|
5
|
+
import { NetworkIcon as C } from "../../network-icon/network-icon.js";
|
|
6
|
+
import { PercentIndicator as x } from "../../percent-indicator/percent-indicator.js";
|
|
7
|
+
import { PoolAPYTooltip as N } from "../../pool-apy-tooltip/pool-apy-tooltip.js";
|
|
8
|
+
import { PoolIndicatorIcon as v } from "../../pool-indicator-icon/pool-indicator-icon.js";
|
|
9
|
+
import { PoolPointsIndicator as D } from "../../pool-points-indicator/pool-points-indicator.js";
|
|
10
|
+
import { Skeleton as u } from "../../skeleton/skeleton.js";
|
|
11
11
|
import "react";
|
|
12
12
|
import "@gearbox-protocol/sdk";
|
|
13
13
|
import "clsx";
|
|
14
14
|
import "tailwind-merge";
|
|
15
15
|
import "sonner";
|
|
16
|
-
import { percentageTemplate as
|
|
17
|
-
import { tokenTemplate as
|
|
16
|
+
import { percentageTemplate as I, formatMoney as p } from "../../../utils/format-money.js";
|
|
17
|
+
import { tokenTemplate as f } from "../../../utils/templates.js";
|
|
18
18
|
import "luxon";
|
|
19
19
|
import "../../../utils/z-index.js";
|
|
20
|
-
import { TokenSymbol as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
import { TokenSymbol as Y } from "../../token-symbol/token-symbol.js";
|
|
21
|
+
import { FormattedMessageTyped as h } from "../../typed-intl/index.js";
|
|
22
|
+
function a(e, l, o) {
|
|
23
|
+
const t = e?.header ?? /* @__PURE__ */ i(
|
|
24
|
+
h,
|
|
25
25
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
messageId: e?.headerMessageId ?? l
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
let r;
|
|
30
|
+
if (e?.headerTip !== null) {
|
|
31
|
+
const n = e?.headerTipMessageId ?? o;
|
|
32
|
+
r = e?.headerTip ?? (n && /* @__PURE__ */ i(h, { messageId: n }));
|
|
33
|
+
}
|
|
34
|
+
return { header: t, headerTip: r, mobileTitle: e?.mobileTitle ?? t };
|
|
35
|
+
}
|
|
36
|
+
function z({ ctx: e }) {
|
|
37
|
+
const { pool: l, underlyingToken: o, points: t, apy: r, isMobile: n } = e, d = n ? 20 : 24, c = /* @__PURE__ */ i(Y, { token: o, size: d });
|
|
38
|
+
return t && t.length > 0 && r ? /* @__PURE__ */ i(
|
|
39
|
+
N,
|
|
40
|
+
{
|
|
41
|
+
totalAPY: r.totalAPY,
|
|
42
|
+
baseAPY: r.baseAPY,
|
|
43
|
+
extraAPY: r.extraAPY,
|
|
29
44
|
points: t,
|
|
30
45
|
tokensList: e.tokensList,
|
|
31
|
-
children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
46
|
+
children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(v, { size: d, children: c }) })
|
|
32
47
|
}
|
|
33
|
-
) : l.hasPoints ? /* @__PURE__ */ i(
|
|
48
|
+
) : l.hasPoints ? /* @__PURE__ */ i(D, { size: d, children: c }) : c;
|
|
34
49
|
}
|
|
35
|
-
function
|
|
36
|
-
const l = e.underlyingToken?.title ?? e.underlyingToken?.symbol ?? "",
|
|
37
|
-
return
|
|
50
|
+
function B(e) {
|
|
51
|
+
const l = e.underlyingToken?.title ?? e.underlyingToken?.symbol ?? "", o = e.pool.version;
|
|
52
|
+
return o && o >= 300 && o < 310 ? `${l} v${Math.floor(o / 100)}` : l;
|
|
38
53
|
}
|
|
39
|
-
function
|
|
54
|
+
function M({
|
|
40
55
|
ctx: e,
|
|
41
56
|
renderDescription: l,
|
|
42
|
-
getPoolName:
|
|
57
|
+
getPoolName: o
|
|
43
58
|
}) {
|
|
44
|
-
const { pool: t } = e,
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
59
|
+
const { pool: t } = e, r = o ? o(e) : B(e);
|
|
60
|
+
return /* @__PURE__ */ s("div", { className: "grid grid-cols-[auto_1fr] gap-x-3", children: [
|
|
61
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-3 shrink-0 leading-0", children: [
|
|
47
62
|
t.network && /* @__PURE__ */ i(
|
|
48
|
-
|
|
63
|
+
C,
|
|
49
64
|
{
|
|
50
65
|
network: t.network,
|
|
51
66
|
isTest: !1,
|
|
@@ -53,196 +68,228 @@ function v({
|
|
|
53
68
|
showTooltip: !0
|
|
54
69
|
}
|
|
55
70
|
),
|
|
56
|
-
/* @__PURE__ */ i(
|
|
71
|
+
/* @__PURE__ */ i(z, { ctx: e })
|
|
57
72
|
] }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */ i("span", { className: "truncate max-w-full", children:
|
|
60
|
-
l && /* @__PURE__ */ i(
|
|
73
|
+
/* @__PURE__ */ s("div", { className: "flex md:flex-col min-w-0 overflow-hidden items-center md:items-start gap-2 md:gap-0", children: [
|
|
74
|
+
/* @__PURE__ */ i("span", { className: "truncate max-w-full", children: r }),
|
|
75
|
+
l && /* @__PURE__ */ i(m, { className: "min-w-0 text-xs", children: l(e) })
|
|
61
76
|
] })
|
|
62
77
|
] });
|
|
63
78
|
}
|
|
64
|
-
function
|
|
65
|
-
const { pool: l, underlyingToken:
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ i(
|
|
68
|
-
/* @__PURE__ */ i(
|
|
79
|
+
function S({ ctx: e }) {
|
|
80
|
+
const { pool: l, underlyingToken: o, loading: t } = e;
|
|
81
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
82
|
+
/* @__PURE__ */ i(u, { loading: !!t, width: 60, children: p(l.expectedLiquidityInUSD ?? 0) }),
|
|
83
|
+
/* @__PURE__ */ i(m, { children: f(
|
|
69
84
|
l.expectedLiquidity,
|
|
70
|
-
|
|
85
|
+
o
|
|
71
86
|
) })
|
|
72
87
|
] });
|
|
73
88
|
}
|
|
74
|
-
function
|
|
75
|
-
const { pool: l, underlyingToken:
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ i(
|
|
78
|
-
/* @__PURE__ */ i(
|
|
89
|
+
function F({ ctx: e }) {
|
|
90
|
+
const { pool: l, underlyingToken: o, loading: t } = e;
|
|
91
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
92
|
+
/* @__PURE__ */ i(u, { loading: !!t, width: 60, children: p(l.totalBorrowedInUSD ?? 0) }),
|
|
93
|
+
/* @__PURE__ */ i(m, { children: f(
|
|
79
94
|
l.totalBorrowed,
|
|
80
|
-
|
|
95
|
+
o
|
|
81
96
|
) })
|
|
82
97
|
] });
|
|
83
98
|
}
|
|
84
|
-
function
|
|
85
|
-
const { pool: l, loading:
|
|
99
|
+
function L({ ctx: e }) {
|
|
100
|
+
const { pool: l, loading: o, underlyingToken: t } = e, r = t?.decimals ?? 18, n = l.poolTokenSymbol != null ? {
|
|
86
101
|
title: l.poolTokenSymbol,
|
|
87
|
-
decimals:
|
|
102
|
+
decimals: r
|
|
88
103
|
} : t;
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */ i(
|
|
91
|
-
l.userBalance !== void 0 && n && /* @__PURE__ */ i(
|
|
104
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
105
|
+
/* @__PURE__ */ i(u, { loading: !!o, width: 60, children: p(l.userBalanceInUSD ?? 0) }),
|
|
106
|
+
l.userBalance !== void 0 && n && /* @__PURE__ */ i(m, { children: f(l.userBalance, n) })
|
|
92
107
|
] });
|
|
93
108
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
return !
|
|
97
|
-
|
|
109
|
+
function j(e, l) {
|
|
110
|
+
const o = e.pool.collateralTokens, { tokensList: t, isMobile: r } = e;
|
|
111
|
+
return !o?.length || !t ? null : /* @__PURE__ */ i(
|
|
112
|
+
A,
|
|
98
113
|
{
|
|
99
114
|
maxAssets: l,
|
|
100
115
|
tokensList: t,
|
|
101
|
-
balances:
|
|
102
|
-
iconSize:
|
|
116
|
+
balances: o.map((n) => ({ token: n })),
|
|
117
|
+
iconSize: r ? 20 : 24,
|
|
103
118
|
options: { mode: "cascade" }
|
|
104
119
|
}
|
|
105
120
|
);
|
|
106
121
|
}
|
|
107
|
-
function
|
|
122
|
+
function re(e) {
|
|
123
|
+
const { header: l, mobileTitle: o } = a(
|
|
124
|
+
e,
|
|
125
|
+
"components.poolTable.pool"
|
|
126
|
+
);
|
|
108
127
|
return {
|
|
109
128
|
id: "pool",
|
|
110
|
-
header:
|
|
129
|
+
header: l,
|
|
111
130
|
width: e?.width ?? "186px",
|
|
112
131
|
align: "left",
|
|
113
132
|
className: "pl-4",
|
|
114
|
-
cell: (
|
|
115
|
-
|
|
133
|
+
cell: (t) => /* @__PURE__ */ i(
|
|
134
|
+
M,
|
|
116
135
|
{
|
|
117
|
-
ctx:
|
|
136
|
+
ctx: t,
|
|
118
137
|
renderDescription: e?.renderDescription,
|
|
119
138
|
getPoolName: e?.getPoolName
|
|
120
139
|
}
|
|
121
140
|
),
|
|
122
|
-
mobileTitle:
|
|
141
|
+
mobileTitle: o
|
|
123
142
|
};
|
|
124
143
|
}
|
|
125
|
-
function
|
|
144
|
+
function ne(e) {
|
|
145
|
+
const { header: l, mobileTitle: o } = a(
|
|
146
|
+
e,
|
|
147
|
+
"components.poolTable.supply"
|
|
148
|
+
);
|
|
126
149
|
return {
|
|
127
150
|
id: "supply",
|
|
128
|
-
header:
|
|
151
|
+
header: l,
|
|
129
152
|
width: e?.width ?? "1fr",
|
|
130
153
|
align: "right",
|
|
131
154
|
hideOnMedium: e?.hideOnMedium,
|
|
132
155
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "supply", defaultDirection: "desc" },
|
|
133
|
-
cell: (
|
|
134
|
-
mobileTitle:
|
|
156
|
+
cell: (t) => /* @__PURE__ */ i(S, { ctx: t }),
|
|
157
|
+
mobileTitle: o
|
|
135
158
|
};
|
|
136
159
|
}
|
|
137
|
-
function
|
|
160
|
+
function ae(e) {
|
|
161
|
+
const { header: l, headerTip: o, mobileTitle: t } = a(
|
|
162
|
+
e,
|
|
163
|
+
"components.poolTable.supplyApy",
|
|
164
|
+
"components.poolTable.supplyApy.tip"
|
|
165
|
+
);
|
|
138
166
|
return {
|
|
139
167
|
id: "supplyApy",
|
|
140
|
-
header:
|
|
141
|
-
headerTip:
|
|
168
|
+
header: l,
|
|
169
|
+
headerTip: o,
|
|
142
170
|
width: e?.width ?? "1.25fr",
|
|
143
171
|
align: "right",
|
|
144
172
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "apy", defaultDirection: "desc" },
|
|
145
|
-
cell: (
|
|
146
|
-
const { apy:
|
|
147
|
-
totalAPY:
|
|
148
|
-
baseAPY:
|
|
149
|
-
extraAPY:
|
|
150
|
-
externalAPY:
|
|
151
|
-
apy7DAgo:
|
|
152
|
-
} =
|
|
153
|
-
return /* @__PURE__ */ i(
|
|
154
|
-
|
|
173
|
+
cell: (r) => {
|
|
174
|
+
const { apy: n, loading: d, points: c, tokensList: g } = r, {
|
|
175
|
+
totalAPY: b = 0,
|
|
176
|
+
baseAPY: T = [],
|
|
177
|
+
extraAPY: w = [],
|
|
178
|
+
externalAPY: y,
|
|
179
|
+
apy7DAgo: k
|
|
180
|
+
} = n ?? {};
|
|
181
|
+
return /* @__PURE__ */ i(u, { width: 60, loading: !!d, children: /* @__PURE__ */ i(
|
|
182
|
+
P,
|
|
155
183
|
{
|
|
156
|
-
totalAPY:
|
|
157
|
-
totalAPYLoading: !!
|
|
158
|
-
baseAPY:
|
|
159
|
-
extraAPY:
|
|
160
|
-
points:
|
|
161
|
-
apy7DAgo:
|
|
162
|
-
tokensList:
|
|
163
|
-
externalAPY:
|
|
184
|
+
totalAPY: b,
|
|
185
|
+
totalAPYLoading: !!d,
|
|
186
|
+
baseAPY: T,
|
|
187
|
+
extraAPY: w,
|
|
188
|
+
points: c,
|
|
189
|
+
apy7DAgo: k,
|
|
190
|
+
tokensList: g,
|
|
191
|
+
externalAPY: y
|
|
164
192
|
}
|
|
165
193
|
) });
|
|
166
194
|
},
|
|
167
|
-
mobileTitle:
|
|
195
|
+
mobileTitle: t
|
|
168
196
|
};
|
|
169
197
|
}
|
|
170
|
-
function
|
|
198
|
+
function de(e) {
|
|
199
|
+
const { header: l, mobileTitle: o } = a(
|
|
200
|
+
e,
|
|
201
|
+
"components.poolTable.borrowed"
|
|
202
|
+
);
|
|
171
203
|
return {
|
|
172
204
|
id: "borrowed",
|
|
173
|
-
header:
|
|
205
|
+
header: l,
|
|
174
206
|
width: e?.width ?? "1.15fr",
|
|
175
207
|
align: "right",
|
|
176
|
-
cell: (
|
|
177
|
-
mobileTitle:
|
|
208
|
+
cell: (t) => /* @__PURE__ */ i(F, { ctx: t }),
|
|
209
|
+
mobileTitle: o
|
|
178
210
|
};
|
|
179
211
|
}
|
|
180
|
-
function
|
|
212
|
+
function se(e) {
|
|
213
|
+
const { header: l, headerTip: o, mobileTitle: t } = a(
|
|
214
|
+
e,
|
|
215
|
+
"components.poolTable.borrowApy"
|
|
216
|
+
);
|
|
181
217
|
return {
|
|
182
218
|
id: "borrowApy",
|
|
183
|
-
header:
|
|
184
|
-
headerTip:
|
|
219
|
+
header: l,
|
|
220
|
+
headerTip: o,
|
|
185
221
|
width: e?.width ?? "150px",
|
|
186
222
|
align: "right",
|
|
187
|
-
cell: (
|
|
188
|
-
const
|
|
189
|
-
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children:
|
|
223
|
+
cell: (r) => {
|
|
224
|
+
const n = r.pool.borrowAPY ?? e?.getBorrowRate?.(r.pool) ?? 0;
|
|
225
|
+
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: I(n) });
|
|
190
226
|
},
|
|
191
|
-
mobileTitle:
|
|
227
|
+
mobileTitle: t
|
|
192
228
|
};
|
|
193
229
|
}
|
|
194
|
-
function
|
|
230
|
+
function ce(e) {
|
|
231
|
+
const { header: l, mobileTitle: o } = a(
|
|
232
|
+
e,
|
|
233
|
+
"components.poolTable.utilization"
|
|
234
|
+
);
|
|
195
235
|
return {
|
|
196
236
|
id: "utilization",
|
|
197
|
-
header:
|
|
237
|
+
header: l,
|
|
198
238
|
width: e?.width ?? "150px",
|
|
199
239
|
align: "right",
|
|
200
240
|
className: "pr-4",
|
|
201
241
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "utilization", defaultDirection: "desc" },
|
|
202
|
-
cell: (
|
|
203
|
-
const r =
|
|
204
|
-
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: /* @__PURE__ */ i(
|
|
242
|
+
cell: (t) => {
|
|
243
|
+
const r = t.pool.utilization ?? 0;
|
|
244
|
+
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: /* @__PURE__ */ i(x, { percent: r }) });
|
|
205
245
|
},
|
|
206
|
-
mobileTitle:
|
|
246
|
+
mobileTitle: o
|
|
207
247
|
};
|
|
208
248
|
}
|
|
209
|
-
function
|
|
210
|
-
const l = e?.maxAssets ?? 5,
|
|
249
|
+
function me(e) {
|
|
250
|
+
const l = e?.maxAssets ?? 5, o = (n) => j(n, l), { header: t, mobileTitle: r } = a(
|
|
251
|
+
e,
|
|
252
|
+
"components.poolTable.collateral"
|
|
253
|
+
);
|
|
211
254
|
return {
|
|
212
255
|
id: "collateral",
|
|
213
|
-
header:
|
|
256
|
+
header: t,
|
|
214
257
|
width: e?.width ?? "148px",
|
|
215
258
|
align: e?.align ?? "left",
|
|
216
259
|
gapBefore: e?.gapBefore ?? "md",
|
|
217
|
-
cell: e?.cell ??
|
|
218
|
-
mobileCell: e?.mobileCell ?? e?.cell ??
|
|
219
|
-
mobileTitle:
|
|
260
|
+
cell: e?.cell ?? o,
|
|
261
|
+
mobileCell: e?.mobileCell ?? e?.cell ?? o,
|
|
262
|
+
mobileTitle: r
|
|
220
263
|
};
|
|
221
264
|
}
|
|
222
|
-
function
|
|
265
|
+
function ue(e) {
|
|
266
|
+
const { header: l, mobileTitle: o } = a(
|
|
267
|
+
e,
|
|
268
|
+
"components.poolTable.balance"
|
|
269
|
+
);
|
|
223
270
|
return {
|
|
224
271
|
id: "balance",
|
|
225
|
-
header:
|
|
272
|
+
header: l,
|
|
226
273
|
width: e?.width ?? "1.15fr",
|
|
227
274
|
align: "right",
|
|
228
275
|
className: e?.className ?? "pr-4",
|
|
229
276
|
headerClassName: e?.headerClassName ?? "pr-4",
|
|
230
277
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "balance", defaultDirection: "desc" },
|
|
231
|
-
cell: e?.cell ?? ((
|
|
232
|
-
mobileTitle:
|
|
278
|
+
cell: e?.cell ?? ((t) => /* @__PURE__ */ i(L, { ctx: t })),
|
|
279
|
+
mobileTitle: o
|
|
233
280
|
};
|
|
234
281
|
}
|
|
235
|
-
function
|
|
282
|
+
function pe(e) {
|
|
236
283
|
return e;
|
|
237
284
|
}
|
|
238
285
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
286
|
+
ue as balanceColumn,
|
|
287
|
+
se as borrowApyColumn,
|
|
288
|
+
de as borrowedColumn,
|
|
289
|
+
me as collateralColumn,
|
|
290
|
+
pe as customColumn,
|
|
291
|
+
re as poolColumn,
|
|
292
|
+
ae as supplyApyColumn,
|
|
293
|
+
ne as supplyColumn,
|
|
294
|
+
ce as utilizationColumn
|
|
248
295
|
};
|
|
@@ -132,7 +132,6 @@ import "../navbar/navbar-indicator-context.js";
|
|
|
132
132
|
import "../app-bar/app-bar.js";
|
|
133
133
|
import "../navitem/navitem.js";
|
|
134
134
|
import "../simple-dropdown/simple-dropdown.js";
|
|
135
|
-
import "../vertical-indicator/vertical-indicator.js";
|
|
136
135
|
import "../progress-bar/progress-bar.js";
|
|
137
136
|
import "../radio-group/radio-group.js";
|
|
138
137
|
import "../search-bar/search-bar.js";
|
|
@@ -160,6 +159,7 @@ import "../time-to-liquidation/time-to-liquidation.js";
|
|
|
160
159
|
import "../tip-card/tip-card.js";
|
|
161
160
|
import "../toggle/toggle.js";
|
|
162
161
|
import "../typography/typography.js";
|
|
162
|
+
import "../vertical-indicator/vertical-indicator.js";
|
|
163
163
|
import "../vertical-list/vertical-list.js";
|
|
164
164
|
import "../with-filter-button/with-filter-button.js";
|
|
165
165
|
function G(i, p) {
|
|
@@ -2,8 +2,8 @@ import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { cva as A } from "class-variance-authority";
|
|
3
3
|
import * as B from "react";
|
|
4
4
|
import { useMemo as D, useRef as N, useState as M, useEffect as E } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import { cn as
|
|
5
|
+
import { SpinnerLoader as I } from "../spinner-loader/spinner-loader.js";
|
|
6
|
+
import { cn as y } from "../../utils/cn.js";
|
|
7
7
|
import { Graph as O } from "./graph.js";
|
|
8
8
|
const q = A(
|
|
9
9
|
"relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",
|
|
@@ -35,41 +35,41 @@ const q = A(
|
|
|
35
35
|
padding: "default"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
),
|
|
38
|
+
), R = B.forwardRef(
|
|
39
39
|
({
|
|
40
40
|
className: n,
|
|
41
41
|
variant: t,
|
|
42
42
|
size: l,
|
|
43
43
|
padding: m,
|
|
44
|
-
title:
|
|
45
|
-
description:
|
|
46
|
-
toolbar:
|
|
44
|
+
title: a,
|
|
45
|
+
description: r,
|
|
46
|
+
toolbar: s,
|
|
47
47
|
loading: i = !1,
|
|
48
48
|
emptyMessage: d,
|
|
49
49
|
error: c,
|
|
50
50
|
children: f,
|
|
51
51
|
...p
|
|
52
52
|
}, x) => {
|
|
53
|
-
const u =
|
|
53
|
+
const u = a || r || s;
|
|
54
54
|
return /* @__PURE__ */ o(
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
57
|
ref: x,
|
|
58
|
-
className:
|
|
58
|
+
className: y(
|
|
59
59
|
"flex flex-col",
|
|
60
60
|
q({ variant: t, size: l, padding: m, className: n })
|
|
61
61
|
),
|
|
62
62
|
...p,
|
|
63
63
|
children: [
|
|
64
64
|
u && /* @__PURE__ */ o("div", { className: "mb-4 flex items-start justify-between gap-4 shrink-0", children: [
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
(a || r) && /* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
66
|
+
a && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: a }),
|
|
67
|
+
r && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: r })
|
|
68
68
|
] }),
|
|
69
|
-
|
|
69
|
+
s && /* @__PURE__ */ e("div", { className: "shrink-0 w-full", children: s })
|
|
70
70
|
] }),
|
|
71
71
|
/* @__PURE__ */ o("div", { className: "relative flex-1 w-full min-h-0", children: [
|
|
72
|
-
i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e(I, { size: 32,
|
|
72
|
+
i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e(I, { size: 32, width: 3 }) }) }),
|
|
73
73
|
c && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
|
|
74
74
|
/* @__PURE__ */ e(
|
|
75
75
|
"svg",
|
|
@@ -117,7 +117,7 @@ const q = A(
|
|
|
117
117
|
/* @__PURE__ */ e(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
|
-
className:
|
|
120
|
+
className: y(
|
|
121
121
|
"w-full h-full transition-[filter] duration-300 delay-300",
|
|
122
122
|
i && "blur-sm pointer-events-none"
|
|
123
123
|
),
|
|
@@ -130,15 +130,15 @@ const q = A(
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
|
-
|
|
133
|
+
R.displayName = "GraphView";
|
|
134
134
|
function X({
|
|
135
135
|
series: n,
|
|
136
136
|
data: t,
|
|
137
137
|
lineColor: l,
|
|
138
138
|
color: m,
|
|
139
|
-
topColor:
|
|
140
|
-
bottomColor:
|
|
141
|
-
graphId:
|
|
139
|
+
topColor: a,
|
|
140
|
+
bottomColor: r,
|
|
141
|
+
graphId: s,
|
|
142
142
|
onUnselectSeries: i,
|
|
143
143
|
loading: d,
|
|
144
144
|
title: c,
|
|
@@ -146,8 +146,8 @@ function X({
|
|
|
146
146
|
toolbar: p,
|
|
147
147
|
emptyMessage: x = "No data available",
|
|
148
148
|
error: u,
|
|
149
|
-
containerClassName:
|
|
150
|
-
variant:
|
|
149
|
+
containerClassName: V,
|
|
150
|
+
variant: W,
|
|
151
151
|
size: z,
|
|
152
152
|
padding: G,
|
|
153
153
|
yMeasureUnit: g,
|
|
@@ -158,7 +158,7 @@ function X({
|
|
|
158
158
|
if (n && n.length > 0)
|
|
159
159
|
return n;
|
|
160
160
|
if (t && t.length > 0) {
|
|
161
|
-
const
|
|
161
|
+
const j = l ?? m;
|
|
162
162
|
return [
|
|
163
163
|
{
|
|
164
164
|
data: t.map((v) => ({
|
|
@@ -167,21 +167,21 @@ function X({
|
|
|
167
167
|
})),
|
|
168
168
|
label: "Value",
|
|
169
169
|
yMeasureUnit: g,
|
|
170
|
-
...
|
|
171
|
-
...
|
|
172
|
-
...
|
|
170
|
+
...j && { lineColor: j },
|
|
171
|
+
...a && { topColor: a },
|
|
172
|
+
...r && { bottomColor: r }
|
|
173
173
|
}
|
|
174
174
|
];
|
|
175
175
|
}
|
|
176
176
|
return [];
|
|
177
|
-
}, [n, t, g, l, m,
|
|
177
|
+
}, [n, t, g, l, m, a, r]), S = !d && h.length === 0, b = N(h);
|
|
178
178
|
h.length > 0 && (b.current = h);
|
|
179
|
-
const k = d && h.length === 0 ? b.current : h,
|
|
179
|
+
const k = d && h.length === 0 ? b.current : h, H = k.length > 0;
|
|
180
180
|
return /* @__PURE__ */ e(
|
|
181
|
-
|
|
181
|
+
R,
|
|
182
182
|
{
|
|
183
|
-
className:
|
|
184
|
-
variant:
|
|
183
|
+
className: V,
|
|
184
|
+
variant: W,
|
|
185
185
|
size: z,
|
|
186
186
|
padding: G,
|
|
187
187
|
title: c,
|
|
@@ -189,8 +189,8 @@ function X({
|
|
|
189
189
|
toolbar: p,
|
|
190
190
|
loading: d,
|
|
191
191
|
error: u,
|
|
192
|
-
emptyMessage:
|
|
193
|
-
children:
|
|
192
|
+
emptyMessage: S ? x : void 0,
|
|
193
|
+
children: H && !u && /* @__PURE__ */ e(
|
|
194
194
|
O,
|
|
195
195
|
{
|
|
196
196
|
series: k,
|
|
@@ -204,21 +204,21 @@ function X({
|
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
206
|
function Y(n = 0) {
|
|
207
|
-
const t = N(null), l = N(null), [m,
|
|
207
|
+
const t = N(null), l = N(null), [m, a] = M(null);
|
|
208
208
|
return E(() => {
|
|
209
|
-
const
|
|
209
|
+
const r = () => {
|
|
210
210
|
if (t.current && l.current) {
|
|
211
211
|
const d = l.current.clientWidth, c = t.current.clientWidth;
|
|
212
|
-
|
|
212
|
+
a(d - c - n);
|
|
213
213
|
}
|
|
214
|
-
},
|
|
215
|
-
return
|
|
216
|
-
|
|
214
|
+
}, s = l.current, i = s ? new ResizeObserver(r) : null;
|
|
215
|
+
return s && i?.observe(s), () => {
|
|
216
|
+
s && i?.unobserve(s);
|
|
217
217
|
};
|
|
218
218
|
}, [n]), { graphWidth: m, parentRef: l, asideRef: t };
|
|
219
219
|
}
|
|
220
220
|
export {
|
|
221
|
-
|
|
221
|
+
R as GraphView,
|
|
222
222
|
X as GraphViewWithData,
|
|
223
223
|
q as graphViewVariants,
|
|
224
224
|
Y as useGraphAside
|