@gearbox-protocol/ui-kit 3.5.0 → 3.6.0-next.1

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.
@@ -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,7 @@
1
+ import { default as React } from 'react';
2
+ import { PoolAssetsTableSort } from './types';
3
+ interface TableHeadProps {
4
+ sort: PoolAssetsTableSort;
5
+ }
6
+ export declare function TableHead({ sort }: TableHeadProps): React.ReactElement;
7
+ 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,8 +3,9 @@
3
3
  * ==================================
4
4
  *
5
5
  * Self-contained type definitions for the pool-list endpoint response.
6
- * The client maps this response 1-to-1 into the `PoolTable` component from
7
- * `@gearbox-protocol/ui-kit`.
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).
8
9
  *
9
10
  * Copy this file into your backend repo — it has **zero npm dependencies**.
10
11
  *
@@ -25,7 +26,6 @@ type Address = `0x${string}`;
25
26
  * ```jsonc
26
27
  * GET /v1/pools?chainIds=1,42161&wallet=0x…
27
28
  * {
28
- * "tokens": { "0xabc…": { "symbol":"USDC", "title":"USDC", "decimals":6 } },
29
29
  * "rows": [ … ]
30
30
  * }
31
31
  * ```
@@ -33,14 +33,6 @@ type Address = `0x${string}`;
33
33
  export interface PoolTableListResponse {
34
34
  /** One entry per pool visible in the table. */
35
35
  rows: PoolTableRowDTO[];
36
- /**
37
- * Global token dictionary shared by all rows.
38
- * Must contain **at least** every `underlyingToken`, every address in
39
- * `collateralTokens`, and every `rewardToken` from `apy.extraAPY`.
40
- *
41
- * Key = lower-case token address.
42
- */
43
- tokens: Record<Address, TokenMetaDTO>;
44
36
  }
45
37
  export interface PoolTableRowDTO {
46
38
  pool: PoolDTO;
@@ -81,7 +73,11 @@ export interface PoolDTO {
81
73
  * Unit: **basis points** (10 000 = 100%).
82
74
  */
83
75
  borrowAPY?: number;
84
- /** Active collateral token addresses for the "Collateral" column. */
76
+ /**
77
+ * Active collateral token addresses for the "Collateral" column.
78
+ * Token symbols/decimals for display are resolved on the client (no server-side
79
+ * token dictionary in this response).
80
+ */
85
81
  collateralTokens?: Address[];
86
82
  /** User's pool position value in USD ("Your Balance" column). */
87
83
  userBalanceInUSD?: number;
@@ -119,8 +115,6 @@ export interface PoolExternalApyDTO {
119
115
  value?: number;
120
116
  /** Source name, e.g. "Curve". */
121
117
  name: string;
122
- /** i18n key or free-form string for tooltip. */
123
- tooltip?: string;
124
118
  }
125
119
  export interface PoolApy7DaysAgoDTO {
126
120
  totalAPY?: number;
@@ -145,16 +139,4 @@ export interface PoolApyPointRewardHintDTO {
145
139
  name?: string;
146
140
  type?: string;
147
141
  }
148
- export interface TokenMetaDTO {
149
- /** Ticker, e.g. "USDC". */
150
- symbol: string;
151
- /** Human-readable name, e.g. "USD Coin". */
152
- title?: string;
153
- /** URL or static asset path for the token icon. */
154
- icon?: string;
155
- /** Full token name (rarely different from title). */
156
- name?: string;
157
- /** Token decimals — required for correct amount formatting on the client. */
158
- decimals: number;
159
- }
160
142
  export {};
@@ -78,6 +78,7 @@ export * from './not-found';
78
78
  export * from './options-list';
79
79
  export * from './overflow';
80
80
  export * from './overflow-container';
81
+ export * from './PoolsAssetsTable';
81
82
  export * from './page-title';
82
83
  export * from './percent-indicator';
83
84
  export * from './points-icon';
@@ -77,6 +77,7 @@ 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/PoolsAssetsTable';
80
81
  export * from './components/page-title';
81
82
  export * from './components/percent-indicator';
82
83
  export * from './components/points-icon';
@@ -69,7 +69,12 @@ 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}"
73
78
  }
74
79
  ;
75
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.5.0",
3
+ "version": "3.6.0-next.1",
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.0.0",
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",