@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,12 +1,20 @@
|
|
|
1
|
+
import { LocaleKeys } from '../../../locale';
|
|
1
2
|
import { PoolDTO, PoolTableCellContext, PoolTableColumnDef } from './types';
|
|
2
3
|
import type * as React from "react";
|
|
4
|
+
interface ColumnHeaderOptions {
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
headerMessageId?: LocaleKeys;
|
|
7
|
+
/** Pass `null` to hide the default tip. */
|
|
8
|
+
headerTip?: React.ReactNode | null;
|
|
9
|
+
headerTipMessageId?: LocaleKeys;
|
|
10
|
+
mobileTitle?: React.ReactNode;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Pool name column — displays token icon, pool name and optional description.
|
|
5
14
|
*
|
|
6
15
|
* Used in both charts and client-v3.
|
|
7
16
|
*/
|
|
8
|
-
export declare function poolColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
9
|
-
header?: React.ReactNode;
|
|
17
|
+
export declare function poolColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
10
18
|
renderDescription?: (ctx: PoolTableCellContext<P>) => React.ReactNode;
|
|
11
19
|
/** Custom pool name formatter. Defaults to "TOKEN vN" for v3 pools. */
|
|
12
20
|
getPoolName?: (ctx: PoolTableCellContext<P>) => string;
|
|
@@ -17,8 +25,7 @@ export declare function poolColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
|
17
25
|
*
|
|
18
26
|
* Used in both charts and client-v3.
|
|
19
27
|
*/
|
|
20
|
-
export declare function supplyColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
21
|
-
header?: React.ReactNode;
|
|
28
|
+
export declare function supplyColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
22
29
|
width?: string;
|
|
23
30
|
sortField?: string;
|
|
24
31
|
hideOnMedium?: boolean;
|
|
@@ -28,9 +35,7 @@ export declare function supplyColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
|
28
35
|
*
|
|
29
36
|
* Used in both charts and client-v3.
|
|
30
37
|
*/
|
|
31
|
-
export declare function supplyApyColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
32
|
-
header?: React.ReactNode;
|
|
33
|
-
headerTip?: React.ReactNode;
|
|
38
|
+
export declare function supplyApyColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
34
39
|
width?: string;
|
|
35
40
|
sortField?: string;
|
|
36
41
|
}): PoolTableColumnDef<P>;
|
|
@@ -39,8 +44,7 @@ export declare function supplyApyColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
|
39
44
|
*
|
|
40
45
|
* Used in both charts and client-v3.
|
|
41
46
|
*/
|
|
42
|
-
export declare function borrowedColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
43
|
-
header?: React.ReactNode;
|
|
47
|
+
export declare function borrowedColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
44
48
|
width?: string;
|
|
45
49
|
}): PoolTableColumnDef<P>;
|
|
46
50
|
/**
|
|
@@ -48,9 +52,7 @@ export declare function borrowedColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
|
48
52
|
*
|
|
49
53
|
* Prefer `pool.borrowAPY` when the backend (or adapter) fills it; otherwise pass `getBorrowRate`.
|
|
50
54
|
*/
|
|
51
|
-
export declare function borrowApyColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
52
|
-
header?: React.ReactNode;
|
|
53
|
-
headerTip?: React.ReactNode;
|
|
55
|
+
export declare function borrowApyColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
54
56
|
width?: string;
|
|
55
57
|
/** Custom getter for borrow rate (basis points). Used when `pool.borrowAPY` is undefined. */
|
|
56
58
|
getBorrowRate?: (pool: P) => number;
|
|
@@ -58,8 +60,7 @@ export declare function borrowApyColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
|
58
60
|
/**
|
|
59
61
|
* Utilization column — `pool.utilization` (0–100) with a progress bar.
|
|
60
62
|
*/
|
|
61
|
-
export declare function utilizationColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
62
|
-
header?: React.ReactNode;
|
|
63
|
+
export declare function utilizationColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
63
64
|
width?: string;
|
|
64
65
|
sortField?: string;
|
|
65
66
|
}): PoolTableColumnDef<P>;
|
|
@@ -69,8 +70,7 @@ export declare function utilizationColumn<P extends PoolDTO = PoolDTO>(options?:
|
|
|
69
70
|
* Default: reads `pool.collateralTokens` and renders {@link AssetsListCell}.
|
|
70
71
|
* Override with `cell` / `mobileCell` for custom asset shapes (e.g. client-v3 quota objects).
|
|
71
72
|
*/
|
|
72
|
-
export declare function collateralColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
73
|
-
header?: React.ReactNode;
|
|
73
|
+
export declare function collateralColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
74
74
|
width?: string;
|
|
75
75
|
gapBefore?: "sm" | "md" | "none";
|
|
76
76
|
cell?: (ctx: PoolTableCellContext<P>) => React.ReactNode;
|
|
@@ -84,8 +84,7 @@ export declare function collateralColumn<P extends PoolDTO = PoolDTO>(options?:
|
|
|
84
84
|
*
|
|
85
85
|
* Default: `pool.userBalanceInUSD`, `pool.userBalance`, `pool.poolTokenSymbol` (and underlying decimals for formatting).
|
|
86
86
|
*/
|
|
87
|
-
export declare function balanceColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
88
|
-
header?: React.ReactNode;
|
|
87
|
+
export declare function balanceColumn<P extends PoolDTO = PoolDTO>(options?: ColumnHeaderOptions & {
|
|
89
88
|
width?: string;
|
|
90
89
|
className?: string;
|
|
91
90
|
headerClassName?: string;
|
|
@@ -96,3 +95,4 @@ export declare function balanceColumn<P extends PoolDTO = PoolDTO>(options?: {
|
|
|
96
95
|
* Generic custom column — convenience helper to create a column with minimal boilerplate.
|
|
97
96
|
*/
|
|
98
97
|
export declare function customColumn<P extends PoolDTO = PoolDTO>(def: PoolTableColumnDef<P>): PoolTableColumnDef<P>;
|
|
98
|
+
export {};
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* ==================================
|
|
4
4
|
*
|
|
5
5
|
* Self-contained type definitions for the pool-list endpoint response.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* locally (e.g. SDK + `tokensList` on each row).
|
|
6
|
+
* Consumers (`@gearbox-protocol/ui-kit`, `charts`, `client-v3`) map these fields
|
|
7
|
+
* into the `PoolTable` component and resolve token metadata (icons, decimals, titles)
|
|
8
|
+
* locally (e.g. SDK + `tokensList` on each row in the app layer).
|
|
9
9
|
*
|
|
10
10
|
* Copy this file into your backend repo — it has **zero npm dependencies**.
|
|
11
11
|
*
|
|
@@ -19,6 +19,72 @@
|
|
|
19
19
|
* The client converts them back via `BigInt(value)`.
|
|
20
20
|
* - `Address` → `0x`-prefixed hex string, lower-case preferred.
|
|
21
21
|
*
|
|
22
|
+
* ## Unit conventions (critical — do not mix)
|
|
23
|
+
*
|
|
24
|
+
* - **`depositAPY`**, **`PoolApyDTO.totalAPY`**, **`PoolBaseApyDTO.apy`**, **`PoolExtraRewardApyDTO.apy`**:
|
|
25
|
+
* **percent** (e.g. `5.2` means 5.2%).
|
|
26
|
+
* - **`borrowAPY`**: **basis points** (`10_000` = 100%). The Borrow APY column uses the same
|
|
27
|
+
* formatter as elsewhere in the app.
|
|
28
|
+
* - **`utilization`**: **percent** in the `0–100` range (not 0–1).
|
|
29
|
+
* - **`expectedLiquidity`**, **`totalBorrowed`**, **`userBalance`**: raw amounts in **underlying /
|
|
30
|
+
* pool token units** (see field docs). Serialize as decimal strings in JSON.
|
|
31
|
+
* - **`*InUSD` fields**: plain `number` (USD).
|
|
32
|
+
*
|
|
33
|
+
* ## Mapping guide — gearbox-backend PR #84 → this contract
|
|
34
|
+
*
|
|
35
|
+
* The PR introduces `PoolOpportunity`, `MarketInfo`, `MarketMetrics`, `YieldBreakdown`, and
|
|
36
|
+
* discriminated `Incentive` (tokens | points). **The HTTP response shape stays
|
|
37
|
+
* {@link PoolTableListResponse}** so existing frontends do not need rewrites. On the server,
|
|
38
|
+
* **project** PR #84 types into the DTOs below.
|
|
39
|
+
*
|
|
40
|
+
* ### `PoolTableRowDTO` from `PoolOpportunity` + optional wallet snapshot
|
|
41
|
+
*
|
|
42
|
+
* - **`pool`**: Build {@link PoolDTO} from `MarketInfo` + latest `MarketMetrics` (and
|
|
43
|
+
* `PoolOpportunity.collaterals` for addresses). See {@link PoolDTO} block comments.
|
|
44
|
+
* - **`apy`**: Build {@link PoolApyDTO} from `PoolOpportunity.yield` (`YieldBreakdown`) and
|
|
45
|
+
* token incentives inside `yield.incentives`. See {@link PoolApyDTO}.
|
|
46
|
+
* - **`points`**: Map each **active** points incentive to {@link PoolApyPointDTO}.
|
|
47
|
+
* Source: `yield.incentives` where `incentive.type === "points"` (or your PR #84 equivalent).
|
|
48
|
+
* Use `[]` or omit when none.
|
|
49
|
+
* - **`chainId`**: Same as `MarketInfo.chainId` / row pool identity (required for table context).
|
|
50
|
+
* - **`href`**: Optional deep link; app may still build locally.
|
|
51
|
+
*
|
|
52
|
+
* ### `PoolDTO` from `MarketInfo` + `MarketMetrics` + `PoolOpportunity`
|
|
53
|
+
*
|
|
54
|
+
* | Contract field | Suggested PR #84 source |
|
|
55
|
+
* | --- | --- |
|
|
56
|
+
* | `address` | `MarketInfo.address` (pool contract) |
|
|
57
|
+
* | `underlyingToken` | `MarketInfo.underlyingAsset` |
|
|
58
|
+
* | `name` | `MarketInfo.name` |
|
|
59
|
+
* | `version` | `MarketInfo.version` (semver-like int as in PR) |
|
|
60
|
+
* | `network` | Derive human label from `chainId` (e.g. "Arbitrum") — **not** necessarily in PR types |
|
|
61
|
+
* | `chainId` | `MarketInfo.chainId` |
|
|
62
|
+
* | `marketConfigurator` | `MarketInfo.marketConfiguratorAddress` |
|
|
63
|
+
* | `expectedLiquidity` | `MarketMetrics.expected` (underlying units → bigint / JSON string) |
|
|
64
|
+
* | `expectedLiquidityInUSD` | `MarketMetrics.expectedUSD` |
|
|
65
|
+
* | `totalBorrowed` | `MarketMetrics.borrowed` |
|
|
66
|
+
* | `totalBorrowedInUSD` | `MarketMetrics.borrowedUSD` |
|
|
67
|
+
* | `utilization` | e.g. `(borrowed / expected) * 100` when `expected > 0`, else `0` — **percent 0–100** |
|
|
68
|
+
* | `depositAPY` | **Percent**: if PR stores annualized rate as fraction (e.g. `0.052`), multiply by `100`. If already percent, pass through. Align with `YieldBreakdown.base` / supply side. |
|
|
69
|
+
* | `borrowAPY` | **Basis points**: if PR `MarketMetrics.baseInterestRate` is a fraction, use `* 10_000`. If already bps, pass through. |
|
|
70
|
+
* | `collateralTokens` | `PoolOpportunity.collaterals.map(c => c.token.address)` (or active subset you expose) |
|
|
71
|
+
* | `userBalanceInUSD` | From `UserPoolPosition` / wallet-aware layer when `wallet` query present |
|
|
72
|
+
* | `userBalance` | Same — position size in pool/deposit token units |
|
|
73
|
+
* | `poolTokenSymbol` | Diesel / pool share symbol if distinct from underlying (app-specific) |
|
|
74
|
+
* | `hasPoints` | `true` if any points incentive is active, e.g. `yield.incentives.some(i => i.type === "points" && i.isActive)` |
|
|
75
|
+
*
|
|
76
|
+
* ### `PoolApyDTO` from `YieldBreakdown` + incentives
|
|
77
|
+
*
|
|
78
|
+
* - **`totalAPY`**: `YieldBreakdown.totalApy` (must be **percent**, consistent with UI).
|
|
79
|
+
* - **`baseAPY`**: At minimum `[{ type: "supplyAPY", apy: YieldBreakdown.base }]`. Add `{ type: "tokenYield", apy }` entries if your model splits organic yield further.
|
|
80
|
+
* - **`extraAPY`**: For each **token** incentive in `YieldBreakdown.incentives` with `type === "tokens"`, map to {@link PoolExtraRewardApyDTO} (see that interface).
|
|
81
|
+
* - **`externalAPY`**: Optional — only if you expose an external protocol boost; shape is {@link PoolExternalApyDTO}.
|
|
82
|
+
* - **`apy7DAgo`**: Optional — requires a **stored snapshot** (e.g. `MarketDetailResponse.metrics7DAgo` in PR #84). Build {@link PoolApy7DaysAgoDTO} the same way as current `apy` for that snapshot. Omit if unavailable.
|
|
83
|
+
*
|
|
84
|
+
* ### `PoolApyPointDTO` from points `Incentive`
|
|
85
|
+
*
|
|
86
|
+
* Map each points program to one row. Align with UI `PoolAPYPointsTip`: `amount`, `name`, `tokenTitle`, `fullTip`, `reward.*`.
|
|
87
|
+
*
|
|
22
88
|
* @packageDocumentation
|
|
23
89
|
*/
|
|
24
90
|
type Address = `0x${string}`;
|
|
@@ -29,11 +95,24 @@ type Address = `0x${string}`;
|
|
|
29
95
|
* "rows": [ … ]
|
|
30
96
|
* }
|
|
31
97
|
* ```
|
|
98
|
+
*
|
|
99
|
+
* **PR #84:** Keep this envelope. Populate `rows` by mapping each internal `PoolOpportunity`
|
|
100
|
+
* (plus metrics and optional user position) into {@link PoolTableRowDTO} — do not replace
|
|
101
|
+
* with a raw `PoolOpportunity[]` at the root if you want zero frontend changes.
|
|
32
102
|
*/
|
|
33
103
|
export interface PoolTableListResponse {
|
|
34
104
|
/** One entry per pool visible in the table. */
|
|
35
105
|
rows: PoolTableRowDTO[];
|
|
36
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* One table row. Apps pass this (with `tokensList` filled client-side) into `PoolTable`.
|
|
109
|
+
*
|
|
110
|
+
* **PR #84 assembly:**
|
|
111
|
+
* - **`pool`**: {@link PoolDTO} from `MarketInfo` + `MarketMetrics` + collateral list on `PoolOpportunity`.
|
|
112
|
+
* - **`apy`**: {@link PoolApyDTO} from `PoolOpportunity.yield` (`YieldBreakdown`); split token vs points as documented on {@link PoolApyDTO} and {@link PoolApyPointDTO}.
|
|
113
|
+
* - **`points`**: derived from **points** incentives only (not duplicated inside `apy.extraAPY`).
|
|
114
|
+
* - **`chainId`**: must match the pool’s chain.
|
|
115
|
+
*/
|
|
37
116
|
export interface PoolTableRowDTO {
|
|
38
117
|
pool: PoolDTO;
|
|
39
118
|
/** Supply / deposit APY breakdown (column + tooltip). */
|
|
@@ -44,55 +123,102 @@ export interface PoolTableRowDTO {
|
|
|
44
123
|
/** Deep-link to pool detail page (client can also build this locally). */
|
|
45
124
|
href?: string;
|
|
46
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Flat pool fields for columns (supply, borrowed, utilization, borrow APY, collateral icons, etc.).
|
|
128
|
+
*
|
|
129
|
+
* **PR #84:** Compose from `MarketInfo` + `MarketMetrics` + `PoolOpportunity.collaterals`.
|
|
130
|
+
* See the file-level mapping table for field-by-field sources.
|
|
131
|
+
*/
|
|
47
132
|
export interface PoolDTO {
|
|
133
|
+
/** **PR #84:** `MarketInfo.address`. */
|
|
48
134
|
address: Address;
|
|
135
|
+
/** **PR #84:** `MarketInfo.underlyingAsset`. */
|
|
49
136
|
underlyingToken: Address;
|
|
50
|
-
/** Display name, e.g. "USDC v3". */
|
|
137
|
+
/** Display name, e.g. "USDC v3". **PR #84:** `MarketInfo.name`. */
|
|
51
138
|
name?: string;
|
|
52
|
-
/** Semver-like integer: 300 = v3, 310 = v3.1, etc. */
|
|
139
|
+
/** Semver-like integer: 300 = v3, 310 = v3.1, etc. **PR #84:** `MarketInfo.version`. */
|
|
53
140
|
version?: number;
|
|
54
|
-
/** Human-readable network label, e.g. "Mainnet", "Arbitrum". */
|
|
141
|
+
/** Human-readable network label, e.g. "Mainnet", "Arbitrum". Derive from `chainId` if not in PR types. */
|
|
55
142
|
network?: string;
|
|
143
|
+
/** **PR #84:** `MarketInfo.chainId`. */
|
|
56
144
|
chainId?: number;
|
|
57
|
-
/** Market configurator address (
|
|
145
|
+
/** Market configurator address (curator badge). **PR #84:** `MarketInfo.marketConfiguratorAddress`. */
|
|
58
146
|
marketConfigurator?: Address;
|
|
59
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Total supplied liquidity in underlying token (bigint → string in JSON).
|
|
149
|
+
* **PR #84:** `MarketMetrics.expected` in underlying units.
|
|
150
|
+
*/
|
|
60
151
|
expectedLiquidity?: bigint;
|
|
61
|
-
/** Same value converted to USD. */
|
|
152
|
+
/** Same value converted to USD. **PR #84:** `MarketMetrics.expectedUSD`. */
|
|
62
153
|
expectedLiquidityInUSD?: number;
|
|
63
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* Total borrowed in underlying token (bigint → string in JSON).
|
|
156
|
+
* **PR #84:** `MarketMetrics.borrowed`.
|
|
157
|
+
*/
|
|
64
158
|
totalBorrowed?: bigint;
|
|
65
|
-
/** Same value converted to USD. */
|
|
159
|
+
/** Same value converted to USD. **PR #84:** `MarketMetrics.borrowedUSD`. */
|
|
66
160
|
totalBorrowedInUSD?: number;
|
|
67
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* Utilization ratio, 0–100 (percent).
|
|
163
|
+
* **PR #84:** e.g. `(borrowed / expected) * 100` with safe zero handling.
|
|
164
|
+
*/
|
|
68
165
|
utilization?: number;
|
|
69
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* Base deposit APY, already in **percent** (e.g. `5.2` = 5.2%).
|
|
168
|
+
* **PR #84:** Align with supply-side APY; convert from fractional rate if needed (`* 100`).
|
|
169
|
+
*/
|
|
70
170
|
depositAPY?: number;
|
|
71
171
|
/**
|
|
72
172
|
* Borrow rate for the "Borrow APY" column.
|
|
73
173
|
* Unit: **basis points** (10 000 = 100%).
|
|
174
|
+
* **PR #84:** Map from `MarketMetrics.baseInterestRate`; convert fraction → bps (`* 10_000`) if applicable.
|
|
74
175
|
*/
|
|
75
176
|
borrowAPY?: number;
|
|
76
177
|
/**
|
|
77
178
|
* Active collateral token addresses for the "Collateral" column.
|
|
78
179
|
* Token symbols/decimals for display are resolved on the client (no server-side
|
|
79
180
|
* token dictionary in this response).
|
|
181
|
+
* **PR #84:** `PoolOpportunity.collaterals.map(c => c.token.address)` (or your filtered list).
|
|
80
182
|
*/
|
|
81
183
|
collateralTokens?: Address[];
|
|
82
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* User's pool position value in USD ("Your Balance" column).
|
|
186
|
+
* **PR #84:** When wallet is requested, from `UserPoolPosition` / similar (e.g. `depositSizeUsd`).
|
|
187
|
+
*/
|
|
83
188
|
userBalanceInUSD?: number;
|
|
84
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* User's position amount in pool/deposit token (bigint → string).
|
|
191
|
+
* **PR #84:** e.g. `UserPoolPosition.depositSize` in token units.
|
|
192
|
+
*/
|
|
85
193
|
userBalance?: bigint;
|
|
86
194
|
/** Pool deposit token symbol, e.g. `"edgeUSDC"`. */
|
|
87
195
|
poolTokenSymbol?: string;
|
|
88
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* `true` when the pool has active points/rewards (shows indicator icon).
|
|
198
|
+
* **PR #84:** e.g. any active `type === "points"` incentive in `yield.incentives`.
|
|
199
|
+
*/
|
|
89
200
|
hasPoints?: boolean;
|
|
90
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Supply APY breakdown for {@link CompoundAPY} / tooltip. All APY numbers here are **percent**.
|
|
204
|
+
*
|
|
205
|
+
* **PR #84:** Build from `PoolOpportunity.yield` (`YieldBreakdown`):
|
|
206
|
+
* - `totalAPY` ← `totalApy`
|
|
207
|
+
* - `baseAPY` ← at least one `supplyAPY` row from `base`; add `tokenYield` rows if split
|
|
208
|
+
* - `extraAPY` ← token incentives only (see {@link PoolExtraRewardApyDTO})
|
|
209
|
+
* - `apy7DAgo` ← optional second snapshot if you persist `metrics7DAgo` / historical yield
|
|
210
|
+
*/
|
|
91
211
|
export interface PoolApyDTO {
|
|
92
|
-
/** Total combined supply APY in percent (`8.33` = 8.33%). */
|
|
212
|
+
/** Total combined supply APY in percent (`8.33` = 8.33%). **PR #84:** `YieldBreakdown.totalApy`. */
|
|
93
213
|
totalAPY: number;
|
|
214
|
+
/** **PR #84:** From `YieldBreakdown.base` (+ optional extra base rows). */
|
|
94
215
|
baseAPY: PoolBaseApyDTO[];
|
|
216
|
+
/**
|
|
217
|
+
* Token reward APY lines (not points — points go to {@link PoolTableRowDTO.points}).
|
|
218
|
+
* **PR #84:** `yield.incentives` filtered to `type === "tokens"`.
|
|
219
|
+
*/
|
|
95
220
|
extraAPY: PoolExtraRewardApyDTO[];
|
|
221
|
+
/** Optional external boost (e.g. third-party protocol). */
|
|
96
222
|
externalAPY?: PoolExternalApyDTO;
|
|
97
223
|
/** Snapshot from 7 days ago (for 1D / 7D comparison in tooltip). */
|
|
98
224
|
apy7DAgo?: PoolApy7DaysAgoDTO;
|
|
@@ -102,6 +228,14 @@ export interface PoolBaseApyDTO {
|
|
|
102
228
|
/** Already in percent. */
|
|
103
229
|
apy: number;
|
|
104
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* One line in "extra APY" (liquidity mining, etc.). **Percent** for `apy`.
|
|
233
|
+
*
|
|
234
|
+
* **PR #84 (token incentive):**
|
|
235
|
+
* - `apy` ← `TokenReward.apy` (or incentive-level APY if that’s where you store it)
|
|
236
|
+
* - `rewardToken` ← `TokenReward.rewardToken.address` (hex string)
|
|
237
|
+
* - `rewardTokenSymbol` ← `TokenReward.rewardToken.symbol`
|
|
238
|
+
*/
|
|
105
239
|
export interface PoolExtraRewardApyDTO {
|
|
106
240
|
/** Extra reward APY in percent. */
|
|
107
241
|
apy: number;
|
|
@@ -116,12 +250,29 @@ export interface PoolExternalApyDTO {
|
|
|
116
250
|
/** Source name, e.g. "Curve". */
|
|
117
251
|
name: string;
|
|
118
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Historical snapshot for tooltip 1D / 7D columns. Same units as {@link PoolApyDTO}.
|
|
255
|
+
*
|
|
256
|
+
* **PR #84:** Fill from your stored 7d metrics / APY snapshot when available; omit otherwise.
|
|
257
|
+
*/
|
|
119
258
|
export interface PoolApy7DaysAgoDTO {
|
|
120
259
|
totalAPY?: number;
|
|
121
260
|
baseAPY?: PoolBaseApyDTO[];
|
|
122
261
|
extraAPY?: PoolExtraRewardApyDTO[];
|
|
123
262
|
externalAPY?: PoolExternalApyDTO;
|
|
124
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* One points program row for the APY tooltip. Matches UI `PoolAPYPointsTip` shape.
|
|
266
|
+
*
|
|
267
|
+
* **PR #84:** Map from a **points** `Incentive` / `PointsIncentive` (discriminated union):
|
|
268
|
+
* - `amount` — formatted string for display, e.g. `"2.5x"` from `PointsReward.multiplier`
|
|
269
|
+
* - `name` — `PointsReward.name` or program title
|
|
270
|
+
* - `tokenTitle` — optional; helps icon copy (e.g. underlying symbol)
|
|
271
|
+
* - `fullTip` — **pre-formatted** human-readable tooltip body (UI-ready)
|
|
272
|
+
* - `reward.duration` — human string (e.g. from `startsAt` / `endsAt`) or omit
|
|
273
|
+
* - `reward.condition` — e.g. `"deposit" | "cross-chain-deposit" | "holding"` if your model has it
|
|
274
|
+
* - `reward.name` / `reward.type` — for points icon / labeling in the UI
|
|
275
|
+
*/
|
|
125
276
|
export interface PoolApyPointDTO {
|
|
126
277
|
/** Formatted amount string, e.g. "2.5x". */
|
|
127
278
|
amount: string;
|
|
@@ -78,8 +78,6 @@ export * from './not-found';
|
|
|
78
78
|
export * from './options-list';
|
|
79
79
|
export * from './overflow';
|
|
80
80
|
export * from './overflow-container';
|
|
81
|
-
export * from './PoolCreditManagersTable';
|
|
82
|
-
export * from './PoolsAssetsTable';
|
|
83
81
|
export * from './page-title';
|
|
84
82
|
export * from './percent-indicator';
|
|
85
83
|
export * from './points-icon';
|
|
@@ -18,7 +18,8 @@ interface ExternalAPYData {
|
|
|
18
18
|
totalValue: number;
|
|
19
19
|
apy: number;
|
|
20
20
|
name: string;
|
|
21
|
-
|
|
21
|
+
/** When omitted, the block renders a plain name + APY line (no i18n id). */
|
|
22
|
+
tooltip?: LocaleKeys;
|
|
22
23
|
}
|
|
23
24
|
interface APY7DAgoData {
|
|
24
25
|
totalAPY?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -77,8 +77,6 @@ export * from './components/not-found';
|
|
|
77
77
|
export * from './components/options-list';
|
|
78
78
|
export * from './components/overflow';
|
|
79
79
|
export * from './components/overflow-container';
|
|
80
|
-
export * from './components/PoolCreditManagersTable';
|
|
81
|
-
export * from './components/PoolsAssetsTable';
|
|
82
80
|
export * from './components/page-title';
|
|
83
81
|
export * from './components/percent-indicator';
|
|
84
82
|
export * from './components/points-icon';
|
|
@@ -71,15 +71,29 @@ declare const _default: {
|
|
|
71
71
|
|
|
72
72
|
"components.openCopyButtons.copy": "Copy to clipboard",
|
|
73
73
|
|
|
74
|
-
"components.
|
|
75
|
-
"components.
|
|
76
|
-
"components.
|
|
77
|
-
"components.
|
|
78
|
-
"components.
|
|
79
|
-
"components.
|
|
80
|
-
"components.
|
|
81
|
-
|
|
82
|
-
"components.
|
|
74
|
+
"components.poolTable.pool": "Pool",
|
|
75
|
+
"components.poolTable.market": "Market",
|
|
76
|
+
"components.poolTable.description.universal": "Universal",
|
|
77
|
+
"components.poolTable.supply": "Supply",
|
|
78
|
+
"components.poolTable.borrowed": "Borrowed",
|
|
79
|
+
"components.poolTable.supplyApy": "Supply APY",
|
|
80
|
+
"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",
|
|
81
|
+
"components.poolTable.depositApy": "Deposit APY",
|
|
82
|
+
"components.poolTable.depositApy.tip": "Deposit APY breakdown: base rate, extra rewards, and points",
|
|
83
|
+
"components.poolTable.borrowApy": "Borrow APY",
|
|
84
|
+
"components.poolTable.utilizationApy": "Utilization APY",
|
|
85
|
+
"components.poolTable.borrowApy.tip": "On top of the utilization borrow APY, there is a borrow quota APY for different assets",
|
|
86
|
+
"components.poolTable.utilization": "Utilization",
|
|
87
|
+
"components.poolTable.collateral": "Collateral",
|
|
88
|
+
"components.poolTable.collateral.showAll": "Show All",
|
|
89
|
+
"components.poolTable.balance": "Your Balance",
|
|
90
|
+
"components.poolTable.balance.tip": "You don't earn token rewards, only organic yield. Please migrate liquidity by using \"Migrate\" flow above.",
|
|
91
|
+
"components.poolTable.emptyList": "No Pools found",
|
|
92
|
+
"components.poolTable.notFound.dashboard": "You currently have no open Market positions.",
|
|
93
|
+
"components.poolTable.notFound.list": "No Markets found",
|
|
94
|
+
"components.poolTable.notFound.description.dashboard": "Choose earn above.",
|
|
95
|
+
"components.poolTable.notFound.description.list": "Choose another chain or toggle Show All Markets",
|
|
96
|
+
"components.poolTable.externalApy.tooltipShort": "{value} APY boost when depositing via {name}"
|
|
83
97
|
}
|
|
84
98
|
;
|
|
85
99
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/ui-kit",
|
|
3
|
-
"version": "3.6.0
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"repository": "https://github.com/gearbox-protocol/ui-kit",
|
|
6
6
|
"license": "MIT",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"@commitlint/cli": "^20.1.0",
|
|
149
149
|
"@commitlint/config-conventional": "^20.0.0",
|
|
150
150
|
"@gearbox-protocol/biome-config": "^1.0.2",
|
|
151
|
-
"@gearbox-protocol/sdk": "13.
|
|
151
|
+
"@gearbox-protocol/sdk": "13.0.0",
|
|
152
152
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
153
153
|
"@storybook/addon-a11y": "^10.0.8",
|
|
154
154
|
"@storybook/addon-docs": "^10.0.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@gearbox-protocol/sdk");require("react");require("clsx");require("tailwind-merge");require("sonner");const c=require("../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const s=require("../table/grid-table.cjs"),d=require("../text-button/text-button.cjs"),u=require("../token-template/token-template.cjs"),x=require("../typed-intl/index.cjs"),r=require("../vertical-indicator/vertical-indicator.cjs"),m=require("./constants.cjs");function p({creditManager:t,last:i,onClick:l,totalDebtMoney:n,underlyingToken:o}){return e.jsxs(s.GridTableRow,{last:i,height:"75px",onRowClick:l,"data-testid":m.PoolCreditManagersTableTest.creditManagerLine,children:[e.jsx(s.GridTableCell,{textAlign:"left",className:"pl-4",size:"sm",children:e.jsx(r.VerticalIndicator,{label:t.name,description:a.shortAddress(t.address)})}),e.jsx(s.GridTableCell,{textAlign:"right",size:"sm",children:e.jsx("div",{className:"flex justify-end flex-col-auto",children:e.jsx("div",{className:"flex-col-auto",children:e.jsx(r.VerticalIndicator,{value:e.jsx(u.TokenTemplate,{value:t.totalDebt,token:o}),valueDescription:c.formatMoney(n)})})})}),e.jsx(s.GridTableCell,{textAlign:"right",className:"pr-4",size:"sm",children:e.jsx("div",{className:"flex justify-end flex-col-auto",children:e.jsx("div",{className:"flex-col-auto",children:e.jsx(r.VerticalIndicator,{label:e.jsx(d.TextButton,{as:"span",children:e.jsx(x.FormattedMessageTyped,{messageId:"components.poolCreditManagersTable.assets",values:{amount:t.collateralTokens.length}})}),description:" "})})})})]})}exports.PoolCreditManagersLineView=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const n=require("../../hooks/use-filter.cjs");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const l=require("../head-cell/head-cell.cjs"),s=require("../table/grid-table.cjs"),t=require("../typed-intl/index.cjs");function d({sort:i}){const o=t.useIntlTyped(),{state:r,set:a}=i;return e.jsxs(s.GridTableRow,{noHover:!0,height:"35px",children:[e.jsx(s.GridTableHead,{justify:"start",size:"sm",className:"pl-4",children:e.jsx(l.HeadCell,{arrowPosition:"right",title:e.jsx(t.FormattedMessageTyped,{messageId:"components.poolAssetsTable.head.name"}),sortDirection:n.getSortForField("name",r),sortField:o.formatMessage({messageId:"components.poolAssetsTable.head.name"}),onSort:()=>a("name")})}),e.jsx(s.GridTableHead,{justify:"end",size:"sm",children:e.jsx(l.HeadCell,{arrowPosition:"left",title:e.jsx(t.FormattedMessageTyped,{messageId:"components.poolAssetsTable.head.currentDebt"}),sortDirection:n.getSortForField("currentDebt",r),sortField:o.formatMessage({messageId:"components.poolAssetsTable.head.currentDebt"}),onSort:()=>a("currentDebt","desc")})}),e.jsx(s.GridTableHead,{justify:"end",size:"sm",className:"pr-4",children:e.jsx(l.HeadCell,{arrowPosition:"left",title:e.jsx(t.FormattedMessageTyped,{messageId:"components.poolAssetsTable.head.assets"}),sortDirection:n.getSortForField("assets",r),sortField:o.formatMessage({messageId:"components.poolAssetsTable.head.assets"}),onSort:()=>a("assets","desc")})})]})}exports.TableHead=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class e{static creditManagerLine="pool-credit-managers-line";static creditManagerDetail="pool-credit-managers-detail"}exports.PoolCreditManagersTableTest=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const b=require("../../hooks/use-media-query.cjs"),o=require("../table/grid-table.cjs"),a=require("./PoolCreditManagersLine.cjs"),u=require("./TableHead.cjs"),g=require("./constants.cjs");function T({handleSelectCM:i,rows:s,sort:l,underlyingToken:n}){const t=b.useIsMobile()?"1fr 120px 0.75fr":"2fr 1fr 1fr";return e.jsxs(o.GridTable,{cols:t,gap:0,size:"lg",wrapperClassName:"overflow-visible",children:[e.jsx(o.GridTableHeader,{children:e.jsx(u.TableHead,{sort:l})}),e.jsx(o.GridTableBody,{children:s.map(({creditManager:r,totalDebtMoney:d},c)=>e.jsx(a.PoolCreditManagersLineView,{creditManager:r,last:c===s.length-1,onClick:i(r),totalDebtMoney:d,underlyingToken:n},r.address))})]})}exports.PoolCreditManagersLineView=a.PoolCreditManagersLineView;exports.PoolCreditManagersTableTest=g.PoolCreditManagersTableTest;exports.PoolCreditManagersTableView=T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const m=require("../../hooks/use-media-query.cjs");require("clsx");require("tailwind-merge");require("sonner");const q=require("../../utils/format-money.cjs");require("luxon");require("../../utils/z-index.cjs");const S=require("../description/description.cjs"),u=require("../short-string/short-string.cjs"),s=require("../table/grid-table.cjs"),t=require("../table/table-sm.cjs"),_=require("../token-symbol/token-symbol.cjs"),d=require("../token-template/token-template.cjs"),l=require("../typed-intl/index.cjs");function y({poolName:p,token:n,currentQuota:x,underlyingToken:r,last:g}){const{limit:h,totalQuoted:T,rate:b}=x,o=m.useIsMobile(),j=m.useIsDesktop()?21:o?40:16,i=()=>e.jsxs("div",{className:"flex items-center flex-col-auto",children:[e.jsx(_.TokenSymbol,{token:n,size:32}),e.jsxs("span",{className:"ml-1.5 md:ml-2.5 text-left",children:[e.jsx(u.ShortString,{maxLength:j,children:n?.title}),e.jsx(S.Description,{children:e.jsx(u.ShortString,{maxLength:20,children:p})})]})]}),a=()=>q.percentageTemplate(b),c=()=>e.jsx("span",{children:e.jsx(l.FormattedMessageTyped,{messageId:"components.poolAssetsTable.usage",values:{amount:e.jsx(d.TokenTemplate,{value:T,token:r,decimalPartLength:2,precision:2,showSymbol:!1},"pool-assets-line-usage-amount"),total:e.jsx(d.TokenTemplate,{value:h,token:r,decimalPartLength:2,precision:2,showSymbol:!1},"pool-assets-line-usage-total")}})});return e.jsx(s.GridTableRow,{last:g,height:"auto",className:"cursor-default",onRowClick:()=>{},style:{minHeight:"75px"},children:o?e.jsx(s.GridTableCell,{span:"full",size:"sm",className:"px-3 py-0!",children:e.jsxs(t.TableLineSm,{columns:2,columnsXs:2,title:i(),className:"w-full",children:[e.jsx(t.TableCellSm,{title:e.jsx(l.FormattedMessageTyped,{messageId:"components.poolAssetsTable.rate"}),children:a()}),e.jsx(t.TableCellSm,{title:e.jsx(l.FormattedMessageTyped,{messageId:"components.poolAssetsTable.limits"}),children:c()})]})}):e.jsxs(e.Fragment,{children:[e.jsx(s.GridTableCell,{textAlign:"left",className:"pl-4",size:"sm",children:i()}),e.jsx(s.GridTableCell,{textAlign:"right",size:"sm",children:a()}),e.jsx(s.GridTableCell,{textAlign:"right",className:"pr-4",size:"sm",children:c()})]})})}exports.PoolAssetsLine=y;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const l=require("../../hooks/use-filter.cjs");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const n=require("../head-cell/head-cell.cjs"),s=require("../table/grid-table.cjs"),t=require("../typed-intl/index.cjs");function p({sort:i}){const o=t.useIntlTyped(),{state:r,set:a}=i,d=()=>a("usage","desc"),c=()=>a("rate","desc"),m=()=>a("name","desc");return e.jsxs(s.GridTableRow,{noHover:!0,height:"35px",children:[e.jsx(s.GridTableHead,{justify:"start",size:"sm",className:"pl-4",children:e.jsx(n.HeadCell,{arrowPosition:"right",title:e.jsx(t.FormattedMessageTyped,{messageId:"components.poolAssetsTable.asset"}),sortDirection:l.getSortForField("name",r),sortField:o.formatMessage({messageId:"components.poolAssetsTable.asset"}),onSort:m})}),e.jsx(s.GridTableHead,{justify:"end",size:"sm",children:e.jsx(n.HeadCell,{arrowPosition:"left",title:e.jsx(t.FormattedMessageTyped,{messageId:"components.poolAssetsTable.rate"}),sortDirection:l.getSortForField("rate",r),sortField:o.formatMessage({messageId:"components.poolAssetsTable.rate"}),onSort:c})}),e.jsx(s.GridTableHead,{justify:"end",size:"sm",className:"pr-4",children:e.jsx(n.HeadCell,{arrowPosition:"left",title:e.jsx(t.FormattedMessageTyped,{messageId:"components.poolAssetsTable.limits"}),sortDirection:l.getSortForField("usage",r),sortField:o.formatMessage({messageId:"components.poolAssetsTable.limits"}),onSort:d})})]})}exports.TableHead=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const b=require("../../hooks/use-media-query.cjs"),o=require("../table/grid-table.cjs"),d=require("./PoolAssetsLine.cjs"),T=require("./TableHead.cjs");function p({list:r,poolName:t,sort:i,tokensList:n,underlyingToken:a}){const l=b.useIsMobile(),u=l?"1fr":"1fr 180px 1fr";return e.jsxs(o.GridTable,{cols:u,gap:0,size:"lg",wrapperClassName:"overflow-visible",children:[!l&&e.jsx(o.GridTableHeader,{children:e.jsx(T.TableHead,{sort:i})}),e.jsx(o.GridTableBody,{children:r.map((s,c)=>e.jsx(d.PoolAssetsLine,{poolName:t,currentQuota:s,token:n[s.token],underlyingToken:a,last:c===r.length-1},s.token))})]})}exports.PoolAssetsTableView=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { shortAddress as n } from "@gearbox-protocol/sdk";
|
|
3
|
-
import "react";
|
|
4
|
-
import "clsx";
|
|
5
|
-
import "tailwind-merge";
|
|
6
|
-
import "sonner";
|
|
7
|
-
import { formatMoney as d } from "../../utils/format-money.js";
|
|
8
|
-
import "@gearbox-protocol/sdk/common-utils";
|
|
9
|
-
import "luxon";
|
|
10
|
-
import "../../utils/z-index.js";
|
|
11
|
-
import { GridTableRow as p, GridTableCell as o } from "../table/grid-table.js";
|
|
12
|
-
import { TextButton as c } from "../text-button/text-button.js";
|
|
13
|
-
import { TokenTemplate as f } from "../token-template/token-template.js";
|
|
14
|
-
import { FormattedMessageTyped as h } from "../typed-intl/index.js";
|
|
15
|
-
import { VerticalIndicator as i } from "../vertical-indicator/vertical-indicator.js";
|
|
16
|
-
import { PoolCreditManagersTableTest as u } from "./constants.js";
|
|
17
|
-
function I({
|
|
18
|
-
creditManager: t,
|
|
19
|
-
last: l,
|
|
20
|
-
onClick: r,
|
|
21
|
-
totalDebtMoney: s,
|
|
22
|
-
underlyingToken: a
|
|
23
|
-
}) {
|
|
24
|
-
return /* @__PURE__ */ m(
|
|
25
|
-
p,
|
|
26
|
-
{
|
|
27
|
-
last: l,
|
|
28
|
-
height: "75px",
|
|
29
|
-
onRowClick: r,
|
|
30
|
-
"data-testid": u.creditManagerLine,
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ e(o, { textAlign: "left", className: "pl-4", size: "sm", children: /* @__PURE__ */ e(
|
|
33
|
-
i,
|
|
34
|
-
{
|
|
35
|
-
label: t.name,
|
|
36
|
-
description: n(t.address)
|
|
37
|
-
}
|
|
38
|
-
) }),
|
|
39
|
-
/* @__PURE__ */ e(o, { textAlign: "right", size: "sm", children: /* @__PURE__ */ e("div", { className: "flex justify-end flex-col-auto", children: /* @__PURE__ */ e("div", { className: "flex-col-auto", children: /* @__PURE__ */ e(
|
|
40
|
-
i,
|
|
41
|
-
{
|
|
42
|
-
value: /* @__PURE__ */ e(
|
|
43
|
-
f,
|
|
44
|
-
{
|
|
45
|
-
value: t.totalDebt,
|
|
46
|
-
token: a
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
valueDescription: d(s)
|
|
50
|
-
}
|
|
51
|
-
) }) }) }),
|
|
52
|
-
/* @__PURE__ */ e(o, { textAlign: "right", className: "pr-4", size: "sm", children: /* @__PURE__ */ e("div", { className: "flex justify-end flex-col-auto", children: /* @__PURE__ */ e("div", { className: "flex-col-auto", children: /* @__PURE__ */ e(
|
|
53
|
-
i,
|
|
54
|
-
{
|
|
55
|
-
label: /* @__PURE__ */ e(c, { as: "span", children: /* @__PURE__ */ e(
|
|
56
|
-
h,
|
|
57
|
-
{
|
|
58
|
-
messageId: "components.poolCreditManagersTable.assets",
|
|
59
|
-
values: { amount: t.collateralTokens.length }
|
|
60
|
-
}
|
|
61
|
-
) }),
|
|
62
|
-
description: " "
|
|
63
|
-
}
|
|
64
|
-
) }) }) })
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
I as PoolCreditManagersLineView
|
|
71
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import { getSortForField as r } from "../../hooks/use-filter.js";
|
|
4
|
-
import "@gearbox-protocol/sdk/common-utils";
|
|
5
|
-
import "@gearbox-protocol/sdk";
|
|
6
|
-
import { HeadCell as a } from "../head-cell/head-cell.js";
|
|
7
|
-
import { GridTableRow as d, GridTableHead as i } from "../table/grid-table.js";
|
|
8
|
-
import { useIntlTyped as p, FormattedMessageTyped as n } from "../typed-intl/index.js";
|
|
9
|
-
function I({ sort: m }) {
|
|
10
|
-
const s = p(), { state: t, set: o } = m;
|
|
11
|
-
return /* @__PURE__ */ l(d, { noHover: !0, height: "35px", children: [
|
|
12
|
-
/* @__PURE__ */ e(i, { justify: "start", size: "sm", className: "pl-4", children: /* @__PURE__ */ e(
|
|
13
|
-
a,
|
|
14
|
-
{
|
|
15
|
-
arrowPosition: "right",
|
|
16
|
-
title: /* @__PURE__ */ e(n, { messageId: "components.poolAssetsTable.head.name" }),
|
|
17
|
-
sortDirection: r("name", t),
|
|
18
|
-
sortField: s.formatMessage({
|
|
19
|
-
messageId: "components.poolAssetsTable.head.name"
|
|
20
|
-
}),
|
|
21
|
-
onSort: () => o("name")
|
|
22
|
-
}
|
|
23
|
-
) }),
|
|
24
|
-
/* @__PURE__ */ e(i, { justify: "end", size: "sm", children: /* @__PURE__ */ e(
|
|
25
|
-
a,
|
|
26
|
-
{
|
|
27
|
-
arrowPosition: "left",
|
|
28
|
-
title: /* @__PURE__ */ e(n, { messageId: "components.poolAssetsTable.head.currentDebt" }),
|
|
29
|
-
sortDirection: r("currentDebt", t),
|
|
30
|
-
sortField: s.formatMessage({
|
|
31
|
-
messageId: "components.poolAssetsTable.head.currentDebt"
|
|
32
|
-
}),
|
|
33
|
-
onSort: () => o("currentDebt", "desc")
|
|
34
|
-
}
|
|
35
|
-
) }),
|
|
36
|
-
/* @__PURE__ */ e(i, { justify: "end", size: "sm", className: "pr-4", children: /* @__PURE__ */ e(
|
|
37
|
-
a,
|
|
38
|
-
{
|
|
39
|
-
arrowPosition: "left",
|
|
40
|
-
title: /* @__PURE__ */ e(n, { messageId: "components.poolAssetsTable.head.assets" }),
|
|
41
|
-
sortDirection: r("assets", t),
|
|
42
|
-
sortField: s.formatMessage({
|
|
43
|
-
messageId: "components.poolAssetsTable.head.assets"
|
|
44
|
-
}),
|
|
45
|
-
onSort: () => o("assets", "desc")
|
|
46
|
-
}
|
|
47
|
-
) })
|
|
48
|
-
] });
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
I as TableHead
|
|
52
|
-
};
|