@liberfi.io/types 0.3.13 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1829 @@
1
+ declare enum Chain {
2
+ ETHEREUM = "1",
3
+ UBIQ = "8",
4
+ OPTIMISM = "10",
5
+ FLARE = "14",
6
+ SONGBIRD = "19",
7
+ ELASTOS = "20",
8
+ KARDIA = "24",
9
+ CRONOS = "25",
10
+ RSK = "30",
11
+ TELOS = "40",
12
+ LUKSO = "42",
13
+ CRAB = "44",
14
+ DARWINIA = "46",
15
+ XDC = "50",
16
+ CSC = "52",
17
+ ZYX = "55",
18
+ BINANCE = "56",
19
+ BINANCE_TESTNET = "97",
20
+ SYSCOIN = "57",
21
+ GOCHAIN = "60",
22
+ ETHEREUMCLASSIC = "61",
23
+ OKEXCHAIN = "66",
24
+ HOO = "70",
25
+ METER = "82",
26
+ NOVA_NETWORK = "87",
27
+ TOMOCHAIN = "88",
28
+ BITKUB = "96",
29
+ XDAI = "100",
30
+ VELAS = "106",
31
+ THUNDERCORE = "108",
32
+ ENULS = "119",
33
+ FUSE = "122",
34
+ HECO = "128",
35
+ UNICHAIN = "130",
36
+ POLYGON = "137",
37
+ SONIC = "146",
38
+ SHIMMER_EVM = "148",
39
+ RBN = "151",
40
+ OMNI = "166",
41
+ MANTA = "169",
42
+ HSK = "177",
43
+ WATER = "181",
44
+ XLAYER = "196",
45
+ XDAIARB = "200",
46
+ OP_BNB = "204",
47
+ VINUCHAIN = "207",
48
+ ENERGYWEB = "246",
49
+ OASYS = "248",
50
+ FANTOM = "250",
51
+ FRAXTAL = "252",
52
+ HPB = "269",
53
+ BOBA = "288",
54
+ OMAX = "311",
55
+ FILECOIN = "314",
56
+ KUCOIN = "321",
57
+ ZKSYNC_ERA = "324",
58
+ SHIDEN = "336",
59
+ THETA = "361",
60
+ PULSE = "369",
61
+ CRONOS_ZKEVM = "388",
62
+ SX = "416",
63
+ AREON = "463",
64
+ WC = "480",
65
+ CANDLE = "534",
66
+ ROLLUX = "570",
67
+ ASTAR = "592",
68
+ REDSTONE = "690",
69
+ MATCHAIN = "698",
70
+ CALLISTO = "820",
71
+ TARA = "841",
72
+ WANCHAIN = "888",
73
+ LYRA_CHAIN = "957",
74
+ BIFROST = "996",
75
+ CONFLUX = "1030",
76
+ METIS = "1088",
77
+ DYMENSION = "1100",
78
+ POLYGON_ZKEVM = "1101",
79
+ CORE = "1116",
80
+ LISK = "1135",
81
+ ULTRON = "1231",
82
+ STEP = "1234",
83
+ MOONBEAM = "1284",
84
+ MOONRIVER = "1285",
85
+ SEI = "1329",
86
+ LIVING_ASSETS_MAINNET = "1440",
87
+ STY = "1514",
88
+ TENET = "1559",
89
+ GRAVITY = "1625",
90
+ REYA_NETWORK = "1729",
91
+ SONEIUM = "1868",
92
+ SWELLCHAIN = "1923",
93
+ ONUS = "1975",
94
+ HUBBLENET = "1992",
95
+ SANKO = "1996",
96
+ DOGECHAIN = "2000",
97
+ MILKOMEDA = "2001",
98
+ MILKOMEDA_A1 = "2002",
99
+ KAVA = "2222",
100
+ SOMA = "2332",
101
+ KARAK = "2410",
102
+ ABSTRACT = "2741",
103
+ ABSTRACT_TESTNET = "11124",
104
+ MORPH = "2818",
105
+ CROSSFI = "4158",
106
+ BEAM = "4337",
107
+ IOTEX = "4689",
108
+ MANTLE = "5000",
109
+ XLC = "5050",
110
+ NAHMII = "5551",
111
+ BOUNCEBIT = "6001",
112
+ TOMBCHAIN = "6969",
113
+ ZETACHAIN = "7000",
114
+ PLANQ = "7070",
115
+ BITROCK = "7171",
116
+ XSAT = "7200",
117
+ CYETH = "7560",
118
+ CANTO = "7700",
119
+ KLAYTN = "8217",
120
+ THAT = "8428",
121
+ BASE = "8453",
122
+ HELA = "8668",
123
+ IOTAEVM = "8822",
124
+ JBC = "8899",
125
+ EVMOS = "9001",
126
+ CARBON = "9790",
127
+ SMARTBCH = "10000",
128
+ ARTELA = "11820",
129
+ IMMUTABLE_ZKEVM = "13371",
130
+ LOOP = "15551",
131
+ GENESYS = "16507",
132
+ EOS_EVM = "17777",
133
+ MAP_PROTOCOL = "22776",
134
+ SAPPHIRE = "23294",
135
+ BITGERT = "32520",
136
+ FUSION = "32659",
137
+ ZILLIQA = "32769",
138
+ APECHAIN = "33139",
139
+ EDU_CHAIN = "41923",
140
+ ARBITRUM = "42161",
141
+ ARBITRUM_TESTNET_GOERLI = "421613",
142
+ ARBITRUM_TESTNET_SEPOLIA = "421614",
143
+ ARBITRUM_NOVA = "42170",
144
+ CELO = "42220",
145
+ OASIS = "42262",
146
+ ASSETCHAIN = "42420",
147
+ ETHERLINK = "42793",
148
+ AVALANCHE = "43114",
149
+ REI = "47805",
150
+ ZIRCUIT = "48900",
151
+ SOPHON = "50104",
152
+ ETN = "52014",
153
+ SUPERPOSITION = "55244",
154
+ REICHAIN = "55555",
155
+ BOBA_BNB = "56288",
156
+ INK = "57073",
157
+ LINEA = "59144",
158
+ BOB = "60808",
159
+ GODWOKEN = "71402",
160
+ BERACHAIN = "80094",
161
+ BLAST = "81457",
162
+ CHILIZ = "88888",
163
+ STRATIS = "105105",
164
+ REAL = "111188",
165
+ ODYSSEY = "153153",
166
+ TAIKO = "167000",
167
+ BITLAYER = "200901",
168
+ HYDRATION = "222222",
169
+ PAREX = "322202",
170
+ POLIS = "333999",
171
+ KEKCHAIN = "420420",
172
+ SCROLL = "534352",
173
+ ZERO_NETWORK = "543210",
174
+ ZKLINK_NOVA = "810180",
175
+ VISION = "888888",
176
+ SAAKURU = "7225878",
177
+ ZORA = "7777777",
178
+ CORN = "21000000",
179
+ NEON = "245022934",
180
+ LUMIA = "994873017",
181
+ AURORA = "1313161554",
182
+ HARMONY = "1666600000",
183
+ PALM = "11297108109",
184
+ ZENIQ = "383414847825",
185
+ CURIO = "836542336838601",
186
+ MODE = "34443",
187
+ SOLANA = "900900900",
188
+ SOLANA_TESTNET = "901901901",
189
+ SOLANA_DEVNET = "902902902"
190
+ }
191
+ declare enum ChainNamespace {
192
+ EVM = "EVM",
193
+ SOLANA = "SOL"
194
+ }
195
+
196
+ /**
197
+ * Classification tag applied to a wallet across token-holding, activity, and
198
+ * portfolio contexts. Sparse — only a small percentage of wallets match one
199
+ * of the known patterns. The `(string & {})` escape hatch allows new server-
200
+ * defined tags to flow through without a library update.
201
+ */
202
+ type WalletTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
203
+
204
+ interface ActivityToken {
205
+ /** token address */
206
+ address: string;
207
+ /** token symbol */
208
+ symbol: string;
209
+ /** token name */
210
+ name?: string;
211
+ /** token avatar image url */
212
+ image?: string;
213
+ /** token amount */
214
+ amount: string;
215
+ /** token amount in USD */
216
+ amountInUsd?: string;
217
+ /** token price in USD at the time of the trade */
218
+ priceInUsd?: string;
219
+ }
220
+ interface ActivityDex {
221
+ /** dex name */
222
+ name?: string;
223
+ /** dex avatar image url */
224
+ image?: string;
225
+ /** dex protocol family */
226
+ protocolFamily?: string;
227
+ /** dex program address */
228
+ programAddress?: string;
229
+ }
230
+ type ActivityType = "buy" | "sell" | "liquidity_initialize" | "liquidity_add" | "liquidity_remove" | "red_packet_create" | "red_packet_claim" | "red_packet_complete" | "red_packet_refund";
231
+ /**
232
+ * An on-chain activity record (trade, liquidity, red packet, etc.).
233
+ */
234
+ interface Activity {
235
+ /** chain id */
236
+ chain: Chain;
237
+ /** wallet address */
238
+ walletAddress: string;
239
+ /** transaction hash */
240
+ txHash: string;
241
+ /** activity type */
242
+ type: ActivityType;
243
+ /** source token */
244
+ from: ActivityToken;
245
+ /** destination token */
246
+ to: ActivityToken;
247
+ /** dex where the activity happened */
248
+ dex?: ActivityDex;
249
+ /** pool address */
250
+ poolAddress?: string;
251
+ /** activity status */
252
+ status: "pending" | "success" | "failed";
253
+ /** activity time */
254
+ time: Date;
255
+ /**
256
+ * Transaction gas fee as a decimal string in the native token's smallest unit
257
+ * (e.g. lamports on Solana, wei on EVM chains). Phase 3; ~100% fill rate on SOL.
258
+ */
259
+ gasFee?: string;
260
+ /**
261
+ * Classification tags applied to the trader for this activity (Phase 3).
262
+ * Sparse — only present when the trader matches one of the known patterns.
263
+ */
264
+ traderTags?: Array<WalletTag>;
265
+ }
266
+ /**
267
+ * A buy/sell trade record. Narrowed subset of {@link Activity}.
268
+ */
269
+ interface Trade extends Activity {
270
+ type: "buy" | "sell";
271
+ }
272
+
273
+ /**
274
+ * Shared cursor-based pagination fields.
275
+ */
276
+ interface CursorPagination {
277
+ /** pagination start cursor */
278
+ startCursor?: string;
279
+ /** pagination end cursor */
280
+ endCursor?: string;
281
+ /** whether there is a previous page */
282
+ hasPrev?: boolean;
283
+ /** whether there is a next page */
284
+ hasNext?: boolean;
285
+ }
286
+
287
+ /**
288
+ * Cursor list result data.
289
+ */
290
+ interface CursorList<T> extends CursorPagination {
291
+ data: Array<T>;
292
+ }
293
+ /**
294
+ * Cursor list query options.
295
+ */
296
+ interface CursorListOptions {
297
+ /** query cursor */
298
+ cursor?: string;
299
+ /** return limit */
300
+ limit?: number;
301
+ /** query direction */
302
+ direction?: "next" | "prev";
303
+ }
304
+
305
+ /**
306
+ * Options for getting trades.
307
+ */
308
+ interface GetTradesOptions extends CursorListOptions {
309
+ /** filter trades before this timestamp */
310
+ before?: Date;
311
+ /** filter trades after this timestamp */
312
+ after?: Date;
313
+ /** filter trades before this block height */
314
+ beforeBlockHeight?: number;
315
+ /** filter trades after this block height */
316
+ afterBlockHeight?: number;
317
+ /** filter trades by type */
318
+ type?: "buy" | "sell";
319
+ /** filter trades by pool address */
320
+ poolAddress?: string;
321
+ }
322
+ /**
323
+ * Sort field for activity list (Phase 3).
324
+ * - `timestamp` — order by activity time (default, descending)
325
+ * - `totalUsd` — order by USD amount (useful for finding whale trades)
326
+ */
327
+ type ActivitiesSortBy = "timestamp" | "totalUsd";
328
+ /**
329
+ * Options for getting activities.
330
+ */
331
+ interface GetActivitiesOptions extends CursorListOptions {
332
+ /** filter activities before this timestamp */
333
+ before?: Date;
334
+ /** filter activities after this timestamp */
335
+ after?: Date;
336
+ /** filter activities before this block height */
337
+ beforeBlockHeight?: number;
338
+ /** filter activities after this block height */
339
+ afterBlockHeight?: number;
340
+ /** filter activities by type */
341
+ type?: ActivityType;
342
+ /** filter activities by pool address */
343
+ poolAddress?: string;
344
+ /**
345
+ * Sort field (Phase 3). Defaults to `timestamp` on the server. When changing
346
+ * `sortBy`, the caller must discard the previous cursor and restart from page 1.
347
+ */
348
+ sortBy?: ActivitiesSortBy;
349
+ }
350
+
351
+ /**
352
+ * Side of a limit order.
353
+ */
354
+ type LimitOrderSide = "buy" | "sell";
355
+ /**
356
+ * Lifecycle state of a limit order (Phase 3 extension).
357
+ * - `active` — order is open, still watching the target price
358
+ * - `filled` — order was executed
359
+ * - `cancelled` — order was cancelled by the user
360
+ * - `expired` — order reached its deadline without filling
361
+ */
362
+ type LimitOrderState = "active" | "filled" | "cancelled" | "expired";
363
+ /**
364
+ * A wallet-scoped limit order (not yet backed by a server endpoint;
365
+ * shape captures the Axiom-style `Orders` tab columns so the widget
366
+ * layer can be built against stable types even while the backend is
367
+ * still being designed).
368
+ */
369
+ interface LimitOrder {
370
+ /** stable order id */
371
+ id: string;
372
+ /** chain id */
373
+ chain: Chain;
374
+ /** owner wallet address */
375
+ wallet: string;
376
+ /** target token address */
377
+ tokenAddress: string;
378
+ /** target token name (mirrored for convenience) */
379
+ tokenName?: string;
380
+ /** target token symbol */
381
+ tokenSymbol?: string;
382
+ /** target token image url */
383
+ tokenImage?: string;
384
+ /** buy or sell */
385
+ side: LimitOrderSide;
386
+ /** order amount in token base units (string to avoid precision loss) */
387
+ amount: string;
388
+ /** optional USD amount at order creation time */
389
+ amountInUsd?: string;
390
+ /** current market cap in USD at query time (display-only) */
391
+ currentMarketCapInUsd?: string;
392
+ /** target market cap in USD at which the order triggers */
393
+ targetMarketCapInUsd?: string;
394
+ /** optional trigger price in USD (alternative to target market cap) */
395
+ targetPriceInUsd?: string;
396
+ /** optional slippage tolerance, range 0-100 */
397
+ slippage?: number;
398
+ /** order state */
399
+ state: LimitOrderState;
400
+ /** order creation time */
401
+ createdAt?: Date;
402
+ /** order expiry time (if any) */
403
+ expiresAt?: Date;
404
+ /** execution time when state is `filled` */
405
+ filledAt?: Date;
406
+ }
407
+
408
+ declare enum SolanaTokenProtocol {
409
+ BAGS = "bags",
410
+ BELIEVE = "believe",
411
+ BONK = "bonk",
412
+ BOOP = "boop",
413
+ HEAVEN = "heaven",
414
+ JUPSTUDIO = "jupstudio",
415
+ LAUNCHLAB = "launchlab",
416
+ METEORA = "meteora",
417
+ MOONIT = "moonit",
418
+ MOONSHOT = "moonshot",
419
+ ORCA = "orca",
420
+ PUMP = "pump",
421
+ RAYDIUM = "raydium",
422
+ SUGAR = "sugar",
423
+ VIRTUAL_CURVE = "virtual-curve",
424
+ PUMP_AMM = "pump-amm"
425
+ }
426
+ type TokenProtocol = SolanaTokenProtocol | (string & {});
427
+ declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
428
+ interface Token {
429
+ /**
430
+ * chain id.
431
+ */
432
+ chain: Chain;
433
+ /**
434
+ * token name, e.g. "Ethereum", "Solana", etc.
435
+ */
436
+ name: string;
437
+ /**
438
+ * token symbol, e.g. "ETH", "SOL", etc.
439
+ */
440
+ symbol: string;
441
+ /**
442
+ * token address.
443
+ */
444
+ address: string;
445
+ /**
446
+ * token decimals.
447
+ */
448
+ decimals: number;
449
+ /**
450
+ * token avatar image url.
451
+ */
452
+ image?: string;
453
+ /**
454
+ * token description.
455
+ */
456
+ description?: string;
457
+ /**
458
+ * token creators.
459
+ */
460
+ creators?: Array<TokenCreator>;
461
+ /**
462
+ * token launch info.
463
+ */
464
+ launchedFrom?: TokenLaunchedFrom;
465
+ /**
466
+ * token migrate progress, range is 0-100.
467
+ */
468
+ migrateProgress?: string;
469
+ /**
470
+ * token migrate info.
471
+ */
472
+ migratedTo?: TokenMigratedTo;
473
+ /**
474
+ * token social medias.
475
+ */
476
+ socialMedias?: TokenSocialMedias;
477
+ /**
478
+ * token stats.
479
+ */
480
+ stats?: TokenStats;
481
+ /**
482
+ * token market data.
483
+ */
484
+ marketData?: TokenMarketData;
485
+ /**
486
+ * token liquidity pools
487
+ */
488
+ liquidities?: Array<TokenLiquidity>;
489
+ /**
490
+ * token security.
491
+ */
492
+ security?: TokenSecurity;
493
+ /**
494
+ * token tags.
495
+ */
496
+ tags?: Array<string>;
497
+ /**
498
+ * token create time.
499
+ */
500
+ createdAt?: Date;
501
+ }
502
+ interface TokenCreator {
503
+ /**
504
+ * token creator's wallet address.
505
+ */
506
+ address?: string;
507
+ /**
508
+ * token creator's share percentage, range is 0-100.
509
+ */
510
+ share?: number;
511
+ /**
512
+ * whether the token creator is verified.
513
+ */
514
+ isVerified?: boolean;
515
+ }
516
+ interface TokenLaunchedFrom {
517
+ /**
518
+ * token launch program address.
519
+ */
520
+ programAddress?: string;
521
+ /**
522
+ * token launch protocol family.
523
+ */
524
+ protocolFamily?: string;
525
+ }
526
+ interface TokenMigratedTo {
527
+ /**
528
+ * token migrate program address.
529
+ */
530
+ programAddress?: string;
531
+ /**
532
+ * token migrate protocol family.
533
+ */
534
+ protocolFamily?: string;
535
+ /**
536
+ * token migrate pool address.
537
+ */
538
+ poolAddress?: string;
539
+ /**
540
+ * token migrate time.
541
+ */
542
+ migratedAt?: Date;
543
+ }
544
+ interface TokenSocialMedias {
545
+ /**
546
+ * token twitter url.
547
+ */
548
+ twitter?: string;
549
+ /**
550
+ * token telegram url.
551
+ */
552
+ telegram?: string;
553
+ /**
554
+ * token website url.
555
+ */
556
+ website?: string;
557
+ /**
558
+ * token tiktok url.
559
+ */
560
+ tiktok?: string;
561
+ /**
562
+ * token discord url.
563
+ */
564
+ discord?: string;
565
+ /**
566
+ * token facebook url.
567
+ */
568
+ facebook?: string;
569
+ /**
570
+ * token github url.
571
+ */
572
+ github?: string;
573
+ /**
574
+ * token instagram url.
575
+ */
576
+ instagram?: string;
577
+ /**
578
+ * token linkedin url.
579
+ */
580
+ linkedin?: string;
581
+ /**
582
+ * token medium url.
583
+ */
584
+ medium?: string;
585
+ /**
586
+ * token reddit url.
587
+ */
588
+ reddit?: string;
589
+ /**
590
+ * token youtube url.
591
+ */
592
+ youtube?: string;
593
+ /**
594
+ * token bitbucket url.
595
+ */
596
+ bitbucket?: string;
597
+ }
598
+ interface TokenStats {
599
+ /**
600
+ * token stats by 1m timeframe.
601
+ */
602
+ "1m"?: TokenStatsByResolution;
603
+ /**
604
+ * token stats by 5m timeframe.
605
+ */
606
+ "5m"?: TokenStatsByResolution;
607
+ /**
608
+ * token stats by 15m timeframe.
609
+ */
610
+ "15m"?: TokenStatsByResolution;
611
+ /**
612
+ * token stats by 30m timeframe.
613
+ */
614
+ "30m"?: TokenStatsByResolution;
615
+ /**
616
+ * token stats by 1h timeframe.
617
+ */
618
+ "1h"?: TokenStatsByResolution;
619
+ /**
620
+ * token stats by 4h timeframe.
621
+ */
622
+ "4h"?: TokenStatsByResolution;
623
+ /**
624
+ * token stats by 24h timeframe.
625
+ */
626
+ "24h"?: TokenStatsByResolution;
627
+ }
628
+ interface TokenStatsByResolution {
629
+ /**
630
+ * buy txs count
631
+ */
632
+ buys?: number;
633
+ /**
634
+ * sell txs count
635
+ */
636
+ sells?: number;
637
+ /**
638
+ * txs count
639
+ */
640
+ trades?: number;
641
+ /**
642
+ * buy addresses count
643
+ */
644
+ buyers?: number;
645
+ /**
646
+ * sell addresses count
647
+ */
648
+ sellers?: number;
649
+ /**
650
+ * trade addresses count
651
+ */
652
+ traders?: number;
653
+ /**
654
+ * buy volumes in quote token
655
+ */
656
+ buyVolumes?: string;
657
+ /**
658
+ * sell volumes in quote token
659
+ */
660
+ sellVolumes?: string;
661
+ /**
662
+ * total volumes in quote token
663
+ */
664
+ volumes?: string;
665
+ /**
666
+ * buy volumes in usd
667
+ */
668
+ buyVolumesInUsd?: string;
669
+ /**
670
+ * sell volumes in usd
671
+ */
672
+ sellVolumesInUsd?: string;
673
+ /**
674
+ * total volumes in usd
675
+ */
676
+ volumesInUsd?: string;
677
+ /**
678
+ * open price in usd
679
+ */
680
+ openPriceInUsd?: string;
681
+ /**
682
+ * close price in usd
683
+ */
684
+ closePriceInUsd?: string;
685
+ /**
686
+ * high price in usd
687
+ */
688
+ highPriceInUsd?: string;
689
+ /**
690
+ * low price in usd
691
+ */
692
+ lowPriceInUsd?: string;
693
+ /**
694
+ * price in usd
695
+ */
696
+ priceInUsd?: string;
697
+ /**
698
+ * price change %
699
+ */
700
+ priceChange?: string;
701
+ }
702
+ interface TokenMarketData {
703
+ /**
704
+ * total supply
705
+ */
706
+ totalSupply?: string;
707
+ /**
708
+ * market cap in quote token
709
+ */
710
+ marketCap?: string;
711
+ /**
712
+ * market cap in usd
713
+ */
714
+ marketCapInUsd?: string;
715
+ /**
716
+ * price in quote token
717
+ */
718
+ price?: string;
719
+ /**
720
+ * price in usd
721
+ */
722
+ priceInUsd?: string;
723
+ /**
724
+ * tvl in quote token
725
+ */
726
+ tvl?: string;
727
+ /**
728
+ * tvl in usd
729
+ */
730
+ tvlInUsd?: string;
731
+ /**
732
+ * holders count
733
+ */
734
+ holders?: number;
735
+ /**
736
+ * top 10 total holdings
737
+ */
738
+ top10Holdings?: string;
739
+ /**
740
+ * top 10 holdings ratio
741
+ */
742
+ top10HoldingsRatio?: string;
743
+ /**
744
+ * top 50 total holdings
745
+ */
746
+ top50Holdings?: string;
747
+ /**
748
+ * top 50 holdings ratio
749
+ */
750
+ top50HoldingsRatio?: string;
751
+ /**
752
+ * top 100 total holdings
753
+ */
754
+ top100Holdings?: string;
755
+ /**
756
+ * top 100 holdings ratio
757
+ */
758
+ top100HoldingsRatio?: string;
759
+ /**
760
+ * Bluechip holders count
761
+ */
762
+ bluechipHolders?: number;
763
+ /**
764
+ * Bluechip total holdings
765
+ */
766
+ bluechipHoldings?: string;
767
+ /**
768
+ * Bluechip holdings ratio
769
+ */
770
+ bluechipHoldingsRatio?: string;
771
+ /**
772
+ * KOL holders count
773
+ */
774
+ kolHolders?: number;
775
+ /**
776
+ * KOL total holdings
777
+ */
778
+ kolHoldings?: string;
779
+ /**
780
+ * KOL holdings ratio
781
+ */
782
+ kolHoldingsRatio?: string;
783
+ /**
784
+ * Sniper holders count
785
+ */
786
+ sniperHolders?: number;
787
+ /**
788
+ * Sniper total holdings
789
+ */
790
+ sniperHoldings?: string;
791
+ /**
792
+ * Sniper holdings ratio
793
+ */
794
+ sniperHoldingsRatio?: string;
795
+ /**
796
+ * Pro holders count
797
+ */
798
+ proHolders?: number;
799
+ /**
800
+ * Pro total holdings
801
+ */
802
+ proHoldings?: string;
803
+ /**
804
+ * Pro holdings ratio
805
+ */
806
+ proHoldingsRatio?: string;
807
+ /**
808
+ * Insider holders count
809
+ */
810
+ insiderHolders?: number;
811
+ /**
812
+ * Insider total holdings
813
+ */
814
+ insiderHoldings?: string;
815
+ /**
816
+ * Insider holdings ratio
817
+ */
818
+ insiderHoldingsRatio?: string;
819
+ /**
820
+ * Sandwich holders count
821
+ */
822
+ sandwichHolders?: number;
823
+ /**
824
+ * Sandwich total holdings
825
+ */
826
+ sandwichHoldings?: string;
827
+ /**
828
+ * Sandwich holdings ratio
829
+ */
830
+ sandwichHoldingsRatio?: string;
831
+ /**
832
+ * Fresh holders count
833
+ */
834
+ freshHolders?: number;
835
+ /**
836
+ * Fresh total holdings
837
+ */
838
+ freshHoldings?: string;
839
+ /**
840
+ * Fresh holdings ratio
841
+ */
842
+ freshHoldingsRatio?: string;
843
+ /**
844
+ * Bundle holders count
845
+ */
846
+ bundleHolders?: number;
847
+ /**
848
+ * Bundle total holdings
849
+ */
850
+ bundleHoldings?: string;
851
+ /**
852
+ * Bundle holdings ratio
853
+ */
854
+ bundleHoldingsRatio?: string;
855
+ /**
856
+ * Dev holders count
857
+ */
858
+ devHolders?: number;
859
+ /**
860
+ * Dev total holdings
861
+ */
862
+ devHoldings?: string;
863
+ /**
864
+ * Dev holdings ratio
865
+ */
866
+ devHoldingsRatio?: string;
867
+ }
868
+ interface TokenLiquidity {
869
+ /**
870
+ * pool avatar image
871
+ */
872
+ image?: string;
873
+ /**
874
+ * pair token address.
875
+ */
876
+ pairAddress?: string;
877
+ /**
878
+ * pool address.
879
+ */
880
+ poolAddress?: string;
881
+ /**
882
+ * program address.
883
+ */
884
+ programAddress?: string;
885
+ /**
886
+ * protocol name.
887
+ */
888
+ protocolName?: string;
889
+ /**
890
+ * protocol family.
891
+ */
892
+ protocolFamily?: string;
893
+ /**
894
+ * tvl in quote token.
895
+ */
896
+ tvl?: string;
897
+ /**
898
+ * tvl in usd.
899
+ */
900
+ tvlInUsd?: string;
901
+ }
902
+ /**
903
+ * Token security flags. Backend currently exposes the five Solana SPL flags
904
+ * below; additional checks may be added in the future as the security service
905
+ * gains coverage of more chains and risk vectors.
906
+ */
907
+ interface TokenSecurity {
908
+ /**
909
+ * whether the token has transfer fee.
910
+ */
911
+ hasTransferFee?: boolean;
912
+ /**
913
+ * whether the token transfer fee is upgradable.
914
+ */
915
+ isTransferFeeUpgradable?: boolean;
916
+ /**
917
+ * whether the token is transferable.
918
+ */
919
+ isTransferable?: boolean;
920
+ /**
921
+ * whether the token is freezable.
922
+ */
923
+ isFreezable?: boolean;
924
+ /**
925
+ * whether the token is closable.
926
+ */
927
+ isClosable?: boolean;
928
+ }
929
+ type TokenResolution = "1s" | "15s" | "30s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "24h";
930
+ interface TokenCandle {
931
+ /**
932
+ * open price in usd
933
+ */
934
+ open: string;
935
+ /**
936
+ * close price in usd
937
+ */
938
+ close: string;
939
+ /**
940
+ * high price in usd
941
+ */
942
+ high: string;
943
+ /**
944
+ * low price in usd
945
+ */
946
+ low: string;
947
+ /**
948
+ * volume in usd
949
+ */
950
+ volume: string;
951
+ /**
952
+ * resolution
953
+ */
954
+ resolution: TokenResolution;
955
+ /**
956
+ * timestamp
957
+ */
958
+ timestamp: Date;
959
+ }
960
+ interface TokenHolder {
961
+ /**
962
+ * holder wallet address
963
+ */
964
+ address: string;
965
+ /**
966
+ * holdings amount in token
967
+ */
968
+ amount: string;
969
+ /**
970
+ * holdings amount in usd
971
+ */
972
+ amountInUsd: string;
973
+ /**
974
+ * holdings ratio, range is 0-100
975
+ */
976
+ ratio: string;
977
+ /**
978
+ * Holder classification tags (Phase 3). Sparse — only present when the
979
+ * wallet matches one of the known patterns (kol/smart/sniper/dev/...).
980
+ */
981
+ tags?: Array<WalletTag>;
982
+ /**
983
+ * The last time this wallet was active on-chain (Phase 3).
984
+ * Sparse (~80% fill rate).
985
+ */
986
+ lastActiveAt?: Date;
987
+ /**
988
+ * The first time this wallet started holding this token (Phase 3).
989
+ * Sparse (~60% fill rate).
990
+ */
991
+ startHoldingAt?: Date;
992
+ }
993
+
994
+ /**
995
+ * Portfolio PNL
996
+ */
997
+ interface PortfolioPnl {
998
+ /** chain id */
999
+ chain: Chain;
1000
+ /** token address */
1001
+ address: string;
1002
+ /** token name */
1003
+ name: string;
1004
+ /** token symbol */
1005
+ symbol: string;
1006
+ /** token image url */
1007
+ image?: string;
1008
+ /** holding token amount */
1009
+ amount: string;
1010
+ /** holding token amount in usd */
1011
+ amountInUsd: string;
1012
+ /** token current price in usd */
1013
+ priceInUsd: string;
1014
+ /** token decimals */
1015
+ decimals: number;
1016
+ /** open position time */
1017
+ openTime?: Date;
1018
+ /** close position time */
1019
+ closeTime?: Date;
1020
+ /** total trades count */
1021
+ totalTrades?: number;
1022
+ /** total buy txs count */
1023
+ buys?: number;
1024
+ /** total buy volumes */
1025
+ buyVolumes?: string;
1026
+ /** total buy volumes in usd */
1027
+ buyVolumesInUsd?: string;
1028
+ /** average buy price in usd */
1029
+ buyAvgPriceInUsd?: string;
1030
+ /** total sell txs count */
1031
+ sells?: number;
1032
+ /** total sell volumes */
1033
+ sellVolumes?: string;
1034
+ /** total sell volumes in usd */
1035
+ sellVolumesInUsd?: string;
1036
+ /** average sell price in usd */
1037
+ sellAvgPriceInUsd?: string;
1038
+ /** realized profit in usd */
1039
+ realizedProfitInUsd?: string;
1040
+ /** realized profit ratio */
1041
+ realizedProfitRatio?: string;
1042
+ /** unrealized profit in usd */
1043
+ unrealizedProfitInUsd?: string;
1044
+ /** unrealized profit ratio */
1045
+ unrealizedProfitRatio?: string;
1046
+ /** total profit in usd (including both realized and unrealized profit) */
1047
+ totalProfitInUsd?: string;
1048
+ /** total profit ratio (including both realized and unrealized profit) */
1049
+ totalProfitRatio?: string;
1050
+ /** average profit per trade in usd */
1051
+ avgProfitPerTradeInUsd?: string;
1052
+ /**
1053
+ * Whether the position is closed (balance == 0). Phase 3; 100% fill rate.
1054
+ * Corresponds to `positionState=closed` filter on the pnl-details endpoint.
1055
+ */
1056
+ isClosed?: boolean;
1057
+ /** First buy time (Phase 3). Sparse (~60% fill rate). */
1058
+ firstBuyAt?: Date;
1059
+ /** Last sell time (Phase 3). Sparse (~30% fill rate). */
1060
+ lastSellAt?: Date;
1061
+ }
1062
+ interface Portfolio {
1063
+ /** chain id */
1064
+ chain: Chain;
1065
+ /** token address */
1066
+ address: string;
1067
+ /** token name */
1068
+ name: string;
1069
+ /** token symbol */
1070
+ symbol: string;
1071
+ /** token image url */
1072
+ image?: string;
1073
+ /** token current price in usd */
1074
+ priceInUsd: string;
1075
+ /** token current price in native token */
1076
+ priceInNative: string;
1077
+ /** holding token amount */
1078
+ amount: string;
1079
+ /** holding token amount in usd */
1080
+ amountInUsd: string;
1081
+ /** holding token amount in native token */
1082
+ amountInNative: string;
1083
+ /** token decimals */
1084
+ decimals: number;
1085
+ /**
1086
+ * Whether the wallet currently holds a positive balance of this token (Phase 3).
1087
+ * Always `true` in `net-worth/tokens` responses (the endpoint filters closed positions out).
1088
+ */
1089
+ isActive?: boolean;
1090
+ /**
1091
+ * Average cost basis in USD (Phase 3). Extremely sparse (~0.2% fill rate) —
1092
+ * backed by historical buy prices and often unavailable.
1093
+ */
1094
+ avgCostUsd?: string;
1095
+ /**
1096
+ * Last time this wallet operated on this token (Phase 3). Sparse.
1097
+ */
1098
+ lastActiveAt?: Date;
1099
+ /**
1100
+ * Tags applied to the wallet for this specific token position (Phase 3). Sparse.
1101
+ */
1102
+ walletTokenTags?: Array<WalletTag>;
1103
+ }
1104
+ /**
1105
+ * Wallet PnL summary
1106
+ */
1107
+ interface WalletPnl {
1108
+ /** chain id */
1109
+ chain: Chain;
1110
+ /** wallet address */
1111
+ address: string;
1112
+ /** total tokens traded */
1113
+ tokens?: number;
1114
+ /** total buy txs count */
1115
+ buys?: number;
1116
+ /** total sell txs count */
1117
+ sells?: number;
1118
+ /** total trades count */
1119
+ totalTrades?: number;
1120
+ /** total winning trades */
1121
+ wins?: number;
1122
+ /** total losing trades */
1123
+ losses?: number;
1124
+ /** win rate, range is 0-1 */
1125
+ winRate?: string;
1126
+ /** total buy amount in usd */
1127
+ buyAmountInUsd?: string;
1128
+ /** total sell amount in usd */
1129
+ sellAmountInUsd?: string;
1130
+ /** total cost in usd */
1131
+ totalCostInUsd?: string;
1132
+ /** realized profit in usd */
1133
+ realizedProfitInUsd?: string;
1134
+ /** realized profit ratio */
1135
+ realizedProfitRatio?: string;
1136
+ /** unrealized profit in usd */
1137
+ unrealizedProfitInUsd?: string;
1138
+ /** unrealized profit ratio */
1139
+ unrealizedProfitRatio?: string;
1140
+ /** total profit in usd (including both realized and unrealized profit) */
1141
+ totalProfitInUsd?: string;
1142
+ /** total profit ratio */
1143
+ totalProfitRatio?: string;
1144
+ /** average profit per trade in usd */
1145
+ avgProfitPerTradeInUsd?: string;
1146
+ }
1147
+ /**
1148
+ * Wallet portfolio PnL details (paged, with summary)
1149
+ */
1150
+ interface WalletPortfolioPnls extends WalletPnl, CursorPagination {
1151
+ /** per-token portfolio + pnl details */
1152
+ portfolios: Array<PortfolioPnl>;
1153
+ }
1154
+ /**
1155
+ * Wallet portfolios
1156
+ */
1157
+ interface WalletPortfolios extends CursorPagination {
1158
+ /** chain id */
1159
+ chain: Chain;
1160
+ /** wallet address */
1161
+ address: string;
1162
+ /** wallet total balance in usd */
1163
+ balanceInUsd: string;
1164
+ /** wallet total balance in native token */
1165
+ balanceInNative: string;
1166
+ /** wallet portfolios */
1167
+ portfolios: Array<Portfolio>;
1168
+ }
1169
+
1170
+ /**
1171
+ * Resolution window for wallet PnL queries (Phase 3).
1172
+ *
1173
+ * Two related endpoints surface this concept:
1174
+ * - `getWalletPortfolioPnls` (per-token, Phase 3) requires this exact set on
1175
+ * the server; other values yield HTTP 400.
1176
+ * - `getWalletPnl` (summary) and `subscribeWalletPnl` are typed against the
1177
+ * same union for callers' ergonomics. The implementation maps to whatever
1178
+ * the upstream SDK accepts; values outside the upstream's set may fall
1179
+ * through to a server-side default.
1180
+ */
1181
+ type WalletPnlResolution = "7d" | "30d" | "90d";
1182
+ /**
1183
+ * Position state filter for wallet PnL details (Phase 3).
1184
+ * - `open` — only tokens with current balance > 0 (default)
1185
+ * - `closed` — only tokens with balance == 0 (historical realized PnL)
1186
+ * - `all` — both open and closed positions
1187
+ */
1188
+ type PositionState = "open" | "closed" | "all";
1189
+ /**
1190
+ * Sort field for wallet PnL details (Phase 3).
1191
+ */
1192
+ type WalletPnlSortBy = "totalPnl" | "realizedPnl" | "unrealizedPnl";
1193
+ /**
1194
+ * Options for getting wallet portfolio PnL details (Phase 3).
1195
+ */
1196
+ interface GetWalletPortfolioPnlsOptions extends CursorListOptions {
1197
+ /**
1198
+ * Statistics time window. Defaults to `30d` in the Client implementation
1199
+ * for backward compatibility; the server requires this parameter and will
1200
+ * return 400 if it is missing.
1201
+ */
1202
+ resolution?: WalletPnlResolution;
1203
+ /** Position state filter. Defaults to `open` on the server. */
1204
+ positionState?: PositionState;
1205
+ /**
1206
+ * Sort field. Defaults to `totalPnl` on the server.
1207
+ * Switching `sortBy` requires discarding the old cursor.
1208
+ */
1209
+ sortBy?: WalletPnlSortBy;
1210
+ }
1211
+ /**
1212
+ * Options for listing a wallet's limit orders.
1213
+ *
1214
+ * NOTE: The server does not yet implement a limit-orders endpoint. The
1215
+ * `Client.getWalletLimitOrders` method throws a `NotImplementedError` and
1216
+ * the React hook surfaces an empty result so the widget layer can be built
1217
+ * ahead of backend availability.
1218
+ */
1219
+ interface GetWalletLimitOrdersOptions extends CursorListOptions {
1220
+ /** filter by order state; defaults to `active`. */
1221
+ state?: LimitOrderState;
1222
+ /** restrict to a single token when provided. */
1223
+ tokenAddress?: string;
1224
+ }
1225
+
1226
+ /**
1227
+ * Subscription handle returned by `ISubscribeClient.*` methods. Call
1228
+ * {@link ISubscription.unsubscribe} to detach the listener and release server
1229
+ * resources.
1230
+ */
1231
+ interface ISubscription {
1232
+ unsubscribe(): void;
1233
+ }
1234
+ /**
1235
+ * Incremental token update from subscriptions.
1236
+ * `chain` + `address` identify the token; all other fields are optional —
1237
+ * `undefined` means this push did not carry that field.
1238
+ */
1239
+ type TokenSubscribed = Partial<Omit<Token, "chain" | "address">> & Pick<Token, "chain" | "address">;
1240
+ interface WalletPnlSubscribed extends WalletPnl {
1241
+ /** pnl resolution window matching the originating subscription */
1242
+ resolution?: WalletPnlResolution;
1243
+ }
1244
+ interface PortfolioSubscribed {
1245
+ /** chain id */
1246
+ chain: Chain;
1247
+ /** wallet address */
1248
+ walletAddress: string;
1249
+ /** token address */
1250
+ tokenAddress: string;
1251
+ /** token current price in usd */
1252
+ priceInUsd?: string;
1253
+ /** holding token amount */
1254
+ amount?: string;
1255
+ }
1256
+ type PortfolioPnlSubscribed = Partial<Omit<PortfolioPnl, "address" | "name" | "symbol" | "image">> & {
1257
+ /** wallet address */
1258
+ walletAddress: string;
1259
+ /** token address */
1260
+ tokenAddress: string;
1261
+ };
1262
+
1263
+ declare enum SwapMode {
1264
+ EXACT_IN = "exact_in",
1265
+ EXACT_OUT = "exact_out"
1266
+ }
1267
+ /**
1268
+ * DEX identifier used for route / mint address conversion. Open union — the
1269
+ * known values cover today's DEXes; new aggregators can be plugged in without
1270
+ * a library update.
1271
+ */
1272
+ type SwapDex = "jupiter" | "kyberswap" | (string & {});
1273
+ interface SwapParams {
1274
+ /** chain id */
1275
+ chain: Chain;
1276
+ /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */
1277
+ dex?: SwapDex;
1278
+ /** user wallet address */
1279
+ userAddress: string;
1280
+ /** input token address */
1281
+ input: string;
1282
+ /** output token address */
1283
+ output: string;
1284
+ /** swap mode, e.g. ExactIn, ExactOut */
1285
+ mode: SwapMode;
1286
+ /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */
1287
+ amount: string;
1288
+ /** slippage, range is 0-100 */
1289
+ slippage?: number;
1290
+ /** priority fee */
1291
+ priorityFee?: string;
1292
+ /** tip fee */
1293
+ tipFee?: string;
1294
+ /** whether to use anti-MEV */
1295
+ isAntiMev?: boolean;
1296
+ /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */
1297
+ permit?: string;
1298
+ /** deadline timestamp in ms (EVM only) */
1299
+ deadline?: number;
1300
+ }
1301
+ interface SwapRoutePlan {
1302
+ /** protocol name / dex name etc. */
1303
+ name: string;
1304
+ /** input token address */
1305
+ input: string;
1306
+ /** input token amount */
1307
+ inputAmount: string;
1308
+ /** output token address */
1309
+ output: string;
1310
+ /** output token amount */
1311
+ outputAmount: string;
1312
+ /** fee quote token address */
1313
+ feeQuote?: string;
1314
+ /** fee amount */
1315
+ feeAmount?: string;
1316
+ /** extra infos by api provider */
1317
+ extra?: Record<string, unknown>;
1318
+ }
1319
+ interface SwapRoute {
1320
+ /** unsigned tx in base64 format */
1321
+ serializedTx: string;
1322
+ /** recent blockhash embedded in the unsigned Solana transaction */
1323
+ recentBlockhash?: string;
1324
+ /** last block height at which the embedded Solana blockhash remains valid */
1325
+ lastValidBlockHeight?: number;
1326
+ /** swap plans */
1327
+ plans: Array<SwapRoutePlan>;
1328
+ /** extra infos by api provider */
1329
+ extra?: Record<string, unknown>;
1330
+ }
1331
+
1332
+ /**
1333
+ * Time window prefix used by per-resolution token metric fields.
1334
+ */
1335
+ type Timeframe = "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "24h";
1336
+ /**
1337
+ * Metric base name that is repeated across timeframes.
1338
+ */
1339
+ type TimeBasedMetric = "buys" | "sells" | "trades" | "traders" | "volumes" | "priceChange";
1340
+ /**
1341
+ * Cross-product of metric × timeframe (e.g. `buys1m`, `priceChange24h`).
1342
+ * Generated from {@link TimeBasedMetric} and {@link Timeframe} so adding a new
1343
+ * timeframe / metric is a one-line change.
1344
+ */
1345
+ type TimeBasedField = `${TimeBasedMetric}${Capitalize<Timeframe>}`;
1346
+ /**
1347
+ * Token field names that do not have a per-resolution variant.
1348
+ */
1349
+ type StandaloneField = "price" | "marketCap" | "tvl" | "holders" | "top10Holdings" | "top10Ratio" | "top100Holdings" | "top100Ratio" | "creatorsHoldings" | "creatorsRatio" | "launchedFromProtocolFamily" | "migratedToProtocolFamily" | "tag" | "createdAt";
1350
+ /**
1351
+ * Token field for filtering / sorting. Open union: server-defined fields not
1352
+ * known to the SDK are still acceptable via the `(string & {})` escape hatch.
1353
+ */
1354
+ type TokenFieldOption = TimeBasedField | StandaloneField | (string & {});
1355
+ /**
1356
+ * Token filter option.
1357
+ */
1358
+ interface TokenFilterOption {
1359
+ field: TokenFieldOption;
1360
+ operator: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "between" | "in" | "nin" | "contains" | "notContains" | "startsWith" | "endsWith" | "isNotNull" | "isNull";
1361
+ value?: string | number | boolean | Array<string | number | boolean>;
1362
+ }
1363
+ /**
1364
+ * Options for getting token candles.
1365
+ */
1366
+ interface GetTokenCandlesOptions {
1367
+ /** query candles after this timestamp */
1368
+ after?: Date;
1369
+ /** query candles before this timestamp */
1370
+ before?: Date;
1371
+ /** return limit */
1372
+ limit?: number;
1373
+ }
1374
+ /**
1375
+ * Options for getting token list.
1376
+ */
1377
+ interface GetTokenListOptions {
1378
+ /** sort field */
1379
+ sortBy?: TokenFieldOption;
1380
+ /** sort direction */
1381
+ sortDirection?: "asc" | "desc";
1382
+ /** filters */
1383
+ filters?: Array<TokenFilterOption>;
1384
+ /** search keywords */
1385
+ keywords?: Array<string>;
1386
+ /** exclude keywords */
1387
+ excludeKeywords?: Array<string>;
1388
+ }
1389
+ /**
1390
+ * Options for searching tokens.
1391
+ */
1392
+ interface SearchTokensOptions extends CursorListOptions {
1393
+ /** chains */
1394
+ chains?: Array<Chain>;
1395
+ /** search keyword */
1396
+ keyword?: string;
1397
+ /** filters */
1398
+ filters?: Array<TokenFilterOption>;
1399
+ /** sort field */
1400
+ sortBy?: TokenFieldOption;
1401
+ /** sort direction */
1402
+ sortDirection?: "asc" | "desc";
1403
+ }
1404
+ /**
1405
+ * Search token cursor list.
1406
+ */
1407
+ interface SearchTokenCursorList extends CursorList<Token> {
1408
+ /** total count */
1409
+ total?: number;
1410
+ /** extra infos by api provider */
1411
+ extra?: Record<string, unknown>;
1412
+ }
1413
+ /**
1414
+ * Sort field for token holder list (Phase 3).
1415
+ * - `holdingUsd` — order by holding value in USD (default, descending)
1416
+ * - `lastActiveAt` — order by wallet's last activity time
1417
+ * - `realizedPnl` — order by realized PnL on this token; used by the
1418
+ * Top Traders view, which shares the same endpoint but
1419
+ * surfaces traders ranked by profit. Server support for
1420
+ * this sort key is required by `getTopTokenTraders`.
1421
+ */
1422
+ type TokenHoldersSortBy = "holdingUsd" | "lastActiveAt" | "realizedPnl";
1423
+ /**
1424
+ * Options for getting token holders (Phase 3).
1425
+ */
1426
+ interface GetTokenHoldersOptions extends CursorListOptions {
1427
+ /**
1428
+ * Sort field. Defaults to `holdingUsd` on the server.
1429
+ * Switching `sortBy` requires discarding the old cursor and restarting from page 1.
1430
+ */
1431
+ sortBy?: TokenHoldersSortBy;
1432
+ }
1433
+ /**
1434
+ * Resolution subset supported by the trending token list.
1435
+ */
1436
+ type TrendingResolution = Extract<TokenResolution, "1m" | "5m" | "1h" | "4h" | "24h">;
1437
+ /**
1438
+ * Options for listing tokens created by a given wallet (the "Dev Tokens" tab).
1439
+ *
1440
+ * NOTE: The server does not yet implement a creator-index endpoint. The
1441
+ * `Client.getTokensByCreator` method throws a `NotImplementedError` and the
1442
+ * React hook surfaces an empty result for now.
1443
+ */
1444
+ interface GetTokensByCreatorOptions extends CursorListOptions {
1445
+ /** optional sort field; server behaviour will be defined when endpoint ships. */
1446
+ sortBy?: TokenFieldOption;
1447
+ /** sort direction. */
1448
+ sortDirection?: "asc" | "desc";
1449
+ }
1450
+
1451
+ interface LatestBlockParams {
1452
+ /** chain id */
1453
+ chain: Chain;
1454
+ }
1455
+ interface BlockchainLatestBlock {
1456
+ /** latest block hash */
1457
+ blockhash: string;
1458
+ /** last valid block height for transactions built with the latest blockhash */
1459
+ lastValidBlockHeight: number;
1460
+ }
1461
+ interface SendTxParams {
1462
+ /** chain id */
1463
+ chain: Chain;
1464
+ /** signed tx in base64 format */
1465
+ serializedTx: string;
1466
+ /** extra infos needed by api provider */
1467
+ extra?: Record<string, unknown>;
1468
+ }
1469
+ interface SendTxResult {
1470
+ /** tx hash */
1471
+ txHash: string;
1472
+ /** extra infos by api provider */
1473
+ extra?: Record<string, unknown>;
1474
+ }
1475
+
1476
+ /**
1477
+ * API client interface — read-side data + transaction broadcast.
1478
+ */
1479
+ interface IClient {
1480
+ /**
1481
+ * fetch token info
1482
+ * @param chain chain id
1483
+ * @param address token address
1484
+ * @returns token info
1485
+ */
1486
+ getToken(chain: Chain, address: string): Promise<Token>;
1487
+ /**
1488
+ * fetch token infos in batch
1489
+ * @param chain chain id
1490
+ * @param addresses token addresses
1491
+ * @returns token infos
1492
+ */
1493
+ getTokens(chain: Chain, addresses: Array<string>): Promise<Array<Token>>;
1494
+ /**
1495
+ * fetch token candles
1496
+ * @param chain chain id
1497
+ * @param address token address
1498
+ * @param resolution token resolution
1499
+ * @param options optional query options
1500
+ * @returns token candles
1501
+ */
1502
+ getTokenCandles(chain: Chain, address: string, resolution: TokenResolution, options?: GetTokenCandlesOptions): Promise<Array<TokenCandle>>;
1503
+ /**
1504
+ * fetch token security
1505
+ * @param chain chain id
1506
+ * @param address token address
1507
+ * @returns token security
1508
+ */
1509
+ getTokenSecurity(chain: Chain, address: string): Promise<TokenSecurity>;
1510
+ /**
1511
+ * fetch token stats
1512
+ * @param chain chain id
1513
+ * @param address token address
1514
+ * @returns token stats
1515
+ */
1516
+ getTokenStats(chain: Chain, address: string): Promise<TokenStats>;
1517
+ /**
1518
+ * fetch token holders
1519
+ * @param chain chain id
1520
+ * @param address token address
1521
+ * @param options optional query options (Phase 3: sortBy)
1522
+ * @returns token holders
1523
+ */
1524
+ getTokenHolders(chain: Chain, address: string, options?: GetTokenHoldersOptions): Promise<CursorList<TokenHolder>>;
1525
+ /**
1526
+ * fetch token market data
1527
+ * @param chain chain id
1528
+ * @param address token address
1529
+ * @returns token market data
1530
+ */
1531
+ getTokenMarketData(chain: Chain, address: string): Promise<TokenMarketData>;
1532
+ /**
1533
+ * fetch `New` token list
1534
+ * @param chain chain id
1535
+ * @param options optional query options
1536
+ * @returns `New` token list
1537
+ */
1538
+ getNewTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1539
+ /**
1540
+ * fetch `Final Stretch` token list
1541
+ * @param chain chain id
1542
+ * @param options optional query options
1543
+ * @returns `Final Stretch` token list
1544
+ */
1545
+ getFinalStretchTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1546
+ /**
1547
+ * fetch `Migrated` token list
1548
+ * @param chain chain id
1549
+ * @param options optional query options
1550
+ * @returns `Migrated` token list
1551
+ */
1552
+ getMigratedTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1553
+ /**
1554
+ * fetch `Trending` token list
1555
+ * @param chain chain id
1556
+ * @param resolution query resolution, e.g. "1m", "5m", "1h", "4h", "24h"
1557
+ * @param options optional query options
1558
+ * @returns `Trending` token list
1559
+ */
1560
+ getTrendingTokens(chain: Chain, resolution: TrendingResolution, options?: GetTokenListOptions): Promise<Array<Token>>;
1561
+ /**
1562
+ * fetch `Stock` token list
1563
+ * @param chain chain id
1564
+ * @param options optional query options
1565
+ * @returns `Stock` token list
1566
+ */
1567
+ getStockTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1568
+ /**
1569
+ * search tokens
1570
+ * @param options optional query options
1571
+ * @returns search token cursor list
1572
+ */
1573
+ searchTokens(options?: SearchTokensOptions): Promise<SearchTokenCursorList>;
1574
+ /**
1575
+ * fetch swap route plans
1576
+ * @param params swap params
1577
+ * @returns swap route plans
1578
+ */
1579
+ swapRoute(params: SwapParams): Promise<SwapRoute>;
1580
+ /**
1581
+ * fetch latest block metadata
1582
+ * @param params latest block params
1583
+ * @returns latest block metadata
1584
+ */
1585
+ getLatestBlock(params: LatestBlockParams): Promise<BlockchainLatestBlock>;
1586
+ /**
1587
+ * send tx
1588
+ * @param params send tx params
1589
+ * @returns send tx result
1590
+ */
1591
+ sendTx(params: SendTxParams): Promise<SendTxResult>;
1592
+ /**
1593
+ * check if tx is successful
1594
+ * @param chain chain id
1595
+ * @param txHash tx hash
1596
+ * @param timeout timeout in milliseconds
1597
+ * @returns true if tx is successful, false otherwise
1598
+ */
1599
+ checkTxSuccess(chain: Chain, txHash: string, timeout?: number): Promise<boolean>;
1600
+ /**
1601
+ * fetch wallet portfolios
1602
+ * @param chain chain id
1603
+ * @param address wallet address
1604
+ * @param options optional pagination options
1605
+ * @returns wallet portfolios
1606
+ */
1607
+ getWalletPortfolios(chain: Chain, address: string, options?: {
1608
+ cursor?: string;
1609
+ limit?: number;
1610
+ }): Promise<WalletPortfolios>;
1611
+ /**
1612
+ * fetch wallet PnL summary
1613
+ * @param chain chain id
1614
+ * @param address wallet address
1615
+ * @param resolution pnl resolution window (e.g. `"7d"`, `"30d"`, `"90d"`)
1616
+ * @returns wallet pnl summary
1617
+ */
1618
+ getWalletPnl(chain: Chain, address: string, resolution?: WalletPnlResolution): Promise<WalletPnl>;
1619
+ /**
1620
+ * fetch wallet portfolio PnL details (per-token)
1621
+ * @param chain chain id
1622
+ * @param address wallet address
1623
+ * @param options optional query options (Phase 3: resolution, positionState, sortBy)
1624
+ * @returns portfolio pnl list with summary
1625
+ */
1626
+ getWalletPortfolioPnls(chain: Chain, address: string, options?: GetWalletPortfolioPnlsOptions): Promise<WalletPortfolioPnls>;
1627
+ /**
1628
+ * fetch wallet portfolios for specific tokens
1629
+ * @param chain chain id
1630
+ * @param address wallet address
1631
+ * @param tokenAddresses token addresses to query
1632
+ * @returns portfolio list for the specified tokens
1633
+ */
1634
+ getWalletPortfoliosByTokens(chain: Chain, address: string, tokenAddresses: Array<string>): Promise<Array<Portfolio>>;
1635
+ /**
1636
+ * fetch wallet portfolio PnL for specific tokens
1637
+ * @param chain chain id
1638
+ * @param address wallet address
1639
+ * @param tokenAddresses token addresses to query
1640
+ * @returns portfolio pnl list for the specified tokens
1641
+ */
1642
+ getWalletPortfolioPnlsByTokens(chain: Chain, address: string, tokenAddresses: Array<string>): Promise<Array<PortfolioPnl>>;
1643
+ /**
1644
+ * fetch wallet's trade activities
1645
+ * @param chain chain id
1646
+ * @param address wallet address
1647
+ * @param options optional query options
1648
+ * @returns wallet's trade activities
1649
+ */
1650
+ getWalletTrades(chain: Chain, address: string, options?: GetTradesOptions): Promise<CursorList<Trade>>;
1651
+ /**
1652
+ * fetch token's trade activities
1653
+ * @param chain chain id
1654
+ * @param address token address
1655
+ * @param options optional query options
1656
+ * @returns token's trade activities
1657
+ */
1658
+ getTokenTrades(chain: Chain, address: string, options?: GetTradesOptions): Promise<CursorList<Trade>>;
1659
+ /**
1660
+ * fetch wallet's activities (trades, liquidity, red packets, etc.)
1661
+ * @param chain chain id
1662
+ * @param address wallet address
1663
+ * @param options optional query options
1664
+ * @returns wallet's activities
1665
+ */
1666
+ getWalletActivities(chain: Chain, address: string, options?: GetActivitiesOptions): Promise<CursorList<Activity>>;
1667
+ /**
1668
+ * fetch token's activities (trades, liquidity, red packets, etc.)
1669
+ * @param chain chain id
1670
+ * @param address token address
1671
+ * @param options optional query options
1672
+ * @returns token's activities
1673
+ */
1674
+ getTokenActivities(chain: Chain, address: string, options?: GetActivitiesOptions): Promise<CursorList<Activity>>;
1675
+ /**
1676
+ * get presigned upload url
1677
+ * @returns presigned upload url
1678
+ */
1679
+ getPresignedUploadUrl(): Promise<string>;
1680
+ /**
1681
+ * fetch a wallet's limit orders.
1682
+ *
1683
+ * Currently unsupported by the backend; implementations throw
1684
+ * `NotImplementedError` to make the gap explicit while the widget-layer
1685
+ * clone of Axiom's Orders tab is being developed.
1686
+ * @param chain chain id
1687
+ * @param address wallet address
1688
+ * @param options optional query options
1689
+ */
1690
+ getWalletLimitOrders(chain: Chain, address: string, options?: GetWalletLimitOrdersOptions): Promise<CursorList<LimitOrder>>;
1691
+ /**
1692
+ * fetch tokens created by a wallet ("Dev Tokens").
1693
+ *
1694
+ * Currently unsupported by the backend; implementations throw
1695
+ * `NotImplementedError`.
1696
+ * @param chain chain id
1697
+ * @param creator creator wallet address
1698
+ * @param options optional query options
1699
+ */
1700
+ getTokensByCreator(chain: Chain, creator: string, options?: GetTokensByCreatorOptions): Promise<CursorList<Token>>;
1701
+ }
1702
+ /**
1703
+ * Subscribe client interface — push-side real-time data.
1704
+ */
1705
+ interface ISubscribeClient {
1706
+ /**
1707
+ * Subscribe to a token's real-time data updates (stats, market data,
1708
+ * holders, liquidity, etc.). The client internally manages multiple
1709
+ * backend channels and delivers incremental updates via `callback`.
1710
+ * @param chain chain id
1711
+ * @param address token address
1712
+ * @param callback receives incremental token updates
1713
+ * @returns subscription
1714
+ */
1715
+ subscribeToken(chain: Chain, address: string, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1716
+ /**
1717
+ * Subscribe token new candles
1718
+ * @param chain chain id
1719
+ * @param address token address
1720
+ * @param resolution token resolution
1721
+ * @param callback callback function
1722
+ * @returns subscription
1723
+ */
1724
+ subscribeTokenCandles(chain: Chain, address: string, resolution: TokenResolution, callback: (candles: Array<TokenCandle>) => void): ISubscription;
1725
+ /**
1726
+ * Subscribe wallet's pnl changes
1727
+ * @param chain chain id
1728
+ * @param address wallet address
1729
+ * @param callback callback function
1730
+ * @returns subscription
1731
+ */
1732
+ subscribeWalletPnl(chain: Chain, address: string, callback: (pnls: Array<WalletPnlSubscribed>) => void): ISubscription;
1733
+ /**
1734
+ * Subscribe wallet's portfolio changes
1735
+ * @param chain chain id
1736
+ * @param address wallet address
1737
+ * @param callback callback function
1738
+ * @returns subscription
1739
+ */
1740
+ subscribeWalletPortfolios(chain: Chain, address: string, callback: (portfolios: Array<PortfolioSubscribed>) => void): ISubscription;
1741
+ /**
1742
+ * Subscribe wallet's portfolio pnl changes
1743
+ * @param chain chain id
1744
+ * @param address wallet address
1745
+ * @param callback callback function
1746
+ * @returns subscription
1747
+ */
1748
+ subscribeWalletPortfolioPnls(chain: Chain, address: string, callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void): ISubscription;
1749
+ /**
1750
+ * Subscribe wallet's new trade activities
1751
+ * @param chain chain id
1752
+ * @param address wallet address
1753
+ * @param callback callback function
1754
+ * @returns subscription
1755
+ */
1756
+ subscribeWalletTrades(chain: Chain, address: string, callback: (trades: Array<Trade>) => void): ISubscription;
1757
+ /**
1758
+ * Subscribe token's new trade activities
1759
+ * @param chain chain id
1760
+ * @param address token address
1761
+ * @param callback callback function
1762
+ * @returns subscription
1763
+ */
1764
+ subscribeTokenTrades(chain: Chain, address: string, callback: (trades: Array<Trade>) => void): ISubscription;
1765
+ /**
1766
+ * Subscribe wallet's new activities (trades, liquidity, etc.)
1767
+ * @param chain chain id
1768
+ * @param address wallet address
1769
+ * @param callback callback function
1770
+ * @returns subscription
1771
+ */
1772
+ subscribeWalletActivities(chain: Chain, address: string, callback: (activities: Array<Activity>) => void): ISubscription;
1773
+ /**
1774
+ * Subscribe token's new activities (trades, liquidity, etc.)
1775
+ * @param chain chain id
1776
+ * @param address token address
1777
+ * @param callback callback function
1778
+ * @returns subscription
1779
+ */
1780
+ subscribeTokenActivities(chain: Chain, address: string, callback: (activities: Array<Activity>) => void): ISubscription;
1781
+ /**
1782
+ * Subscribe to `New` token list real-time updates. The client internally
1783
+ * manages multiple backend channels (new token events, metadata, stats,
1784
+ * holders, supply, liquidity, bonding curve) and delivers incremental
1785
+ * updates via `callback`.
1786
+ * @param chain chain id
1787
+ * @param callback receives incremental token updates
1788
+ * @returns subscription
1789
+ */
1790
+ subscribeNewTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1791
+ /**
1792
+ * Subscribe to `Trending` token list real-time updates. The client
1793
+ * internally manages multiple backend channels (stats, holders, supply,
1794
+ * liquidity) and delivers incremental updates via `callback`.
1795
+ * @param chain chain id
1796
+ * @param callback receives incremental token updates
1797
+ * @returns subscription
1798
+ */
1799
+ subscribeTrendingTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1800
+ /**
1801
+ * Subscribe to `Migrated` token list real-time updates. The client
1802
+ * internally manages multiple backend channels (stats, holders, supply,
1803
+ * liquidity) and delivers incremental updates via `callback`.
1804
+ * @param chain chain id
1805
+ * @param callback receives incremental token updates
1806
+ * @returns subscription
1807
+ */
1808
+ subscribeMigratedTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1809
+ /**
1810
+ * Subscribe to `FinalStretch` token list real-time updates. The client
1811
+ * internally manages multiple backend channels (stats, holders, supply,
1812
+ * liquidity, bonding curve) and delivers incremental updates via `callback`.
1813
+ * @param chain chain id
1814
+ * @param callback receives incremental token updates
1815
+ * @returns subscription
1816
+ */
1817
+ subscribeFinalStretchTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1818
+ /**
1819
+ * Subscribe to `Stock` token list real-time updates. The client internally
1820
+ * manages multiple backend channels (stats, holders, supply, liquidity)
1821
+ * and delivers incremental updates via `callback`.
1822
+ * @param chain chain id
1823
+ * @param callback receives incremental token updates
1824
+ * @returns subscription
1825
+ */
1826
+ subscribeStockTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1827
+ }
1828
+
1829
+ export { type ActivityToken as A, type ActivitiesSortBy, type BlockchainLatestBlock, Chain as C, type CursorList, type CursorListOptions, type CursorPagination, type GetActivitiesOptions, type GetTokenCandlesOptions, type GetTokenHoldersOptions, type GetTokenListOptions, type GetTokensByCreatorOptions, type GetTradesOptions, type GetWalletLimitOrdersOptions, type GetWalletPortfolioPnlsOptions, type IClient, type ISubscribeClient, type ISubscription, type LimitOrderSide as L, type LatestBlockParams, type PortfolioPnl as P, type PortfolioPnlSubscribed, type PortfolioSubscribed, type PositionState, SolanaTokenProtocol as S, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, type SwapDex, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Trade as T, type TokenFieldOption, type TokenFilterOption, type TokenHoldersSortBy, type TokenSubscribed, type TrendingResolution, type WalletTag as W, type WalletPnlResolution, type WalletPnlSortBy, type WalletPnlSubscribed, type ActivityDex as a, type ActivityType as b, type Activity as c, ChainNamespace as d, type LimitOrderState as e, type LimitOrder as f, type TokenProtocol as g, SOLANA_TOKEN_PROTOCOLS as h, type Token as i, type TokenCreator as j, type TokenLaunchedFrom as k, type TokenMigratedTo as l, type TokenSocialMedias as m, type TokenStats as n, type TokenStatsByResolution as o, type TokenMarketData as p, type TokenLiquidity as q, type TokenSecurity as r, type TokenResolution as s, type TokenCandle as t, type TokenHolder as u, type Portfolio as v, type WalletPnl as w, type WalletPortfolioPnls as x, type WalletPortfolios as y };