@gearbox-protocol/ui-kit 3.14.0-next.65 → 3.14.0-next.67
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/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/breakpoint-provider.cjs +1 -0
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/rewards-cell.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy-legacy.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/compound-apy/index.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/apy-tooltip.cjs +1 -0
- package/dist/cjs/components/pool-apy-tooltip/index.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/index.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/index.cjs +1 -0
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -0
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
- package/dist/cjs/hooks/use-media-query.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/types/common.cjs +1 -1
- package/dist/cjs/utils/apy-breakdown.cjs +1 -0
- package/dist/cjs/utils/bps.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/token-icon-source.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +132 -206
- package/dist/esm/components/block-sync/block-sync.js +5 -4
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +5 -4
- package/dist/esm/components/breakpoint-provider.js +67 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +3 -2
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +3 -2
- package/dist/esm/components/complex-input/complex-input.js +5 -4
- package/dist/esm/components/composites/index.js +86 -81
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +3 -2
- package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.js +3 -2
- package/dist/esm/components/composites/pool-table/columns.js +61 -60
- package/dist/esm/components/composites/strategies-table/columns.js +55 -86
- package/dist/esm/components/composites/strategies-table/components/cells/cells.js +150 -110
- package/dist/esm/components/composites/strategies-table/components/cells/index.js +7 -5
- package/dist/esm/components/composites/strategies-table/components/index.js +32 -30
- package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +35 -32
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +91 -224
- package/dist/esm/components/composites/strategies-table/components/strategies-table.js +26 -24
- package/dist/esm/components/composites/strategies-table/index.js +36 -31
- package/dist/esm/components/composites/strategies-table/types/index.js +5 -1
- package/dist/esm/components/composites/strategies-table/types/rewards-cell.js +40 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +32 -189
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +5 -4
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +26 -26
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.js +40 -38
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.js +53 -47
- package/dist/esm/components/compound-apy/compound-apy-legacy.js +127 -0
- package/dist/esm/components/compound-apy/compound-apy.js +56 -245
- package/dist/esm/components/compound-apy/index.js +4 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +25 -180
- package/dist/esm/components/index.js +805 -787
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +5 -4
- package/dist/esm/components/pool-apy-tooltip/apy-tooltip.js +155 -0
- package/dist/esm/components/pool-apy-tooltip/index.js +4 -2
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +3 -3
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +3 -2
- package/dist/esm/components/token-icon/token-icon.js +72 -58
- package/dist/esm/components/token-symbol/index.js +2 -3
- package/dist/esm/components/token-symbol/token-symbol.js +41 -62
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +35 -192
- package/dist/esm/components/with-copy/with-copy.js +5 -4
- package/dist/esm/components/yield-breakdown-tooltip/index.js +4 -0
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +222 -0
- package/dist/esm/hooks/use-debounce-call.js +3 -2
- package/dist/esm/hooks/use-media-query.js +49 -16
- package/dist/esm/index.js +974 -946
- package/dist/esm/locale/en.json.js +9 -2
- package/dist/esm/types/common.js +1 -6
- package/dist/esm/utils/apy-breakdown.js +18 -0
- package/dist/esm/utils/bps.js +4 -0
- package/dist/esm/utils/index.js +105 -95
- package/dist/esm/utils/token-icon-source.js +48 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +44 -4
- package/dist/types/components/breakpoint-provider.d.ts +56 -0
- package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +34 -3
- package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +14 -10
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +10 -13
- package/dist/types/components/composites/strategies-table/index.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/types/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/types/rewards-cell.d.ts +48 -0
- package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +37 -32
- package/dist/types/components/composites/strategies-table/types/table.d.ts +27 -12
- package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +3 -3
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.d.ts +5 -0
- package/dist/types/components/compound-apy/compound-apy-legacy.d.ts +109 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +18 -94
- package/dist/types/components/compound-apy/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/components/points-icon/index.d.ts +1 -1
- package/dist/types/components/points-icon/points-icon.d.ts +13 -2
- package/dist/types/components/pool-apy-tooltip/apy-tooltip.d.ts +20 -0
- package/dist/types/components/pool-apy-tooltip/index.d.ts +1 -0
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +18 -1
- package/dist/types/components/token-icon/token-icon.d.ts +11 -2
- package/dist/types/components/token-symbol/token-symbol.d.ts +4 -4
- package/dist/types/components/yield-breakdown-tooltip/index.d.ts +1 -0
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +32 -0
- package/dist/types/hooks/use-media-query.d.ts +5 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale/en.json.d.ts +10 -2
- package/dist/types/types/common.d.ts +5 -11
- package/dist/types/utils/apy-breakdown.d.ts +18 -0
- package/dist/types/utils/bps.d.ts +3 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/token-icon-source.d.ts +28 -0
- package/package.json +2 -2
package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.js
CHANGED
|
@@ -1,61 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { VSpace as
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { VSpace as i } from "../../../../vspace/vspace.js";
|
|
3
3
|
import { useIsMobile as f } from "../../../../../hooks/use-media-query.js";
|
|
4
|
-
import { TransactionConfirmSuccessResultTest as
|
|
5
|
-
import { TransactionConfirmSuccessIcon as
|
|
6
|
-
function
|
|
7
|
-
icon:
|
|
8
|
-
headline:
|
|
9
|
-
subtitle:
|
|
10
|
-
txHashRow:
|
|
11
|
-
footerAction:
|
|
4
|
+
import { TransactionConfirmSuccessResultTest as l } from "./constants.js";
|
|
5
|
+
import { TransactionConfirmSuccessIcon as u } from "./TransactionConfirmSuccessIcon.js";
|
|
6
|
+
function w({
|
|
7
|
+
icon: n = /* @__PURE__ */ e(u, {}),
|
|
8
|
+
headline: r,
|
|
9
|
+
subtitle: d,
|
|
10
|
+
txHashRow: a,
|
|
11
|
+
footerAction: c
|
|
12
12
|
}) {
|
|
13
|
-
const s = f(),
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
const s = f(), m = s ? 16 : 24, o = s ? 8 : 12, h = s ? 24 : 32;
|
|
14
|
+
return /* @__PURE__ */ t(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
className: "flex w-full flex-
|
|
18
|
-
"data-testid":
|
|
17
|
+
className: "flex min-h-0 w-full flex-1 flex-col",
|
|
18
|
+
"data-testid": l.root,
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/* @__PURE__ */ t("div", { className: "flex min-h-0 w-full flex-1 flex-col items-center overflow-x-hidden overflow-y-auto text-center", children: [
|
|
21
|
+
n && /* @__PURE__ */ t("div", { children: [
|
|
22
|
+
/* @__PURE__ */ e(i, { height: m }),
|
|
23
|
+
n,
|
|
24
|
+
/* @__PURE__ */ e(i, { height: 24 })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ t("div", { children: [
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: "text-xl font-medium leading-tight md:text-2xl",
|
|
31
|
+
"data-testid": l.headline,
|
|
32
|
+
children: r
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ e(i, { height: o }),
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: "text-sm text-secondary-foreground",
|
|
40
|
+
"data-testid": l.subtitle,
|
|
41
|
+
children: d
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }),
|
|
45
|
+
a ? /* @__PURE__ */ t("div", { className: "w-full", children: [
|
|
46
|
+
/* @__PURE__ */ e(i, { height: o }),
|
|
47
|
+
/* @__PURE__ */ e("div", { className: "w-full text-center", children: a })
|
|
48
|
+
] }) : null
|
|
49
|
+
] }),
|
|
50
|
+
c ? /* @__PURE__ */ t(
|
|
24
51
|
"div",
|
|
25
52
|
{
|
|
26
|
-
className: "
|
|
27
|
-
"data-testid":
|
|
28
|
-
children:
|
|
53
|
+
className: "w-full shrink-0",
|
|
54
|
+
"data-testid": l.footer,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ e(i, { height: h }),
|
|
57
|
+
c
|
|
58
|
+
]
|
|
29
59
|
}
|
|
30
|
-
)
|
|
31
|
-
/* @__PURE__ */ e(t, { height: u }),
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
"div",
|
|
34
|
-
{
|
|
35
|
-
className: "text-sm text-secondary-foreground",
|
|
36
|
-
"data-testid": i.subtitle,
|
|
37
|
-
children: m
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
n ? /* @__PURE__ */ l(r, { children: [
|
|
41
|
-
/* @__PURE__ */ e(t, { height: c }),
|
|
42
|
-
/* @__PURE__ */ e("div", { className: "w-full text-center", children: n })
|
|
43
|
-
] }) : null,
|
|
44
|
-
a ? /* @__PURE__ */ l(r, { children: [
|
|
45
|
-
/* @__PURE__ */ e(t, { height: c }),
|
|
46
|
-
/* @__PURE__ */ e(
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
className: "w-full",
|
|
50
|
-
"data-testid": i.footer,
|
|
51
|
-
children: a
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
] }) : null
|
|
60
|
+
) : null
|
|
55
61
|
]
|
|
56
62
|
}
|
|
57
63
|
);
|
|
58
64
|
}
|
|
59
65
|
export {
|
|
60
|
-
|
|
66
|
+
w as TransactionConfirmSuccessResult
|
|
61
67
|
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { IconInfo as $ } from "@gearbox-protocol/static";
|
|
3
|
+
import * as h from "react";
|
|
4
|
+
import { PointsIcon as L } from "../points-icon/points-icon.js";
|
|
5
|
+
import "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import "../icons/fa-icon.js";
|
|
7
|
+
import { TokenIcon as M } from "../token-icon/token-icon.js";
|
|
8
|
+
import "../tooltip/simple-tooltip.js";
|
|
9
|
+
import "../tooltip/tooltip.js";
|
|
10
|
+
import "react-intl";
|
|
11
|
+
import "../vertical-indicator/vertical-indicator.js";
|
|
12
|
+
import "../vertical-list/vertical-list.js";
|
|
13
|
+
import "@gearbox-protocol/sdk";
|
|
14
|
+
import { cn as S } from "../../utils/cn.js";
|
|
15
|
+
import "sonner";
|
|
16
|
+
import { formatPercentAmount as v } from "../../utils/format-money.js";
|
|
17
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
18
|
+
import "luxon";
|
|
19
|
+
import "../../utils/z-index.js";
|
|
20
|
+
import { PoolAPYTooltip as j } from "../pool-apy-tooltip/pool-apy-tooltip.js";
|
|
21
|
+
function C(o, a) {
|
|
22
|
+
return o ?? a;
|
|
23
|
+
}
|
|
24
|
+
function ne({
|
|
25
|
+
totalAPY: o,
|
|
26
|
+
totalAPYLoading: a,
|
|
27
|
+
baseAPY: z,
|
|
28
|
+
extraAPY: f,
|
|
29
|
+
externalAPY: t,
|
|
30
|
+
points: i,
|
|
31
|
+
apy7DAgo: I,
|
|
32
|
+
tokensList: g,
|
|
33
|
+
decimals: y = 2,
|
|
34
|
+
className: R
|
|
35
|
+
}) {
|
|
36
|
+
const m = h.useMemo(() => {
|
|
37
|
+
if (t)
|
|
38
|
+
return {
|
|
39
|
+
...t,
|
|
40
|
+
value: t.value ?? t.apy ?? 0
|
|
41
|
+
};
|
|
42
|
+
}, [t]), s = h.useMemo(() => f.filter((u) => (u.apy || 0) > 0), [f]), w = !a && o >= 1e-3, x = () => {
|
|
43
|
+
const u = s.length > 0, E = m && !a && m.totalValue > 0 && m.totalValue !== o, N = i && i.length > 0, V = `${[
|
|
44
|
+
v(o, y),
|
|
45
|
+
...E ? [v(m.totalValue, y)] : []
|
|
46
|
+
].join("-")}%`, T = Math.max(s.length, 0), k = i?.filter((e) => e.reward) ?? [], l = T + k.length;
|
|
47
|
+
return /* @__PURE__ */ d("div", { className: S("inline-flex items-center gap-1.5", R), children: [
|
|
48
|
+
/* @__PURE__ */ d("span", { className: "inline-flex items-center", children: [
|
|
49
|
+
V,
|
|
50
|
+
w && /* @__PURE__ */ n("span", { className: "ml-1.5 leading-[0] text-gray-70", children: /* @__PURE__ */ n($, { size: 14 }) })
|
|
51
|
+
] }),
|
|
52
|
+
(u || N) && /* @__PURE__ */ d("span", { className: "relative inline-flex", children: [
|
|
53
|
+
s.map((e, r) => {
|
|
54
|
+
const c = g?.[e.rewardToken], p = r === l - 1;
|
|
55
|
+
return /* @__PURE__ */ n(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
style: {
|
|
59
|
+
zIndex: l - r,
|
|
60
|
+
marginRight: p ? 0 : -7
|
|
61
|
+
},
|
|
62
|
+
children: /* @__PURE__ */ n(
|
|
63
|
+
M,
|
|
64
|
+
{
|
|
65
|
+
token: C(c, e.rewardTokenSymbol),
|
|
66
|
+
size: 14,
|
|
67
|
+
style: {
|
|
68
|
+
margin: e.rewardTokenSymbol === "GEAR" ? "-3px 0 0 0" : "0"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
},
|
|
73
|
+
`extra-${e.rewardToken}-${e.apy}`
|
|
74
|
+
);
|
|
75
|
+
}),
|
|
76
|
+
k.map((e, r) => {
|
|
77
|
+
const c = r + T, p = c === l - 1;
|
|
78
|
+
return /* @__PURE__ */ n(
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
style: {
|
|
82
|
+
zIndex: l - c,
|
|
83
|
+
marginRight: p ? 0 : -7
|
|
84
|
+
},
|
|
85
|
+
children: /* @__PURE__ */ n(
|
|
86
|
+
L,
|
|
87
|
+
{
|
|
88
|
+
reward: {
|
|
89
|
+
name: e.reward?.name || e.name,
|
|
90
|
+
type: e.reward?.type || e.name.toLowerCase()
|
|
91
|
+
},
|
|
92
|
+
size: 14
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
},
|
|
96
|
+
`points-${e.name}-${r}`
|
|
97
|
+
);
|
|
98
|
+
})
|
|
99
|
+
] })
|
|
100
|
+
] });
|
|
101
|
+
}, b = h.useMemo(() => {
|
|
102
|
+
if (t)
|
|
103
|
+
return {
|
|
104
|
+
totalValue: t.totalValue,
|
|
105
|
+
apy: t.value ?? t.apy ?? 0,
|
|
106
|
+
name: t.name,
|
|
107
|
+
tooltip: t.tooltip
|
|
108
|
+
};
|
|
109
|
+
}, [t]);
|
|
110
|
+
return w ? /* @__PURE__ */ n(
|
|
111
|
+
j,
|
|
112
|
+
{
|
|
113
|
+
baseAPY: z,
|
|
114
|
+
extraAPY: s,
|
|
115
|
+
totalAPY: o,
|
|
116
|
+
externalAPY: b,
|
|
117
|
+
points: i,
|
|
118
|
+
apy7DAgo: I,
|
|
119
|
+
tokensList: g,
|
|
120
|
+
children: x()
|
|
121
|
+
}
|
|
122
|
+
) : x();
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
ne as CompoundAPYLegacy,
|
|
126
|
+
C as getRewardTokenSymbol
|
|
127
|
+
};
|
|
@@ -1,284 +1,95 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { isIconComposite as G } from "../../types/common.js";
|
|
8
|
-
import { formatPercentAmount as T } from "../../utils/format-money.js";
|
|
9
|
-
import { getStatic as Z } from "../../utils/static.js";
|
|
10
|
-
import "../accordion/accordion.js";
|
|
11
|
-
import "@fortawesome/free-solid-svg-icons";
|
|
12
|
-
import "../icons/fa-icon.js";
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { PointsIcon as R } from "../points-icon/points-icon.js";
|
|
3
|
+
import { TokenIcon as Y } from "../token-icon/token-icon.js";
|
|
4
|
+
import { YieldBreakdownTooltip as w } from "../yield-breakdown-tooltip/yield-breakdown-tooltip.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { positiveTokenRewardsOf as z, pointProgramsOf as I, totalApyOf as L } from "../../utils/apy-breakdown.js";
|
|
13
7
|
import "@gearbox-protocol/sdk";
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
8
|
+
import { bpsToPercent as N } from "../../utils/bps.js";
|
|
9
|
+
import { cn as $ } from "../../utils/cn.js";
|
|
16
10
|
import "sonner";
|
|
11
|
+
import { formatPercentAmount as v } from "../../utils/format-money.js";
|
|
17
12
|
import "@gearbox-protocol/sdk/common-utils";
|
|
18
13
|
import "luxon";
|
|
19
14
|
import "../../utils/z-index.js";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import "../buttons/back-button/back-button.js";
|
|
29
|
-
import "../buttons/button/button.js";
|
|
30
|
-
import "../buttons/copy-button/copy-button.js";
|
|
31
|
-
import "../buttons/external-button/external-button.js";
|
|
32
|
-
import "../buttons/filter-button/filter-button.js";
|
|
33
|
-
import "../buttons/navigation-button/navigation-button.js";
|
|
34
|
-
import "../buttons/tab-button/tab-button.js";
|
|
35
|
-
import "wagmi";
|
|
36
|
-
import "../auth/wallet-ui-context.js";
|
|
37
|
-
import "../avatar/avatar.js";
|
|
38
|
-
import "../badge/badge.js";
|
|
39
|
-
import "../base-link/base-link.js";
|
|
40
|
-
import "../navigation-context/navigation-context.js";
|
|
41
|
-
import "../button-checkbox/button-checkbox.js";
|
|
42
|
-
import "../card-grid/card-grid.js";
|
|
43
|
-
import "../cards/card/card.js";
|
|
44
|
-
import "../carousel/carousel.js";
|
|
45
|
-
import "../checkbox/checkbox.js";
|
|
46
|
-
import "../checkbox/checkbox-labeled.js";
|
|
47
|
-
import "../checkbox-item/checkbox-item.js";
|
|
48
|
-
import "../client-adapters/styled-button/styled-button.js";
|
|
49
|
-
import "../client-adapters/styled-dialog-container/styled-dialog-container.js";
|
|
50
|
-
import "../client-adapters/styled-rounded-image/styled-rounded-image.js";
|
|
51
|
-
import "../colored-text/colored-text.js";
|
|
52
|
-
import "../input/input.js";
|
|
53
|
-
import "../with-title/with-title.js";
|
|
54
|
-
import "../smart-number-input/balance-indicator.js";
|
|
55
|
-
import "../smart-number-input/smart-number-input.js";
|
|
56
|
-
import "../composites/credit-account-history/credit-account-history.js";
|
|
57
|
-
import "../simple-dropdown/simple-dropdown.js";
|
|
58
|
-
import "../simple-dropdown/simple-dropdown-menu-item.js";
|
|
59
|
-
import "../typography/typography.js";
|
|
60
|
-
import "../table/grid-table.js";
|
|
61
|
-
import { getSymbolOrIcon as R } from "../token-symbol/token-symbol.js";
|
|
62
|
-
import "../help-tip/help-tip.js";
|
|
63
|
-
import "../description/description.js";
|
|
64
|
-
import "../confirm-menu/confirm-menu.js";
|
|
65
|
-
import "../dialog/dialog-modal-container.js";
|
|
66
|
-
import "../text-button/text-button.js";
|
|
67
|
-
import "../vertical-indicator/vertical-indicator.js";
|
|
68
|
-
import "../rounded-image/rounded-image.js";
|
|
69
|
-
import "../progress/progress.js";
|
|
70
|
-
import "../pool-indicator-icon/pool-indicator-icon.js";
|
|
71
|
-
import "../skeleton/skeleton.js";
|
|
72
|
-
import "../composites/strategies-table/components/feature/feature.styles.js";
|
|
73
|
-
import "viem";
|
|
74
|
-
import "../icon-button/icon-button.js";
|
|
75
|
-
import "../separate-line/separate-line.js";
|
|
76
|
-
import "../tip-card/tip-card.js";
|
|
77
|
-
import "../vertical-list/vertical-list.js";
|
|
78
|
-
import "../composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.js";
|
|
79
|
-
import "../composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js";
|
|
80
|
-
import "../composites/tx-preview/confirm/dialog/constants.js";
|
|
81
|
-
import "../modal/modal.js";
|
|
82
|
-
import "../dialog/dialog-container.js";
|
|
83
|
-
import "../spinner-loader/spinner-loader.js";
|
|
84
|
-
import "../currency-button/currency-button.js";
|
|
85
|
-
import "../detailed-apy/detailed-apy.js";
|
|
86
|
-
import "../detailed-page-title/detailed-page-title.js";
|
|
87
|
-
import "../detailed-page-title/detailed-page-title-copy-button.js";
|
|
88
|
-
import "../detailed-page-title/detailed-page-title-explorer-dropdown.js";
|
|
89
|
-
import "@radix-ui/react-dialog";
|
|
90
|
-
import "../dialog/dialog-content.js";
|
|
91
|
-
import "../dialog/dialog-description.js";
|
|
92
|
-
import "../dialog/dialog-footer.js";
|
|
93
|
-
import "../dialog/dialog-header.js";
|
|
94
|
-
import "../dialog/dialog-title.js";
|
|
95
|
-
import "../dialog/dialog-overlay.js";
|
|
96
|
-
import "../label/label.js";
|
|
97
|
-
import "../dropdown-menu/dropdown-menu.js";
|
|
98
|
-
import "../dropdown-menu/dropdown-menu-checkbox-item.js";
|
|
99
|
-
import "../dropdown-menu/dropdown-menu-content.js";
|
|
100
|
-
import "../dropdown-menu/dropdown-menu-item.js";
|
|
101
|
-
import "../dropdown-menu/dropdown-menu-label.js";
|
|
102
|
-
import "../dropdown-menu/dropdown-menu-radio-item.js";
|
|
103
|
-
import "../dropdown-menu/dropdown-menu-separator.js";
|
|
104
|
-
import "../dropdown-menu/dropdown-menu-shortcut.js";
|
|
105
|
-
import "../dropdown-menu/dropdown-menu-sub-content.js";
|
|
106
|
-
import "../dropdown-menu/dropdown-menu-sub-trigger.js";
|
|
107
|
-
import "../edit-input/edit-input.js";
|
|
108
|
-
import "../fadeout-loading/fadeout-loading.js";
|
|
109
|
-
import "../filter/filter-block.js";
|
|
110
|
-
import "../filter/filter-checkbox-item.js";
|
|
111
|
-
import "../filter/filter-chip.js";
|
|
112
|
-
import "../filter/filter-chips.js";
|
|
113
|
-
import "../filter/filter-dropdown-item.js";
|
|
114
|
-
import "../filter/filter-group.js";
|
|
115
|
-
import "../filter/filter-label.js";
|
|
116
|
-
import "../search-line/search-line.js";
|
|
117
|
-
import "../tabs/tabs.js";
|
|
118
|
-
import "../filter/filter-modal-item.js";
|
|
119
|
-
import "../filter/filter-radio-item.js";
|
|
120
|
-
import "../filter/filter-separator.js";
|
|
121
|
-
import "../filter/variants.js";
|
|
122
|
-
import "../graph/formatters.js";
|
|
123
|
-
import "lightweight-charts";
|
|
124
|
-
import "../graph/graph-view.js";
|
|
125
|
-
import "../health-factor/health-factor.js";
|
|
126
|
-
import "../horizontal-indicator/horizontal-indicator.js";
|
|
127
|
-
import "../layout/app-footer/app-footer.js";
|
|
128
|
-
import "../layout/app-header/app-header.js";
|
|
129
|
-
import "../layout/col/col.js";
|
|
130
|
-
import "../layout/container/container.js";
|
|
131
|
-
import "../layout/footer/footer.js";
|
|
132
|
-
import "../layout/grid/grid.js";
|
|
133
|
-
import "../layout/header/header.js";
|
|
134
|
-
import "../layout/layout/layout.js";
|
|
135
|
-
import "../layout/main-aside-layout/main-aside-layout.js";
|
|
136
|
-
import "../page-title/page-title.js";
|
|
137
|
-
import "../layout/social-icons/social-icons.js";
|
|
138
|
-
import "../legal-agreement/legal-agreement-theme.js";
|
|
139
|
-
import "../link/link.js";
|
|
140
|
-
import "../../utils/reactochart-compat.js";
|
|
141
|
-
import "../status-elements/status-elements.js";
|
|
142
|
-
import "../loader/loader.js";
|
|
143
|
-
import "../loading/loading.js";
|
|
144
|
-
import "../loading-bar/loading-bar.js";
|
|
145
|
-
import "react-markdown";
|
|
146
|
-
import "remark-gfm";
|
|
147
|
-
import "../navbar/navbar.js";
|
|
148
|
-
import "../navbar/navbar-indicator-context.js";
|
|
149
|
-
import "../app-bar/app-bar.js";
|
|
150
|
-
import "../navitem/navitem.js";
|
|
151
|
-
import "../progress-bar/progress-bar.js";
|
|
152
|
-
import "../radio-group/radio-group.js";
|
|
153
|
-
import "../search-bar/search-bar.js";
|
|
154
|
-
import "../segmented-control/segmented-control.js";
|
|
155
|
-
import "../select/select.js";
|
|
156
|
-
import "../separator/separator.js";
|
|
157
|
-
import "../simple-accordion/simple-accordion.js";
|
|
158
|
-
import "../slider/slider.js";
|
|
159
|
-
import "../slider/slider-context.js";
|
|
160
|
-
import "@radix-ui/react-slider";
|
|
161
|
-
import "../spinner/spinner.js";
|
|
162
|
-
import "../split-list/split-list.js";
|
|
163
|
-
import "../stat-badge/stat-badge.js";
|
|
164
|
-
import "../status-dot/status-dot.js";
|
|
165
|
-
import "../stepper/stepper.js";
|
|
166
|
-
import "../switch/switch.js";
|
|
167
|
-
import "../table/table.js";
|
|
168
|
-
import "../table/grid-table-loader.js";
|
|
169
|
-
import "../textarea/textarea.js";
|
|
170
|
-
import "../theme-provider.js";
|
|
171
|
-
import "../time-to-liquidation/time-to-liquidation.js";
|
|
172
|
-
import "../toggle/toggle.js";
|
|
173
|
-
import "../with-filter-button/with-filter-button.js";
|
|
174
|
-
function O(r, m) {
|
|
175
|
-
if (r?.icon !== void 0 && G(r.icon))
|
|
176
|
-
return R(r) ?? (r.symbol || m);
|
|
177
|
-
const n = r?.symbol || m;
|
|
178
|
-
return n === "GEAR" ? { icon: Z("/logo/logo_symbol.png") } : R(r) || n;
|
|
179
|
-
}
|
|
180
|
-
function Xr({
|
|
181
|
-
totalAPY: r,
|
|
182
|
-
totalAPYLoading: m,
|
|
183
|
-
baseAPY: n,
|
|
184
|
-
extraAPY: u,
|
|
185
|
-
externalAPY: t,
|
|
186
|
-
points: e,
|
|
187
|
-
apy7DAgo: z,
|
|
188
|
-
tokensList: g,
|
|
189
|
-
decimals: b = 2,
|
|
190
|
-
className: E
|
|
15
|
+
function K({
|
|
16
|
+
apy: e,
|
|
17
|
+
maxLeverage: f,
|
|
18
|
+
collateralApy: h,
|
|
19
|
+
borrowApy: g,
|
|
20
|
+
additionalBorrowApy: x,
|
|
21
|
+
decimals: u = 2,
|
|
22
|
+
className: a
|
|
191
23
|
}) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
].join("-")}%`, x = Math.max(s.length, 0), I = e?.filter((o) => o.reward) ?? [], l = x + I.length;
|
|
203
|
-
return /* @__PURE__ */ h("div", { className: E, children: [
|
|
204
|
-
/* @__PURE__ */ h("span", { className: "inline-flex items-center", children: [
|
|
205
|
-
M,
|
|
206
|
-
w && /* @__PURE__ */ i("span", { className: "ml-1.5 leading-[0] text-gray-70", children: /* @__PURE__ */ i(N, { size: 14 }) })
|
|
207
|
-
] }),
|
|
208
|
-
/* @__PURE__ */ i("div", {}),
|
|
209
|
-
(d || $) && /* @__PURE__ */ h("span", { className: "relative inline-flex", children: [
|
|
210
|
-
s.map((o, p) => {
|
|
211
|
-
const c = g?.[o.rewardToken], f = p === l - 1;
|
|
212
|
-
return /* @__PURE__ */ i(
|
|
24
|
+
if (!e)
|
|
25
|
+
return /* @__PURE__ */ n("span", { className: "text-secondary-foreground", children: "—" });
|
|
26
|
+
const i = z(e), m = I(e), p = L(e), A = p >= 1, l = () => {
|
|
27
|
+
const P = i.length > 0, k = m.length > 0, y = `${v(N(p), u)}%`, c = i.length, o = c + m.length;
|
|
28
|
+
return /* @__PURE__ */ d("div", { className: $("inline-flex items-center gap-1.5", a), children: [
|
|
29
|
+
/* @__PURE__ */ n("span", { className: "inline-flex items-center", children: y }),
|
|
30
|
+
(P || k) && /* @__PURE__ */ d("span", { className: "relative inline-flex", children: [
|
|
31
|
+
i.map((t, r) => {
|
|
32
|
+
const s = r === o - 1;
|
|
33
|
+
return /* @__PURE__ */ n(
|
|
213
34
|
"span",
|
|
214
35
|
{
|
|
215
36
|
style: {
|
|
216
|
-
zIndex:
|
|
217
|
-
marginRight:
|
|
37
|
+
zIndex: o - r,
|
|
38
|
+
marginRight: s ? 0 : -7
|
|
218
39
|
},
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
|
|
40
|
+
children: /* @__PURE__ */ n(
|
|
41
|
+
Y,
|
|
221
42
|
{
|
|
222
|
-
|
|
43
|
+
token: t.token,
|
|
223
44
|
size: 14,
|
|
224
45
|
style: {
|
|
225
|
-
margin:
|
|
46
|
+
margin: t.token.symbol === "GEAR" ? "-3px 0 0 0" : "0"
|
|
226
47
|
}
|
|
227
48
|
}
|
|
228
49
|
)
|
|
229
50
|
},
|
|
230
|
-
`extra-${
|
|
51
|
+
`extra-${t.token.address}-${t.supplyApr ?? 0}`
|
|
231
52
|
);
|
|
232
53
|
}),
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
return /* @__PURE__ */
|
|
54
|
+
m.map((t, r) => {
|
|
55
|
+
const s = r + c, T = s === o - 1;
|
|
56
|
+
return /* @__PURE__ */ n(
|
|
236
57
|
"span",
|
|
237
58
|
{
|
|
238
59
|
style: {
|
|
239
|
-
zIndex:
|
|
240
|
-
marginRight:
|
|
60
|
+
zIndex: o - s,
|
|
61
|
+
marginRight: T ? 0 : -7
|
|
241
62
|
},
|
|
242
|
-
children: /* @__PURE__ */
|
|
243
|
-
|
|
63
|
+
children: /* @__PURE__ */ n(
|
|
64
|
+
R,
|
|
244
65
|
{
|
|
245
66
|
reward: {
|
|
246
|
-
name:
|
|
247
|
-
type:
|
|
67
|
+
name: t.name,
|
|
68
|
+
type: t.id
|
|
248
69
|
},
|
|
249
70
|
size: 14
|
|
250
71
|
}
|
|
251
72
|
)
|
|
252
73
|
},
|
|
253
|
-
`points-${
|
|
74
|
+
`points-${t.id}`
|
|
254
75
|
);
|
|
255
76
|
})
|
|
256
77
|
] })
|
|
257
78
|
] });
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
totalValue: t.totalValue,
|
|
262
|
-
apy: t.value ?? t.apy ?? 0,
|
|
263
|
-
name: t.name,
|
|
264
|
-
tooltip: t.tooltip
|
|
265
|
-
};
|
|
266
|
-
}, [t]);
|
|
267
|
-
return w ? /* @__PURE__ */ i(
|
|
268
|
-
C,
|
|
79
|
+
};
|
|
80
|
+
return A ? /* @__PURE__ */ n(
|
|
81
|
+
w,
|
|
269
82
|
{
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
children: v()
|
|
83
|
+
supplyApy: e,
|
|
84
|
+
maxLeverage: f,
|
|
85
|
+
collateralApy: h,
|
|
86
|
+
borrowApy: g,
|
|
87
|
+
additionalBorrowApy: x,
|
|
88
|
+
className: a,
|
|
89
|
+
children: l()
|
|
278
90
|
}
|
|
279
|
-
) :
|
|
91
|
+
) : l();
|
|
280
92
|
}
|
|
281
93
|
export {
|
|
282
|
-
|
|
283
|
-
O as getRewardTokenSymbol
|
|
94
|
+
K as CompoundAPY
|
|
284
95
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { CompoundAPY as m
|
|
1
|
+
import { CompoundAPY as m } from "./compound-apy.js";
|
|
2
|
+
import { CompoundAPYLegacy as p, getRewardTokenSymbol as d } from "./compound-apy-legacy.js";
|
|
2
3
|
export {
|
|
3
4
|
m as CompoundAPY,
|
|
4
|
-
|
|
5
|
+
p as CompoundAPYLegacy,
|
|
6
|
+
d as getRewardTokenSymbol
|
|
5
7
|
};
|