@liberfi.io/types 0.1.178 → 0.2.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/README.md +28 -23
- package/dist/index.d.mts +141 -10
- package/dist/index.d.ts +141 -10
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -43,26 +43,29 @@ No peer dependencies required.
|
|
|
43
43
|
| `TokenLiquidity` | Liquidity pool info: pool/pair address, protocol, TVL. |
|
|
44
44
|
| `TokenSecurity` | Security flags: transfer fee, freezable, closable, transferable. |
|
|
45
45
|
| `TokenCandle` | OHLCV candlestick data point with resolution and timestamp. |
|
|
46
|
-
| `TokenHolder` | Single holder: address, amount, USD value, holding ratio.
|
|
46
|
+
| `TokenHolder` | Single holder: address, amount, USD value, holding ratio. Phase 3: `tags`, `lastActiveAt`, `startHoldingAt`. |
|
|
47
|
+
| `HolderTag` | Classification tag for a holder (`kol` / `smart` / `sniper` / `dev` / `bundle` / `bluechip` / `(string & {})`). |
|
|
47
48
|
|
|
48
49
|
### Domain Interfaces — Activity
|
|
49
50
|
|
|
50
|
-
| Type | Description
|
|
51
|
-
| --------------- |
|
|
52
|
-
| `Activity` | On-chain activity record (trade, liquidity, red packet).
|
|
53
|
-
| `ActivityToken` | Token within an activity: address, symbol, amount, USD values.
|
|
54
|
-
| `ActivityDex` | DEX where the activity occurred: name, image, protocol family, program address.
|
|
55
|
-
| `
|
|
51
|
+
| Type | Description |
|
|
52
|
+
| --------------- | ----------------------------------------------------------------------------------------- | -------- |
|
|
53
|
+
| `Activity` | On-chain activity record (trade, liquidity, red packet). Phase 3: `gasFee`, `traderTags`. |
|
|
54
|
+
| `ActivityToken` | Token within an activity: address, symbol, amount, USD values. |
|
|
55
|
+
| `ActivityDex` | DEX where the activity occurred: name, image, protocol family, program address. |
|
|
56
|
+
| `TraderTag` | Classification tag for an activity's trader (same vocabulary as `HolderTag`). |
|
|
57
|
+
| `Trade` | Narrowed subset of `Activity` with `type: "buy" | "sell"`. |
|
|
56
58
|
|
|
57
59
|
### Domain Interfaces — Wallet & Portfolio
|
|
58
60
|
|
|
59
|
-
| Type | Description
|
|
60
|
-
| --------------------- |
|
|
61
|
-
| `Portfolio` | Wallet's token holding: price, amount, decimals
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
61
|
+
| Type | Description |
|
|
62
|
+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| `Portfolio` | Wallet's token holding: price, amount, decimals. Phase 3: `isActive`, `avgCostUsd`, `lastActiveAt`, `walletTokenTags`. |
|
|
64
|
+
| `WalletTokenTag` | Classification tag applied to a wallet-token relationship (e.g. `held`, `sold`, `bluechip`). |
|
|
65
|
+
| `PortfolioPnl` | Per-token PnL details: buy/sell volumes, avg prices, realized/unrealized profit. Phase 3: `isClosed`, `firstBuyAt`, `lastSellAt`. |
|
|
66
|
+
| `WalletPnl` | Wallet-level PnL summary: win rate, total trades, profit breakdown. |
|
|
67
|
+
| `WalletPortfolioPnls` | Paginated portfolio PnL list with wallet-level summary (extends `WalletPnl` + `CursorPagination`). |
|
|
68
|
+
| `WalletPortfolios` | Paginated wallet portfolios with total balance (extends `CursorPagination`). |
|
|
66
69
|
|
|
67
70
|
### API Contract — Pagination
|
|
68
71
|
|
|
@@ -74,15 +77,17 @@ No peer dependencies required.
|
|
|
74
77
|
|
|
75
78
|
### API Contract — Query Options
|
|
76
79
|
|
|
77
|
-
| Type
|
|
78
|
-
|
|
|
79
|
-
| `GetTokenCandlesOptions`
|
|
80
|
-
| `GetTokenListOptions`
|
|
81
|
-
| `SearchTokensOptions`
|
|
82
|
-
| `SearchTokenCursorList`
|
|
83
|
-
| `TokenFilterOption`
|
|
84
|
-
| `GetTradesOptions`
|
|
85
|
-
| `GetActivitiesOptions`
|
|
80
|
+
| Type | Description |
|
|
81
|
+
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `GetTokenCandlesOptions` | Candle query options: `after`, `before` (Date), `limit`. |
|
|
83
|
+
| `GetTokenListOptions` | Token list options: `sortBy`, `sortDirection`, `filters`, `keywords`, `excludeKeywords`. |
|
|
84
|
+
| `SearchTokensOptions` | Search options (extends `CursorListOptions`): `chains`, `keyword`, `filters`, `sortBy`, `sortDirection`. |
|
|
85
|
+
| `SearchTokenCursorList` | Search result (extends `CursorList<Token>`): adds `total` count and `extra` metadata. |
|
|
86
|
+
| `TokenFilterOption` | Filter descriptor: `field` (TokenFieldOption), `operator` (eq/gt/between/in/…), `value`. |
|
|
87
|
+
| `GetTradesOptions` | Trade query options (extends `CursorListOptions`): `before`, `after`, `beforeBlockHeight`, `afterBlockHeight`, `type`, `poolAddress`. |
|
|
88
|
+
| `GetActivitiesOptions` | Activity query options (extends `CursorListOptions`): time/block filters plus `type`, and (Phase 3) `sortBy` (`timestamp` / `totalUsd`). |
|
|
89
|
+
| `GetTokenHoldersOptions` | Token holder query options (extends `CursorListOptions`): Phase 3 `sortBy` (`amount` / `usd` / `ratio` / `lastActiveAt`). |
|
|
90
|
+
| `GetWalletPortfolioPnlsOptions` | Wallet PnL detail query options (extends `CursorListOptions`): Phase 3 `resolution` (required; `1d` / `7d` / `30d` / `all`), `positionState` (`open` / `closed` / `all`), `sortBy` (`pnl` / `totalUsd` / `winRate`). |
|
|
86
91
|
|
|
87
92
|
### API Contract — Swap & Transaction
|
|
88
93
|
|
package/dist/index.d.mts
CHANGED
|
@@ -220,6 +220,11 @@ interface ActivityDex {
|
|
|
220
220
|
programAddress?: string;
|
|
221
221
|
}
|
|
222
222
|
type ActivityType = "buy" | "sell" | "liquidity_initialize" | "liquidity_add" | "liquidity_remove" | "red_packet_create" | "red_packet_claim" | "red_packet_complete" | "red_packet_refund";
|
|
223
|
+
/**
|
|
224
|
+
* Classification tag applied to an activity's trader (Phase 3).
|
|
225
|
+
* Same vocabulary as {@link HolderTag}; sparse (~0.1%–2% fill rate).
|
|
226
|
+
*/
|
|
227
|
+
type TraderTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
|
|
223
228
|
/**
|
|
224
229
|
* An on-chain activity record (trade, liquidity, red packet, etc.).
|
|
225
230
|
*/
|
|
@@ -244,6 +249,16 @@ interface Activity {
|
|
|
244
249
|
status: "pending" | "success" | "failed";
|
|
245
250
|
/** activity time */
|
|
246
251
|
time: Date;
|
|
252
|
+
/**
|
|
253
|
+
* Transaction gas fee as a decimal string in the native token's smallest unit
|
|
254
|
+
* (e.g. lamports on Solana, wei on EVM chains). Phase 3; ~100% fill rate on SOL.
|
|
255
|
+
*/
|
|
256
|
+
gasFee?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Classification tags applied to the trader for this activity (Phase 3).
|
|
259
|
+
* Sparse — only present when the trader matches one of the known patterns.
|
|
260
|
+
*/
|
|
261
|
+
traderTags?: Array<TraderTag>;
|
|
247
262
|
}
|
|
248
263
|
/**
|
|
249
264
|
* A buy/sell trade record. Narrowed subset of {@link Activity}.
|
|
@@ -802,6 +817,11 @@ interface TokenCandle {
|
|
|
802
817
|
*/
|
|
803
818
|
timestamp: Date;
|
|
804
819
|
}
|
|
820
|
+
/**
|
|
821
|
+
* Classification tag applied to a wallet in the context of a specific token holding.
|
|
822
|
+
* See Phase 3 API doc — values are sparse (only 0.1%–2% of holders have tags).
|
|
823
|
+
*/
|
|
824
|
+
type HolderTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
|
|
805
825
|
interface TokenHolder {
|
|
806
826
|
/**
|
|
807
827
|
* holder wallet address
|
|
@@ -819,6 +839,21 @@ interface TokenHolder {
|
|
|
819
839
|
* holdings ratio, range is 0-100
|
|
820
840
|
*/
|
|
821
841
|
ratio: string;
|
|
842
|
+
/**
|
|
843
|
+
* Holder classification tags (Phase 3). Sparse — only present when the
|
|
844
|
+
* wallet matches one of the known patterns (kol/smart/sniper/dev/...).
|
|
845
|
+
*/
|
|
846
|
+
tags?: Array<HolderTag>;
|
|
847
|
+
/**
|
|
848
|
+
* The last time this wallet was active on-chain (Phase 3).
|
|
849
|
+
* Sparse (~80% fill rate).
|
|
850
|
+
*/
|
|
851
|
+
lastActiveAt?: Date;
|
|
852
|
+
/**
|
|
853
|
+
* The first time this wallet started holding this token (Phase 3).
|
|
854
|
+
* Sparse (~60% fill rate).
|
|
855
|
+
*/
|
|
856
|
+
startHoldingAt?: Date;
|
|
822
857
|
}
|
|
823
858
|
|
|
824
859
|
/**
|
|
@@ -835,6 +870,11 @@ interface CursorPagination {
|
|
|
835
870
|
hasNext?: boolean;
|
|
836
871
|
}
|
|
837
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Classification tag applied to a wallet in the context of a specific token position
|
|
875
|
+
* (Phase 3). Same vocabulary as holder/trader tags; sparse.
|
|
876
|
+
*/
|
|
877
|
+
type WalletTokenTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
|
|
838
878
|
/**
|
|
839
879
|
* Portfolio PNL
|
|
840
880
|
*/
|
|
@@ -893,6 +933,15 @@ interface PortfolioPnl {
|
|
|
893
933
|
totalProfitRatio?: string;
|
|
894
934
|
/** average profit per trade in usd */
|
|
895
935
|
avgProfitPerTradeInUsd?: string;
|
|
936
|
+
/**
|
|
937
|
+
* Whether the position is closed (balance == 0). Phase 3; 100% fill rate.
|
|
938
|
+
* Corresponds to `positionState=closed` filter on the pnl-details endpoint.
|
|
939
|
+
*/
|
|
940
|
+
isClosed?: boolean;
|
|
941
|
+
/** First buy time (Phase 3). Sparse (~60% fill rate). */
|
|
942
|
+
firstBuyAt?: Date;
|
|
943
|
+
/** Last sell time (Phase 3). Sparse (~30% fill rate). */
|
|
944
|
+
lastSellAt?: Date;
|
|
896
945
|
}
|
|
897
946
|
interface Portfolio {
|
|
898
947
|
/** chain id */
|
|
@@ -917,6 +966,24 @@ interface Portfolio {
|
|
|
917
966
|
amountInNative: string;
|
|
918
967
|
/** token decimals */
|
|
919
968
|
decimals: number;
|
|
969
|
+
/**
|
|
970
|
+
* Whether the wallet currently holds a positive balance of this token (Phase 3).
|
|
971
|
+
* Always `true` in `net-worth/tokens` responses (the endpoint filters closed positions out).
|
|
972
|
+
*/
|
|
973
|
+
isActive?: boolean;
|
|
974
|
+
/**
|
|
975
|
+
* Average cost basis in USD (Phase 3). Extremely sparse (~0.2% fill rate) —
|
|
976
|
+
* backed by historical buy prices and often unavailable.
|
|
977
|
+
*/
|
|
978
|
+
avgCostUsd?: string;
|
|
979
|
+
/**
|
|
980
|
+
* Last time this wallet operated on this token (Phase 3). Sparse.
|
|
981
|
+
*/
|
|
982
|
+
lastActiveAt?: Date;
|
|
983
|
+
/**
|
|
984
|
+
* Tags applied to the wallet for this specific token position (Phase 3). Sparse.
|
|
985
|
+
*/
|
|
986
|
+
walletTokenTags?: Array<WalletTokenTag>;
|
|
920
987
|
}
|
|
921
988
|
/**
|
|
922
989
|
* Wallet PnL summary
|
|
@@ -1168,6 +1235,12 @@ interface GetTradesOptions extends CursorListOptions {
|
|
|
1168
1235
|
/** filter trades by pool address */
|
|
1169
1236
|
poolAddress?: string;
|
|
1170
1237
|
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Sort field for activity list (Phase 3).
|
|
1240
|
+
* - `timestamp` — order by activity time (default, descending)
|
|
1241
|
+
* - `totalUsd` — order by USD amount (useful for finding whale trades)
|
|
1242
|
+
*/
|
|
1243
|
+
type ActivitiesSortBy = "timestamp" | "totalUsd";
|
|
1171
1244
|
/**
|
|
1172
1245
|
* Options for getting activities
|
|
1173
1246
|
*/
|
|
@@ -1184,6 +1257,60 @@ interface GetActivitiesOptions extends CursorListOptions {
|
|
|
1184
1257
|
type?: ActivityType;
|
|
1185
1258
|
/** filter activities by pool address */
|
|
1186
1259
|
poolAddress?: string;
|
|
1260
|
+
/**
|
|
1261
|
+
* Sort field (Phase 3). Defaults to `timestamp` on the server. When changing
|
|
1262
|
+
* `sortBy`, the caller must discard the previous cursor and restart from page 1.
|
|
1263
|
+
*/
|
|
1264
|
+
sortBy?: ActivitiesSortBy;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Sort field for token holder list (Phase 3).
|
|
1268
|
+
* - `holdingUsd` — order by holding value in USD (default, descending)
|
|
1269
|
+
* - `lastActiveAt` — order by wallet's last activity time
|
|
1270
|
+
*/
|
|
1271
|
+
type TokenHoldersSortBy = "holdingUsd" | "lastActiveAt";
|
|
1272
|
+
/**
|
|
1273
|
+
* Options for getting token holders (Phase 3).
|
|
1274
|
+
*/
|
|
1275
|
+
interface GetTokenHoldersOptions extends CursorListOptions {
|
|
1276
|
+
/**
|
|
1277
|
+
* Sort field. Defaults to `holdingUsd` on the server.
|
|
1278
|
+
* Switching `sortBy` requires discarding the old cursor and restarting from page 1.
|
|
1279
|
+
*/
|
|
1280
|
+
sortBy?: TokenHoldersSortBy;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Resolution window for wallet PnL queries (Phase 3).
|
|
1284
|
+
*/
|
|
1285
|
+
type WalletPnlResolution = "7d" | "30d" | "90d";
|
|
1286
|
+
/**
|
|
1287
|
+
* Position state filter for wallet PnL details (Phase 3).
|
|
1288
|
+
* - `open` — only tokens with current balance > 0 (default)
|
|
1289
|
+
* - `closed` — only tokens with balance == 0 (historical realized PnL)
|
|
1290
|
+
* - `all` — both open and closed positions
|
|
1291
|
+
*/
|
|
1292
|
+
type PositionState = "open" | "closed" | "all";
|
|
1293
|
+
/**
|
|
1294
|
+
* Sort field for wallet PnL details (Phase 3).
|
|
1295
|
+
*/
|
|
1296
|
+
type WalletPnlSortBy = "totalPnl" | "realizedPnl" | "unrealizedPnl";
|
|
1297
|
+
/**
|
|
1298
|
+
* Options for getting wallet portfolio PnL details (Phase 3).
|
|
1299
|
+
*/
|
|
1300
|
+
interface GetWalletPortfolioPnlsOptions extends CursorListOptions {
|
|
1301
|
+
/**
|
|
1302
|
+
* Statistics time window. Defaults to `30d` in the Client implementation
|
|
1303
|
+
* for backward compatibility; the server requires this parameter and will
|
|
1304
|
+
* return 400 if it is missing.
|
|
1305
|
+
*/
|
|
1306
|
+
resolution?: WalletPnlResolution;
|
|
1307
|
+
/** Position state filter. Defaults to `open` on the server. */
|
|
1308
|
+
positionState?: PositionState;
|
|
1309
|
+
/**
|
|
1310
|
+
* Sort field. Defaults to `totalPnl` on the server.
|
|
1311
|
+
* Switching `sortBy` requires discarding the old cursor.
|
|
1312
|
+
*/
|
|
1313
|
+
sortBy?: WalletPnlSortBy;
|
|
1187
1314
|
}
|
|
1188
1315
|
/**
|
|
1189
1316
|
* Resolution subset supported by the trending token list.
|
|
@@ -1234,10 +1361,10 @@ interface IClient {
|
|
|
1234
1361
|
* fetch token holders
|
|
1235
1362
|
* @param chain chain id
|
|
1236
1363
|
* @param address token address
|
|
1237
|
-
* @param options optional query options
|
|
1364
|
+
* @param options optional query options (Phase 3: sortBy)
|
|
1238
1365
|
* @returns token holders
|
|
1239
1366
|
*/
|
|
1240
|
-
getTokenHolders(chain: Chain, address: string, options?:
|
|
1367
|
+
getTokenHolders(chain: Chain, address: string, options?: GetTokenHoldersOptions): Promise<CursorList<TokenHolder>>;
|
|
1241
1368
|
/**
|
|
1242
1369
|
* fetch token market data
|
|
1243
1370
|
* @param chain chain id
|
|
@@ -1336,13 +1463,10 @@ interface IClient {
|
|
|
1336
1463
|
* fetch wallet portfolio PnL details (per-token)
|
|
1337
1464
|
* @param chain chain id
|
|
1338
1465
|
* @param address wallet address
|
|
1339
|
-
* @param options optional query options
|
|
1466
|
+
* @param options optional query options (Phase 3: resolution, positionState, sortBy)
|
|
1340
1467
|
* @returns portfolio pnl list with summary
|
|
1341
1468
|
*/
|
|
1342
|
-
getWalletPortfolioPnls(chain: Chain, address: string, options?:
|
|
1343
|
-
cursor?: string;
|
|
1344
|
-
limit?: number;
|
|
1345
|
-
}): Promise<WalletPortfolioPnls>;
|
|
1469
|
+
getWalletPortfolioPnls(chain: Chain, address: string, options?: GetWalletPortfolioPnlsOptions): Promise<WalletPortfolioPnls>;
|
|
1346
1470
|
/**
|
|
1347
1471
|
* fetch wallet portfolios for specific tokens
|
|
1348
1472
|
* @param chain chain id
|
|
@@ -1555,20 +1679,24 @@ interface ISubscribeClient {
|
|
|
1555
1679
|
subscribeStockTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
|
|
1556
1680
|
}
|
|
1557
1681
|
|
|
1682
|
+
type index_ActivitiesSortBy = ActivitiesSortBy;
|
|
1558
1683
|
type index_BlockchainLatestBlock = BlockchainLatestBlock;
|
|
1559
1684
|
type index_CursorList<T> = CursorList<T>;
|
|
1560
1685
|
type index_CursorListOptions = CursorListOptions;
|
|
1561
1686
|
type index_CursorPagination = CursorPagination;
|
|
1562
1687
|
type index_GetActivitiesOptions = GetActivitiesOptions;
|
|
1563
1688
|
type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
|
|
1689
|
+
type index_GetTokenHoldersOptions = GetTokenHoldersOptions;
|
|
1564
1690
|
type index_GetTokenListOptions = GetTokenListOptions;
|
|
1565
1691
|
type index_GetTradesOptions = GetTradesOptions;
|
|
1692
|
+
type index_GetWalletPortfolioPnlsOptions = GetWalletPortfolioPnlsOptions;
|
|
1566
1693
|
type index_IClient = IClient;
|
|
1567
1694
|
type index_ISubscribeClient = ISubscribeClient;
|
|
1568
1695
|
type index_ISubscription = ISubscription;
|
|
1569
1696
|
type index_LatestBlockParams = LatestBlockParams;
|
|
1570
1697
|
type index_PortfolioPnlSubscribed = PortfolioPnlSubscribed;
|
|
1571
1698
|
type index_PortfolioSubscribed = PortfolioSubscribed;
|
|
1699
|
+
type index_PositionState = PositionState;
|
|
1572
1700
|
type index_SearchTokenCursorList = SearchTokenCursorList;
|
|
1573
1701
|
type index_SearchTokensOptions = SearchTokensOptions;
|
|
1574
1702
|
type index_SendTxParams = SendTxParams;
|
|
@@ -1581,11 +1709,14 @@ type index_SwapRoute = SwapRoute;
|
|
|
1581
1709
|
type index_SwapRoutePlan = SwapRoutePlan;
|
|
1582
1710
|
type index_TokenFieldOption = TokenFieldOption;
|
|
1583
1711
|
type index_TokenFilterOption = TokenFilterOption;
|
|
1712
|
+
type index_TokenHoldersSortBy = TokenHoldersSortBy;
|
|
1584
1713
|
type index_TokenSubscribed = TokenSubscribed;
|
|
1585
1714
|
type index_TrendingResolution = TrendingResolution;
|
|
1715
|
+
type index_WalletPnlResolution = WalletPnlResolution;
|
|
1716
|
+
type index_WalletPnlSortBy = WalletPnlSortBy;
|
|
1586
1717
|
type index_WalletPnlSubscribed = WalletPnlSubscribed;
|
|
1587
1718
|
declare namespace index {
|
|
1588
|
-
export { type index_BlockchainLatestBlock as BlockchainLatestBlock, type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_CursorPagination as CursorPagination, type index_GetActivitiesOptions as GetActivitiesOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradesOptions as GetTradesOptions, type index_IClient as IClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_LatestBlockParams as LatestBlockParams, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, type index_SwapDex as SwapDex, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenSubscribed as TokenSubscribed, type index_TrendingResolution as TrendingResolution, type index_WalletPnlSubscribed as WalletPnlSubscribed };
|
|
1719
|
+
export { type index_ActivitiesSortBy as ActivitiesSortBy, type index_BlockchainLatestBlock as BlockchainLatestBlock, type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_CursorPagination as CursorPagination, type index_GetActivitiesOptions as GetActivitiesOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenHoldersOptions as GetTokenHoldersOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradesOptions as GetTradesOptions, type index_GetWalletPortfolioPnlsOptions as GetWalletPortfolioPnlsOptions, type index_IClient as IClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_LatestBlockParams as LatestBlockParams, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_PositionState as PositionState, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, type index_SwapDex as SwapDex, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenHoldersSortBy as TokenHoldersSortBy, type index_TokenSubscribed as TokenSubscribed, type index_TrendingResolution as TrendingResolution, type index_WalletPnlResolution as WalletPnlResolution, type index_WalletPnlSortBy as WalletPnlSortBy, type index_WalletPnlSubscribed as WalletPnlSubscribed };
|
|
1589
1720
|
}
|
|
1590
1721
|
|
|
1591
1722
|
declare global {
|
|
@@ -1595,6 +1726,6 @@ declare global {
|
|
|
1595
1726
|
};
|
|
1596
1727
|
}
|
|
1597
1728
|
}
|
|
1598
|
-
declare const _default: "0.
|
|
1729
|
+
declare const _default: "0.2.0";
|
|
1599
1730
|
|
|
1600
|
-
export { index as API, type Activity, type ActivityDex, type ActivityToken, type ActivityType, type BlockchainLatestBlock, Chain, ChainNamespace, type CursorList, type CursorListOptions, type CursorPagination, type GetActivitiesOptions, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradesOptions, type IClient, type ISubscribeClient, type ISubscription, type LatestBlockParams, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, type SwapDex, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHolder, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type Trade, type TrendingResolution, type WalletPnl, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, _default as version };
|
|
1731
|
+
export { index as API, type ActivitiesSortBy, type Activity, type ActivityDex, type ActivityToken, type ActivityType, type BlockchainLatestBlock, Chain, ChainNamespace, type CursorList, type CursorListOptions, type CursorPagination, type GetActivitiesOptions, type GetTokenCandlesOptions, type GetTokenHoldersOptions, type GetTokenListOptions, type GetTradesOptions, type GetWalletPortfolioPnlsOptions, type HolderTag, type IClient, type ISubscribeClient, type ISubscription, type LatestBlockParams, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, type PositionState, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, type SwapDex, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHolder, type TokenHoldersSortBy, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type Trade, type TraderTag, type TrendingResolution, type WalletPnl, type WalletPnlResolution, type WalletPnlSortBy, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, type WalletTokenTag, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -220,6 +220,11 @@ interface ActivityDex {
|
|
|
220
220
|
programAddress?: string;
|
|
221
221
|
}
|
|
222
222
|
type ActivityType = "buy" | "sell" | "liquidity_initialize" | "liquidity_add" | "liquidity_remove" | "red_packet_create" | "red_packet_claim" | "red_packet_complete" | "red_packet_refund";
|
|
223
|
+
/**
|
|
224
|
+
* Classification tag applied to an activity's trader (Phase 3).
|
|
225
|
+
* Same vocabulary as {@link HolderTag}; sparse (~0.1%–2% fill rate).
|
|
226
|
+
*/
|
|
227
|
+
type TraderTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
|
|
223
228
|
/**
|
|
224
229
|
* An on-chain activity record (trade, liquidity, red packet, etc.).
|
|
225
230
|
*/
|
|
@@ -244,6 +249,16 @@ interface Activity {
|
|
|
244
249
|
status: "pending" | "success" | "failed";
|
|
245
250
|
/** activity time */
|
|
246
251
|
time: Date;
|
|
252
|
+
/**
|
|
253
|
+
* Transaction gas fee as a decimal string in the native token's smallest unit
|
|
254
|
+
* (e.g. lamports on Solana, wei on EVM chains). Phase 3; ~100% fill rate on SOL.
|
|
255
|
+
*/
|
|
256
|
+
gasFee?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Classification tags applied to the trader for this activity (Phase 3).
|
|
259
|
+
* Sparse — only present when the trader matches one of the known patterns.
|
|
260
|
+
*/
|
|
261
|
+
traderTags?: Array<TraderTag>;
|
|
247
262
|
}
|
|
248
263
|
/**
|
|
249
264
|
* A buy/sell trade record. Narrowed subset of {@link Activity}.
|
|
@@ -802,6 +817,11 @@ interface TokenCandle {
|
|
|
802
817
|
*/
|
|
803
818
|
timestamp: Date;
|
|
804
819
|
}
|
|
820
|
+
/**
|
|
821
|
+
* Classification tag applied to a wallet in the context of a specific token holding.
|
|
822
|
+
* See Phase 3 API doc — values are sparse (only 0.1%–2% of holders have tags).
|
|
823
|
+
*/
|
|
824
|
+
type HolderTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
|
|
805
825
|
interface TokenHolder {
|
|
806
826
|
/**
|
|
807
827
|
* holder wallet address
|
|
@@ -819,6 +839,21 @@ interface TokenHolder {
|
|
|
819
839
|
* holdings ratio, range is 0-100
|
|
820
840
|
*/
|
|
821
841
|
ratio: string;
|
|
842
|
+
/**
|
|
843
|
+
* Holder classification tags (Phase 3). Sparse — only present when the
|
|
844
|
+
* wallet matches one of the known patterns (kol/smart/sniper/dev/...).
|
|
845
|
+
*/
|
|
846
|
+
tags?: Array<HolderTag>;
|
|
847
|
+
/**
|
|
848
|
+
* The last time this wallet was active on-chain (Phase 3).
|
|
849
|
+
* Sparse (~80% fill rate).
|
|
850
|
+
*/
|
|
851
|
+
lastActiveAt?: Date;
|
|
852
|
+
/**
|
|
853
|
+
* The first time this wallet started holding this token (Phase 3).
|
|
854
|
+
* Sparse (~60% fill rate).
|
|
855
|
+
*/
|
|
856
|
+
startHoldingAt?: Date;
|
|
822
857
|
}
|
|
823
858
|
|
|
824
859
|
/**
|
|
@@ -835,6 +870,11 @@ interface CursorPagination {
|
|
|
835
870
|
hasNext?: boolean;
|
|
836
871
|
}
|
|
837
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Classification tag applied to a wallet in the context of a specific token position
|
|
875
|
+
* (Phase 3). Same vocabulary as holder/trader tags; sparse.
|
|
876
|
+
*/
|
|
877
|
+
type WalletTokenTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
|
|
838
878
|
/**
|
|
839
879
|
* Portfolio PNL
|
|
840
880
|
*/
|
|
@@ -893,6 +933,15 @@ interface PortfolioPnl {
|
|
|
893
933
|
totalProfitRatio?: string;
|
|
894
934
|
/** average profit per trade in usd */
|
|
895
935
|
avgProfitPerTradeInUsd?: string;
|
|
936
|
+
/**
|
|
937
|
+
* Whether the position is closed (balance == 0). Phase 3; 100% fill rate.
|
|
938
|
+
* Corresponds to `positionState=closed` filter on the pnl-details endpoint.
|
|
939
|
+
*/
|
|
940
|
+
isClosed?: boolean;
|
|
941
|
+
/** First buy time (Phase 3). Sparse (~60% fill rate). */
|
|
942
|
+
firstBuyAt?: Date;
|
|
943
|
+
/** Last sell time (Phase 3). Sparse (~30% fill rate). */
|
|
944
|
+
lastSellAt?: Date;
|
|
896
945
|
}
|
|
897
946
|
interface Portfolio {
|
|
898
947
|
/** chain id */
|
|
@@ -917,6 +966,24 @@ interface Portfolio {
|
|
|
917
966
|
amountInNative: string;
|
|
918
967
|
/** token decimals */
|
|
919
968
|
decimals: number;
|
|
969
|
+
/**
|
|
970
|
+
* Whether the wallet currently holds a positive balance of this token (Phase 3).
|
|
971
|
+
* Always `true` in `net-worth/tokens` responses (the endpoint filters closed positions out).
|
|
972
|
+
*/
|
|
973
|
+
isActive?: boolean;
|
|
974
|
+
/**
|
|
975
|
+
* Average cost basis in USD (Phase 3). Extremely sparse (~0.2% fill rate) —
|
|
976
|
+
* backed by historical buy prices and often unavailable.
|
|
977
|
+
*/
|
|
978
|
+
avgCostUsd?: string;
|
|
979
|
+
/**
|
|
980
|
+
* Last time this wallet operated on this token (Phase 3). Sparse.
|
|
981
|
+
*/
|
|
982
|
+
lastActiveAt?: Date;
|
|
983
|
+
/**
|
|
984
|
+
* Tags applied to the wallet for this specific token position (Phase 3). Sparse.
|
|
985
|
+
*/
|
|
986
|
+
walletTokenTags?: Array<WalletTokenTag>;
|
|
920
987
|
}
|
|
921
988
|
/**
|
|
922
989
|
* Wallet PnL summary
|
|
@@ -1168,6 +1235,12 @@ interface GetTradesOptions extends CursorListOptions {
|
|
|
1168
1235
|
/** filter trades by pool address */
|
|
1169
1236
|
poolAddress?: string;
|
|
1170
1237
|
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Sort field for activity list (Phase 3).
|
|
1240
|
+
* - `timestamp` — order by activity time (default, descending)
|
|
1241
|
+
* - `totalUsd` — order by USD amount (useful for finding whale trades)
|
|
1242
|
+
*/
|
|
1243
|
+
type ActivitiesSortBy = "timestamp" | "totalUsd";
|
|
1171
1244
|
/**
|
|
1172
1245
|
* Options for getting activities
|
|
1173
1246
|
*/
|
|
@@ -1184,6 +1257,60 @@ interface GetActivitiesOptions extends CursorListOptions {
|
|
|
1184
1257
|
type?: ActivityType;
|
|
1185
1258
|
/** filter activities by pool address */
|
|
1186
1259
|
poolAddress?: string;
|
|
1260
|
+
/**
|
|
1261
|
+
* Sort field (Phase 3). Defaults to `timestamp` on the server. When changing
|
|
1262
|
+
* `sortBy`, the caller must discard the previous cursor and restart from page 1.
|
|
1263
|
+
*/
|
|
1264
|
+
sortBy?: ActivitiesSortBy;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Sort field for token holder list (Phase 3).
|
|
1268
|
+
* - `holdingUsd` — order by holding value in USD (default, descending)
|
|
1269
|
+
* - `lastActiveAt` — order by wallet's last activity time
|
|
1270
|
+
*/
|
|
1271
|
+
type TokenHoldersSortBy = "holdingUsd" | "lastActiveAt";
|
|
1272
|
+
/**
|
|
1273
|
+
* Options for getting token holders (Phase 3).
|
|
1274
|
+
*/
|
|
1275
|
+
interface GetTokenHoldersOptions extends CursorListOptions {
|
|
1276
|
+
/**
|
|
1277
|
+
* Sort field. Defaults to `holdingUsd` on the server.
|
|
1278
|
+
* Switching `sortBy` requires discarding the old cursor and restarting from page 1.
|
|
1279
|
+
*/
|
|
1280
|
+
sortBy?: TokenHoldersSortBy;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Resolution window for wallet PnL queries (Phase 3).
|
|
1284
|
+
*/
|
|
1285
|
+
type WalletPnlResolution = "7d" | "30d" | "90d";
|
|
1286
|
+
/**
|
|
1287
|
+
* Position state filter for wallet PnL details (Phase 3).
|
|
1288
|
+
* - `open` — only tokens with current balance > 0 (default)
|
|
1289
|
+
* - `closed` — only tokens with balance == 0 (historical realized PnL)
|
|
1290
|
+
* - `all` — both open and closed positions
|
|
1291
|
+
*/
|
|
1292
|
+
type PositionState = "open" | "closed" | "all";
|
|
1293
|
+
/**
|
|
1294
|
+
* Sort field for wallet PnL details (Phase 3).
|
|
1295
|
+
*/
|
|
1296
|
+
type WalletPnlSortBy = "totalPnl" | "realizedPnl" | "unrealizedPnl";
|
|
1297
|
+
/**
|
|
1298
|
+
* Options for getting wallet portfolio PnL details (Phase 3).
|
|
1299
|
+
*/
|
|
1300
|
+
interface GetWalletPortfolioPnlsOptions extends CursorListOptions {
|
|
1301
|
+
/**
|
|
1302
|
+
* Statistics time window. Defaults to `30d` in the Client implementation
|
|
1303
|
+
* for backward compatibility; the server requires this parameter and will
|
|
1304
|
+
* return 400 if it is missing.
|
|
1305
|
+
*/
|
|
1306
|
+
resolution?: WalletPnlResolution;
|
|
1307
|
+
/** Position state filter. Defaults to `open` on the server. */
|
|
1308
|
+
positionState?: PositionState;
|
|
1309
|
+
/**
|
|
1310
|
+
* Sort field. Defaults to `totalPnl` on the server.
|
|
1311
|
+
* Switching `sortBy` requires discarding the old cursor.
|
|
1312
|
+
*/
|
|
1313
|
+
sortBy?: WalletPnlSortBy;
|
|
1187
1314
|
}
|
|
1188
1315
|
/**
|
|
1189
1316
|
* Resolution subset supported by the trending token list.
|
|
@@ -1234,10 +1361,10 @@ interface IClient {
|
|
|
1234
1361
|
* fetch token holders
|
|
1235
1362
|
* @param chain chain id
|
|
1236
1363
|
* @param address token address
|
|
1237
|
-
* @param options optional query options
|
|
1364
|
+
* @param options optional query options (Phase 3: sortBy)
|
|
1238
1365
|
* @returns token holders
|
|
1239
1366
|
*/
|
|
1240
|
-
getTokenHolders(chain: Chain, address: string, options?:
|
|
1367
|
+
getTokenHolders(chain: Chain, address: string, options?: GetTokenHoldersOptions): Promise<CursorList<TokenHolder>>;
|
|
1241
1368
|
/**
|
|
1242
1369
|
* fetch token market data
|
|
1243
1370
|
* @param chain chain id
|
|
@@ -1336,13 +1463,10 @@ interface IClient {
|
|
|
1336
1463
|
* fetch wallet portfolio PnL details (per-token)
|
|
1337
1464
|
* @param chain chain id
|
|
1338
1465
|
* @param address wallet address
|
|
1339
|
-
* @param options optional query options
|
|
1466
|
+
* @param options optional query options (Phase 3: resolution, positionState, sortBy)
|
|
1340
1467
|
* @returns portfolio pnl list with summary
|
|
1341
1468
|
*/
|
|
1342
|
-
getWalletPortfolioPnls(chain: Chain, address: string, options?:
|
|
1343
|
-
cursor?: string;
|
|
1344
|
-
limit?: number;
|
|
1345
|
-
}): Promise<WalletPortfolioPnls>;
|
|
1469
|
+
getWalletPortfolioPnls(chain: Chain, address: string, options?: GetWalletPortfolioPnlsOptions): Promise<WalletPortfolioPnls>;
|
|
1346
1470
|
/**
|
|
1347
1471
|
* fetch wallet portfolios for specific tokens
|
|
1348
1472
|
* @param chain chain id
|
|
@@ -1555,20 +1679,24 @@ interface ISubscribeClient {
|
|
|
1555
1679
|
subscribeStockTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
|
|
1556
1680
|
}
|
|
1557
1681
|
|
|
1682
|
+
type index_ActivitiesSortBy = ActivitiesSortBy;
|
|
1558
1683
|
type index_BlockchainLatestBlock = BlockchainLatestBlock;
|
|
1559
1684
|
type index_CursorList<T> = CursorList<T>;
|
|
1560
1685
|
type index_CursorListOptions = CursorListOptions;
|
|
1561
1686
|
type index_CursorPagination = CursorPagination;
|
|
1562
1687
|
type index_GetActivitiesOptions = GetActivitiesOptions;
|
|
1563
1688
|
type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
|
|
1689
|
+
type index_GetTokenHoldersOptions = GetTokenHoldersOptions;
|
|
1564
1690
|
type index_GetTokenListOptions = GetTokenListOptions;
|
|
1565
1691
|
type index_GetTradesOptions = GetTradesOptions;
|
|
1692
|
+
type index_GetWalletPortfolioPnlsOptions = GetWalletPortfolioPnlsOptions;
|
|
1566
1693
|
type index_IClient = IClient;
|
|
1567
1694
|
type index_ISubscribeClient = ISubscribeClient;
|
|
1568
1695
|
type index_ISubscription = ISubscription;
|
|
1569
1696
|
type index_LatestBlockParams = LatestBlockParams;
|
|
1570
1697
|
type index_PortfolioPnlSubscribed = PortfolioPnlSubscribed;
|
|
1571
1698
|
type index_PortfolioSubscribed = PortfolioSubscribed;
|
|
1699
|
+
type index_PositionState = PositionState;
|
|
1572
1700
|
type index_SearchTokenCursorList = SearchTokenCursorList;
|
|
1573
1701
|
type index_SearchTokensOptions = SearchTokensOptions;
|
|
1574
1702
|
type index_SendTxParams = SendTxParams;
|
|
@@ -1581,11 +1709,14 @@ type index_SwapRoute = SwapRoute;
|
|
|
1581
1709
|
type index_SwapRoutePlan = SwapRoutePlan;
|
|
1582
1710
|
type index_TokenFieldOption = TokenFieldOption;
|
|
1583
1711
|
type index_TokenFilterOption = TokenFilterOption;
|
|
1712
|
+
type index_TokenHoldersSortBy = TokenHoldersSortBy;
|
|
1584
1713
|
type index_TokenSubscribed = TokenSubscribed;
|
|
1585
1714
|
type index_TrendingResolution = TrendingResolution;
|
|
1715
|
+
type index_WalletPnlResolution = WalletPnlResolution;
|
|
1716
|
+
type index_WalletPnlSortBy = WalletPnlSortBy;
|
|
1586
1717
|
type index_WalletPnlSubscribed = WalletPnlSubscribed;
|
|
1587
1718
|
declare namespace index {
|
|
1588
|
-
export { type index_BlockchainLatestBlock as BlockchainLatestBlock, type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_CursorPagination as CursorPagination, type index_GetActivitiesOptions as GetActivitiesOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradesOptions as GetTradesOptions, type index_IClient as IClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_LatestBlockParams as LatestBlockParams, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, type index_SwapDex as SwapDex, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenSubscribed as TokenSubscribed, type index_TrendingResolution as TrendingResolution, type index_WalletPnlSubscribed as WalletPnlSubscribed };
|
|
1719
|
+
export { type index_ActivitiesSortBy as ActivitiesSortBy, type index_BlockchainLatestBlock as BlockchainLatestBlock, type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_CursorPagination as CursorPagination, type index_GetActivitiesOptions as GetActivitiesOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenHoldersOptions as GetTokenHoldersOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradesOptions as GetTradesOptions, type index_GetWalletPortfolioPnlsOptions as GetWalletPortfolioPnlsOptions, type index_IClient as IClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_LatestBlockParams as LatestBlockParams, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_PositionState as PositionState, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, type index_SwapDex as SwapDex, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenHoldersSortBy as TokenHoldersSortBy, type index_TokenSubscribed as TokenSubscribed, type index_TrendingResolution as TrendingResolution, type index_WalletPnlResolution as WalletPnlResolution, type index_WalletPnlSortBy as WalletPnlSortBy, type index_WalletPnlSubscribed as WalletPnlSubscribed };
|
|
1589
1720
|
}
|
|
1590
1721
|
|
|
1591
1722
|
declare global {
|
|
@@ -1595,6 +1726,6 @@ declare global {
|
|
|
1595
1726
|
};
|
|
1596
1727
|
}
|
|
1597
1728
|
}
|
|
1598
|
-
declare const _default: "0.
|
|
1729
|
+
declare const _default: "0.2.0";
|
|
1599
1730
|
|
|
1600
|
-
export { index as API, type Activity, type ActivityDex, type ActivityToken, type ActivityType, type BlockchainLatestBlock, Chain, ChainNamespace, type CursorList, type CursorListOptions, type CursorPagination, type GetActivitiesOptions, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradesOptions, type IClient, type ISubscribeClient, type ISubscription, type LatestBlockParams, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, type SwapDex, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHolder, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type Trade, type TrendingResolution, type WalletPnl, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, _default as version };
|
|
1731
|
+
export { index as API, type ActivitiesSortBy, type Activity, type ActivityDex, type ActivityToken, type ActivityType, type BlockchainLatestBlock, Chain, ChainNamespace, type CursorList, type CursorListOptions, type CursorPagination, type GetActivitiesOptions, type GetTokenCandlesOptions, type GetTokenHoldersOptions, type GetTokenListOptions, type GetTradesOptions, type GetWalletPortfolioPnlsOptions, type HolderTag, type IClient, type ISubscribeClient, type ISubscription, type LatestBlockParams, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, type PositionState, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, type SwapDex, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHolder, type TokenHoldersSortBy, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type Trade, type TraderTag, type TrendingResolution, type WalletPnl, type WalletPnlResolution, type WalletPnlSortBy, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, type WalletTokenTag, _default as version };
|
package/dist/index.js
CHANGED
|
@@ -46,9 +46,9 @@ var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
|
|
|
46
46
|
// src/version.ts
|
|
47
47
|
if (typeof window !== "undefined") {
|
|
48
48
|
window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};
|
|
49
|
-
window.__LIBERFI_VERSION__["@liberfi.io/types"] = "0.
|
|
49
|
+
window.__LIBERFI_VERSION__["@liberfi.io/types"] = "0.2.0";
|
|
50
50
|
}
|
|
51
|
-
var version_default = "0.
|
|
51
|
+
var version_default = "0.2.0";
|
|
52
52
|
|
|
53
53
|
// src/chains.ts
|
|
54
54
|
var Chain = /* @__PURE__ */ ((Chain2) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/api/index.ts","../src/api/dex.ts","../src/version.ts","../src/chains.ts","../src/token.ts"],"sourcesContent":["import * as API from \"./api\";\n\nexport { default as version } from \"./version\";\nexport * from \"./api\";\nexport * from \"./activity\";\nexport * from \"./chains\";\nexport * from \"./token\";\nexport * from \"./wallet\";\n\n// Re-export as API namespace for backward compatibility\nexport { API };\n","export * from \"./dex\";\nexport * from \"./pagination\";\n","import { Activity, ActivityType, Trade } from \"../activity\";\nimport { Chain } from \"../chains\";\nimport {\n Token,\n TokenCandle,\n TokenHolder,\n TokenMarketData,\n TokenResolution,\n TokenSecurity,\n TokenStats,\n} from \"../token\";\nimport {\n Portfolio,\n PortfolioPnl,\n WalletPnl,\n WalletPortfolioPnls,\n WalletPortfolios,\n} from \"../wallet\";\nimport { CursorPagination } from \"./pagination\";\n\n/**\n * Cursor list result data\n */\nexport interface CursorList<T> extends CursorPagination {\n data: Array<T>;\n}\n\n/**\n * Cursor list query options\n */\nexport interface CursorListOptions {\n /** query cursor */\n cursor?: string;\n /** return limit */\n limit?: number;\n /** query direction */\n direction?: \"next\" | \"prev\";\n}\n\n/**\n * Options for getting token candles\n */\nexport interface GetTokenCandlesOptions {\n /** query candles after this timestamp */\n after?: Date;\n /** query candles before this timestamp */\n before?: Date;\n /** return limit */\n limit?: number;\n}\n\n/**\n * Token field for filtering\n */\nexport type TokenFieldOption =\n | \"price\"\n | \"priceChange1m\"\n | \"priceChange5m\"\n | \"priceChange15m\"\n | \"priceChange30m\"\n | \"priceChange1h\"\n | \"priceChange4h\"\n | \"priceChange24h\"\n | \"marketCap\"\n | \"tvl\"\n | \"top10Holdings\"\n | \"top10Ratio\"\n | \"top100Holdings\"\n | \"top100Ratio\"\n | \"holders\"\n | \"creatorsHoldings\"\n | \"creatorsRatio\"\n | \"buys1m\"\n | \"buys5m\"\n | \"buys15m\"\n | \"buys30m\"\n | \"buys1h\"\n | \"buys4h\"\n | \"buys24h\"\n | \"sells1m\"\n | \"sells5m\"\n | \"sells15m\"\n | \"sells30m\"\n | \"sells1h\"\n | \"sells4h\"\n | \"sells24h\"\n | \"trades1m\"\n | \"trades5m\"\n | \"trades15m\"\n | \"trades30m\"\n | \"trades1h\"\n | \"trades4h\"\n | \"trades24h\"\n | \"traders1m\"\n | \"traders5m\"\n | \"traders15m\"\n | \"traders30m\"\n | \"traders1h\"\n | \"traders4h\"\n | \"traders24h\"\n | \"volumes1m\"\n | \"volumes5m\"\n | \"volumes15m\"\n | \"volumes30m\"\n | \"volumes1h\"\n | \"volumes4h\"\n | \"volumes24h\"\n | \"launchedFromProtocolFamily\"\n | \"migratedToProtocolFamily\"\n | \"tag\"\n | \"createdAt\"\n | (string & {});\n\n/**\n * Token filter option\n */\nexport interface TokenFilterOption {\n field: TokenFieldOption;\n operator:\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\"\n | \"between\"\n | \"in\"\n | \"nin\"\n | \"contains\"\n | \"notContains\"\n | \"startsWith\"\n | \"endsWith\"\n | \"isNotNull\"\n | \"isNull\";\n value?: string | number | boolean | Array<string | number | boolean>;\n}\n\n/**\n * Options for getting token list\n */\nexport interface GetTokenListOptions {\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** search keywords */\n keywords?: Array<string>;\n /** exclude keywords */\n excludeKeywords?: Array<string>;\n}\n\n/**\n * Options for searching tokens\n */\nexport interface SearchTokensOptions extends CursorListOptions {\n /** chains */\n chains?: Array<Chain>;\n /** search keyword */\n keyword?: string;\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n}\n\n/**\n * Search token cursor list\n */\nexport interface SearchTokenCursorList extends CursorList<Token> {\n /** total count */\n total?: number;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport enum SwapMode {\n EXACT_IN = \"exact_in\",\n EXACT_OUT = \"exact_out\",\n}\n\n/** DEX identifier used for route / mint address conversion. */\nexport type SwapDex = \"jupiter\" | \"kyberswap\";\n\nexport interface SwapParams {\n /** chain id */\n chain: Chain;\n /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */\n dex?: SwapDex;\n /** user wallet address */\n userAddress: string;\n /** input token address */\n input: string;\n /** output token address */\n output: string;\n /** swap mode, e.g. ExactIn, ExactOut */\n mode: SwapMode;\n /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */\n amount: string;\n /** slippage, range is 0-100 */\n slippage?: number;\n /** priority fee */\n priorityFee?: string;\n /** tip fee */\n tipFee?: string;\n /** whether to use anti-MEV */\n isAntiMev?: boolean;\n /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */\n permit?: string;\n /** deadline timestamp in ms (EVM only) */\n deadline?: number;\n}\n\nexport interface SwapRoutePlan {\n /** protocol name / dex name etc. */\n name: string;\n /** input token address */\n input: string;\n /** input token amount */\n inputAmount: string;\n /** output token address */\n output: string;\n /** output token amount */\n outputAmount: string;\n /** fee quote token address */\n feeQuote?: string;\n /** fee amount */\n feeAmount?: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SwapRoute {\n /** unsigned tx in base64 format */\n serializedTx: string;\n /** recent blockhash embedded in the unsigned Solana transaction */\n recentBlockhash?: string;\n /** last block height at which the embedded Solana blockhash remains valid */\n lastValidBlockHeight?: number;\n /** swap plans */\n plans: Array<SwapRoutePlan>;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface LatestBlockParams {\n /** chain id */\n chain: Chain;\n}\n\nexport interface BlockchainLatestBlock {\n /** latest block hash */\n blockhash: string;\n /** last valid block height for transactions built with the latest blockhash */\n lastValidBlockHeight: number;\n}\n\nexport interface SendTxParams {\n /** chain id */\n chain: Chain;\n /** signed tx in base64 format */\n serializedTx: string;\n /** extra infos needed by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SendTxResult {\n /** tx hash */\n txHash: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\n/**\n * Options for getting trades\n */\nexport interface GetTradesOptions extends CursorListOptions {\n /** filter trades before this timestamp */\n before?: Date;\n /** filter trades after this timestamp */\n after?: Date;\n /** filter trades before this block height */\n beforeBlockHeight?: number;\n /** filter trades after this block height */\n afterBlockHeight?: number;\n /** filter trades by type */\n type?: \"buy\" | \"sell\";\n /** filter trades by pool address */\n poolAddress?: string;\n}\n\n/**\n * Options for getting activities\n */\nexport interface GetActivitiesOptions extends CursorListOptions {\n /** filter activities before this timestamp */\n before?: Date;\n /** filter activities after this timestamp */\n after?: Date;\n /** filter activities before this block height */\n beforeBlockHeight?: number;\n /** filter activities after this block height */\n afterBlockHeight?: number;\n /** filter activities by type */\n type?: ActivityType;\n /** filter activities by pool address */\n poolAddress?: string;\n}\n\n/**\n * Resolution subset supported by the trending token list.\n */\nexport type TrendingResolution = Extract<\n TokenResolution,\n \"1m\" | \"5m\" | \"1h\" | \"4h\" | \"24h\"\n>;\n\n/**\n * API client interface\n */\nexport interface IClient {\n /**\n * fetch token info\n * @param chain chain id\n * @param address token address\n * @returns token info\n */\n getToken(chain: Chain, address: string): Promise<Token>;\n\n /**\n * fetch token infos in batch\n * @param chain chain id\n * @param addresses token addresses\n * @returns token infos\n */\n getTokens(chain: Chain, addresses: Array<string>): Promise<Array<Token>>;\n\n /**\n * fetch token candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param options optional query options\n * @returns token candles\n */\n getTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n options?: GetTokenCandlesOptions,\n ): Promise<Array<TokenCandle>>;\n\n /**\n * fetch token security\n * @param chain chain id\n * @param address token address\n * @returns token security\n */\n getTokenSecurity(chain: Chain, address: string): Promise<TokenSecurity>;\n\n /**\n * fetch token stats\n * @param chain chain id\n * @param address token address\n * @returns token stats\n */\n getTokenStats(chain: Chain, address: string): Promise<TokenStats>;\n\n /**\n * fetch token holders\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token holders\n */\n getTokenHolders(\n chain: Chain,\n address: string,\n options?: CursorListOptions,\n ): Promise<CursorList<TokenHolder>>;\n\n /**\n * fetch token market data\n * @param chain chain id\n * @param address token address\n * @returns token market data\n */\n getTokenMarketData(chain: Chain, address: string): Promise<TokenMarketData>;\n\n /**\n * fetch `New` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `New` token list\n */\n getNewTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Final Stretch` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Final Stretch` token list\n */\n getFinalStretchTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Migrated` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Migrated` token list\n */\n getMigratedTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Trending` token list\n * @param chain chain id\n * @param resolution query resolution, e.g. \"1m\", \"5m\", \"1h\", \"4h\", \"24h\"\n * @param options optional query options\n * @returns `Trending` token list\n */\n getTrendingTokens(\n chain: Chain,\n resolution: TrendingResolution,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Stock` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Stock` token list\n */\n getStockTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * search tokens\n * @param options optional query options\n * @returns search token cursor list\n */\n searchTokens(options?: SearchTokensOptions): Promise<SearchTokenCursorList>;\n\n /**\n * fetch swap route plans\n * @param params swap params\n * @returns swap route plans\n */\n swapRoute(params: SwapParams): Promise<SwapRoute>;\n\n /**\n * fetch latest block metadata\n * @param params latest block params\n * @returns latest block metadata\n */\n getLatestBlock(params: LatestBlockParams): Promise<BlockchainLatestBlock>;\n\n /**\n * send tx\n * @param params send tx params\n * @returns send tx result\n */\n sendTx(params: SendTxParams): Promise<SendTxResult>;\n\n /**\n * check if tx is successful\n * @param chain chain id\n * @param txHash tx hash\n * @param timeout timeout in milliseconds\n * @returns true if tx is successful, false otherwise\n */\n checkTxSuccess(\n chain: Chain,\n txHash: string,\n timeout?: number,\n ): Promise<boolean>;\n\n /**\n * fetch wallet portfolios\n * @param chain chain id\n * @param address wallet address\n * @param options optional pagination options\n * @returns wallet portfolios\n */\n getWalletPortfolios(\n chain: Chain,\n address: string,\n options?: { cursor?: string; limit?: number },\n ): Promise<WalletPortfolios>;\n\n /**\n * fetch wallet PnL summary\n * @param chain chain id\n * @param address wallet address\n * @param resolution pnl resolution (e.g. \"7d\", \"30d\")\n * @returns wallet pnl summary\n */\n getWalletPnl(\n chain: Chain,\n address: string,\n resolution?: string,\n ): Promise<WalletPnl>;\n\n /**\n * fetch wallet portfolio PnL details (per-token)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns portfolio pnl list with summary\n */\n getWalletPortfolioPnls(\n chain: Chain,\n address: string,\n options?: { cursor?: string; limit?: number },\n ): Promise<WalletPortfolioPnls>;\n\n /**\n * fetch wallet portfolios for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio list for the specified tokens\n */\n getWalletPortfoliosByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<Portfolio>>;\n\n /**\n * fetch wallet portfolio PnL for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio pnl list for the specified tokens\n */\n getWalletPortfolioPnlsByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<PortfolioPnl>>;\n\n /**\n * fetch wallet's trade activities\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's trade activities\n */\n getWalletTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch token's trade activities\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's trade activities\n */\n getTokenTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch wallet's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's activities\n */\n getWalletActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * fetch token's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's activities\n */\n getTokenActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * get presigned upload url\n * @returns presigned upload url\n */\n getPresignedUploadUrl(): Promise<string>;\n}\n\nexport interface ISubscription {\n unsubscribe(): void;\n}\n\n/**\n * Incremental token update from subscriptions.\n * `chain` + `address` identify the token; all other fields are optional —\n * `undefined` means this push did not carry that field.\n */\nexport type TokenSubscribed = Partial<Omit<Token, \"chain\" | \"address\">> &\n Pick<Token, \"chain\" | \"address\">;\n\nexport interface WalletPnlSubscribed extends WalletPnl {\n /** pnl resolution (e.g. \"7d\", \"30d\") */\n resolution?: string;\n}\n\nexport interface PortfolioSubscribed {\n /** chain id */\n chain: Chain;\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n /** token current price in usd */\n priceInUsd?: string;\n /** holding token amount */\n amount?: string;\n}\n\nexport type PortfolioPnlSubscribed = Partial<\n Omit<PortfolioPnl, \"address\" | \"name\" | \"symbol\" | \"image\">\n> & {\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n};\n\n/**\n * Subscribe client interface\n */\nexport interface ISubscribeClient {\n /**\n * Subscribe to a token's real-time data updates (stats, market data,\n * holders, liquidity, etc.). The client internally manages multiple\n * backend channels and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param address token address\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeToken(\n chain: Chain,\n address: string,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token new candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n callback: (candles: Array<TokenCandle>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPnl(\n chain: Chain,\n address: string,\n callback: (pnls: Array<WalletPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolios(\n chain: Chain,\n address: string,\n callback: (portfolios: Array<PortfolioSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolioPnls(\n chain: Chain,\n address: string,\n callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new trade activities\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new trade activities\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `New` token list real-time updates. The client internally\n * manages multiple backend channels (new token events, metadata, stats,\n * holders, supply, liquidity, bonding curve) and delivers incremental\n * updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeNewTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Trending` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeTrendingTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Migrated` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeMigratedTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `FinalStretch` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity, bonding curve) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeFinalStretchTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Stock` token list real-time updates. The client internally\n * manages multiple backend channels (stats, holders, supply, liquidity)\n * and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeStockTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n}\n","declare global {\n interface Window {\n __LIBERFI_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif (typeof window !== \"undefined\") {\n window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};\n window.__LIBERFI_VERSION__[\"@liberfi.io/types\"] = \"0.1.178\";\n}\n\nexport default \"0.1.178\";\n","export enum Chain {\n ETHEREUM = \"1\",\n UBIQ = \"8\",\n OPTIMISM = \"10\",\n FLARE = \"14\",\n SONGBIRD = \"19\",\n ELASTOS = \"20\",\n KARDIA = \"24\",\n CRONOS = \"25\",\n RSK = \"30\",\n TELOS = \"40\",\n LUKSO = \"42\",\n CRAB = \"44\",\n DARWINIA = \"46\",\n XDC = \"50\",\n CSC = \"52\",\n ZYX = \"55\",\n BINANCE = \"56\",\n BINANCE_TESTNET = \"97\",\n SYSCOIN = \"57\",\n GOCHAIN = \"60\",\n ETHEREUMCLASSIC = \"61\",\n OKEXCHAIN = \"66\",\n HOO = \"70\",\n METER = \"82\",\n NOVA_NETWORK = \"87\",\n TOMOCHAIN = \"88\",\n BITKUB = \"96\",\n XDAI = \"100\",\n VELAS = \"106\",\n THUNDERCORE = \"108\",\n ENULS = \"119\",\n FUSE = \"122\",\n HECO = \"128\",\n UNICHAIN = \"130\",\n POLYGON = \"137\",\n SONIC = \"146\",\n SHIMMER_EVM = \"148\",\n RBN = \"151\",\n OMNI = \"166\",\n MANTA = \"169\",\n HSK = \"177\",\n WATER = \"181\",\n XLAYER = \"196\",\n XDAIARB = \"200\",\n OP_BNB = \"204\",\n VINUCHAIN = \"207\",\n ENERGYWEB = \"246\",\n OASYS = \"248\",\n FANTOM = \"250\",\n FRAXTAL = \"252\",\n HPB = \"269\",\n BOBA = \"288\",\n OMAX = \"311\",\n FILECOIN = \"314\",\n KUCOIN = \"321\",\n ZKSYNC_ERA = \"324\",\n SHIDEN = \"336\",\n THETA = \"361\",\n PULSE = \"369\",\n CRONOS_ZKEVM = \"388\",\n SX = \"416\",\n AREON = \"463\",\n WC = \"480\",\n CANDLE = \"534\",\n ROLLUX = \"570\",\n ASTAR = \"592\",\n REDSTONE = \"690\",\n MATCHAIN = \"698\",\n CALLISTO = \"820\",\n TARA = \"841\",\n WANCHAIN = \"888\",\n LYRA_CHAIN = \"957\",\n BIFROST = \"996\",\n CONFLUX = \"1030\",\n METIS = \"1088\",\n DYMENSION = \"1100\",\n POLYGON_ZKEVM = \"1101\",\n CORE = \"1116\",\n LISK = \"1135\",\n ULTRON = \"1231\",\n STEP = \"1234\",\n MOONBEAM = \"1284\",\n MOONRIVER = \"1285\",\n SEI = \"1329\",\n LIVING_ASSETS_MAINNET = \"1440\",\n STY = \"1514\",\n TENET = \"1559\",\n GRAVITY = \"1625\",\n REYA_NETWORK = \"1729\",\n SONEIUM = \"1868\",\n SWELLCHAIN = \"1923\",\n ONUS = \"1975\",\n HUBBLENET = \"1992\",\n SANKO = \"1996\",\n DOGECHAIN = \"2000\",\n MILKOMEDA = \"2001\",\n MILKOMEDA_A1 = \"2002\",\n KAVA = \"2222\",\n SOMA = \"2332\",\n KARAK = \"2410\",\n ABSTRACT = \"2741\",\n ABSTRACT_TESTNET = \"11124\",\n MORPH = \"2818\",\n CROSSFI = \"4158\",\n BEAM = \"4337\",\n IOTEX = \"4689\",\n MANTLE = \"5000\",\n XLC = \"5050\",\n NAHMII = \"5551\",\n BOUNCEBIT = \"6001\",\n TOMBCHAIN = \"6969\",\n ZETACHAIN = \"7000\",\n PLANQ = \"7070\",\n BITROCK = \"7171\",\n XSAT = \"7200\",\n CYETH = \"7560\",\n CANTO = \"7700\",\n KLAYTN = \"8217\",\n THAT = \"8428\",\n BASE = \"8453\",\n HELA = \"8668\",\n IOTAEVM = \"8822\",\n JBC = \"8899\",\n EVMOS = \"9001\",\n CARBON = \"9790\",\n SMARTBCH = \"10000\",\n ARTELA = \"11820\",\n IMMUTABLE_ZKEVM = \"13371\",\n LOOP = \"15551\",\n GENESYS = \"16507\",\n EOS_EVM = \"17777\",\n MAP_PROTOCOL = \"22776\",\n SAPPHIRE = \"23294\",\n BITGERT = \"32520\",\n FUSION = \"32659\",\n ZILLIQA = \"32769\",\n APECHAIN = \"33139\",\n EDU_CHAIN = \"41923\",\n ARBITRUM = \"42161\",\n ARBITRUM_TESTNET_GOERLI = \"421613\",\n ARBITRUM_TESTNET_SEPOLIA = \"421614\",\n ARBITRUM_NOVA = \"42170\",\n CELO = \"42220\",\n OASIS = \"42262\",\n ASSETCHAIN = \"42420\",\n ETHERLINK = \"42793\",\n AVALANCHE = \"43114\",\n REI = \"47805\",\n ZIRCUIT = \"48900\",\n SOPHON = \"50104\",\n ETN = \"52014\",\n SUPERPOSITION = \"55244\",\n REICHAIN = \"55555\",\n BOBA_BNB = \"56288\",\n INK = \"57073\",\n LINEA = \"59144\",\n BOB = \"60808\",\n GODWOKEN = \"71402\",\n BERACHAIN = \"80094\",\n BLAST = \"81457\",\n CHILIZ = \"88888\",\n STRATIS = \"105105\",\n REAL = \"111188\",\n ODYSSEY = \"153153\",\n TAIKO = \"167000\",\n BITLAYER = \"200901\",\n HYDRATION = \"222222\",\n PAREX = \"322202\",\n POLIS = \"333999\",\n KEKCHAIN = \"420420\",\n SCROLL = \"534352\",\n ZERO_NETWORK = \"543210\",\n ZKLINK_NOVA = \"810180\",\n VISION = \"888888\",\n SAAKURU = \"7225878\",\n ZORA = \"7777777\",\n CORN = \"21000000\",\n NEON = \"245022934\",\n LUMIA = \"994873017\",\n AURORA = \"1313161554\",\n HARMONY = \"1666600000\",\n PALM = \"11297108109\",\n ZENIQ = \"383414847825\",\n CURIO = \"836542336838601\",\n MODE = \"34443\",\n SOLANA = \"900900900\",\n SOLANA_TESTNET = \"901901901\",\n SOLANA_DEVNET = \"902902902\",\n}\n\nexport enum ChainNamespace {\n EVM = \"EVM\",\n SOLANA = \"SOL\",\n}\n","import { Chain } from \"./chains\";\n\nexport enum SolanaTokenProtocol {\n BAGS = \"bags\",\n BELIEVE = \"believe\",\n BONK = \"bonk\",\n BOOP = \"boop\",\n HEAVEN = \"heaven\",\n JUPSTUDIO = \"jupstudio\",\n LAUNCHLAB = \"launchlab\",\n METEORA = \"meteora\",\n MOONIT = \"moonit\",\n MOONSHOT = \"moonshot\",\n ORCA = \"orca\",\n PUMP = \"pump\",\n RAYDIUM = \"raydium\",\n SUGAR = \"sugar\",\n VIRTUAL_CURVE = \"virtual-curve\",\n PUMP_AMM = \"pump-amm\",\n}\n\nexport type TokenProtocol = SolanaTokenProtocol | (string & {});\n\nexport const SOLANA_TOKEN_PROTOCOLS = Object.values(SolanaTokenProtocol);\n\nexport interface Token {\n /**\n * chain id.\n */\n chain: Chain;\n /**\n * token name, e.g. \"Ethereum\", \"Solana\", etc.\n */\n name: string;\n /**\n * token symbol, e.g. \"ETH\", \"SOL\", etc.\n */\n symbol: string;\n /**\n * token address.\n */\n address: string;\n /**\n * token decimals.\n */\n decimals: number;\n /**\n * token avatar image url.\n */\n image?: string;\n /**\n * token description.\n */\n description?: string;\n /**\n * token creators.\n */\n creators?: Array<TokenCreator>;\n /**\n * token launch info.\n */\n launchedFrom?: TokenLaunchedFrom;\n /**\n * token migrate progress, range is 0-100.\n */\n migrateProgress?: string;\n /**\n * token migrate info.\n */\n migratedTo?: TokenMigratedTo;\n /**\n * token social medias.\n */\n socialMedias?: TokenSocialMedias;\n /**\n * token stats.\n */\n stats?: TokenStats;\n /**\n * token market data.\n */\n marketData?: TokenMarketData;\n /**\n * token liquidity pools\n */\n liquidities?: Array<TokenLiquidity>;\n /**\n * token security.\n */\n security?: TokenSecurity;\n /**\n * token tags.\n */\n tags?: Array<string>;\n /**\n * token create time.\n */\n createdAt?: Date;\n}\n\nexport interface TokenCreator {\n /**\n * token creator's wallet address.\n */\n address?: string;\n /**\n * token creator's share percentage, range is 0-100.\n */\n share?: number;\n /**\n * whether the token creator is verified.\n */\n isVerified?: boolean;\n}\n\nexport interface TokenLaunchedFrom {\n /**\n * token launch program address.\n */\n programAddress?: string;\n /**\n * token launch protocol family.\n */\n protocolFamily?: string;\n}\n\nexport interface TokenMigratedTo {\n /**\n * token migrate program address.\n */\n programAddress?: string;\n /**\n * token migrate protocol family.\n */\n protocolFamily?: string;\n /**\n * token migrate pool address.\n */\n poolAddress?: string;\n /**\n * token migrate time.\n */\n migratedAt?: Date;\n}\n\nexport interface TokenSocialMedias {\n /**\n * token twitter url.\n */\n twitter?: string;\n /**\n * token telegram url.\n */\n telegram?: string;\n /**\n * token website url.\n */\n website?: string;\n /**\n * token tiktok url.\n */\n tiktok?: string;\n /**\n * token discord url.\n */\n discord?: string;\n /**\n * token facebook url.\n */\n facebook?: string;\n /**\n * token github url.\n */\n github?: string;\n /**\n * token instagram url.\n */\n instagram?: string;\n /**\n * token linkedin url.\n */\n linkedin?: string;\n /**\n * token medium url.\n */\n medium?: string;\n /**\n * token reddit url.\n */\n reddit?: string;\n /**\n * token youtube url.\n */\n youtube?: string;\n /**\n * token bitbucket url.\n */\n bitbucket?: string;\n}\n\nexport interface TokenStats {\n /**\n * token stats by 1m timeframe.\n */\n \"1m\"?: TokenStatsByResolution;\n /**\n * token stats by 5m timeframe.\n */\n \"5m\"?: TokenStatsByResolution;\n /**\n * token stats by 15m timeframe.\n */\n \"15m\"?: TokenStatsByResolution;\n /**\n * token stats by 30m timeframe.\n */\n \"30m\"?: TokenStatsByResolution;\n /**\n * token stats by 1h timeframe.\n */\n \"1h\"?: TokenStatsByResolution;\n /**\n * token stats by 4h timeframe.\n */\n \"4h\"?: TokenStatsByResolution;\n /**\n * token stats by 24h timeframe.\n */\n \"24h\"?: TokenStatsByResolution;\n}\n\nexport interface TokenStatsByResolution {\n /**\n * buy txs count\n */\n buys?: number;\n /**\n * sell txs count\n */\n sells?: number;\n /**\n * txs count\n */\n trades?: number;\n /**\n * buy addresses count\n */\n buyers?: number;\n /**\n * sell addresses count\n */\n sellers?: number;\n /**\n * trade addresses count\n */\n traders?: number;\n /**\n * buy volumes in quote token\n */\n buyVolumes?: string;\n /**\n * sell volumes in quote token\n */\n sellVolumes?: string;\n /**\n * total volumes in quote token\n */\n volumes?: string;\n /**\n * buy volumes in usd\n */\n buyVolumesInUsd?: string;\n /**\n * sell volumes in usd\n */\n sellVolumesInUsd?: string;\n /**\n * total volumes in usd\n */\n volumesInUsd?: string;\n /**\n * open price in usd\n */\n openPriceInUsd?: string;\n /**\n * close price in usd\n */\n closePriceInUsd?: string;\n /**\n * high price in usd\n */\n highPriceInUsd?: string;\n /**\n * low price in usd\n */\n lowPriceInUsd?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * price change %\n */\n priceChange?: string;\n}\n\nexport interface TokenMarketData {\n /**\n * total supply\n */\n totalSupply?: string;\n /**\n * market cap in quote token\n */\n marketCap?: string;\n /**\n * market cap in usd\n */\n marketCapInUsd?: string;\n /**\n * price in quote token\n */\n price?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * tvl in quote token\n */\n tvl?: string;\n /**\n * tvl in usd\n */\n tvlInUsd?: string;\n /**\n * holders count\n */\n holders?: number;\n /**\n * top 10 total holdings\n */\n top10Holdings?: string;\n /**\n * top 10 holdings ratio\n */\n top10HoldingsRatio?: string;\n /**\n * top 50 total holdings\n */\n top50Holdings?: string;\n /**\n * top 50 holdings ratio\n */\n top50HoldingsRatio?: string;\n /**\n * top 100 total holdings\n */\n top100Holdings?: string;\n /**\n * top 100 holdings ratio\n */\n top100HoldingsRatio?: string;\n /**\n * Bluechip holders count\n */\n bluechipHolders?: number;\n /**\n * Bluechip total holdings\n */\n bluechipHoldings?: string;\n /**\n * Bluechip holdings ratio\n */\n bluechipHoldingsRatio?: string;\n /**\n * KOL holders count\n */\n kolHolders?: number;\n /**\n * KOL total holdings\n */\n kolHoldings?: string;\n /**\n * KOL holdings ratio\n */\n kolHoldingsRatio?: string;\n /**\n * Sniper holders count\n */\n sniperHolders?: number;\n /**\n * Sniper total holdings\n */\n sniperHoldings?: string;\n /**\n * Sniper holdings ratio\n */\n sniperHoldingsRatio?: string;\n /**\n * Pro holders count\n */\n proHolders?: number;\n /**\n * Pro total holdings\n */\n proHoldings?: string;\n /**\n * Pro holdings ratio\n */\n proHoldingsRatio?: string;\n /**\n * Insider holders count\n */\n insiderHolders?: number;\n /**\n * Insider total holdings\n */\n insiderHoldings?: string;\n /**\n * Insider holdings ratio\n */\n insiderHoldingsRatio?: string;\n /**\n * Sandwich holders count\n */\n sandwichHolders?: number;\n /**\n * Sandwich total holdings\n */\n sandwichHoldings?: string;\n /**\n * Sandwich holdings ratio\n */\n sandwichHoldingsRatio?: string;\n /**\n * Fresh holders count\n */\n freshHolders?: number;\n /**\n * Fresh total holdings\n */\n freshHoldings?: string;\n /**\n * Fresh holdings ratio\n */\n freshHoldingsRatio?: string;\n /**\n * Bundle holders count\n */\n bundleHolders?: number;\n /**\n * Bundle total holdings\n */\n bundleHoldings?: string;\n /**\n * Bundle holdings ratio\n */\n bundleHoldingsRatio?: string;\n /**\n * Dev holders count\n */\n devHolders?: number;\n /**\n * Dev total holdings\n */\n devHoldings?: string;\n /**\n * Dev holdings ratio\n */\n devHoldingsRatio?: string;\n}\n\nexport interface TokenLiquidity {\n /**\n * pool avatar image\n */\n image?: string;\n /**\n * pair token address.\n */\n pairAddress?: string;\n /**\n * pool address.\n */\n poolAddress?: string;\n /**\n * program address.\n */\n programAddress?: string;\n /**\n * protocol name.\n */\n protocolName?: string;\n /**\n * protocol family.\n */\n protocolFamily?: string;\n /**\n * tvl in quote token.\n */\n tvl?: string;\n /**\n * tvl in usd.\n */\n tvlInUsd?: string;\n}\n\n/**\n * TODO: more security checks\n */\nexport interface TokenSecurity {\n /**\n * whether the token has transfer fee.\n */\n hasTransferFee?: boolean;\n /**\n * whether the token transfer fee is upgradable.\n */\n isTransferFeeUpgradable?: boolean;\n /**\n * whether the token is transferable.\n */\n isTransferable?: boolean;\n /**\n * whether the token is freezable.\n */\n isFreezable?: boolean;\n /**\n * whether the token is closable.\n */\n isClosable?: boolean;\n}\n\nexport type TokenResolution =\n | \"1s\"\n | \"15s\"\n | \"30s\"\n | \"1m\"\n | \"5m\"\n | \"15m\"\n | \"30m\"\n | \"1h\"\n | \"4h\"\n | \"12h\"\n | \"24h\";\n\nexport interface TokenCandle {\n /**\n * open price in usd\n */\n open: string;\n /**\n * close price in usd\n */\n close: string;\n /**\n * high price in usd\n */\n high: string;\n /**\n * low price in usd\n */\n low: string;\n /**\n * volume in usd\n */\n volume: string;\n /**\n * resolution\n */\n resolution: TokenResolution;\n /**\n * timestamp\n */\n timestamp: Date;\n}\n\nexport interface TokenHolder {\n /**\n * holder wallet address\n */\n address: string;\n /**\n * holdings amount in token\n */\n amount: string;\n /**\n * hold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A,OAAA,aAAU;AACV,EAAAA,OAAA,UAAO;AACP,EAAAA,OAAA,WAAQ;AACR,EAAAA,OAAA,WAAQ;AACR,EAAAA,OAAA,UAAO;AACP,EAAAA,OAAA,YAAS;AACT,EAAAA,OAAA,oBAAiB;AACjB,EAAAA,OAAA,mBAAgB;AA5LN,SAAAA;AAAA,GAAA;AA+LL,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,SAAM;AACN,EAAAA,gBAAA,YAAS;AAFC,SAAAA;AAAA,GAAA;;;AC7LL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,mBAAgB;AAChB,EAAAA,qBAAA,cAAW;AAhBD,SAAAA;AAAA,GAAA;AAqBL,IAAM,yBAAyB,OAAO,OAAO,mBAAmB;","names":["SwapMode","Chain","ChainNamespace","SolanaTokenProtocol"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/api/index.ts","../src/api/dex.ts","../src/version.ts","../src/chains.ts","../src/token.ts"],"sourcesContent":["import * as API from \"./api\";\n\nexport { default as version } from \"./version\";\nexport * from \"./api\";\nexport * from \"./activity\";\nexport * from \"./chains\";\nexport * from \"./token\";\nexport * from \"./wallet\";\n\n// Re-export as API namespace for backward compatibility\nexport { API };\n","export * from \"./dex\";\nexport * from \"./pagination\";\n","import { Activity, ActivityType, Trade } from \"../activity\";\nimport { Chain } from \"../chains\";\nimport {\n Token,\n TokenCandle,\n TokenHolder,\n TokenMarketData,\n TokenResolution,\n TokenSecurity,\n TokenStats,\n} from \"../token\";\nimport {\n Portfolio,\n PortfolioPnl,\n WalletPnl,\n WalletPortfolioPnls,\n WalletPortfolios,\n} from \"../wallet\";\nimport { CursorPagination } from \"./pagination\";\n\n/**\n * Cursor list result data\n */\nexport interface CursorList<T> extends CursorPagination {\n data: Array<T>;\n}\n\n/**\n * Cursor list query options\n */\nexport interface CursorListOptions {\n /** query cursor */\n cursor?: string;\n /** return limit */\n limit?: number;\n /** query direction */\n direction?: \"next\" | \"prev\";\n}\n\n/**\n * Options for getting token candles\n */\nexport interface GetTokenCandlesOptions {\n /** query candles after this timestamp */\n after?: Date;\n /** query candles before this timestamp */\n before?: Date;\n /** return limit */\n limit?: number;\n}\n\n/**\n * Token field for filtering\n */\nexport type TokenFieldOption =\n | \"price\"\n | \"priceChange1m\"\n | \"priceChange5m\"\n | \"priceChange15m\"\n | \"priceChange30m\"\n | \"priceChange1h\"\n | \"priceChange4h\"\n | \"priceChange24h\"\n | \"marketCap\"\n | \"tvl\"\n | \"top10Holdings\"\n | \"top10Ratio\"\n | \"top100Holdings\"\n | \"top100Ratio\"\n | \"holders\"\n | \"creatorsHoldings\"\n | \"creatorsRatio\"\n | \"buys1m\"\n | \"buys5m\"\n | \"buys15m\"\n | \"buys30m\"\n | \"buys1h\"\n | \"buys4h\"\n | \"buys24h\"\n | \"sells1m\"\n | \"sells5m\"\n | \"sells15m\"\n | \"sells30m\"\n | \"sells1h\"\n | \"sells4h\"\n | \"sells24h\"\n | \"trades1m\"\n | \"trades5m\"\n | \"trades15m\"\n | \"trades30m\"\n | \"trades1h\"\n | \"trades4h\"\n | \"trades24h\"\n | \"traders1m\"\n | \"traders5m\"\n | \"traders15m\"\n | \"traders30m\"\n | \"traders1h\"\n | \"traders4h\"\n | \"traders24h\"\n | \"volumes1m\"\n | \"volumes5m\"\n | \"volumes15m\"\n | \"volumes30m\"\n | \"volumes1h\"\n | \"volumes4h\"\n | \"volumes24h\"\n | \"launchedFromProtocolFamily\"\n | \"migratedToProtocolFamily\"\n | \"tag\"\n | \"createdAt\"\n | (string & {});\n\n/**\n * Token filter option\n */\nexport interface TokenFilterOption {\n field: TokenFieldOption;\n operator:\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\"\n | \"between\"\n | \"in\"\n | \"nin\"\n | \"contains\"\n | \"notContains\"\n | \"startsWith\"\n | \"endsWith\"\n | \"isNotNull\"\n | \"isNull\";\n value?: string | number | boolean | Array<string | number | boolean>;\n}\n\n/**\n * Options for getting token list\n */\nexport interface GetTokenListOptions {\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** search keywords */\n keywords?: Array<string>;\n /** exclude keywords */\n excludeKeywords?: Array<string>;\n}\n\n/**\n * Options for searching tokens\n */\nexport interface SearchTokensOptions extends CursorListOptions {\n /** chains */\n chains?: Array<Chain>;\n /** search keyword */\n keyword?: string;\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n}\n\n/**\n * Search token cursor list\n */\nexport interface SearchTokenCursorList extends CursorList<Token> {\n /** total count */\n total?: number;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport enum SwapMode {\n EXACT_IN = \"exact_in\",\n EXACT_OUT = \"exact_out\",\n}\n\n/** DEX identifier used for route / mint address conversion. */\nexport type SwapDex = \"jupiter\" | \"kyberswap\";\n\nexport interface SwapParams {\n /** chain id */\n chain: Chain;\n /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */\n dex?: SwapDex;\n /** user wallet address */\n userAddress: string;\n /** input token address */\n input: string;\n /** output token address */\n output: string;\n /** swap mode, e.g. ExactIn, ExactOut */\n mode: SwapMode;\n /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */\n amount: string;\n /** slippage, range is 0-100 */\n slippage?: number;\n /** priority fee */\n priorityFee?: string;\n /** tip fee */\n tipFee?: string;\n /** whether to use anti-MEV */\n isAntiMev?: boolean;\n /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */\n permit?: string;\n /** deadline timestamp in ms (EVM only) */\n deadline?: number;\n}\n\nexport interface SwapRoutePlan {\n /** protocol name / dex name etc. */\n name: string;\n /** input token address */\n input: string;\n /** input token amount */\n inputAmount: string;\n /** output token address */\n output: string;\n /** output token amount */\n outputAmount: string;\n /** fee quote token address */\n feeQuote?: string;\n /** fee amount */\n feeAmount?: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SwapRoute {\n /** unsigned tx in base64 format */\n serializedTx: string;\n /** recent blockhash embedded in the unsigned Solana transaction */\n recentBlockhash?: string;\n /** last block height at which the embedded Solana blockhash remains valid */\n lastValidBlockHeight?: number;\n /** swap plans */\n plans: Array<SwapRoutePlan>;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface LatestBlockParams {\n /** chain id */\n chain: Chain;\n}\n\nexport interface BlockchainLatestBlock {\n /** latest block hash */\n blockhash: string;\n /** last valid block height for transactions built with the latest blockhash */\n lastValidBlockHeight: number;\n}\n\nexport interface SendTxParams {\n /** chain id */\n chain: Chain;\n /** signed tx in base64 format */\n serializedTx: string;\n /** extra infos needed by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SendTxResult {\n /** tx hash */\n txHash: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\n/**\n * Options for getting trades\n */\nexport interface GetTradesOptions extends CursorListOptions {\n /** filter trades before this timestamp */\n before?: Date;\n /** filter trades after this timestamp */\n after?: Date;\n /** filter trades before this block height */\n beforeBlockHeight?: number;\n /** filter trades after this block height */\n afterBlockHeight?: number;\n /** filter trades by type */\n type?: \"buy\" | \"sell\";\n /** filter trades by pool address */\n poolAddress?: string;\n}\n\n/**\n * Sort field for activity list (Phase 3).\n * - `timestamp` — order by activity time (default, descending)\n * - `totalUsd` — order by USD amount (useful for finding whale trades)\n */\nexport type ActivitiesSortBy = \"timestamp\" | \"totalUsd\";\n\n/**\n * Options for getting activities\n */\nexport interface GetActivitiesOptions extends CursorListOptions {\n /** filter activities before this timestamp */\n before?: Date;\n /** filter activities after this timestamp */\n after?: Date;\n /** filter activities before this block height */\n beforeBlockHeight?: number;\n /** filter activities after this block height */\n afterBlockHeight?: number;\n /** filter activities by type */\n type?: ActivityType;\n /** filter activities by pool address */\n poolAddress?: string;\n /**\n * Sort field (Phase 3). Defaults to `timestamp` on the server. When changing\n * `sortBy`, the caller must discard the previous cursor and restart from page 1.\n */\n sortBy?: ActivitiesSortBy;\n}\n\n/**\n * Sort field for token holder list (Phase 3).\n * - `holdingUsd` — order by holding value in USD (default, descending)\n * - `lastActiveAt` — order by wallet's last activity time\n */\nexport type TokenHoldersSortBy = \"holdingUsd\" | \"lastActiveAt\";\n\n/**\n * Options for getting token holders (Phase 3).\n */\nexport interface GetTokenHoldersOptions extends CursorListOptions {\n /**\n * Sort field. Defaults to `holdingUsd` on the server.\n * Switching `sortBy` requires discarding the old cursor and restarting from page 1.\n */\n sortBy?: TokenHoldersSortBy;\n}\n\n/**\n * Resolution window for wallet PnL queries (Phase 3).\n */\nexport type WalletPnlResolution = \"7d\" | \"30d\" | \"90d\";\n\n/**\n * Position state filter for wallet PnL details (Phase 3).\n * - `open` — only tokens with current balance > 0 (default)\n * - `closed` — only tokens with balance == 0 (historical realized PnL)\n * - `all` — both open and closed positions\n */\nexport type PositionState = \"open\" | \"closed\" | \"all\";\n\n/**\n * Sort field for wallet PnL details (Phase 3).\n */\nexport type WalletPnlSortBy = \"totalPnl\" | \"realizedPnl\" | \"unrealizedPnl\";\n\n/**\n * Options for getting wallet portfolio PnL details (Phase 3).\n */\nexport interface GetWalletPortfolioPnlsOptions extends CursorListOptions {\n /**\n * Statistics time window. Defaults to `30d` in the Client implementation\n * for backward compatibility; the server requires this parameter and will\n * return 400 if it is missing.\n */\n resolution?: WalletPnlResolution;\n /** Position state filter. Defaults to `open` on the server. */\n positionState?: PositionState;\n /**\n * Sort field. Defaults to `totalPnl` on the server.\n * Switching `sortBy` requires discarding the old cursor.\n */\n sortBy?: WalletPnlSortBy;\n}\n\n/**\n * Resolution subset supported by the trending token list.\n */\nexport type TrendingResolution = Extract<\n TokenResolution,\n \"1m\" | \"5m\" | \"1h\" | \"4h\" | \"24h\"\n>;\n\n/**\n * API client interface\n */\nexport interface IClient {\n /**\n * fetch token info\n * @param chain chain id\n * @param address token address\n * @returns token info\n */\n getToken(chain: Chain, address: string): Promise<Token>;\n\n /**\n * fetch token infos in batch\n * @param chain chain id\n * @param addresses token addresses\n * @returns token infos\n */\n getTokens(chain: Chain, addresses: Array<string>): Promise<Array<Token>>;\n\n /**\n * fetch token candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param options optional query options\n * @returns token candles\n */\n getTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n options?: GetTokenCandlesOptions,\n ): Promise<Array<TokenCandle>>;\n\n /**\n * fetch token security\n * @param chain chain id\n * @param address token address\n * @returns token security\n */\n getTokenSecurity(chain: Chain, address: string): Promise<TokenSecurity>;\n\n /**\n * fetch token stats\n * @param chain chain id\n * @param address token address\n * @returns token stats\n */\n getTokenStats(chain: Chain, address: string): Promise<TokenStats>;\n\n /**\n * fetch token holders\n * @param chain chain id\n * @param address token address\n * @param options optional query options (Phase 3: sortBy)\n * @returns token holders\n */\n getTokenHolders(\n chain: Chain,\n address: string,\n options?: GetTokenHoldersOptions,\n ): Promise<CursorList<TokenHolder>>;\n\n /**\n * fetch token market data\n * @param chain chain id\n * @param address token address\n * @returns token market data\n */\n getTokenMarketData(chain: Chain, address: string): Promise<TokenMarketData>;\n\n /**\n * fetch `New` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `New` token list\n */\n getNewTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Final Stretch` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Final Stretch` token list\n */\n getFinalStretchTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Migrated` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Migrated` token list\n */\n getMigratedTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Trending` token list\n * @param chain chain id\n * @param resolution query resolution, e.g. \"1m\", \"5m\", \"1h\", \"4h\", \"24h\"\n * @param options optional query options\n * @returns `Trending` token list\n */\n getTrendingTokens(\n chain: Chain,\n resolution: TrendingResolution,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Stock` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Stock` token list\n */\n getStockTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * search tokens\n * @param options optional query options\n * @returns search token cursor list\n */\n searchTokens(options?: SearchTokensOptions): Promise<SearchTokenCursorList>;\n\n /**\n * fetch swap route plans\n * @param params swap params\n * @returns swap route plans\n */\n swapRoute(params: SwapParams): Promise<SwapRoute>;\n\n /**\n * fetch latest block metadata\n * @param params latest block params\n * @returns latest block metadata\n */\n getLatestBlock(params: LatestBlockParams): Promise<BlockchainLatestBlock>;\n\n /**\n * send tx\n * @param params send tx params\n * @returns send tx result\n */\n sendTx(params: SendTxParams): Promise<SendTxResult>;\n\n /**\n * check if tx is successful\n * @param chain chain id\n * @param txHash tx hash\n * @param timeout timeout in milliseconds\n * @returns true if tx is successful, false otherwise\n */\n checkTxSuccess(\n chain: Chain,\n txHash: string,\n timeout?: number,\n ): Promise<boolean>;\n\n /**\n * fetch wallet portfolios\n * @param chain chain id\n * @param address wallet address\n * @param options optional pagination options\n * @returns wallet portfolios\n */\n getWalletPortfolios(\n chain: Chain,\n address: string,\n options?: { cursor?: string; limit?: number },\n ): Promise<WalletPortfolios>;\n\n /**\n * fetch wallet PnL summary\n * @param chain chain id\n * @param address wallet address\n * @param resolution pnl resolution (e.g. \"7d\", \"30d\")\n * @returns wallet pnl summary\n */\n getWalletPnl(\n chain: Chain,\n address: string,\n resolution?: string,\n ): Promise<WalletPnl>;\n\n /**\n * fetch wallet portfolio PnL details (per-token)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options (Phase 3: resolution, positionState, sortBy)\n * @returns portfolio pnl list with summary\n */\n getWalletPortfolioPnls(\n chain: Chain,\n address: string,\n options?: GetWalletPortfolioPnlsOptions,\n ): Promise<WalletPortfolioPnls>;\n\n /**\n * fetch wallet portfolios for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio list for the specified tokens\n */\n getWalletPortfoliosByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<Portfolio>>;\n\n /**\n * fetch wallet portfolio PnL for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio pnl list for the specified tokens\n */\n getWalletPortfolioPnlsByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<PortfolioPnl>>;\n\n /**\n * fetch wallet's trade activities\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's trade activities\n */\n getWalletTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch token's trade activities\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's trade activities\n */\n getTokenTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch wallet's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's activities\n */\n getWalletActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * fetch token's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's activities\n */\n getTokenActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * get presigned upload url\n * @returns presigned upload url\n */\n getPresignedUploadUrl(): Promise<string>;\n}\n\nexport interface ISubscription {\n unsubscribe(): void;\n}\n\n/**\n * Incremental token update from subscriptions.\n * `chain` + `address` identify the token; all other fields are optional —\n * `undefined` means this push did not carry that field.\n */\nexport type TokenSubscribed = Partial<Omit<Token, \"chain\" | \"address\">> &\n Pick<Token, \"chain\" | \"address\">;\n\nexport interface WalletPnlSubscribed extends WalletPnl {\n /** pnl resolution (e.g. \"7d\", \"30d\") */\n resolution?: string;\n}\n\nexport interface PortfolioSubscribed {\n /** chain id */\n chain: Chain;\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n /** token current price in usd */\n priceInUsd?: string;\n /** holding token amount */\n amount?: string;\n}\n\nexport type PortfolioPnlSubscribed = Partial<\n Omit<PortfolioPnl, \"address\" | \"name\" | \"symbol\" | \"image\">\n> & {\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n};\n\n/**\n * Subscribe client interface\n */\nexport interface ISubscribeClient {\n /**\n * Subscribe to a token's real-time data updates (stats, market data,\n * holders, liquidity, etc.). The client internally manages multiple\n * backend channels and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param address token address\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeToken(\n chain: Chain,\n address: string,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token new candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n callback: (candles: Array<TokenCandle>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPnl(\n chain: Chain,\n address: string,\n callback: (pnls: Array<WalletPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolios(\n chain: Chain,\n address: string,\n callback: (portfolios: Array<PortfolioSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolioPnls(\n chain: Chain,\n address: string,\n callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new trade activities\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new trade activities\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `New` token list real-time updates. The client internally\n * manages multiple backend channels (new token events, metadata, stats,\n * holders, supply, liquidity, bonding curve) and delivers incremental\n * updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeNewTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Trending` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeTrendingTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Migrated` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeMigratedTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `FinalStretch` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity, bonding curve) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeFinalStretchTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Stock` token list real-time updates. The client internally\n * manages multiple backend channels (stats, holders, supply, liquidity)\n * and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeStockTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n}\n","declare global {\n interface Window {\n __LIBERFI_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif (typeof window !== \"undefined\") {\n window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};\n window.__LIBERFI_VERSION__[\"@liberfi.io/types\"] = \"0.2.0\";\n}\n\nexport default \"0.2.0\";\n","export enum Chain {\n ETHEREUM = \"1\",\n UBIQ = \"8\",\n OPTIMISM = \"10\",\n FLARE = \"14\",\n SONGBIRD = \"19\",\n ELASTOS = \"20\",\n KARDIA = \"24\",\n CRONOS = \"25\",\n RSK = \"30\",\n TELOS = \"40\",\n LUKSO = \"42\",\n CRAB = \"44\",\n DARWINIA = \"46\",\n XDC = \"50\",\n CSC = \"52\",\n ZYX = \"55\",\n BINANCE = \"56\",\n BINANCE_TESTNET = \"97\",\n SYSCOIN = \"57\",\n GOCHAIN = \"60\",\n ETHEREUMCLASSIC = \"61\",\n OKEXCHAIN = \"66\",\n HOO = \"70\",\n METER = \"82\",\n NOVA_NETWORK = \"87\",\n TOMOCHAIN = \"88\",\n BITKUB = \"96\",\n XDAI = \"100\",\n VELAS = \"106\",\n THUNDERCORE = \"108\",\n ENULS = \"119\",\n FUSE = \"122\",\n HECO = \"128\",\n UNICHAIN = \"130\",\n POLYGON = \"137\",\n SONIC = \"146\",\n SHIMMER_EVM = \"148\",\n RBN = \"151\",\n OMNI = \"166\",\n MANTA = \"169\",\n HSK = \"177\",\n WATER = \"181\",\n XLAYER = \"196\",\n XDAIARB = \"200\",\n OP_BNB = \"204\",\n VINUCHAIN = \"207\",\n ENERGYWEB = \"246\",\n OASYS = \"248\",\n FANTOM = \"250\",\n FRAXTAL = \"252\",\n HPB = \"269\",\n BOBA = \"288\",\n OMAX = \"311\",\n FILECOIN = \"314\",\n KUCOIN = \"321\",\n ZKSYNC_ERA = \"324\",\n SHIDEN = \"336\",\n THETA = \"361\",\n PULSE = \"369\",\n CRONOS_ZKEVM = \"388\",\n SX = \"416\",\n AREON = \"463\",\n WC = \"480\",\n CANDLE = \"534\",\n ROLLUX = \"570\",\n ASTAR = \"592\",\n REDSTONE = \"690\",\n MATCHAIN = \"698\",\n CALLISTO = \"820\",\n TARA = \"841\",\n WANCHAIN = \"888\",\n LYRA_CHAIN = \"957\",\n BIFROST = \"996\",\n CONFLUX = \"1030\",\n METIS = \"1088\",\n DYMENSION = \"1100\",\n POLYGON_ZKEVM = \"1101\",\n CORE = \"1116\",\n LISK = \"1135\",\n ULTRON = \"1231\",\n STEP = \"1234\",\n MOONBEAM = \"1284\",\n MOONRIVER = \"1285\",\n SEI = \"1329\",\n LIVING_ASSETS_MAINNET = \"1440\",\n STY = \"1514\",\n TENET = \"1559\",\n GRAVITY = \"1625\",\n REYA_NETWORK = \"1729\",\n SONEIUM = \"1868\",\n SWELLCHAIN = \"1923\",\n ONUS = \"1975\",\n HUBBLENET = \"1992\",\n SANKO = \"1996\",\n DOGECHAIN = \"2000\",\n MILKOMEDA = \"2001\",\n MILKOMEDA_A1 = \"2002\",\n KAVA = \"2222\",\n SOMA = \"2332\",\n KARAK = \"2410\",\n ABSTRACT = \"2741\",\n ABSTRACT_TESTNET = \"11124\",\n MORPH = \"2818\",\n CROSSFI = \"4158\",\n BEAM = \"4337\",\n IOTEX = \"4689\",\n MANTLE = \"5000\",\n XLC = \"5050\",\n NAHMII = \"5551\",\n BOUNCEBIT = \"6001\",\n TOMBCHAIN = \"6969\",\n ZETACHAIN = \"7000\",\n PLANQ = \"7070\",\n BITROCK = \"7171\",\n XSAT = \"7200\",\n CYETH = \"7560\",\n CANTO = \"7700\",\n KLAYTN = \"8217\",\n THAT = \"8428\",\n BASE = \"8453\",\n HELA = \"8668\",\n IOTAEVM = \"8822\",\n JBC = \"8899\",\n EVMOS = \"9001\",\n CARBON = \"9790\",\n SMARTBCH = \"10000\",\n ARTELA = \"11820\",\n IMMUTABLE_ZKEVM = \"13371\",\n LOOP = \"15551\",\n GENESYS = \"16507\",\n EOS_EVM = \"17777\",\n MAP_PROTOCOL = \"22776\",\n SAPPHIRE = \"23294\",\n BITGERT = \"32520\",\n FUSION = \"32659\",\n ZILLIQA = \"32769\",\n APECHAIN = \"33139\",\n EDU_CHAIN = \"41923\",\n ARBITRUM = \"42161\",\n ARBITRUM_TESTNET_GOERLI = \"421613\",\n ARBITRUM_TESTNET_SEPOLIA = \"421614\",\n ARBITRUM_NOVA = \"42170\",\n CELO = \"42220\",\n OASIS = \"42262\",\n ASSETCHAIN = \"42420\",\n ETHERLINK = \"42793\",\n AVALANCHE = \"43114\",\n REI = \"47805\",\n ZIRCUIT = \"48900\",\n SOPHON = \"50104\",\n ETN = \"52014\",\n SUPERPOSITION = \"55244\",\n REICHAIN = \"55555\",\n BOBA_BNB = \"56288\",\n INK = \"57073\",\n LINEA = \"59144\",\n BOB = \"60808\",\n GODWOKEN = \"71402\",\n BERACHAIN = \"80094\",\n BLAST = \"81457\",\n CHILIZ = \"88888\",\n STRATIS = \"105105\",\n REAL = \"111188\",\n ODYSSEY = \"153153\",\n TAIKO = \"167000\",\n BITLAYER = \"200901\",\n HYDRATION = \"222222\",\n PAREX = \"322202\",\n POLIS = \"333999\",\n KEKCHAIN = \"420420\",\n SCROLL = \"534352\",\n ZERO_NETWORK = \"543210\",\n ZKLINK_NOVA = \"810180\",\n VISION = \"888888\",\n SAAKURU = \"7225878\",\n ZORA = \"7777777\",\n CORN = \"21000000\",\n NEON = \"245022934\",\n LUMIA = \"994873017\",\n AURORA = \"1313161554\",\n HARMONY = \"1666600000\",\n PALM = \"11297108109\",\n ZENIQ = \"383414847825\",\n CURIO = \"836542336838601\",\n MODE = \"34443\",\n SOLANA = \"900900900\",\n SOLANA_TESTNET = \"901901901\",\n SOLANA_DEVNET = \"902902902\",\n}\n\nexport enum ChainNamespace {\n EVM = \"EVM\",\n SOLANA = \"SOL\",\n}\n","import { Chain } from \"./chains\";\n\nexport enum SolanaTokenProtocol {\n BAGS = \"bags\",\n BELIEVE = \"believe\",\n BONK = \"bonk\",\n BOOP = \"boop\",\n HEAVEN = \"heaven\",\n JUPSTUDIO = \"jupstudio\",\n LAUNCHLAB = \"launchlab\",\n METEORA = \"meteora\",\n MOONIT = \"moonit\",\n MOONSHOT = \"moonshot\",\n ORCA = \"orca\",\n PUMP = \"pump\",\n RAYDIUM = \"raydium\",\n SUGAR = \"sugar\",\n VIRTUAL_CURVE = \"virtual-curve\",\n PUMP_AMM = \"pump-amm\",\n}\n\nexport type TokenProtocol = SolanaTokenProtocol | (string & {});\n\nexport const SOLANA_TOKEN_PROTOCOLS = Object.values(SolanaTokenProtocol);\n\nexport interface Token {\n /**\n * chain id.\n */\n chain: Chain;\n /**\n * token name, e.g. \"Ethereum\", \"Solana\", etc.\n */\n name: string;\n /**\n * token symbol, e.g. \"ETH\", \"SOL\", etc.\n */\n symbol: string;\n /**\n * token address.\n */\n address: string;\n /**\n * token decimals.\n */\n decimals: number;\n /**\n * token avatar image url.\n */\n image?: string;\n /**\n * token description.\n */\n description?: string;\n /**\n * token creators.\n */\n creators?: Array<TokenCreator>;\n /**\n * token launch info.\n */\n launchedFrom?: TokenLaunchedFrom;\n /**\n * token migrate progress, range is 0-100.\n */\n migrateProgress?: string;\n /**\n * token migrate info.\n */\n migratedTo?: TokenMigratedTo;\n /**\n * token social medias.\n */\n socialMedias?: TokenSocialMedias;\n /**\n * token stats.\n */\n stats?: TokenStats;\n /**\n * token market data.\n */\n marketData?: TokenMarketData;\n /**\n * token liquidity pools\n */\n liquidities?: Array<TokenLiquidity>;\n /**\n * token security.\n */\n security?: TokenSecurity;\n /**\n * token tags.\n */\n tags?: Array<string>;\n /**\n * token create time.\n */\n createdAt?: Date;\n}\n\nexport interface TokenCreator {\n /**\n * token creator's wallet address.\n */\n address?: string;\n /**\n * token creator's share percentage, range is 0-100.\n */\n share?: number;\n /**\n * whether the token creator is verified.\n */\n isVerified?: boolean;\n}\n\nexport interface TokenLaunchedFrom {\n /**\n * token launch program address.\n */\n programAddress?: string;\n /**\n * token launch protocol family.\n */\n protocolFamily?: string;\n}\n\nexport interface TokenMigratedTo {\n /**\n * token migrate program address.\n */\n programAddress?: string;\n /**\n * token migrate protocol family.\n */\n protocolFamily?: string;\n /**\n * token migrate pool address.\n */\n poolAddress?: string;\n /**\n * token migrate time.\n */\n migratedAt?: Date;\n}\n\nexport interface TokenSocialMedias {\n /**\n * token twitter url.\n */\n twitter?: string;\n /**\n * token telegram url.\n */\n telegram?: string;\n /**\n * token website url.\n */\n website?: string;\n /**\n * token tiktok url.\n */\n tiktok?: string;\n /**\n * token discord url.\n */\n discord?: string;\n /**\n * token facebook url.\n */\n facebook?: string;\n /**\n * token github url.\n */\n github?: string;\n /**\n * token instagram url.\n */\n instagram?: string;\n /**\n * token linkedin url.\n */\n linkedin?: string;\n /**\n * token medium url.\n */\n medium?: string;\n /**\n * token reddit url.\n */\n reddit?: string;\n /**\n * token youtube url.\n */\n youtube?: string;\n /**\n * token bitbucket url.\n */\n bitbucket?: string;\n}\n\nexport interface TokenStats {\n /**\n * token stats by 1m timeframe.\n */\n \"1m\"?: TokenStatsByResolution;\n /**\n * token stats by 5m timeframe.\n */\n \"5m\"?: TokenStatsByResolution;\n /**\n * token stats by 15m timeframe.\n */\n \"15m\"?: TokenStatsByResolution;\n /**\n * token stats by 30m timeframe.\n */\n \"30m\"?: TokenStatsByResolution;\n /**\n * token stats by 1h timeframe.\n */\n \"1h\"?: TokenStatsByResolution;\n /**\n * token stats by 4h timeframe.\n */\n \"4h\"?: TokenStatsByResolution;\n /**\n * token stats by 24h timeframe.\n */\n \"24h\"?: TokenStatsByResolution;\n}\n\nexport interface TokenStatsByResolution {\n /**\n * buy txs count\n */\n buys?: number;\n /**\n * sell txs count\n */\n sells?: number;\n /**\n * txs count\n */\n trades?: number;\n /**\n * buy addresses count\n */\n buyers?: number;\n /**\n * sell addresses count\n */\n sellers?: number;\n /**\n * trade addresses count\n */\n traders?: number;\n /**\n * buy volumes in quote token\n */\n buyVolumes?: string;\n /**\n * sell volumes in quote token\n */\n sellVolumes?: string;\n /**\n * total volumes in quote token\n */\n volumes?: string;\n /**\n * buy volumes in usd\n */\n buyVolumesInUsd?: string;\n /**\n * sell volumes in usd\n */\n sellVolumesInUsd?: string;\n /**\n * total volumes in usd\n */\n volumesInUsd?: string;\n /**\n * open price in usd\n */\n openPriceInUsd?: string;\n /**\n * close price in usd\n */\n closePriceInUsd?: string;\n /**\n * high price in usd\n */\n highPriceInUsd?: string;\n /**\n * low price in usd\n */\n lowPriceInUsd?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * price change %\n */\n priceChange?: string;\n}\n\nexport interface TokenMarketData {\n /**\n * total supply\n */\n totalSupply?: string;\n /**\n * market cap in quote token\n */\n marketCap?: string;\n /**\n * market cap in usd\n */\n marketCapInUsd?: string;\n /**\n * price in quote token\n */\n price?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * tvl in quote token\n */\n tvl?: string;\n /**\n * tvl in usd\n */\n tvlInUsd?: string;\n /**\n * holders count\n */\n holders?: number;\n /**\n * top 10 total holdings\n */\n top10Holdings?: string;\n /**\n * top 10 holdings ratio\n */\n top10HoldingsRatio?: string;\n /**\n * top 50 total holdings\n */\n top50Holdings?: string;\n /**\n * top 50 holdings ratio\n */\n top50HoldingsRatio?: string;\n /**\n * top 100 total holdings\n */\n top100Holdings?: string;\n /**\n * top 100 holdings ratio\n */\n top100HoldingsRatio?: string;\n /**\n * Bluechip holders count\n */\n bluechipHolders?: number;\n /**\n * Bluechip total holdings\n */\n bluechipHoldings?: string;\n /**\n * Bluechip holdings ratio\n */\n bluechipHoldingsRatio?: string;\n /**\n * KOL holders count\n */\n kolHolders?: number;\n /**\n * KOL total holdings\n */\n kolHoldings?: string;\n /**\n * KOL holdings ratio\n */\n kolHoldingsRatio?: string;\n /**\n * Sniper holders count\n */\n sniperHolders?: number;\n /**\n * Sniper total holdings\n */\n sniperHoldings?: string;\n /**\n * Sniper holdings ratio\n */\n sniperHoldingsRatio?: string;\n /**\n * Pro holders count\n */\n proHolders?: number;\n /**\n * Pro total holdings\n */\n proHoldings?: string;\n /**\n * Pro holdings ratio\n */\n proHoldingsRatio?: string;\n /**\n * Insider holders count\n */\n insiderHolders?: number;\n /**\n * Insider total holdings\n */\n insiderHoldings?: string;\n /**\n * Insider holdings ratio\n */\n insiderHoldingsRatio?: string;\n /**\n * Sandwich holders count\n */\n sandwichHolders?: number;\n /**\n * Sandwich total holdings\n */\n sandwichHoldings?: string;\n /**\n * Sandwich holdings ratio\n */\n sandwichHoldingsRatio?: string;\n /**\n * Fresh holders count\n */\n freshHolders?: number;\n /**\n * Fresh total holdings\n */\n freshHoldings?: string;\n /**\n * Fresh holdings ratio\n */\n freshHoldingsRatio?: string;\n /**\n * Bundle holders count\n */\n bundleHolders?: number;\n /**\n * Bundle total holdings\n */\n bundleHoldings?: string;\n /**\n * Bundle holdings ratio\n */\n bundleHoldingsRatio?: string;\n /**\n * Dev holders count\n */\n devHolders?: number;\n /**\n * Dev total holdings\n */\n devHoldings?: string;\n /**\n * Dev holdings ratio\n */\n devHoldingsRatio?: string;\n}\n\nexport interface TokenLiquidity {\n /**\n * pool avatar image\n */\n image?: string;\n /**\n * pair token address.\n */\n pairAddress?: string;\n /**\n * pool address.\n */\n poolAddress?: string;\n /**\n * program address.\n */\n programAddress?: string;\n /**\n * protocol name.\n */\n protocolName?: string;\n /**\n * protocol family.\n */\n protocolFamily?: string;\n /**\n * tvl in quote token.\n */\n tvl?: string;\n /**\n * tvl in usd.\n */\n tvlInUsd?: string;\n}\n\n/**\n * TODO: more security checks\n */\nexport interface TokenSecurity {\n /**\n * whether the token has transfer fee.\n */\n hasTransferFee?: boolean;\n /**\n * whether the token transfer fee is upgradable.\n */\n isTransferFeeUpgradable?: boolean;\n /**\n * whether the token is transferable.\n */\n isTransferable?: boolean;\n /**\n * whether the token is freezable.\n */\n isFreezable?: boolean;\n /**\n * whether the token is closable.\n */\n isClosable?: boolean;\n}\n\nexport type TokenResolution =\n | \"1s\"\n | \"15s\"\n | \"30s\"\n | \"1m\"\n | \"5m\"\n | \"15m\"\n | \"30m\"\n | \"1h\"\n | \"4h\"\n | \"12h\"\n | \"24h\";\n\nexport interface TokenCandle {\n /**\n * open price in usd\n */\n open: string;\n /**\n * close price in usd\n */\n close: string;\n /**\n * high price in usd\n */\n high: string;\n /**\n * low price in usd\n */\n low: string;\n /**\n * volume in usd\n */\n volume: string;\n /**\n * resolution\n */\n resolution: TokenResolution;\n /**\n * timestamp\n */\n timestamp: Date;\n}\n\n/**\n * Classification tag applied to a wallet in the context of a specific token holding.\n * See Phase 3 API doc — values are sparse (only 0.1%–2% of holders have tags).\n */\nexport type HolderTag =\n | \"kol\"\n | \"smart\"\n | \"sniper\"\n | \"dev\"\n | \"bundle\"\n | \"bluechip\"\n | (string & {});\n\nexport interface TokenHolder {\n /**\n * holder wallet address\n */\n address: string;\n /**\n * holdings amount in token\n */\n amount: string;\n /**\n * holdings amount in usd\n */\n amountInUsd: string;\n /**\n * holdings ratio, range is 0-100\n */\n ratio: string;\n /**\n * Holder classification tags (Phase 3). Sparse — only present when the\n * wallet matches one of the known patterns (kol/smart/sniper/dev/...).\n */\n tags?: Array<HolderTag>;\n /**\n * The last time this wallet was active on-chain (Phase 3).\n * Sparse (~80% fill rate).\n */\n lastActiveAt?: Date;\n /**\n * The first time this wallet started holding this token (Phase 3).\n * Sparse (~60% fill rate).\n */\n startHoldingAt?: Date;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACmLO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,eAAY;AAFF,SAAAA;AAAA,GAAA;;;AC5KZ,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,sBAAsB,OAAO,uBAAuB,CAAC;AAC5D,SAAO,oBAAoB,mBAAmB,IAAI;AACpD;AAEA,IAAO,kBAAQ;;;ACZR,IAAK,QAAL,kBAAKC,WAAL;AACL,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,UAAO;AACP,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,WAAQ;AACR,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,aAAU;AACV,EAAAA,OAAA,YAAS;AACT,EAAAA,OAAA,YAAS;AACT,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,WAAQ;AACR,EA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AACR,EAAAA,qBAAA,mBAAgB;AAChB,EAAAA,qBAAA,cAAW;AAhBD,SAAAA;AAAA,GAAA;AAqBL,IAAM,yBAAyB,OAAO,OAAO,mBAAmB;","names":["SwapMode","Chain","ChainNamespace","SolanaTokenProtocol"]}
|
package/dist/index.mjs
CHANGED
|
@@ -20,9 +20,9 @@ var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
|
|
|
20
20
|
// src/version.ts
|
|
21
21
|
if (typeof window !== "undefined") {
|
|
22
22
|
window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};
|
|
23
|
-
window.__LIBERFI_VERSION__["@liberfi.io/types"] = "0.
|
|
23
|
+
window.__LIBERFI_VERSION__["@liberfi.io/types"] = "0.2.0";
|
|
24
24
|
}
|
|
25
|
-
var version_default = "0.
|
|
25
|
+
var version_default = "0.2.0";
|
|
26
26
|
|
|
27
27
|
// src/chains.ts
|
|
28
28
|
var Chain = /* @__PURE__ */ ((Chain2) => {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/index.ts","../src/api/dex.ts","../src/version.ts","../src/chains.ts","../src/token.ts"],"sourcesContent":["export * from \"./dex\";\nexport * from \"./pagination\";\n","import { Activity, ActivityType, Trade } from \"../activity\";\nimport { Chain } from \"../chains\";\nimport {\n Token,\n TokenCandle,\n TokenHolder,\n TokenMarketData,\n TokenResolution,\n TokenSecurity,\n TokenStats,\n} from \"../token\";\nimport {\n Portfolio,\n PortfolioPnl,\n WalletPnl,\n WalletPortfolioPnls,\n WalletPortfolios,\n} from \"../wallet\";\nimport { CursorPagination } from \"./pagination\";\n\n/**\n * Cursor list result data\n */\nexport interface CursorList<T> extends CursorPagination {\n data: Array<T>;\n}\n\n/**\n * Cursor list query options\n */\nexport interface CursorListOptions {\n /** query cursor */\n cursor?: string;\n /** return limit */\n limit?: number;\n /** query direction */\n direction?: \"next\" | \"prev\";\n}\n\n/**\n * Options for getting token candles\n */\nexport interface GetTokenCandlesOptions {\n /** query candles after this timestamp */\n after?: Date;\n /** query candles before this timestamp */\n before?: Date;\n /** return limit */\n limit?: number;\n}\n\n/**\n * Token field for filtering\n */\nexport type TokenFieldOption =\n | \"price\"\n | \"priceChange1m\"\n | \"priceChange5m\"\n | \"priceChange15m\"\n | \"priceChange30m\"\n | \"priceChange1h\"\n | \"priceChange4h\"\n | \"priceChange24h\"\n | \"marketCap\"\n | \"tvl\"\n | \"top10Holdings\"\n | \"top10Ratio\"\n | \"top100Holdings\"\n | \"top100Ratio\"\n | \"holders\"\n | \"creatorsHoldings\"\n | \"creatorsRatio\"\n | \"buys1m\"\n | \"buys5m\"\n | \"buys15m\"\n | \"buys30m\"\n | \"buys1h\"\n | \"buys4h\"\n | \"buys24h\"\n | \"sells1m\"\n | \"sells5m\"\n | \"sells15m\"\n | \"sells30m\"\n | \"sells1h\"\n | \"sells4h\"\n | \"sells24h\"\n | \"trades1m\"\n | \"trades5m\"\n | \"trades15m\"\n | \"trades30m\"\n | \"trades1h\"\n | \"trades4h\"\n | \"trades24h\"\n | \"traders1m\"\n | \"traders5m\"\n | \"traders15m\"\n | \"traders30m\"\n | \"traders1h\"\n | \"traders4h\"\n | \"traders24h\"\n | \"volumes1m\"\n | \"volumes5m\"\n | \"volumes15m\"\n | \"volumes30m\"\n | \"volumes1h\"\n | \"volumes4h\"\n | \"volumes24h\"\n | \"launchedFromProtocolFamily\"\n | \"migratedToProtocolFamily\"\n | \"tag\"\n | \"createdAt\"\n | (string & {});\n\n/**\n * Token filter option\n */\nexport interface TokenFilterOption {\n field: TokenFieldOption;\n operator:\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\"\n | \"between\"\n | \"in\"\n | \"nin\"\n | \"contains\"\n | \"notContains\"\n | \"startsWith\"\n | \"endsWith\"\n | \"isNotNull\"\n | \"isNull\";\n value?: string | number | boolean | Array<string | number | boolean>;\n}\n\n/**\n * Options for getting token list\n */\nexport interface GetTokenListOptions {\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** search keywords */\n keywords?: Array<string>;\n /** exclude keywords */\n excludeKeywords?: Array<string>;\n}\n\n/**\n * Options for searching tokens\n */\nexport interface SearchTokensOptions extends CursorListOptions {\n /** chains */\n chains?: Array<Chain>;\n /** search keyword */\n keyword?: string;\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n}\n\n/**\n * Search token cursor list\n */\nexport interface SearchTokenCursorList extends CursorList<Token> {\n /** total count */\n total?: number;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport enum SwapMode {\n EXACT_IN = \"exact_in\",\n EXACT_OUT = \"exact_out\",\n}\n\n/** DEX identifier used for route / mint address conversion. */\nexport type SwapDex = \"jupiter\" | \"kyberswap\";\n\nexport interface SwapParams {\n /** chain id */\n chain: Chain;\n /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */\n dex?: SwapDex;\n /** user wallet address */\n userAddress: string;\n /** input token address */\n input: string;\n /** output token address */\n output: string;\n /** swap mode, e.g. ExactIn, ExactOut */\n mode: SwapMode;\n /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */\n amount: string;\n /** slippage, range is 0-100 */\n slippage?: number;\n /** priority fee */\n priorityFee?: string;\n /** tip fee */\n tipFee?: string;\n /** whether to use anti-MEV */\n isAntiMev?: boolean;\n /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */\n permit?: string;\n /** deadline timestamp in ms (EVM only) */\n deadline?: number;\n}\n\nexport interface SwapRoutePlan {\n /** protocol name / dex name etc. */\n name: string;\n /** input token address */\n input: string;\n /** input token amount */\n inputAmount: string;\n /** output token address */\n output: string;\n /** output token amount */\n outputAmount: string;\n /** fee quote token address */\n feeQuote?: string;\n /** fee amount */\n feeAmount?: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SwapRoute {\n /** unsigned tx in base64 format */\n serializedTx: string;\n /** recent blockhash embedded in the unsigned Solana transaction */\n recentBlockhash?: string;\n /** last block height at which the embedded Solana blockhash remains valid */\n lastValidBlockHeight?: number;\n /** swap plans */\n plans: Array<SwapRoutePlan>;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface LatestBlockParams {\n /** chain id */\n chain: Chain;\n}\n\nexport interface BlockchainLatestBlock {\n /** latest block hash */\n blockhash: string;\n /** last valid block height for transactions built with the latest blockhash */\n lastValidBlockHeight: number;\n}\n\nexport interface SendTxParams {\n /** chain id */\n chain: Chain;\n /** signed tx in base64 format */\n serializedTx: string;\n /** extra infos needed by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SendTxResult {\n /** tx hash */\n txHash: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\n/**\n * Options for getting trades\n */\nexport interface GetTradesOptions extends CursorListOptions {\n /** filter trades before this timestamp */\n before?: Date;\n /** filter trades after this timestamp */\n after?: Date;\n /** filter trades before this block height */\n beforeBlockHeight?: number;\n /** filter trades after this block height */\n afterBlockHeight?: number;\n /** filter trades by type */\n type?: \"buy\" | \"sell\";\n /** filter trades by pool address */\n poolAddress?: string;\n}\n\n/**\n * Options for getting activities\n */\nexport interface GetActivitiesOptions extends CursorListOptions {\n /** filter activities before this timestamp */\n before?: Date;\n /** filter activities after this timestamp */\n after?: Date;\n /** filter activities before this block height */\n beforeBlockHeight?: number;\n /** filter activities after this block height */\n afterBlockHeight?: number;\n /** filter activities by type */\n type?: ActivityType;\n /** filter activities by pool address */\n poolAddress?: string;\n}\n\n/**\n * Resolution subset supported by the trending token list.\n */\nexport type TrendingResolution = Extract<\n TokenResolution,\n \"1m\" | \"5m\" | \"1h\" | \"4h\" | \"24h\"\n>;\n\n/**\n * API client interface\n */\nexport interface IClient {\n /**\n * fetch token info\n * @param chain chain id\n * @param address token address\n * @returns token info\n */\n getToken(chain: Chain, address: string): Promise<Token>;\n\n /**\n * fetch token infos in batch\n * @param chain chain id\n * @param addresses token addresses\n * @returns token infos\n */\n getTokens(chain: Chain, addresses: Array<string>): Promise<Array<Token>>;\n\n /**\n * fetch token candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param options optional query options\n * @returns token candles\n */\n getTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n options?: GetTokenCandlesOptions,\n ): Promise<Array<TokenCandle>>;\n\n /**\n * fetch token security\n * @param chain chain id\n * @param address token address\n * @returns token security\n */\n getTokenSecurity(chain: Chain, address: string): Promise<TokenSecurity>;\n\n /**\n * fetch token stats\n * @param chain chain id\n * @param address token address\n * @returns token stats\n */\n getTokenStats(chain: Chain, address: string): Promise<TokenStats>;\n\n /**\n * fetch token holders\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token holders\n */\n getTokenHolders(\n chain: Chain,\n address: string,\n options?: CursorListOptions,\n ): Promise<CursorList<TokenHolder>>;\n\n /**\n * fetch token market data\n * @param chain chain id\n * @param address token address\n * @returns token market data\n */\n getTokenMarketData(chain: Chain, address: string): Promise<TokenMarketData>;\n\n /**\n * fetch `New` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `New` token list\n */\n getNewTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Final Stretch` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Final Stretch` token list\n */\n getFinalStretchTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Migrated` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Migrated` token list\n */\n getMigratedTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Trending` token list\n * @param chain chain id\n * @param resolution query resolution, e.g. \"1m\", \"5m\", \"1h\", \"4h\", \"24h\"\n * @param options optional query options\n * @returns `Trending` token list\n */\n getTrendingTokens(\n chain: Chain,\n resolution: TrendingResolution,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Stock` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Stock` token list\n */\n getStockTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * search tokens\n * @param options optional query options\n * @returns search token cursor list\n */\n searchTokens(options?: SearchTokensOptions): Promise<SearchTokenCursorList>;\n\n /**\n * fetch swap route plans\n * @param params swap params\n * @returns swap route plans\n */\n swapRoute(params: SwapParams): Promise<SwapRoute>;\n\n /**\n * fetch latest block metadata\n * @param params latest block params\n * @returns latest block metadata\n */\n getLatestBlock(params: LatestBlockParams): Promise<BlockchainLatestBlock>;\n\n /**\n * send tx\n * @param params send tx params\n * @returns send tx result\n */\n sendTx(params: SendTxParams): Promise<SendTxResult>;\n\n /**\n * check if tx is successful\n * @param chain chain id\n * @param txHash tx hash\n * @param timeout timeout in milliseconds\n * @returns true if tx is successful, false otherwise\n */\n checkTxSuccess(\n chain: Chain,\n txHash: string,\n timeout?: number,\n ): Promise<boolean>;\n\n /**\n * fetch wallet portfolios\n * @param chain chain id\n * @param address wallet address\n * @param options optional pagination options\n * @returns wallet portfolios\n */\n getWalletPortfolios(\n chain: Chain,\n address: string,\n options?: { cursor?: string; limit?: number },\n ): Promise<WalletPortfolios>;\n\n /**\n * fetch wallet PnL summary\n * @param chain chain id\n * @param address wallet address\n * @param resolution pnl resolution (e.g. \"7d\", \"30d\")\n * @returns wallet pnl summary\n */\n getWalletPnl(\n chain: Chain,\n address: string,\n resolution?: string,\n ): Promise<WalletPnl>;\n\n /**\n * fetch wallet portfolio PnL details (per-token)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns portfolio pnl list with summary\n */\n getWalletPortfolioPnls(\n chain: Chain,\n address: string,\n options?: { cursor?: string; limit?: number },\n ): Promise<WalletPortfolioPnls>;\n\n /**\n * fetch wallet portfolios for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio list for the specified tokens\n */\n getWalletPortfoliosByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<Portfolio>>;\n\n /**\n * fetch wallet portfolio PnL for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio pnl list for the specified tokens\n */\n getWalletPortfolioPnlsByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<PortfolioPnl>>;\n\n /**\n * fetch wallet's trade activities\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's trade activities\n */\n getWalletTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch token's trade activities\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's trade activities\n */\n getTokenTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch wallet's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's activities\n */\n getWalletActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * fetch token's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's activities\n */\n getTokenActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * get presigned upload url\n * @returns presigned upload url\n */\n getPresignedUploadUrl(): Promise<string>;\n}\n\nexport interface ISubscription {\n unsubscribe(): void;\n}\n\n/**\n * Incremental token update from subscriptions.\n * `chain` + `address` identify the token; all other fields are optional —\n * `undefined` means this push did not carry that field.\n */\nexport type TokenSubscribed = Partial<Omit<Token, \"chain\" | \"address\">> &\n Pick<Token, \"chain\" | \"address\">;\n\nexport interface WalletPnlSubscribed extends WalletPnl {\n /** pnl resolution (e.g. \"7d\", \"30d\") */\n resolution?: string;\n}\n\nexport interface PortfolioSubscribed {\n /** chain id */\n chain: Chain;\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n /** token current price in usd */\n priceInUsd?: string;\n /** holding token amount */\n amount?: string;\n}\n\nexport type PortfolioPnlSubscribed = Partial<\n Omit<PortfolioPnl, \"address\" | \"name\" | \"symbol\" | \"image\">\n> & {\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n};\n\n/**\n * Subscribe client interface\n */\nexport interface ISubscribeClient {\n /**\n * Subscribe to a token's real-time data updates (stats, market data,\n * holders, liquidity, etc.). The client internally manages multiple\n * backend channels and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param address token address\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeToken(\n chain: Chain,\n address: string,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token new candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n callback: (candles: Array<TokenCandle>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPnl(\n chain: Chain,\n address: string,\n callback: (pnls: Array<WalletPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolios(\n chain: Chain,\n address: string,\n callback: (portfolios: Array<PortfolioSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolioPnls(\n chain: Chain,\n address: string,\n callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new trade activities\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new trade activities\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `New` token list real-time updates. The client internally\n * manages multiple backend channels (new token events, metadata, stats,\n * holders, supply, liquidity, bonding curve) and delivers incremental\n * updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeNewTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Trending` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeTrendingTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Migrated` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeMigratedTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `FinalStretch` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity, bonding curve) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeFinalStretchTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Stock` token list real-time updates. The client internally\n * manages multiple backend channels (stats, holders, supply, liquidity)\n * and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeStockTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n}\n","declare global {\n interface Window {\n __LIBERFI_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif (typeof window !== \"undefined\") {\n window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};\n window.__LIBERFI_VERSION__[\"@liberfi.io/types\"] = \"0.1.178\";\n}\n\nexport default \"0.1.178\";\n","export enum Chain {\n ETHEREUM = \"1\",\n UBIQ = \"8\",\n OPTIMISM = \"10\",\n FLARE = \"14\",\n SONGBIRD = \"19\",\n ELASTOS = \"20\",\n KARDIA = \"24\",\n CRONOS = \"25\",\n RSK = \"30\",\n TELOS = \"40\",\n LUKSO = \"42\",\n CRAB = \"44\",\n DARWINIA = \"46\",\n XDC = \"50\",\n CSC = \"52\",\n ZYX = \"55\",\n BINANCE = \"56\",\n BINANCE_TESTNET = \"97\",\n SYSCOIN = \"57\",\n GOCHAIN = \"60\",\n ETHEREUMCLASSIC = \"61\",\n OKEXCHAIN = \"66\",\n HOO = \"70\",\n METER = \"82\",\n NOVA_NETWORK = \"87\",\n TOMOCHAIN = \"88\",\n BITKUB = \"96\",\n XDAI = \"100\",\n VELAS = \"106\",\n THUNDERCORE = \"108\",\n ENULS = \"119\",\n FUSE = \"122\",\n HECO = \"128\",\n UNICHAIN = \"130\",\n POLYGON = \"137\",\n SONIC = \"146\",\n SHIMMER_EVM = \"148\",\n RBN = \"151\",\n OMNI = \"166\",\n MANTA = \"169\",\n HSK = \"177\",\n WATER = \"181\",\n XLAYER = \"196\",\n XDAIARB = \"200\",\n OP_BNB = \"204\",\n VINUCHAIN = \"207\",\n ENERGYWEB = \"246\",\n OASYS = \"248\",\n FANTOM = \"250\",\n FRAXTAL = \"252\",\n HPB = \"269\",\n BOBA = \"288\",\n OMAX = \"311\",\n FILECOIN = \"314\",\n KUCOIN = \"321\",\n ZKSYNC_ERA = \"324\",\n SHIDEN = \"336\",\n THETA = \"361\",\n PULSE = \"369\",\n CRONOS_ZKEVM = \"388\",\n SX = \"416\",\n AREON = \"463\",\n WC = \"480\",\n CANDLE = \"534\",\n ROLLUX = \"570\",\n ASTAR = \"592\",\n REDSTONE = \"690\",\n MATCHAIN = \"698\",\n CALLISTO = \"820\",\n TARA = \"841\",\n WANCHAIN = \"888\",\n LYRA_CHAIN = \"957\",\n BIFROST = \"996\",\n CONFLUX = \"1030\",\n METIS = \"1088\",\n DYMENSION = \"1100\",\n POLYGON_ZKEVM = \"1101\",\n CORE = \"1116\",\n LISK = \"1135\",\n ULTRON = \"1231\",\n STEP = \"1234\",\n MOONBEAM = \"1284\",\n MOONRIVER = \"1285\",\n SEI = \"1329\",\n LIVING_ASSETS_MAINNET = \"1440\",\n STY = \"1514\",\n TENET = \"1559\",\n GRAVITY = \"1625\",\n REYA_NETWORK = \"1729\",\n SONEIUM = \"1868\",\n SWELLCHAIN = \"1923\",\n ONUS = \"1975\",\n HUBBLENET = \"1992\",\n SANKO = \"1996\",\n DOGECHAIN = \"2000\",\n MILKOMEDA = \"2001\",\n MILKOMEDA_A1 = \"2002\",\n KAVA = \"2222\",\n SOMA = \"2332\",\n KARAK = \"2410\",\n ABSTRACT = \"2741\",\n ABSTRACT_TESTNET = \"11124\",\n MORPH = \"2818\",\n CROSSFI = \"4158\",\n BEAM = \"4337\",\n IOTEX = \"4689\",\n MANTLE = \"5000\",\n XLC = \"5050\",\n NAHMII = \"5551\",\n BOUNCEBIT = \"6001\",\n TOMBCHAIN = \"6969\",\n ZETACHAIN = \"7000\",\n PLANQ = \"7070\",\n BITROCK = \"7171\",\n XSAT = \"7200\",\n CYETH = \"7560\",\n CANTO = \"7700\",\n KLAYTN = \"8217\",\n THAT = \"8428\",\n BASE = \"8453\",\n HELA = \"8668\",\n IOTAEVM = \"8822\",\n JBC = \"8899\",\n EVMOS = \"9001\",\n CARBON = \"9790\",\n SMARTBCH = \"10000\",\n ARTELA = \"11820\",\n IMMUTABLE_ZKEVM = \"13371\",\n LOOP = \"15551\",\n GENESYS = \"16507\",\n EOS_EVM = \"17777\",\n MAP_PROTOCOL = \"22776\",\n SAPPHIRE = \"23294\",\n BITGERT = \"32520\",\n FUSION = \"32659\",\n ZILLIQA = \"32769\",\n APECHAIN = \"33139\",\n EDU_CHAIN = \"41923\",\n ARBITRUM = \"42161\",\n ARBITRUM_TESTNET_GOERLI = \"421613\",\n ARBITRUM_TESTNET_SEPOLIA = \"421614\",\n ARBITRUM_NOVA = \"42170\",\n CELO = \"42220\",\n OASIS = \"42262\",\n ASSETCHAIN = \"42420\",\n ETHERLINK = \"42793\",\n AVALANCHE = \"43114\",\n REI = \"47805\",\n ZIRCUIT = \"48900\",\n SOPHON = \"50104\",\n ETN = \"52014\",\n SUPERPOSITION = \"55244\",\n REICHAIN = \"55555\",\n BOBA_BNB = \"56288\",\n INK = \"57073\",\n LINEA = \"59144\",\n BOB = \"60808\",\n GODWOKEN = \"71402\",\n BERACHAIN = \"80094\",\n BLAST = \"81457\",\n CHILIZ = \"88888\",\n STRATIS = \"105105\",\n REAL = \"111188\",\n ODYSSEY = \"153153\",\n TAIKO = \"167000\",\n BITLAYER = \"200901\",\n HYDRATION = \"222222\",\n PAREX = \"322202\",\n POLIS = \"333999\",\n KEKCHAIN = \"420420\",\n SCROLL = \"534352\",\n ZERO_NETWORK = \"543210\",\n ZKLINK_NOVA = \"810180\",\n VISION = \"888888\",\n SAAKURU = \"7225878\",\n ZORA = \"7777777\",\n CORN = \"21000000\",\n NEON = \"245022934\",\n LUMIA = \"994873017\",\n AURORA = \"1313161554\",\n HARMONY = \"1666600000\",\n PALM = \"11297108109\",\n ZENIQ = \"383414847825\",\n CURIO = \"836542336838601\",\n MODE = \"34443\",\n SOLANA = \"900900900\",\n SOLANA_TESTNET = \"901901901\",\n SOLANA_DEVNET = \"902902902\",\n}\n\nexport enum ChainNamespace {\n EVM = \"EVM\",\n SOLANA = \"SOL\",\n}\n","import { Chain } from \"./chains\";\n\nexport enum SolanaTokenProtocol {\n BAGS = \"bags\",\n BELIEVE = \"believe\",\n BONK = \"bonk\",\n BOOP = \"boop\",\n HEAVEN = \"heaven\",\n JUPSTUDIO = \"jupstudio\",\n LAUNCHLAB = \"launchlab\",\n METEORA = \"meteora\",\n MOONIT = \"moonit\",\n MOONSHOT = \"moonshot\",\n ORCA = \"orca\",\n PUMP = \"pump\",\n RAYDIUM = \"raydium\",\n SUGAR = \"sugar\",\n VIRTUAL_CURVE = \"virtual-curve\",\n PUMP_AMM = \"pump-amm\",\n}\n\nexport type TokenProtocol = SolanaTokenProtocol | (string & {});\n\nexport const SOLANA_TOKEN_PROTOCOLS = Object.values(SolanaTokenProtocol);\n\nexport interface Token {\n /**\n * chain id.\n */\n chain: Chain;\n /**\n * token name, e.g. \"Ethereum\", \"Solana\", etc.\n */\n name: string;\n /**\n * token symbol, e.g. \"ETH\", \"SOL\", etc.\n */\n symbol: string;\n /**\n * token address.\n */\n address: string;\n /**\n * token decimals.\n */\n decimals: number;\n /**\n * token avatar image url.\n */\n image?: string;\n /**\n * token description.\n */\n description?: string;\n /**\n * token creators.\n */\n creators?: Array<TokenCreator>;\n /**\n * token launch info.\n */\n launchedFrom?: TokenLaunchedFrom;\n /**\n * token migrate progress, range is 0-100.\n */\n migrateProgress?: string;\n /**\n * token migrate info.\n */\n migratedTo?: TokenMigratedTo;\n /**\n * token social medias.\n */\n socialMedias?: TokenSocialMedias;\n /**\n * token stats.\n */\n stats?: TokenStats;\n /**\n * token market data.\n */\n marketData?: TokenMarketData;\n /**\n * token liquidity pools\n */\n liquidities?: Array<TokenLiquidity>;\n /**\n * token security.\n */\n security?: TokenSecurity;\n /**\n * token tags.\n */\n tags?: Array<string>;\n /**\n * token create time.\n */\n createdAt?: Date;\n}\n\nexport interface TokenCreator {\n /**\n * token creator's wallet address.\n */\n address?: string;\n /**\n * token creator's share percentage, range is 0-100.\n */\n share?: number;\n /**\n * whether the token creator is verified.\n */\n isVerified?: boolean;\n}\n\nexport interface TokenLaunchedFrom {\n /**\n * token launch program address.\n */\n programAddress?: string;\n /**\n * token launch protocol family.\n */\n protocolFamily?: string;\n}\n\nexport interface TokenMigratedTo {\n /**\n * token migrate program address.\n */\n programAddress?: string;\n /**\n * token migrate protocol family.\n */\n protocolFamily?: string;\n /**\n * token migrate pool address.\n */\n poolAddress?: string;\n /**\n * token migrate time.\n */\n migratedAt?: Date;\n}\n\nexport interface TokenSocialMedias {\n /**\n * token twitter url.\n */\n twitter?: string;\n /**\n * token telegram url.\n */\n telegram?: string;\n /**\n * token website url.\n */\n website?: string;\n /**\n * token tiktok url.\n */\n tiktok?: string;\n /**\n * token discord url.\n */\n discord?: string;\n /**\n * token facebook url.\n */\n facebook?: string;\n /**\n * token github url.\n */\n github?: string;\n /**\n * token instagram url.\n */\n instagram?: string;\n /**\n * token linkedin url.\n */\n linkedin?: string;\n /**\n * token medium url.\n */\n medium?: string;\n /**\n * token reddit url.\n */\n reddit?: string;\n /**\n * token youtube url.\n */\n youtube?: string;\n /**\n * token bitbucket url.\n */\n bitbucket?: string;\n}\n\nexport interface TokenStats {\n /**\n * token stats by 1m timeframe.\n */\n \"1m\"?: TokenStatsByResolution;\n /**\n * token stats by 5m timeframe.\n */\n \"5m\"?: TokenStatsByResolution;\n /**\n * token stats by 15m timeframe.\n */\n \"15m\"?: TokenStatsByResolution;\n /**\n * token stats by 30m timeframe.\n */\n \"30m\"?: TokenStatsByResolution;\n /**\n * token stats by 1h timeframe.\n */\n \"1h\"?: TokenStatsByResolution;\n /**\n * token stats by 4h timeframe.\n */\n \"4h\"?: TokenStatsByResolution;\n /**\n * token stats by 24h timeframe.\n */\n \"24h\"?: TokenStatsByResolution;\n}\n\nexport interface TokenStatsByResolution {\n /**\n * buy txs count\n */\n buys?: number;\n /**\n * sell txs count\n */\n sells?: number;\n /**\n * txs count\n */\n trades?: number;\n /**\n * buy addresses count\n */\n buyers?: number;\n /**\n * sell addresses count\n */\n sellers?: number;\n /**\n * trade addresses count\n */\n traders?: number;\n /**\n * buy volumes in quote token\n */\n buyVolumes?: string;\n /**\n * sell volumes in quote token\n */\n sellVolumes?: string;\n /**\n * total volumes in quote token\n */\n volumes?: string;\n /**\n * buy volumes in usd\n */\n buyVolumesInUsd?: string;\n /**\n * sell volumes in usd\n */\n sellVolumesInUsd?: string;\n /**\n * total volumes in usd\n */\n volumesInUsd?: string;\n /**\n * open price in usd\n */\n openPriceInUsd?: string;\n /**\n * close price in usd\n */\n closePriceInUsd?: string;\n /**\n * high price in usd\n */\n highPriceInUsd?: string;\n /**\n * low price in usd\n */\n lowPriceInUsd?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * price change %\n */\n priceChange?: string;\n}\n\nexport interface TokenMarketData {\n /**\n * total supply\n */\n totalSupply?: string;\n /**\n * market cap in quote token\n */\n marketCap?: string;\n /**\n * market cap in usd\n */\n marketCapInUsd?: string;\n /**\n * price in quote token\n */\n price?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * tvl in quote token\n */\n tvl?: string;\n /**\n * tvl in usd\n */\n tvlInUsd?: string;\n /**\n * holders count\n */\n holders?: number;\n /**\n * top 10 total holdings\n */\n top10Holdings?: string;\n /**\n * top 10 holdings ratio\n */\n top10HoldingsRatio?: string;\n /**\n * top 50 total holdings\n */\n top50Holdings?: string;\n /**\n * top 50 holdings ratio\n */\n top50HoldingsRatio?: string;\n /**\n * top 100 total holdings\n */\n top100Holdings?: string;\n /**\n * top 100 holdings ratio\n */\n top100HoldingsRatio?: string;\n /**\n * Bluechip holders count\n */\n bluechipHolders?: number;\n /**\n * Bluechip total holdings\n */\n bluechipHoldings?: string;\n /**\n * Bluechip holdings ratio\n */\n bluechipHoldingsRatio?: string;\n /**\n * KOL holders count\n */\n kolHolders?: number;\n /**\n * KOL total holdings\n */\n kolHoldings?: string;\n /**\n * KOL holdings ratio\n */\n kolHoldingsRatio?: string;\n /**\n * Sniper holders count\n */\n sniperHolders?: number;\n /**\n * Sniper total holdings\n */\n sniperHoldings?: string;\n /**\n * Sniper holdings ratio\n */\n sniperHoldingsRatio?: string;\n /**\n * Pro holders count\n */\n proHolders?: number;\n /**\n * Pro total holdings\n */\n proHoldings?: string;\n /**\n * Pro holdings ratio\n */\n proHoldingsRatio?: string;\n /**\n * Insider holders count\n */\n insiderHolders?: number;\n /**\n * Insider total holdings\n */\n insiderHoldings?: string;\n /**\n * Insider holdings ratio\n */\n insiderHoldingsRatio?: string;\n /**\n * Sandwich holders count\n */\n sandwichHolders?: number;\n /**\n * Sandwich total holdings\n */\n sandwichHoldings?: string;\n /**\n * Sandwich holdings ratio\n */\n sandwichHoldingsRatio?: string;\n /**\n * Fresh holders count\n */\n freshHolders?: number;\n /**\n * Fresh total holdings\n */\n freshHoldings?: string;\n /**\n * Fresh holdings ratio\n */\n freshHoldingsRatio?: string;\n /**\n * Bundle holders count\n */\n bundleHolders?: number;\n /**\n * Bundle total holdings\n */\n bundleHoldings?: string;\n /**\n * Bundle holdings ratio\n */\n bundleHoldingsRatio?: string;\n /**\n * Dev holders count\n */\n devHolders?: number;\n /**\n * Dev total holdings\n */\n devHoldings?: string;\n /**\n * Dev holdings ratio\n */\n devHoldingsRatio?: string;\n}\n\nexport interface TokenLiquidity {\n /**\n * pool avatar image\n */\n image?: string;\n /**\n * pair token address.\n */\n pairAddress?: string;\n /**\n * pool address.\n */\n poolAddress?: string;\n /**\n * program address.\n */\n programAddress?: string;\n /**\n * protocol name.\n */\n protocolName?: string;\n /**\n * protocol family.\n */\n protocolFamily?: string;\n /**\n * tvl in quote token.\n */\n tvl?: string;\n /**\n * tvl in usd.\n */\n tvlInUsd?: string;\n}\n\n/**\n * TODO: more security checks\n */\nexport interface TokenSecurity {\n /**\n * whether the token has transfer fee.\n */\n hasTransferFee?: boolean;\n /**\n * whether the token transfer fee is upgradable.\n */\n isTransferFeeUpgradable?: boolean;\n /**\n * whether the token is transferable.\n */\n isTransferable?: boolean;\n /**\n * whether the token is freezable.\n */\n isFreezable?: boolean;\n /**\n * whether the token is closable.\n */\n isClosable?: boolean;\n}\n\nexport type TokenResolution =\n | \"1s\"\n | \"15s\"\n | \"30s\"\n | \"1m\"\n | \"5m\"\n | \"15m\"\n | \"30m\"\n | \"1h\"\n | \"4h\"\n | \"12h\"\n | \"24h\";\n\nexport interface TokenCandle {\n /**\n * open price in usd\n */\n open: string;\n /**\n * close price in usd\n */\n close: string;\n /**\n * high price in usd\n */\n high: string;\n /**\n * low price in usd\n */\n low: string;\n /**\n * volume in usd\n */\n volume: string;\n /**\n * resolution\n */\n resolution: TokenResolution;\n /**\n * timestamp\n */\n timestamp: Date;\n}\n\nexport interface TokenHolder {\n /**\n * holder wallet address\n */\n address: string;\n /**\n * holdings amount in token\n */\n amount: string;\n /**\n * holdings amount in usd\n */\n amountInUsd: string;\n /**\n * holdings ratio, range is 0-100\n */\n ratio: string;\n}\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACmLO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,eAAY;AAFF,SAAAA;AAAA,GAAA;;;AC5KZ,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,sBAAsB,OAAO,uBAAuB,CAAC;AAC5D,SAAO,oBAAoB,mBAAmB,IAA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,aAAU;AACV,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,mBAAgB;AAChB,EAAAA,qBAAA,cAAW;AAhBD,SAAAA;AAAA,GAAA;AAqBL,IAAM,yBAAyB,OAAO,OAAO,mBAAmB;","names":["SwapMode","Chain","ChainNamespace","SolanaTokenProtocol"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/index.ts","../src/api/dex.ts","../src/version.ts","../src/chains.ts","../src/token.ts"],"sourcesContent":["export * from \"./dex\";\nexport * from \"./pagination\";\n","import { Activity, ActivityType, Trade } from \"../activity\";\nimport { Chain } from \"../chains\";\nimport {\n Token,\n TokenCandle,\n TokenHolder,\n TokenMarketData,\n TokenResolution,\n TokenSecurity,\n TokenStats,\n} from \"../token\";\nimport {\n Portfolio,\n PortfolioPnl,\n WalletPnl,\n WalletPortfolioPnls,\n WalletPortfolios,\n} from \"../wallet\";\nimport { CursorPagination } from \"./pagination\";\n\n/**\n * Cursor list result data\n */\nexport interface CursorList<T> extends CursorPagination {\n data: Array<T>;\n}\n\n/**\n * Cursor list query options\n */\nexport interface CursorListOptions {\n /** query cursor */\n cursor?: string;\n /** return limit */\n limit?: number;\n /** query direction */\n direction?: \"next\" | \"prev\";\n}\n\n/**\n * Options for getting token candles\n */\nexport interface GetTokenCandlesOptions {\n /** query candles after this timestamp */\n after?: Date;\n /** query candles before this timestamp */\n before?: Date;\n /** return limit */\n limit?: number;\n}\n\n/**\n * Token field for filtering\n */\nexport type TokenFieldOption =\n | \"price\"\n | \"priceChange1m\"\n | \"priceChange5m\"\n | \"priceChange15m\"\n | \"priceChange30m\"\n | \"priceChange1h\"\n | \"priceChange4h\"\n | \"priceChange24h\"\n | \"marketCap\"\n | \"tvl\"\n | \"top10Holdings\"\n | \"top10Ratio\"\n | \"top100Holdings\"\n | \"top100Ratio\"\n | \"holders\"\n | \"creatorsHoldings\"\n | \"creatorsRatio\"\n | \"buys1m\"\n | \"buys5m\"\n | \"buys15m\"\n | \"buys30m\"\n | \"buys1h\"\n | \"buys4h\"\n | \"buys24h\"\n | \"sells1m\"\n | \"sells5m\"\n | \"sells15m\"\n | \"sells30m\"\n | \"sells1h\"\n | \"sells4h\"\n | \"sells24h\"\n | \"trades1m\"\n | \"trades5m\"\n | \"trades15m\"\n | \"trades30m\"\n | \"trades1h\"\n | \"trades4h\"\n | \"trades24h\"\n | \"traders1m\"\n | \"traders5m\"\n | \"traders15m\"\n | \"traders30m\"\n | \"traders1h\"\n | \"traders4h\"\n | \"traders24h\"\n | \"volumes1m\"\n | \"volumes5m\"\n | \"volumes15m\"\n | \"volumes30m\"\n | \"volumes1h\"\n | \"volumes4h\"\n | \"volumes24h\"\n | \"launchedFromProtocolFamily\"\n | \"migratedToProtocolFamily\"\n | \"tag\"\n | \"createdAt\"\n | (string & {});\n\n/**\n * Token filter option\n */\nexport interface TokenFilterOption {\n field: TokenFieldOption;\n operator:\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\"\n | \"between\"\n | \"in\"\n | \"nin\"\n | \"contains\"\n | \"notContains\"\n | \"startsWith\"\n | \"endsWith\"\n | \"isNotNull\"\n | \"isNull\";\n value?: string | number | boolean | Array<string | number | boolean>;\n}\n\n/**\n * Options for getting token list\n */\nexport interface GetTokenListOptions {\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** search keywords */\n keywords?: Array<string>;\n /** exclude keywords */\n excludeKeywords?: Array<string>;\n}\n\n/**\n * Options for searching tokens\n */\nexport interface SearchTokensOptions extends CursorListOptions {\n /** chains */\n chains?: Array<Chain>;\n /** search keyword */\n keyword?: string;\n /** filters */\n filters?: Array<TokenFilterOption>;\n /** sort field */\n sortBy?: TokenFieldOption;\n /** sort direction */\n sortDirection?: \"asc\" | \"desc\";\n}\n\n/**\n * Search token cursor list\n */\nexport interface SearchTokenCursorList extends CursorList<Token> {\n /** total count */\n total?: number;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport enum SwapMode {\n EXACT_IN = \"exact_in\",\n EXACT_OUT = \"exact_out\",\n}\n\n/** DEX identifier used for route / mint address conversion. */\nexport type SwapDex = \"jupiter\" | \"kyberswap\";\n\nexport interface SwapParams {\n /** chain id */\n chain: Chain;\n /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */\n dex?: SwapDex;\n /** user wallet address */\n userAddress: string;\n /** input token address */\n input: string;\n /** output token address */\n output: string;\n /** swap mode, e.g. ExactIn, ExactOut */\n mode: SwapMode;\n /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */\n amount: string;\n /** slippage, range is 0-100 */\n slippage?: number;\n /** priority fee */\n priorityFee?: string;\n /** tip fee */\n tipFee?: string;\n /** whether to use anti-MEV */\n isAntiMev?: boolean;\n /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */\n permit?: string;\n /** deadline timestamp in ms (EVM only) */\n deadline?: number;\n}\n\nexport interface SwapRoutePlan {\n /** protocol name / dex name etc. */\n name: string;\n /** input token address */\n input: string;\n /** input token amount */\n inputAmount: string;\n /** output token address */\n output: string;\n /** output token amount */\n outputAmount: string;\n /** fee quote token address */\n feeQuote?: string;\n /** fee amount */\n feeAmount?: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SwapRoute {\n /** unsigned tx in base64 format */\n serializedTx: string;\n /** recent blockhash embedded in the unsigned Solana transaction */\n recentBlockhash?: string;\n /** last block height at which the embedded Solana blockhash remains valid */\n lastValidBlockHeight?: number;\n /** swap plans */\n plans: Array<SwapRoutePlan>;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface LatestBlockParams {\n /** chain id */\n chain: Chain;\n}\n\nexport interface BlockchainLatestBlock {\n /** latest block hash */\n blockhash: string;\n /** last valid block height for transactions built with the latest blockhash */\n lastValidBlockHeight: number;\n}\n\nexport interface SendTxParams {\n /** chain id */\n chain: Chain;\n /** signed tx in base64 format */\n serializedTx: string;\n /** extra infos needed by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SendTxResult {\n /** tx hash */\n txHash: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\n/**\n * Options for getting trades\n */\nexport interface GetTradesOptions extends CursorListOptions {\n /** filter trades before this timestamp */\n before?: Date;\n /** filter trades after this timestamp */\n after?: Date;\n /** filter trades before this block height */\n beforeBlockHeight?: number;\n /** filter trades after this block height */\n afterBlockHeight?: number;\n /** filter trades by type */\n type?: \"buy\" | \"sell\";\n /** filter trades by pool address */\n poolAddress?: string;\n}\n\n/**\n * Sort field for activity list (Phase 3).\n * - `timestamp` — order by activity time (default, descending)\n * - `totalUsd` — order by USD amount (useful for finding whale trades)\n */\nexport type ActivitiesSortBy = \"timestamp\" | \"totalUsd\";\n\n/**\n * Options for getting activities\n */\nexport interface GetActivitiesOptions extends CursorListOptions {\n /** filter activities before this timestamp */\n before?: Date;\n /** filter activities after this timestamp */\n after?: Date;\n /** filter activities before this block height */\n beforeBlockHeight?: number;\n /** filter activities after this block height */\n afterBlockHeight?: number;\n /** filter activities by type */\n type?: ActivityType;\n /** filter activities by pool address */\n poolAddress?: string;\n /**\n * Sort field (Phase 3). Defaults to `timestamp` on the server. When changing\n * `sortBy`, the caller must discard the previous cursor and restart from page 1.\n */\n sortBy?: ActivitiesSortBy;\n}\n\n/**\n * Sort field for token holder list (Phase 3).\n * - `holdingUsd` — order by holding value in USD (default, descending)\n * - `lastActiveAt` — order by wallet's last activity time\n */\nexport type TokenHoldersSortBy = \"holdingUsd\" | \"lastActiveAt\";\n\n/**\n * Options for getting token holders (Phase 3).\n */\nexport interface GetTokenHoldersOptions extends CursorListOptions {\n /**\n * Sort field. Defaults to `holdingUsd` on the server.\n * Switching `sortBy` requires discarding the old cursor and restarting from page 1.\n */\n sortBy?: TokenHoldersSortBy;\n}\n\n/**\n * Resolution window for wallet PnL queries (Phase 3).\n */\nexport type WalletPnlResolution = \"7d\" | \"30d\" | \"90d\";\n\n/**\n * Position state filter for wallet PnL details (Phase 3).\n * - `open` — only tokens with current balance > 0 (default)\n * - `closed` — only tokens with balance == 0 (historical realized PnL)\n * - `all` — both open and closed positions\n */\nexport type PositionState = \"open\" | \"closed\" | \"all\";\n\n/**\n * Sort field for wallet PnL details (Phase 3).\n */\nexport type WalletPnlSortBy = \"totalPnl\" | \"realizedPnl\" | \"unrealizedPnl\";\n\n/**\n * Options for getting wallet portfolio PnL details (Phase 3).\n */\nexport interface GetWalletPortfolioPnlsOptions extends CursorListOptions {\n /**\n * Statistics time window. Defaults to `30d` in the Client implementation\n * for backward compatibility; the server requires this parameter and will\n * return 400 if it is missing.\n */\n resolution?: WalletPnlResolution;\n /** Position state filter. Defaults to `open` on the server. */\n positionState?: PositionState;\n /**\n * Sort field. Defaults to `totalPnl` on the server.\n * Switching `sortBy` requires discarding the old cursor.\n */\n sortBy?: WalletPnlSortBy;\n}\n\n/**\n * Resolution subset supported by the trending token list.\n */\nexport type TrendingResolution = Extract<\n TokenResolution,\n \"1m\" | \"5m\" | \"1h\" | \"4h\" | \"24h\"\n>;\n\n/**\n * API client interface\n */\nexport interface IClient {\n /**\n * fetch token info\n * @param chain chain id\n * @param address token address\n * @returns token info\n */\n getToken(chain: Chain, address: string): Promise<Token>;\n\n /**\n * fetch token infos in batch\n * @param chain chain id\n * @param addresses token addresses\n * @returns token infos\n */\n getTokens(chain: Chain, addresses: Array<string>): Promise<Array<Token>>;\n\n /**\n * fetch token candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param options optional query options\n * @returns token candles\n */\n getTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n options?: GetTokenCandlesOptions,\n ): Promise<Array<TokenCandle>>;\n\n /**\n * fetch token security\n * @param chain chain id\n * @param address token address\n * @returns token security\n */\n getTokenSecurity(chain: Chain, address: string): Promise<TokenSecurity>;\n\n /**\n * fetch token stats\n * @param chain chain id\n * @param address token address\n * @returns token stats\n */\n getTokenStats(chain: Chain, address: string): Promise<TokenStats>;\n\n /**\n * fetch token holders\n * @param chain chain id\n * @param address token address\n * @param options optional query options (Phase 3: sortBy)\n * @returns token holders\n */\n getTokenHolders(\n chain: Chain,\n address: string,\n options?: GetTokenHoldersOptions,\n ): Promise<CursorList<TokenHolder>>;\n\n /**\n * fetch token market data\n * @param chain chain id\n * @param address token address\n * @returns token market data\n */\n getTokenMarketData(chain: Chain, address: string): Promise<TokenMarketData>;\n\n /**\n * fetch `New` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `New` token list\n */\n getNewTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Final Stretch` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Final Stretch` token list\n */\n getFinalStretchTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Migrated` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Migrated` token list\n */\n getMigratedTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Trending` token list\n * @param chain chain id\n * @param resolution query resolution, e.g. \"1m\", \"5m\", \"1h\", \"4h\", \"24h\"\n * @param options optional query options\n * @returns `Trending` token list\n */\n getTrendingTokens(\n chain: Chain,\n resolution: TrendingResolution,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * fetch `Stock` token list\n * @param chain chain id\n * @param options optional query options\n * @returns `Stock` token list\n */\n getStockTokens(\n chain: Chain,\n options?: GetTokenListOptions,\n ): Promise<Array<Token>>;\n\n /**\n * search tokens\n * @param options optional query options\n * @returns search token cursor list\n */\n searchTokens(options?: SearchTokensOptions): Promise<SearchTokenCursorList>;\n\n /**\n * fetch swap route plans\n * @param params swap params\n * @returns swap route plans\n */\n swapRoute(params: SwapParams): Promise<SwapRoute>;\n\n /**\n * fetch latest block metadata\n * @param params latest block params\n * @returns latest block metadata\n */\n getLatestBlock(params: LatestBlockParams): Promise<BlockchainLatestBlock>;\n\n /**\n * send tx\n * @param params send tx params\n * @returns send tx result\n */\n sendTx(params: SendTxParams): Promise<SendTxResult>;\n\n /**\n * check if tx is successful\n * @param chain chain id\n * @param txHash tx hash\n * @param timeout timeout in milliseconds\n * @returns true if tx is successful, false otherwise\n */\n checkTxSuccess(\n chain: Chain,\n txHash: string,\n timeout?: number,\n ): Promise<boolean>;\n\n /**\n * fetch wallet portfolios\n * @param chain chain id\n * @param address wallet address\n * @param options optional pagination options\n * @returns wallet portfolios\n */\n getWalletPortfolios(\n chain: Chain,\n address: string,\n options?: { cursor?: string; limit?: number },\n ): Promise<WalletPortfolios>;\n\n /**\n * fetch wallet PnL summary\n * @param chain chain id\n * @param address wallet address\n * @param resolution pnl resolution (e.g. \"7d\", \"30d\")\n * @returns wallet pnl summary\n */\n getWalletPnl(\n chain: Chain,\n address: string,\n resolution?: string,\n ): Promise<WalletPnl>;\n\n /**\n * fetch wallet portfolio PnL details (per-token)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options (Phase 3: resolution, positionState, sortBy)\n * @returns portfolio pnl list with summary\n */\n getWalletPortfolioPnls(\n chain: Chain,\n address: string,\n options?: GetWalletPortfolioPnlsOptions,\n ): Promise<WalletPortfolioPnls>;\n\n /**\n * fetch wallet portfolios for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio list for the specified tokens\n */\n getWalletPortfoliosByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<Portfolio>>;\n\n /**\n * fetch wallet portfolio PnL for specific tokens\n * @param chain chain id\n * @param address wallet address\n * @param tokenAddresses token addresses to query\n * @returns portfolio pnl list for the specified tokens\n */\n getWalletPortfolioPnlsByTokens(\n chain: Chain,\n address: string,\n tokenAddresses: Array<string>,\n ): Promise<Array<PortfolioPnl>>;\n\n /**\n * fetch wallet's trade activities\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's trade activities\n */\n getWalletTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch token's trade activities\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's trade activities\n */\n getTokenTrades(\n chain: Chain,\n address: string,\n options?: GetTradesOptions,\n ): Promise<CursorList<Trade>>;\n\n /**\n * fetch wallet's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param options optional query options\n * @returns wallet's activities\n */\n getWalletActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * fetch token's activities (trades, liquidity, red packets, etc.)\n * @param chain chain id\n * @param address token address\n * @param options optional query options\n * @returns token's activities\n */\n getTokenActivities(\n chain: Chain,\n address: string,\n options?: GetActivitiesOptions,\n ): Promise<CursorList<Activity>>;\n\n /**\n * get presigned upload url\n * @returns presigned upload url\n */\n getPresignedUploadUrl(): Promise<string>;\n}\n\nexport interface ISubscription {\n unsubscribe(): void;\n}\n\n/**\n * Incremental token update from subscriptions.\n * `chain` + `address` identify the token; all other fields are optional —\n * `undefined` means this push did not carry that field.\n */\nexport type TokenSubscribed = Partial<Omit<Token, \"chain\" | \"address\">> &\n Pick<Token, \"chain\" | \"address\">;\n\nexport interface WalletPnlSubscribed extends WalletPnl {\n /** pnl resolution (e.g. \"7d\", \"30d\") */\n resolution?: string;\n}\n\nexport interface PortfolioSubscribed {\n /** chain id */\n chain: Chain;\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n /** token current price in usd */\n priceInUsd?: string;\n /** holding token amount */\n amount?: string;\n}\n\nexport type PortfolioPnlSubscribed = Partial<\n Omit<PortfolioPnl, \"address\" | \"name\" | \"symbol\" | \"image\">\n> & {\n /** wallet address */\n walletAddress: string;\n /** token address */\n tokenAddress: string;\n};\n\n/**\n * Subscribe client interface\n */\nexport interface ISubscribeClient {\n /**\n * Subscribe to a token's real-time data updates (stats, market data,\n * holders, liquidity, etc.). The client internally manages multiple\n * backend channels and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param address token address\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeToken(\n chain: Chain,\n address: string,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token new candles\n * @param chain chain id\n * @param address token address\n * @param resolution token resolution\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenCandles(\n chain: Chain,\n address: string,\n resolution: TokenResolution,\n callback: (candles: Array<TokenCandle>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPnl(\n chain: Chain,\n address: string,\n callback: (pnls: Array<WalletPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolios(\n chain: Chain,\n address: string,\n callback: (portfolios: Array<PortfolioSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's portfolio pnl changes\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletPortfolioPnls(\n chain: Chain,\n address: string,\n callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new trade activities\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new trade activities\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenTrades(\n chain: Chain,\n address: string,\n callback: (trades: Array<Trade>) => void,\n ): ISubscription;\n\n /**\n * Subscribe wallet's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address wallet address\n * @param callback callback function\n * @returns subscription\n */\n subscribeWalletActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe token's new activities (trades, liquidity, etc.)\n * @param chain chain id\n * @param address token address\n * @param callback callback function\n * @returns subscription\n */\n subscribeTokenActivities(\n chain: Chain,\n address: string,\n callback: (activities: Array<Activity>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `New` token list real-time updates. The client internally\n * manages multiple backend channels (new token events, metadata, stats,\n * holders, supply, liquidity, bonding curve) and delivers incremental\n * updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeNewTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Trending` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeTrendingTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Migrated` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeMigratedTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `FinalStretch` token list real-time updates. The client\n * internally manages multiple backend channels (stats, holders, supply,\n * liquidity, bonding curve) and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeFinalStretchTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n\n /**\n * Subscribe to `Stock` token list real-time updates. The client internally\n * manages multiple backend channels (stats, holders, supply, liquidity)\n * and delivers incremental updates via `callback`.\n * @param chain chain id\n * @param callback receives incremental token updates\n * @returns subscription\n */\n subscribeStockTokens(\n chain: Chain,\n callback: (data: Array<TokenSubscribed>) => void,\n ): ISubscription;\n}\n","declare global {\n interface Window {\n __LIBERFI_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif (typeof window !== \"undefined\") {\n window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};\n window.__LIBERFI_VERSION__[\"@liberfi.io/types\"] = \"0.2.0\";\n}\n\nexport default \"0.2.0\";\n","export enum Chain {\n ETHEREUM = \"1\",\n UBIQ = \"8\",\n OPTIMISM = \"10\",\n FLARE = \"14\",\n SONGBIRD = \"19\",\n ELASTOS = \"20\",\n KARDIA = \"24\",\n CRONOS = \"25\",\n RSK = \"30\",\n TELOS = \"40\",\n LUKSO = \"42\",\n CRAB = \"44\",\n DARWINIA = \"46\",\n XDC = \"50\",\n CSC = \"52\",\n ZYX = \"55\",\n BINANCE = \"56\",\n BINANCE_TESTNET = \"97\",\n SYSCOIN = \"57\",\n GOCHAIN = \"60\",\n ETHEREUMCLASSIC = \"61\",\n OKEXCHAIN = \"66\",\n HOO = \"70\",\n METER = \"82\",\n NOVA_NETWORK = \"87\",\n TOMOCHAIN = \"88\",\n BITKUB = \"96\",\n XDAI = \"100\",\n VELAS = \"106\",\n THUNDERCORE = \"108\",\n ENULS = \"119\",\n FUSE = \"122\",\n HECO = \"128\",\n UNICHAIN = \"130\",\n POLYGON = \"137\",\n SONIC = \"146\",\n SHIMMER_EVM = \"148\",\n RBN = \"151\",\n OMNI = \"166\",\n MANTA = \"169\",\n HSK = \"177\",\n WATER = \"181\",\n XLAYER = \"196\",\n XDAIARB = \"200\",\n OP_BNB = \"204\",\n VINUCHAIN = \"207\",\n ENERGYWEB = \"246\",\n OASYS = \"248\",\n FANTOM = \"250\",\n FRAXTAL = \"252\",\n HPB = \"269\",\n BOBA = \"288\",\n OMAX = \"311\",\n FILECOIN = \"314\",\n KUCOIN = \"321\",\n ZKSYNC_ERA = \"324\",\n SHIDEN = \"336\",\n THETA = \"361\",\n PULSE = \"369\",\n CRONOS_ZKEVM = \"388\",\n SX = \"416\",\n AREON = \"463\",\n WC = \"480\",\n CANDLE = \"534\",\n ROLLUX = \"570\",\n ASTAR = \"592\",\n REDSTONE = \"690\",\n MATCHAIN = \"698\",\n CALLISTO = \"820\",\n TARA = \"841\",\n WANCHAIN = \"888\",\n LYRA_CHAIN = \"957\",\n BIFROST = \"996\",\n CONFLUX = \"1030\",\n METIS = \"1088\",\n DYMENSION = \"1100\",\n POLYGON_ZKEVM = \"1101\",\n CORE = \"1116\",\n LISK = \"1135\",\n ULTRON = \"1231\",\n STEP = \"1234\",\n MOONBEAM = \"1284\",\n MOONRIVER = \"1285\",\n SEI = \"1329\",\n LIVING_ASSETS_MAINNET = \"1440\",\n STY = \"1514\",\n TENET = \"1559\",\n GRAVITY = \"1625\",\n REYA_NETWORK = \"1729\",\n SONEIUM = \"1868\",\n SWELLCHAIN = \"1923\",\n ONUS = \"1975\",\n HUBBLENET = \"1992\",\n SANKO = \"1996\",\n DOGECHAIN = \"2000\",\n MILKOMEDA = \"2001\",\n MILKOMEDA_A1 = \"2002\",\n KAVA = \"2222\",\n SOMA = \"2332\",\n KARAK = \"2410\",\n ABSTRACT = \"2741\",\n ABSTRACT_TESTNET = \"11124\",\n MORPH = \"2818\",\n CROSSFI = \"4158\",\n BEAM = \"4337\",\n IOTEX = \"4689\",\n MANTLE = \"5000\",\n XLC = \"5050\",\n NAHMII = \"5551\",\n BOUNCEBIT = \"6001\",\n TOMBCHAIN = \"6969\",\n ZETACHAIN = \"7000\",\n PLANQ = \"7070\",\n BITROCK = \"7171\",\n XSAT = \"7200\",\n CYETH = \"7560\",\n CANTO = \"7700\",\n KLAYTN = \"8217\",\n THAT = \"8428\",\n BASE = \"8453\",\n HELA = \"8668\",\n IOTAEVM = \"8822\",\n JBC = \"8899\",\n EVMOS = \"9001\",\n CARBON = \"9790\",\n SMARTBCH = \"10000\",\n ARTELA = \"11820\",\n IMMUTABLE_ZKEVM = \"13371\",\n LOOP = \"15551\",\n GENESYS = \"16507\",\n EOS_EVM = \"17777\",\n MAP_PROTOCOL = \"22776\",\n SAPPHIRE = \"23294\",\n BITGERT = \"32520\",\n FUSION = \"32659\",\n ZILLIQA = \"32769\",\n APECHAIN = \"33139\",\n EDU_CHAIN = \"41923\",\n ARBITRUM = \"42161\",\n ARBITRUM_TESTNET_GOERLI = \"421613\",\n ARBITRUM_TESTNET_SEPOLIA = \"421614\",\n ARBITRUM_NOVA = \"42170\",\n CELO = \"42220\",\n OASIS = \"42262\",\n ASSETCHAIN = \"42420\",\n ETHERLINK = \"42793\",\n AVALANCHE = \"43114\",\n REI = \"47805\",\n ZIRCUIT = \"48900\",\n SOPHON = \"50104\",\n ETN = \"52014\",\n SUPERPOSITION = \"55244\",\n REICHAIN = \"55555\",\n BOBA_BNB = \"56288\",\n INK = \"57073\",\n LINEA = \"59144\",\n BOB = \"60808\",\n GODWOKEN = \"71402\",\n BERACHAIN = \"80094\",\n BLAST = \"81457\",\n CHILIZ = \"88888\",\n STRATIS = \"105105\",\n REAL = \"111188\",\n ODYSSEY = \"153153\",\n TAIKO = \"167000\",\n BITLAYER = \"200901\",\n HYDRATION = \"222222\",\n PAREX = \"322202\",\n POLIS = \"333999\",\n KEKCHAIN = \"420420\",\n SCROLL = \"534352\",\n ZERO_NETWORK = \"543210\",\n ZKLINK_NOVA = \"810180\",\n VISION = \"888888\",\n SAAKURU = \"7225878\",\n ZORA = \"7777777\",\n CORN = \"21000000\",\n NEON = \"245022934\",\n LUMIA = \"994873017\",\n AURORA = \"1313161554\",\n HARMONY = \"1666600000\",\n PALM = \"11297108109\",\n ZENIQ = \"383414847825\",\n CURIO = \"836542336838601\",\n MODE = \"34443\",\n SOLANA = \"900900900\",\n SOLANA_TESTNET = \"901901901\",\n SOLANA_DEVNET = \"902902902\",\n}\n\nexport enum ChainNamespace {\n EVM = \"EVM\",\n SOLANA = \"SOL\",\n}\n","import { Chain } from \"./chains\";\n\nexport enum SolanaTokenProtocol {\n BAGS = \"bags\",\n BELIEVE = \"believe\",\n BONK = \"bonk\",\n BOOP = \"boop\",\n HEAVEN = \"heaven\",\n JUPSTUDIO = \"jupstudio\",\n LAUNCHLAB = \"launchlab\",\n METEORA = \"meteora\",\n MOONIT = \"moonit\",\n MOONSHOT = \"moonshot\",\n ORCA = \"orca\",\n PUMP = \"pump\",\n RAYDIUM = \"raydium\",\n SUGAR = \"sugar\",\n VIRTUAL_CURVE = \"virtual-curve\",\n PUMP_AMM = \"pump-amm\",\n}\n\nexport type TokenProtocol = SolanaTokenProtocol | (string & {});\n\nexport const SOLANA_TOKEN_PROTOCOLS = Object.values(SolanaTokenProtocol);\n\nexport interface Token {\n /**\n * chain id.\n */\n chain: Chain;\n /**\n * token name, e.g. \"Ethereum\", \"Solana\", etc.\n */\n name: string;\n /**\n * token symbol, e.g. \"ETH\", \"SOL\", etc.\n */\n symbol: string;\n /**\n * token address.\n */\n address: string;\n /**\n * token decimals.\n */\n decimals: number;\n /**\n * token avatar image url.\n */\n image?: string;\n /**\n * token description.\n */\n description?: string;\n /**\n * token creators.\n */\n creators?: Array<TokenCreator>;\n /**\n * token launch info.\n */\n launchedFrom?: TokenLaunchedFrom;\n /**\n * token migrate progress, range is 0-100.\n */\n migrateProgress?: string;\n /**\n * token migrate info.\n */\n migratedTo?: TokenMigratedTo;\n /**\n * token social medias.\n */\n socialMedias?: TokenSocialMedias;\n /**\n * token stats.\n */\n stats?: TokenStats;\n /**\n * token market data.\n */\n marketData?: TokenMarketData;\n /**\n * token liquidity pools\n */\n liquidities?: Array<TokenLiquidity>;\n /**\n * token security.\n */\n security?: TokenSecurity;\n /**\n * token tags.\n */\n tags?: Array<string>;\n /**\n * token create time.\n */\n createdAt?: Date;\n}\n\nexport interface TokenCreator {\n /**\n * token creator's wallet address.\n */\n address?: string;\n /**\n * token creator's share percentage, range is 0-100.\n */\n share?: number;\n /**\n * whether the token creator is verified.\n */\n isVerified?: boolean;\n}\n\nexport interface TokenLaunchedFrom {\n /**\n * token launch program address.\n */\n programAddress?: string;\n /**\n * token launch protocol family.\n */\n protocolFamily?: string;\n}\n\nexport interface TokenMigratedTo {\n /**\n * token migrate program address.\n */\n programAddress?: string;\n /**\n * token migrate protocol family.\n */\n protocolFamily?: string;\n /**\n * token migrate pool address.\n */\n poolAddress?: string;\n /**\n * token migrate time.\n */\n migratedAt?: Date;\n}\n\nexport interface TokenSocialMedias {\n /**\n * token twitter url.\n */\n twitter?: string;\n /**\n * token telegram url.\n */\n telegram?: string;\n /**\n * token website url.\n */\n website?: string;\n /**\n * token tiktok url.\n */\n tiktok?: string;\n /**\n * token discord url.\n */\n discord?: string;\n /**\n * token facebook url.\n */\n facebook?: string;\n /**\n * token github url.\n */\n github?: string;\n /**\n * token instagram url.\n */\n instagram?: string;\n /**\n * token linkedin url.\n */\n linkedin?: string;\n /**\n * token medium url.\n */\n medium?: string;\n /**\n * token reddit url.\n */\n reddit?: string;\n /**\n * token youtube url.\n */\n youtube?: string;\n /**\n * token bitbucket url.\n */\n bitbucket?: string;\n}\n\nexport interface TokenStats {\n /**\n * token stats by 1m timeframe.\n */\n \"1m\"?: TokenStatsByResolution;\n /**\n * token stats by 5m timeframe.\n */\n \"5m\"?: TokenStatsByResolution;\n /**\n * token stats by 15m timeframe.\n */\n \"15m\"?: TokenStatsByResolution;\n /**\n * token stats by 30m timeframe.\n */\n \"30m\"?: TokenStatsByResolution;\n /**\n * token stats by 1h timeframe.\n */\n \"1h\"?: TokenStatsByResolution;\n /**\n * token stats by 4h timeframe.\n */\n \"4h\"?: TokenStatsByResolution;\n /**\n * token stats by 24h timeframe.\n */\n \"24h\"?: TokenStatsByResolution;\n}\n\nexport interface TokenStatsByResolution {\n /**\n * buy txs count\n */\n buys?: number;\n /**\n * sell txs count\n */\n sells?: number;\n /**\n * txs count\n */\n trades?: number;\n /**\n * buy addresses count\n */\n buyers?: number;\n /**\n * sell addresses count\n */\n sellers?: number;\n /**\n * trade addresses count\n */\n traders?: number;\n /**\n * buy volumes in quote token\n */\n buyVolumes?: string;\n /**\n * sell volumes in quote token\n */\n sellVolumes?: string;\n /**\n * total volumes in quote token\n */\n volumes?: string;\n /**\n * buy volumes in usd\n */\n buyVolumesInUsd?: string;\n /**\n * sell volumes in usd\n */\n sellVolumesInUsd?: string;\n /**\n * total volumes in usd\n */\n volumesInUsd?: string;\n /**\n * open price in usd\n */\n openPriceInUsd?: string;\n /**\n * close price in usd\n */\n closePriceInUsd?: string;\n /**\n * high price in usd\n */\n highPriceInUsd?: string;\n /**\n * low price in usd\n */\n lowPriceInUsd?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * price change %\n */\n priceChange?: string;\n}\n\nexport interface TokenMarketData {\n /**\n * total supply\n */\n totalSupply?: string;\n /**\n * market cap in quote token\n */\n marketCap?: string;\n /**\n * market cap in usd\n */\n marketCapInUsd?: string;\n /**\n * price in quote token\n */\n price?: string;\n /**\n * price in usd\n */\n priceInUsd?: string;\n /**\n * tvl in quote token\n */\n tvl?: string;\n /**\n * tvl in usd\n */\n tvlInUsd?: string;\n /**\n * holders count\n */\n holders?: number;\n /**\n * top 10 total holdings\n */\n top10Holdings?: string;\n /**\n * top 10 holdings ratio\n */\n top10HoldingsRatio?: string;\n /**\n * top 50 total holdings\n */\n top50Holdings?: string;\n /**\n * top 50 holdings ratio\n */\n top50HoldingsRatio?: string;\n /**\n * top 100 total holdings\n */\n top100Holdings?: string;\n /**\n * top 100 holdings ratio\n */\n top100HoldingsRatio?: string;\n /**\n * Bluechip holders count\n */\n bluechipHolders?: number;\n /**\n * Bluechip total holdings\n */\n bluechipHoldings?: string;\n /**\n * Bluechip holdings ratio\n */\n bluechipHoldingsRatio?: string;\n /**\n * KOL holders count\n */\n kolHolders?: number;\n /**\n * KOL total holdings\n */\n kolHoldings?: string;\n /**\n * KOL holdings ratio\n */\n kolHoldingsRatio?: string;\n /**\n * Sniper holders count\n */\n sniperHolders?: number;\n /**\n * Sniper total holdings\n */\n sniperHoldings?: string;\n /**\n * Sniper holdings ratio\n */\n sniperHoldingsRatio?: string;\n /**\n * Pro holders count\n */\n proHolders?: number;\n /**\n * Pro total holdings\n */\n proHoldings?: string;\n /**\n * Pro holdings ratio\n */\n proHoldingsRatio?: string;\n /**\n * Insider holders count\n */\n insiderHolders?: number;\n /**\n * Insider total holdings\n */\n insiderHoldings?: string;\n /**\n * Insider holdings ratio\n */\n insiderHoldingsRatio?: string;\n /**\n * Sandwich holders count\n */\n sandwichHolders?: number;\n /**\n * Sandwich total holdings\n */\n sandwichHoldings?: string;\n /**\n * Sandwich holdings ratio\n */\n sandwichHoldingsRatio?: string;\n /**\n * Fresh holders count\n */\n freshHolders?: number;\n /**\n * Fresh total holdings\n */\n freshHoldings?: string;\n /**\n * Fresh holdings ratio\n */\n freshHoldingsRatio?: string;\n /**\n * Bundle holders count\n */\n bundleHolders?: number;\n /**\n * Bundle total holdings\n */\n bundleHoldings?: string;\n /**\n * Bundle holdings ratio\n */\n bundleHoldingsRatio?: string;\n /**\n * Dev holders count\n */\n devHolders?: number;\n /**\n * Dev total holdings\n */\n devHoldings?: string;\n /**\n * Dev holdings ratio\n */\n devHoldingsRatio?: string;\n}\n\nexport interface TokenLiquidity {\n /**\n * pool avatar image\n */\n image?: string;\n /**\n * pair token address.\n */\n pairAddress?: string;\n /**\n * pool address.\n */\n poolAddress?: string;\n /**\n * program address.\n */\n programAddress?: string;\n /**\n * protocol name.\n */\n protocolName?: string;\n /**\n * protocol family.\n */\n protocolFamily?: string;\n /**\n * tvl in quote token.\n */\n tvl?: string;\n /**\n * tvl in usd.\n */\n tvlInUsd?: string;\n}\n\n/**\n * TODO: more security checks\n */\nexport interface TokenSecurity {\n /**\n * whether the token has transfer fee.\n */\n hasTransferFee?: boolean;\n /**\n * whether the token transfer fee is upgradable.\n */\n isTransferFeeUpgradable?: boolean;\n /**\n * whether the token is transferable.\n */\n isTransferable?: boolean;\n /**\n * whether the token is freezable.\n */\n isFreezable?: boolean;\n /**\n * whether the token is closable.\n */\n isClosable?: boolean;\n}\n\nexport type TokenResolution =\n | \"1s\"\n | \"15s\"\n | \"30s\"\n | \"1m\"\n | \"5m\"\n | \"15m\"\n | \"30m\"\n | \"1h\"\n | \"4h\"\n | \"12h\"\n | \"24h\";\n\nexport interface TokenCandle {\n /**\n * open price in usd\n */\n open: string;\n /**\n * close price in usd\n */\n close: string;\n /**\n * high price in usd\n */\n high: string;\n /**\n * low price in usd\n */\n low: string;\n /**\n * volume in usd\n */\n volume: string;\n /**\n * resolution\n */\n resolution: TokenResolution;\n /**\n * timestamp\n */\n timestamp: Date;\n}\n\n/**\n * Classification tag applied to a wallet in the context of a specific token holding.\n * See Phase 3 API doc — values are sparse (only 0.1%–2% of holders have tags).\n */\nexport type HolderTag =\n | \"kol\"\n | \"smart\"\n | \"sniper\"\n | \"dev\"\n | \"bundle\"\n | \"bluechip\"\n | (string & {});\n\nexport interface TokenHolder {\n /**\n * holder wallet address\n */\n address: string;\n /**\n * holdings amount in token\n */\n amount: string;\n /**\n * holdings amount in usd\n */\n amountInUsd: string;\n /**\n * holdings ratio, range is 0-100\n */\n ratio: string;\n /**\n * Holder classification tags (Phase 3). Sparse — only present when the\n * wallet matches one of the known patterns (kol/smart/sniper/dev/...).\n */\n tags?: Array<HolderTag>;\n /**\n * The last time this wallet was active on-chain (Phase 3).\n * Sparse (~80% fill rate).\n */\n lastActiveAt?: Date;\n /**\n * The first time this wallet started holding this token (Phase 3).\n * Sparse (~60% fill rate).\n */\n startHoldingAt?: Date;\n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,OAAA,oBAAiB;AACjB,EAAAA,OAAA,mBAAgB;AA5LN,SAAAA;AAAA,GAAA;AA+LL,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,SAAM;AACN,EAAAA,gBAAA,YAAS;AAFC,SAAAA;AAAA,GAAA;;;AC7LL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,mBAAgB;AAChB,EAAAA,qBAAA,cAAW;AAhBD,SAAAA;AAAA,GAAA;AAqBL,IAAM,yBAAyB,OAAO,OAAO,mBAAmB;","names":["SwapMode","Chain","ChainNamespace","SolanaTokenProtocol"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liberfi.io/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Liberfi React SDK types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"tsup": "^8.5.0",
|
|
21
21
|
"typedoc": "^0.28.12",
|
|
22
|
-
"tsconfig": "0.1.
|
|
22
|
+
"tsconfig": "0.1.168"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|