@gearbox-protocol/ui-kit 3.5.2 → 3.6.0-next.2
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/PoolCreditManagersTable/PoolCreditManagersLine.cjs +1 -0
- package/dist/cjs/components/PoolCreditManagersTable/TableHead.cjs +1 -0
- package/dist/cjs/components/PoolCreditManagersTable/constants.cjs +1 -0
- package/dist/cjs/components/PoolCreditManagersTable/index.cjs +1 -0
- package/dist/cjs/components/PoolCreditManagersTable/types.cjs +1 -0
- package/dist/cjs/components/PoolsAssetsTable/PoolAssetsLine.cjs +1 -0
- package/dist/cjs/components/PoolsAssetsTable/TableHead.cjs +1 -0
- package/dist/cjs/components/PoolsAssetsTable/index.cjs +1 -0
- package/dist/cjs/components/PoolsAssetsTable/types.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.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/PoolCreditManagersTable/PoolCreditManagersLine.js +71 -0
- package/dist/esm/components/PoolCreditManagersTable/TableHead.js +52 -0
- package/dist/esm/components/PoolCreditManagersTable/constants.js +7 -0
- package/dist/esm/components/PoolCreditManagersTable/index.js +45 -0
- package/dist/esm/components/PoolCreditManagersTable/types.js +1 -0
- package/dist/esm/components/PoolsAssetsTable/PoolAssetsLine.js +107 -0
- package/dist/esm/components/PoolsAssetsTable/TableHead.js +52 -0
- package/dist/esm/components/PoolsAssetsTable/index.js +43 -0
- package/dist/esm/components/PoolsAssetsTable/types.js +1 -0
- package/dist/esm/components/compound-apy/compound-apy.js +1 -1
- package/dist/esm/components/index.js +386 -378
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +69 -75
- package/dist/esm/index.js +489 -481
- package/dist/esm/locale/en.json.js +9 -1
- package/dist/globals.css +1 -1
- package/dist/types/components/PoolCreditManagersTable/PoolCreditManagersLine.d.ts +11 -0
- package/dist/types/components/PoolCreditManagersTable/TableHead.d.ts +7 -0
- package/dist/types/components/PoolCreditManagersTable/constants.d.ts +4 -0
- package/dist/types/components/PoolCreditManagersTable/index.d.ts +14 -0
- package/dist/types/components/PoolCreditManagersTable/types.d.ts +22 -0
- package/dist/types/components/PoolsAssetsTable/PoolAssetsLine.d.ts +12 -0
- package/dist/types/components/PoolsAssetsTable/TableHead.d.ts +7 -0
- package/dist/types/components/PoolsAssetsTable/index.d.ts +13 -0
- package/dist/types/components/PoolsAssetsTable/types.d.ts +17 -0
- package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +17 -168
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +1 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale/en.json.d.ts +11 -1
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TokenData } from '@gearbox-protocol/sdk/common-utils';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PoolCreditManagerTableRow } from './types';
|
|
4
|
+
export interface PoolCreditManagersLineViewProps {
|
|
5
|
+
readonly creditManager: PoolCreditManagerTableRow;
|
|
6
|
+
readonly last: boolean;
|
|
7
|
+
readonly onClick: () => void;
|
|
8
|
+
readonly totalDebtMoney: bigint;
|
|
9
|
+
readonly underlyingToken: TokenData | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function PoolCreditManagersLineView({ creditManager, last, onClick, totalDebtMoney, underlyingToken, }: PoolCreditManagersLineViewProps): React.ReactElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TokenData } from '@gearbox-protocol/sdk/common-utils';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PoolCreditManagersTableRowModel, PoolCreditManagerTableRow, PoolCreditManagerTableSort } from './types';
|
|
4
|
+
export { PoolCreditManagersTableTest } from './constants';
|
|
5
|
+
export type { PoolCreditManagersLineViewProps } from './PoolCreditManagersLine';
|
|
6
|
+
export { PoolCreditManagersLineView } from './PoolCreditManagersLine';
|
|
7
|
+
export type { PoolCreditManagerSortFields, PoolCreditManagersFilterState, PoolCreditManagersTableRowModel, PoolCreditManagerTableRow, PoolCreditManagerTableSort, } from './types';
|
|
8
|
+
export interface PoolCreditManagersTableViewProps<TRow extends PoolCreditManagerTableRow = PoolCreditManagerTableRow> {
|
|
9
|
+
readonly handleSelectCM: (cm: TRow) => () => void;
|
|
10
|
+
readonly rows: ReadonlyArray<PoolCreditManagersTableRowModel<TRow>>;
|
|
11
|
+
readonly sort: PoolCreditManagerTableSort;
|
|
12
|
+
readonly underlyingToken: TokenData | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function PoolCreditManagersTableView<TRow extends PoolCreditManagerTableRow = PoolCreditManagerTableRow>({ handleSelectCM, rows, sort, underlyingToken, }: PoolCreditManagersTableViewProps<TRow>): React.ReactElement | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { SortField, SortSetterFunction } from '../../hooks';
|
|
3
|
+
export type PoolCreditManagerSortFields = "name" | "currentDebt" | "assets";
|
|
4
|
+
export interface PoolCreditManagerTableSort {
|
|
5
|
+
readonly state: SortField<PoolCreditManagerSortFields> | null;
|
|
6
|
+
readonly set: SortSetterFunction<PoolCreditManagerSortFields>;
|
|
7
|
+
}
|
|
8
|
+
export interface PoolCreditManagersFilterState {
|
|
9
|
+
readonly sort: PoolCreditManagerTableSort;
|
|
10
|
+
}
|
|
11
|
+
/** Fields used by PoolCreditManagersLineView (compatible with CreditManagerData_Legacy) */
|
|
12
|
+
export interface PoolCreditManagerTableRow {
|
|
13
|
+
readonly address: Address;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly totalDebt: bigint;
|
|
16
|
+
readonly collateralTokens: readonly unknown[];
|
|
17
|
+
readonly underlyingToken: Address;
|
|
18
|
+
}
|
|
19
|
+
export interface PoolCreditManagersTableRowModel<TRow extends PoolCreditManagerTableRow = PoolCreditManagerTableRow> {
|
|
20
|
+
readonly creditManager: TRow;
|
|
21
|
+
readonly totalDebtMoney: bigint;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TokenData } from '@gearbox-protocol/sdk/common-utils';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PoolAssetsTableQuotaRow } from './types';
|
|
4
|
+
interface PoolAssetsLineProps {
|
|
5
|
+
poolName: string;
|
|
6
|
+
token: TokenData;
|
|
7
|
+
currentQuota: PoolAssetsTableQuotaRow;
|
|
8
|
+
underlyingToken: TokenData;
|
|
9
|
+
last: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function PoolAssetsLine({ poolName, token, currentQuota, underlyingToken, last, }: PoolAssetsLineProps): React.ReactElement;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TokenData } from '@gearbox-protocol/sdk/common-utils';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Address } from 'viem';
|
|
4
|
+
import { PoolAssetsTableQuotaRow, PoolAssetsTableSort } from './types';
|
|
5
|
+
export type { PoolAssetsFilterState, PoolAssetsSortFields, PoolAssetsTableQuotaRow, PoolAssetsTableSort, } from './types';
|
|
6
|
+
export interface PoolAssetsTableViewProps {
|
|
7
|
+
readonly list: ReadonlyArray<PoolAssetsTableQuotaRow>;
|
|
8
|
+
readonly poolName: string;
|
|
9
|
+
readonly sort: PoolAssetsTableSort;
|
|
10
|
+
readonly tokensList: Record<Address, TokenData>;
|
|
11
|
+
readonly underlyingToken: TokenData;
|
|
12
|
+
}
|
|
13
|
+
export declare function PoolAssetsTableView({ list, poolName, sort, tokensList, underlyingToken, }: PoolAssetsTableViewProps): React.ReactElement | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { SortField, SortSetterFunction } from '../../hooks';
|
|
3
|
+
export type PoolAssetsSortFields = "name" | "rate" | "usage";
|
|
4
|
+
export interface PoolAssetsTableSort {
|
|
5
|
+
readonly state: SortField<PoolAssetsSortFields> | null;
|
|
6
|
+
readonly set: SortSetterFunction<PoolAssetsSortFields>;
|
|
7
|
+
}
|
|
8
|
+
export interface PoolAssetsFilterState {
|
|
9
|
+
readonly sort: PoolAssetsTableSort;
|
|
10
|
+
}
|
|
11
|
+
/** Quota fields used by PoolAssetsLine (compatible with sdk QuotaInfo) */
|
|
12
|
+
export interface PoolAssetsTableQuotaRow {
|
|
13
|
+
readonly token: Address;
|
|
14
|
+
readonly limit: bigint;
|
|
15
|
+
readonly totalQuoted: bigint;
|
|
16
|
+
readonly rate: bigint;
|
|
17
|
+
}
|
|
@@ -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
|
+
* The client maps pool / APY / points fields into the `PoolTable` component from
|
|
7
|
+
* `@gearbox-protocol/ui-kit` and resolves token metadata (icons, decimals, titles)
|
|
8
|
+
* locally (e.g. SDK + `tokensList` on each row).
|
|
9
9
|
*
|
|
10
10
|
* Copy this file into your backend repo — it has **zero npm dependencies**.
|
|
11
11
|
*
|
|
@@ -19,72 +19,6 @@
|
|
|
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
|
-
*
|
|
88
22
|
* @packageDocumentation
|
|
89
23
|
*/
|
|
90
24
|
type Address = `0x${string}`;
|
|
@@ -95,24 +29,11 @@ type Address = `0x${string}`;
|
|
|
95
29
|
* "rows": [ … ]
|
|
96
30
|
* }
|
|
97
31
|
* ```
|
|
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.
|
|
102
32
|
*/
|
|
103
33
|
export interface PoolTableListResponse {
|
|
104
34
|
/** One entry per pool visible in the table. */
|
|
105
35
|
rows: PoolTableRowDTO[];
|
|
106
36
|
}
|
|
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
|
-
*/
|
|
116
37
|
export interface PoolTableRowDTO {
|
|
117
38
|
pool: PoolDTO;
|
|
118
39
|
/** Supply / deposit APY breakdown (column + tooltip). */
|
|
@@ -123,102 +44,55 @@ export interface PoolTableRowDTO {
|
|
|
123
44
|
/** Deep-link to pool detail page (client can also build this locally). */
|
|
124
45
|
href?: string;
|
|
125
46
|
}
|
|
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
|
-
*/
|
|
132
47
|
export interface PoolDTO {
|
|
133
|
-
/** **PR #84:** `MarketInfo.address`. */
|
|
134
48
|
address: Address;
|
|
135
|
-
/** **PR #84:** `MarketInfo.underlyingAsset`. */
|
|
136
49
|
underlyingToken: Address;
|
|
137
|
-
/** Display name, e.g. "USDC v3".
|
|
50
|
+
/** Display name, e.g. "USDC v3". */
|
|
138
51
|
name?: string;
|
|
139
|
-
/** Semver-like integer: 300 = v3, 310 = v3.1, etc.
|
|
52
|
+
/** Semver-like integer: 300 = v3, 310 = v3.1, etc. */
|
|
140
53
|
version?: number;
|
|
141
|
-
/** Human-readable network label, e.g. "Mainnet", "Arbitrum".
|
|
54
|
+
/** Human-readable network label, e.g. "Mainnet", "Arbitrum". */
|
|
142
55
|
network?: string;
|
|
143
|
-
/** **PR #84:** `MarketInfo.chainId`. */
|
|
144
56
|
chainId?: number;
|
|
145
|
-
/** Market configurator address (curator badge).
|
|
57
|
+
/** Market configurator address (rendered as curator badge). */
|
|
146
58
|
marketConfigurator?: Address;
|
|
147
|
-
/**
|
|
148
|
-
* Total supplied liquidity in underlying token (bigint → string in JSON).
|
|
149
|
-
* **PR #84:** `MarketMetrics.expected` in underlying units.
|
|
150
|
-
*/
|
|
59
|
+
/** Total supplied liquidity in underlying token (bigint → string in JSON). */
|
|
151
60
|
expectedLiquidity?: bigint;
|
|
152
|
-
/** Same value converted to USD.
|
|
61
|
+
/** Same value converted to USD. */
|
|
153
62
|
expectedLiquidityInUSD?: number;
|
|
154
|
-
/**
|
|
155
|
-
* Total borrowed in underlying token (bigint → string in JSON).
|
|
156
|
-
* **PR #84:** `MarketMetrics.borrowed`.
|
|
157
|
-
*/
|
|
63
|
+
/** Total borrowed in underlying token (bigint → string in JSON). */
|
|
158
64
|
totalBorrowed?: bigint;
|
|
159
|
-
/** Same value converted to USD.
|
|
65
|
+
/** Same value converted to USD. */
|
|
160
66
|
totalBorrowedInUSD?: number;
|
|
161
|
-
/**
|
|
162
|
-
* Utilization ratio, 0–100 (percent).
|
|
163
|
-
* **PR #84:** e.g. `(borrowed / expected) * 100` with safe zero handling.
|
|
164
|
-
*/
|
|
67
|
+
/** Utilization ratio, 0–100 (percent). */
|
|
165
68
|
utilization?: number;
|
|
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
|
-
*/
|
|
69
|
+
/** Base deposit APY, already in **percent** (e.g. `5.2` = 5.2%). */
|
|
170
70
|
depositAPY?: number;
|
|
171
71
|
/**
|
|
172
72
|
* Borrow rate for the "Borrow APY" column.
|
|
173
73
|
* Unit: **basis points** (10 000 = 100%).
|
|
174
|
-
* **PR #84:** Map from `MarketMetrics.baseInterestRate`; convert fraction → bps (`* 10_000`) if applicable.
|
|
175
74
|
*/
|
|
176
75
|
borrowAPY?: number;
|
|
177
76
|
/**
|
|
178
77
|
* Active collateral token addresses for the "Collateral" column.
|
|
179
78
|
* Token symbols/decimals for display are resolved on the client (no server-side
|
|
180
79
|
* token dictionary in this response).
|
|
181
|
-
* **PR #84:** `PoolOpportunity.collaterals.map(c => c.token.address)` (or your filtered list).
|
|
182
80
|
*/
|
|
183
81
|
collateralTokens?: Address[];
|
|
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
|
-
*/
|
|
82
|
+
/** User's pool position value in USD ("Your Balance" column). */
|
|
188
83
|
userBalanceInUSD?: number;
|
|
189
|
-
/**
|
|
190
|
-
* User's position amount in pool/deposit token (bigint → string).
|
|
191
|
-
* **PR #84:** e.g. `UserPoolPosition.depositSize` in token units.
|
|
192
|
-
*/
|
|
84
|
+
/** User's position amount in pool/deposit token (bigint → string). */
|
|
193
85
|
userBalance?: bigint;
|
|
194
86
|
/** Pool deposit token symbol, e.g. `"edgeUSDC"`. */
|
|
195
87
|
poolTokenSymbol?: string;
|
|
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
|
-
*/
|
|
88
|
+
/** `true` when the pool has active points/rewards (shows indicator icon). */
|
|
200
89
|
hasPoints?: boolean;
|
|
201
90
|
}
|
|
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
|
-
*/
|
|
211
91
|
export interface PoolApyDTO {
|
|
212
|
-
/** Total combined supply APY in percent (`8.33` = 8.33%).
|
|
92
|
+
/** Total combined supply APY in percent (`8.33` = 8.33%). */
|
|
213
93
|
totalAPY: number;
|
|
214
|
-
/** **PR #84:** From `YieldBreakdown.base` (+ optional extra base rows). */
|
|
215
94
|
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
|
-
*/
|
|
220
95
|
extraAPY: PoolExtraRewardApyDTO[];
|
|
221
|
-
/** Optional external boost (e.g. third-party protocol). */
|
|
222
96
|
externalAPY?: PoolExternalApyDTO;
|
|
223
97
|
/** Snapshot from 7 days ago (for 1D / 7D comparison in tooltip). */
|
|
224
98
|
apy7DAgo?: PoolApy7DaysAgoDTO;
|
|
@@ -228,14 +102,6 @@ export interface PoolBaseApyDTO {
|
|
|
228
102
|
/** Already in percent. */
|
|
229
103
|
apy: number;
|
|
230
104
|
}
|
|
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
|
-
*/
|
|
239
105
|
export interface PoolExtraRewardApyDTO {
|
|
240
106
|
/** Extra reward APY in percent. */
|
|
241
107
|
apy: number;
|
|
@@ -250,29 +116,12 @@ export interface PoolExternalApyDTO {
|
|
|
250
116
|
/** Source name, e.g. "Curve". */
|
|
251
117
|
name: string;
|
|
252
118
|
}
|
|
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
|
-
*/
|
|
258
119
|
export interface PoolApy7DaysAgoDTO {
|
|
259
120
|
totalAPY?: number;
|
|
260
121
|
baseAPY?: PoolBaseApyDTO[];
|
|
261
122
|
extraAPY?: PoolExtraRewardApyDTO[];
|
|
262
123
|
externalAPY?: PoolExternalApyDTO;
|
|
263
124
|
}
|
|
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
|
-
*/
|
|
276
125
|
export interface PoolApyPointDTO {
|
|
277
126
|
/** Formatted amount string, e.g. "2.5x". */
|
|
278
127
|
amount: string;
|
|
@@ -78,6 +78,8 @@ 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';
|
|
81
83
|
export * from './page-title';
|
|
82
84
|
export * from './percent-indicator';
|
|
83
85
|
export * from './points-icon';
|
|
@@ -18,8 +18,7 @@ interface ExternalAPYData {
|
|
|
18
18
|
totalValue: number;
|
|
19
19
|
apy: number;
|
|
20
20
|
name: string;
|
|
21
|
-
|
|
22
|
-
tooltip?: LocaleKeys;
|
|
21
|
+
tooltip: LocaleKeys;
|
|
23
22
|
}
|
|
24
23
|
interface APY7DAgoData {
|
|
25
24
|
totalAPY?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ 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';
|
|
80
82
|
export * from './components/page-title';
|
|
81
83
|
export * from './components/percent-indicator';
|
|
82
84
|
export * from './components/points-icon';
|
|
@@ -69,7 +69,17 @@ declare const _default: {
|
|
|
69
69
|
"components.apyParts.points": "{symbol} Incentive",
|
|
70
70
|
"components.apyParts.points.condition.crossDeposit": "For cross-chain deposits made via Omni",
|
|
71
71
|
|
|
72
|
-
"components.openCopyButtons.copy": "Copy to clipboard"
|
|
72
|
+
"components.openCopyButtons.copy": "Copy to clipboard",
|
|
73
|
+
|
|
74
|
+
"components.poolAssetsTable.asset": "Asset",
|
|
75
|
+
"components.poolAssetsTable.rate": "Effective rate",
|
|
76
|
+
"components.poolAssetsTable.limits": "Limits Usage",
|
|
77
|
+
"components.poolAssetsTable.usage": "{amount} of {total}",
|
|
78
|
+
"components.poolAssetsTable.head.name": "Credit Manager",
|
|
79
|
+
"components.poolAssetsTable.head.currentDebt": "Current Debt",
|
|
80
|
+
"components.poolAssetsTable.head.assets": "Asset LT",
|
|
81
|
+
|
|
82
|
+
"components.poolCreditManagersTable.assets": "{amount} assets"
|
|
73
83
|
}
|
|
74
84
|
;
|
|
75
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/ui-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-next.2",
|
|
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.6.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",
|