@liberfi.io/types 0.3.12 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,1842 +1 @@
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
- interface ActivityToken {
197
- /** token address */
198
- address: string;
199
- /** token symbol */
200
- symbol: string;
201
- /** token name */
202
- name?: string;
203
- /** token avatar image url */
204
- image?: string;
205
- /** token amount */
206
- amount: string;
207
- /** token amount in USD */
208
- amountInUsd?: string;
209
- /** token price in USD at the time of the trade */
210
- priceInUsd?: string;
211
- }
212
- interface ActivityDex {
213
- /** dex name */
214
- name?: string;
215
- /** dex avatar image url */
216
- image?: string;
217
- /** dex protocol family */
218
- protocolFamily?: string;
219
- /** dex program address */
220
- programAddress?: string;
221
- }
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 & {});
228
- /**
229
- * An on-chain activity record (trade, liquidity, red packet, etc.).
230
- */
231
- interface Activity {
232
- /** chain id */
233
- chain: Chain;
234
- /** wallet address */
235
- walletAddress: string;
236
- /** transaction hash */
237
- txHash: string;
238
- /** activity type */
239
- type: ActivityType;
240
- /** source token */
241
- from: ActivityToken;
242
- /** destination token */
243
- to: ActivityToken;
244
- /** dex where the activity happened */
245
- dex?: ActivityDex;
246
- /** pool address */
247
- poolAddress?: string;
248
- /** activity status */
249
- status: "pending" | "success" | "failed";
250
- /** activity time */
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>;
262
- }
263
- /**
264
- * A buy/sell trade record. Narrowed subset of {@link Activity}.
265
- */
266
- interface Trade extends Activity {
267
- type: "buy" | "sell";
268
- }
269
-
270
- /**
271
- * Side of a limit order.
272
- */
273
- type LimitOrderSide = "buy" | "sell";
274
- /**
275
- * Lifecycle state of a limit order (Phase 3 extension).
276
- * - `active` — order is open, still watching the target price
277
- * - `filled` — order was executed
278
- * - `cancelled` — order was cancelled by the user
279
- * - `expired` — order reached its deadline without filling
280
- */
281
- type LimitOrderState = "active" | "filled" | "cancelled" | "expired";
282
- /**
283
- * A wallet-scoped limit order (not yet backed by a server endpoint;
284
- * shape captures the Axiom-style `Orders` tab columns so the widget
285
- * layer can be built against stable types even while the backend is
286
- * still being designed).
287
- */
288
- interface LimitOrder {
289
- /** stable order id */
290
- id: string;
291
- /** chain id */
292
- chain: Chain;
293
- /** owner wallet address */
294
- wallet: string;
295
- /** target token address */
296
- tokenAddress: string;
297
- /** target token name (mirrored for convenience) */
298
- tokenName?: string;
299
- /** target token symbol */
300
- tokenSymbol?: string;
301
- /** target token image url */
302
- tokenImage?: string;
303
- /** buy or sell */
304
- side: LimitOrderSide;
305
- /** order amount in token base units (string to avoid precision loss) */
306
- amount: string;
307
- /** optional USD amount at order creation time */
308
- amountInUsd?: string;
309
- /** current market cap in USD at query time (display-only) */
310
- currentMarketCapInUsd?: string;
311
- /** target market cap in USD at which the order triggers */
312
- targetMarketCapInUsd?: string;
313
- /** optional trigger price in USD (alternative to target market cap) */
314
- targetPriceInUsd?: string;
315
- /** optional slippage tolerance, range 0-100 */
316
- slippage?: number;
317
- /** order state */
318
- state: LimitOrderState;
319
- /** order creation time */
320
- createdAt?: Date;
321
- /** order expiry time (if any) */
322
- expiresAt?: Date;
323
- /** execution time when state is `filled` */
324
- filledAt?: Date;
325
- }
326
-
327
- declare enum SolanaTokenProtocol {
328
- BAGS = "bags",
329
- BELIEVE = "believe",
330
- BONK = "bonk",
331
- BOOP = "boop",
332
- HEAVEN = "heaven",
333
- JUPSTUDIO = "jupstudio",
334
- LAUNCHLAB = "launchlab",
335
- METEORA = "meteora",
336
- MOONIT = "moonit",
337
- MOONSHOT = "moonshot",
338
- ORCA = "orca",
339
- PUMP = "pump",
340
- RAYDIUM = "raydium",
341
- SUGAR = "sugar",
342
- VIRTUAL_CURVE = "virtual-curve",
343
- PUMP_AMM = "pump-amm"
344
- }
345
- type TokenProtocol = SolanaTokenProtocol | (string & {});
346
- declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
347
- interface Token {
348
- /**
349
- * chain id.
350
- */
351
- chain: Chain;
352
- /**
353
- * token name, e.g. "Ethereum", "Solana", etc.
354
- */
355
- name: string;
356
- /**
357
- * token symbol, e.g. "ETH", "SOL", etc.
358
- */
359
- symbol: string;
360
- /**
361
- * token address.
362
- */
363
- address: string;
364
- /**
365
- * token decimals.
366
- */
367
- decimals: number;
368
- /**
369
- * token avatar image url.
370
- */
371
- image?: string;
372
- /**
373
- * token description.
374
- */
375
- description?: string;
376
- /**
377
- * token creators.
378
- */
379
- creators?: Array<TokenCreator>;
380
- /**
381
- * token launch info.
382
- */
383
- launchedFrom?: TokenLaunchedFrom;
384
- /**
385
- * token migrate progress, range is 0-100.
386
- */
387
- migrateProgress?: string;
388
- /**
389
- * token migrate info.
390
- */
391
- migratedTo?: TokenMigratedTo;
392
- /**
393
- * token social medias.
394
- */
395
- socialMedias?: TokenSocialMedias;
396
- /**
397
- * token stats.
398
- */
399
- stats?: TokenStats;
400
- /**
401
- * token market data.
402
- */
403
- marketData?: TokenMarketData;
404
- /**
405
- * token liquidity pools
406
- */
407
- liquidities?: Array<TokenLiquidity>;
408
- /**
409
- * token security.
410
- */
411
- security?: TokenSecurity;
412
- /**
413
- * token tags.
414
- */
415
- tags?: Array<string>;
416
- /**
417
- * token create time.
418
- */
419
- createdAt?: Date;
420
- }
421
- interface TokenCreator {
422
- /**
423
- * token creator's wallet address.
424
- */
425
- address?: string;
426
- /**
427
- * token creator's share percentage, range is 0-100.
428
- */
429
- share?: number;
430
- /**
431
- * whether the token creator is verified.
432
- */
433
- isVerified?: boolean;
434
- }
435
- interface TokenLaunchedFrom {
436
- /**
437
- * token launch program address.
438
- */
439
- programAddress?: string;
440
- /**
441
- * token launch protocol family.
442
- */
443
- protocolFamily?: string;
444
- }
445
- interface TokenMigratedTo {
446
- /**
447
- * token migrate program address.
448
- */
449
- programAddress?: string;
450
- /**
451
- * token migrate protocol family.
452
- */
453
- protocolFamily?: string;
454
- /**
455
- * token migrate pool address.
456
- */
457
- poolAddress?: string;
458
- /**
459
- * token migrate time.
460
- */
461
- migratedAt?: Date;
462
- }
463
- interface TokenSocialMedias {
464
- /**
465
- * token twitter url.
466
- */
467
- twitter?: string;
468
- /**
469
- * token telegram url.
470
- */
471
- telegram?: string;
472
- /**
473
- * token website url.
474
- */
475
- website?: string;
476
- /**
477
- * token tiktok url.
478
- */
479
- tiktok?: string;
480
- /**
481
- * token discord url.
482
- */
483
- discord?: string;
484
- /**
485
- * token facebook url.
486
- */
487
- facebook?: string;
488
- /**
489
- * token github url.
490
- */
491
- github?: string;
492
- /**
493
- * token instagram url.
494
- */
495
- instagram?: string;
496
- /**
497
- * token linkedin url.
498
- */
499
- linkedin?: string;
500
- /**
501
- * token medium url.
502
- */
503
- medium?: string;
504
- /**
505
- * token reddit url.
506
- */
507
- reddit?: string;
508
- /**
509
- * token youtube url.
510
- */
511
- youtube?: string;
512
- /**
513
- * token bitbucket url.
514
- */
515
- bitbucket?: string;
516
- }
517
- interface TokenStats {
518
- /**
519
- * token stats by 1m timeframe.
520
- */
521
- "1m"?: TokenStatsByResolution;
522
- /**
523
- * token stats by 5m timeframe.
524
- */
525
- "5m"?: TokenStatsByResolution;
526
- /**
527
- * token stats by 15m timeframe.
528
- */
529
- "15m"?: TokenStatsByResolution;
530
- /**
531
- * token stats by 30m timeframe.
532
- */
533
- "30m"?: TokenStatsByResolution;
534
- /**
535
- * token stats by 1h timeframe.
536
- */
537
- "1h"?: TokenStatsByResolution;
538
- /**
539
- * token stats by 4h timeframe.
540
- */
541
- "4h"?: TokenStatsByResolution;
542
- /**
543
- * token stats by 24h timeframe.
544
- */
545
- "24h"?: TokenStatsByResolution;
546
- }
547
- interface TokenStatsByResolution {
548
- /**
549
- * buy txs count
550
- */
551
- buys?: number;
552
- /**
553
- * sell txs count
554
- */
555
- sells?: number;
556
- /**
557
- * txs count
558
- */
559
- trades?: number;
560
- /**
561
- * buy addresses count
562
- */
563
- buyers?: number;
564
- /**
565
- * sell addresses count
566
- */
567
- sellers?: number;
568
- /**
569
- * trade addresses count
570
- */
571
- traders?: number;
572
- /**
573
- * buy volumes in quote token
574
- */
575
- buyVolumes?: string;
576
- /**
577
- * sell volumes in quote token
578
- */
579
- sellVolumes?: string;
580
- /**
581
- * total volumes in quote token
582
- */
583
- volumes?: string;
584
- /**
585
- * buy volumes in usd
586
- */
587
- buyVolumesInUsd?: string;
588
- /**
589
- * sell volumes in usd
590
- */
591
- sellVolumesInUsd?: string;
592
- /**
593
- * total volumes in usd
594
- */
595
- volumesInUsd?: string;
596
- /**
597
- * open price in usd
598
- */
599
- openPriceInUsd?: string;
600
- /**
601
- * close price in usd
602
- */
603
- closePriceInUsd?: string;
604
- /**
605
- * high price in usd
606
- */
607
- highPriceInUsd?: string;
608
- /**
609
- * low price in usd
610
- */
611
- lowPriceInUsd?: string;
612
- /**
613
- * price in usd
614
- */
615
- priceInUsd?: string;
616
- /**
617
- * price change %
618
- */
619
- priceChange?: string;
620
- }
621
- interface TokenMarketData {
622
- /**
623
- * total supply
624
- */
625
- totalSupply?: string;
626
- /**
627
- * market cap in quote token
628
- */
629
- marketCap?: string;
630
- /**
631
- * market cap in usd
632
- */
633
- marketCapInUsd?: string;
634
- /**
635
- * price in quote token
636
- */
637
- price?: string;
638
- /**
639
- * price in usd
640
- */
641
- priceInUsd?: string;
642
- /**
643
- * tvl in quote token
644
- */
645
- tvl?: string;
646
- /**
647
- * tvl in usd
648
- */
649
- tvlInUsd?: string;
650
- /**
651
- * holders count
652
- */
653
- holders?: number;
654
- /**
655
- * top 10 total holdings
656
- */
657
- top10Holdings?: string;
658
- /**
659
- * top 10 holdings ratio
660
- */
661
- top10HoldingsRatio?: string;
662
- /**
663
- * top 50 total holdings
664
- */
665
- top50Holdings?: string;
666
- /**
667
- * top 50 holdings ratio
668
- */
669
- top50HoldingsRatio?: string;
670
- /**
671
- * top 100 total holdings
672
- */
673
- top100Holdings?: string;
674
- /**
675
- * top 100 holdings ratio
676
- */
677
- top100HoldingsRatio?: string;
678
- /**
679
- * Bluechip holders count
680
- */
681
- bluechipHolders?: number;
682
- /**
683
- * Bluechip total holdings
684
- */
685
- bluechipHoldings?: string;
686
- /**
687
- * Bluechip holdings ratio
688
- */
689
- bluechipHoldingsRatio?: string;
690
- /**
691
- * KOL holders count
692
- */
693
- kolHolders?: number;
694
- /**
695
- * KOL total holdings
696
- */
697
- kolHoldings?: string;
698
- /**
699
- * KOL holdings ratio
700
- */
701
- kolHoldingsRatio?: string;
702
- /**
703
- * Sniper holders count
704
- */
705
- sniperHolders?: number;
706
- /**
707
- * Sniper total holdings
708
- */
709
- sniperHoldings?: string;
710
- /**
711
- * Sniper holdings ratio
712
- */
713
- sniperHoldingsRatio?: string;
714
- /**
715
- * Pro holders count
716
- */
717
- proHolders?: number;
718
- /**
719
- * Pro total holdings
720
- */
721
- proHoldings?: string;
722
- /**
723
- * Pro holdings ratio
724
- */
725
- proHoldingsRatio?: string;
726
- /**
727
- * Insider holders count
728
- */
729
- insiderHolders?: number;
730
- /**
731
- * Insider total holdings
732
- */
733
- insiderHoldings?: string;
734
- /**
735
- * Insider holdings ratio
736
- */
737
- insiderHoldingsRatio?: string;
738
- /**
739
- * Sandwich holders count
740
- */
741
- sandwichHolders?: number;
742
- /**
743
- * Sandwich total holdings
744
- */
745
- sandwichHoldings?: string;
746
- /**
747
- * Sandwich holdings ratio
748
- */
749
- sandwichHoldingsRatio?: string;
750
- /**
751
- * Fresh holders count
752
- */
753
- freshHolders?: number;
754
- /**
755
- * Fresh total holdings
756
- */
757
- freshHoldings?: string;
758
- /**
759
- * Fresh holdings ratio
760
- */
761
- freshHoldingsRatio?: string;
762
- /**
763
- * Bundle holders count
764
- */
765
- bundleHolders?: number;
766
- /**
767
- * Bundle total holdings
768
- */
769
- bundleHoldings?: string;
770
- /**
771
- * Bundle holdings ratio
772
- */
773
- bundleHoldingsRatio?: string;
774
- /**
775
- * Dev holders count
776
- */
777
- devHolders?: number;
778
- /**
779
- * Dev total holdings
780
- */
781
- devHoldings?: string;
782
- /**
783
- * Dev holdings ratio
784
- */
785
- devHoldingsRatio?: string;
786
- }
787
- interface TokenLiquidity {
788
- /**
789
- * pool avatar image
790
- */
791
- image?: string;
792
- /**
793
- * pair token address.
794
- */
795
- pairAddress?: string;
796
- /**
797
- * pool address.
798
- */
799
- poolAddress?: string;
800
- /**
801
- * program address.
802
- */
803
- programAddress?: string;
804
- /**
805
- * protocol name.
806
- */
807
- protocolName?: string;
808
- /**
809
- * protocol family.
810
- */
811
- protocolFamily?: string;
812
- /**
813
- * tvl in quote token.
814
- */
815
- tvl?: string;
816
- /**
817
- * tvl in usd.
818
- */
819
- tvlInUsd?: string;
820
- }
821
- /**
822
- * TODO: more security checks
823
- */
824
- interface TokenSecurity {
825
- /**
826
- * whether the token has transfer fee.
827
- */
828
- hasTransferFee?: boolean;
829
- /**
830
- * whether the token transfer fee is upgradable.
831
- */
832
- isTransferFeeUpgradable?: boolean;
833
- /**
834
- * whether the token is transferable.
835
- */
836
- isTransferable?: boolean;
837
- /**
838
- * whether the token is freezable.
839
- */
840
- isFreezable?: boolean;
841
- /**
842
- * whether the token is closable.
843
- */
844
- isClosable?: boolean;
845
- }
846
- type TokenResolution = "1s" | "15s" | "30s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "24h";
847
- interface TokenCandle {
848
- /**
849
- * open price in usd
850
- */
851
- open: string;
852
- /**
853
- * close price in usd
854
- */
855
- close: string;
856
- /**
857
- * high price in usd
858
- */
859
- high: string;
860
- /**
861
- * low price in usd
862
- */
863
- low: string;
864
- /**
865
- * volume in usd
866
- */
867
- volume: string;
868
- /**
869
- * resolution
870
- */
871
- resolution: TokenResolution;
872
- /**
873
- * timestamp
874
- */
875
- timestamp: Date;
876
- }
877
- /**
878
- * Classification tag applied to a wallet in the context of a specific token holding.
879
- * See Phase 3 API doc — values are sparse (only 0.1%–2% of holders have tags).
880
- */
881
- type HolderTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
882
- interface TokenHolder {
883
- /**
884
- * holder wallet address
885
- */
886
- address: string;
887
- /**
888
- * holdings amount in token
889
- */
890
- amount: string;
891
- /**
892
- * holdings amount in usd
893
- */
894
- amountInUsd: string;
895
- /**
896
- * holdings ratio, range is 0-100
897
- */
898
- ratio: string;
899
- /**
900
- * Holder classification tags (Phase 3). Sparse — only present when the
901
- * wallet matches one of the known patterns (kol/smart/sniper/dev/...).
902
- */
903
- tags?: Array<HolderTag>;
904
- /**
905
- * The last time this wallet was active on-chain (Phase 3).
906
- * Sparse (~80% fill rate).
907
- */
908
- lastActiveAt?: Date;
909
- /**
910
- * The first time this wallet started holding this token (Phase 3).
911
- * Sparse (~60% fill rate).
912
- */
913
- startHoldingAt?: Date;
914
- }
915
-
916
- /**
917
- * Shared cursor-based pagination fields.
918
- */
919
- interface CursorPagination {
920
- /** pagination start cursor */
921
- startCursor?: string;
922
- /** pagination end cursor */
923
- endCursor?: string;
924
- /** whether there is a previous page */
925
- hasPrev?: boolean;
926
- /** whether there is a next page */
927
- hasNext?: boolean;
928
- }
929
-
930
- /**
931
- * Classification tag applied to a wallet in the context of a specific token position
932
- * (Phase 3). Same vocabulary as holder/trader tags; sparse.
933
- */
934
- type WalletTokenTag = "kol" | "smart" | "sniper" | "dev" | "bundle" | "bluechip" | (string & {});
935
- /**
936
- * Portfolio PNL
937
- */
938
- interface PortfolioPnl {
939
- /** chain id */
940
- chain: Chain;
941
- /** token address */
942
- address: string;
943
- /** token name */
944
- name: string;
945
- /** token symbol */
946
- symbol: string;
947
- /** token image url */
948
- image?: string;
949
- /** holding token amount */
950
- amount: string;
951
- /** holding token amount in usd */
952
- amountInUsd: string;
953
- /** token current price in usd */
954
- priceInUsd: string;
955
- /** token decimals */
956
- decimals: number;
957
- /** open position time */
958
- openTime?: Date;
959
- /** close position time */
960
- closeTime?: Date;
961
- /** total trades count */
962
- totalTrades?: number;
963
- /** total buy txs count */
964
- buys?: number;
965
- /** total buy volumes */
966
- buyVolumes?: string;
967
- /** total buy volumes in usd */
968
- buyVolumesInUsd?: string;
969
- /** average buy price in usd */
970
- buyAvgPriceInUsd?: string;
971
- /** total sell txs count */
972
- sells?: number;
973
- /** total sell volumes */
974
- sellVolumes?: string;
975
- /** total sell volumes in usd */
976
- sellVolumesInUsd?: string;
977
- /** average sell price in usd */
978
- sellAvgPriceInUsd?: string;
979
- /** realized profit in usd */
980
- realizedProfitInUsd?: string;
981
- /** realized profit ratio */
982
- realizedProfitRatio?: string;
983
- /** unrealized profit in usd */
984
- unrealizedProfitInUsd?: string;
985
- /** unrealized profit ratio */
986
- unrealizedProfitRatio?: string;
987
- /** total profit in usd (including both realized and unrealized profit) */
988
- totalProfitInUsd?: string;
989
- /** total profit ratio (including both realized and unrealized profit) */
990
- totalProfitRatio?: string;
991
- /** average profit per trade in usd */
992
- avgProfitPerTradeInUsd?: string;
993
- /**
994
- * Whether the position is closed (balance == 0). Phase 3; 100% fill rate.
995
- * Corresponds to `positionState=closed` filter on the pnl-details endpoint.
996
- */
997
- isClosed?: boolean;
998
- /** First buy time (Phase 3). Sparse (~60% fill rate). */
999
- firstBuyAt?: Date;
1000
- /** Last sell time (Phase 3). Sparse (~30% fill rate). */
1001
- lastSellAt?: Date;
1002
- }
1003
- interface Portfolio {
1004
- /** chain id */
1005
- chain: Chain;
1006
- /** token address */
1007
- address: string;
1008
- /** token name */
1009
- name: string;
1010
- /** token symbol */
1011
- symbol: string;
1012
- /** token image url */
1013
- image?: string;
1014
- /** token current price in usd */
1015
- priceInUsd: string;
1016
- /** token current price in native token */
1017
- priceInNative: string;
1018
- /** holding token amount */
1019
- amount: string;
1020
- /** holding token amount in usd */
1021
- amountInUsd: string;
1022
- /** holding token amount in native token */
1023
- amountInNative: string;
1024
- /** token decimals */
1025
- decimals: number;
1026
- /**
1027
- * Whether the wallet currently holds a positive balance of this token (Phase 3).
1028
- * Always `true` in `net-worth/tokens` responses (the endpoint filters closed positions out).
1029
- */
1030
- isActive?: boolean;
1031
- /**
1032
- * Average cost basis in USD (Phase 3). Extremely sparse (~0.2% fill rate) —
1033
- * backed by historical buy prices and often unavailable.
1034
- */
1035
- avgCostUsd?: string;
1036
- /**
1037
- * Last time this wallet operated on this token (Phase 3). Sparse.
1038
- */
1039
- lastActiveAt?: Date;
1040
- /**
1041
- * Tags applied to the wallet for this specific token position (Phase 3). Sparse.
1042
- */
1043
- walletTokenTags?: Array<WalletTokenTag>;
1044
- }
1045
- /**
1046
- * Wallet PnL summary
1047
- */
1048
- interface WalletPnl {
1049
- /** chain id */
1050
- chain: Chain;
1051
- /** wallet address */
1052
- address: string;
1053
- /** total tokens traded */
1054
- tokens?: number;
1055
- /** total buy txs count */
1056
- buys?: number;
1057
- /** total sell txs count */
1058
- sells?: number;
1059
- /** total trades count */
1060
- totalTrades?: number;
1061
- /** total winning trades */
1062
- wins?: number;
1063
- /** total losing trades */
1064
- losses?: number;
1065
- /** win rate, range is 0-1 */
1066
- winRate?: string;
1067
- /** total buy amount in usd */
1068
- buyAmountInUsd?: string;
1069
- /** total sell amount in usd */
1070
- sellAmountInUsd?: string;
1071
- /** total cost in usd */
1072
- totalCostInUsd?: string;
1073
- /** realized profit in usd */
1074
- realizedProfitInUsd?: string;
1075
- /** realized profit ratio */
1076
- realizedProfitRatio?: string;
1077
- /** unrealized profit in usd */
1078
- unrealizedProfitInUsd?: string;
1079
- /** unrealized profit ratio */
1080
- unrealizedProfitRatio?: string;
1081
- /** total profit in usd (including both realized and unrealized profit) */
1082
- totalProfitInUsd?: string;
1083
- /** total profit ratio */
1084
- totalProfitRatio?: string;
1085
- /** average profit per trade in usd */
1086
- avgProfitPerTradeInUsd?: string;
1087
- }
1088
- /**
1089
- * Wallet portfolio PnL details (paged, with summary)
1090
- */
1091
- interface WalletPortfolioPnls extends WalletPnl, CursorPagination {
1092
- /** per-token portfolio + pnl details */
1093
- portfolios: Array<PortfolioPnl>;
1094
- }
1095
- /**
1096
- * Wallet portfolios
1097
- */
1098
- interface WalletPortfolios extends CursorPagination {
1099
- /** chain id */
1100
- chain: Chain;
1101
- /** wallet address */
1102
- address: string;
1103
- /** wallet total balance in usd */
1104
- balanceInUsd: string;
1105
- /** wallet total balance in native token */
1106
- balanceInNative: string;
1107
- /** wallet portfolios */
1108
- portfolios: Array<Portfolio>;
1109
- }
1110
-
1111
- /**
1112
- * Cursor list result data
1113
- */
1114
- interface CursorList<T> extends CursorPagination {
1115
- data: Array<T>;
1116
- }
1117
- /**
1118
- * Cursor list query options
1119
- */
1120
- interface CursorListOptions {
1121
- /** query cursor */
1122
- cursor?: string;
1123
- /** return limit */
1124
- limit?: number;
1125
- /** query direction */
1126
- direction?: "next" | "prev";
1127
- }
1128
- /**
1129
- * Options for getting token candles
1130
- */
1131
- interface GetTokenCandlesOptions {
1132
- /** query candles after this timestamp */
1133
- after?: Date;
1134
- /** query candles before this timestamp */
1135
- before?: Date;
1136
- /** return limit */
1137
- limit?: number;
1138
- }
1139
- /**
1140
- * Token field for filtering
1141
- */
1142
- type TokenFieldOption = "price" | "priceChange1m" | "priceChange5m" | "priceChange15m" | "priceChange30m" | "priceChange1h" | "priceChange4h" | "priceChange24h" | "marketCap" | "tvl" | "top10Holdings" | "top10Ratio" | "top100Holdings" | "top100Ratio" | "holders" | "creatorsHoldings" | "creatorsRatio" | "buys1m" | "buys5m" | "buys15m" | "buys30m" | "buys1h" | "buys4h" | "buys24h" | "sells1m" | "sells5m" | "sells15m" | "sells30m" | "sells1h" | "sells4h" | "sells24h" | "trades1m" | "trades5m" | "trades15m" | "trades30m" | "trades1h" | "trades4h" | "trades24h" | "traders1m" | "traders5m" | "traders15m" | "traders30m" | "traders1h" | "traders4h" | "traders24h" | "volumes1m" | "volumes5m" | "volumes15m" | "volumes30m" | "volumes1h" | "volumes4h" | "volumes24h" | "launchedFromProtocolFamily" | "migratedToProtocolFamily" | "tag" | "createdAt" | (string & {});
1143
- /**
1144
- * Token filter option
1145
- */
1146
- interface TokenFilterOption {
1147
- field: TokenFieldOption;
1148
- operator: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "between" | "in" | "nin" | "contains" | "notContains" | "startsWith" | "endsWith" | "isNotNull" | "isNull";
1149
- value?: string | number | boolean | Array<string | number | boolean>;
1150
- }
1151
- /**
1152
- * Options for getting token list
1153
- */
1154
- interface GetTokenListOptions {
1155
- /** sort field */
1156
- sortBy?: TokenFieldOption;
1157
- /** sort direction */
1158
- sortDirection?: "asc" | "desc";
1159
- /** filters */
1160
- filters?: Array<TokenFilterOption>;
1161
- /** search keywords */
1162
- keywords?: Array<string>;
1163
- /** exclude keywords */
1164
- excludeKeywords?: Array<string>;
1165
- }
1166
- /**
1167
- * Options for searching tokens
1168
- */
1169
- interface SearchTokensOptions extends CursorListOptions {
1170
- /** chains */
1171
- chains?: Array<Chain>;
1172
- /** search keyword */
1173
- keyword?: string;
1174
- /** filters */
1175
- filters?: Array<TokenFilterOption>;
1176
- /** sort field */
1177
- sortBy?: TokenFieldOption;
1178
- /** sort direction */
1179
- sortDirection?: "asc" | "desc";
1180
- }
1181
- /**
1182
- * Search token cursor list
1183
- */
1184
- interface SearchTokenCursorList extends CursorList<Token> {
1185
- /** total count */
1186
- total?: number;
1187
- /** extra infos by api provider */
1188
- extra?: Record<string, unknown>;
1189
- }
1190
- declare enum SwapMode {
1191
- EXACT_IN = "exact_in",
1192
- EXACT_OUT = "exact_out"
1193
- }
1194
- /** DEX identifier used for route / mint address conversion. */
1195
- type SwapDex = "jupiter" | "kyberswap";
1196
- interface SwapParams {
1197
- /** chain id */
1198
- chain: Chain;
1199
- /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */
1200
- dex?: SwapDex;
1201
- /** user wallet address */
1202
- userAddress: string;
1203
- /** input token address */
1204
- input: string;
1205
- /** output token address */
1206
- output: string;
1207
- /** swap mode, e.g. ExactIn, ExactOut */
1208
- mode: SwapMode;
1209
- /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */
1210
- amount: string;
1211
- /** slippage, range is 0-100 */
1212
- slippage?: number;
1213
- /** priority fee */
1214
- priorityFee?: string;
1215
- /** tip fee */
1216
- tipFee?: string;
1217
- /** whether to use anti-MEV */
1218
- isAntiMev?: boolean;
1219
- /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */
1220
- permit?: string;
1221
- /** deadline timestamp in ms (EVM only) */
1222
- deadline?: number;
1223
- }
1224
- interface SwapRoutePlan {
1225
- /** protocol name / dex name etc. */
1226
- name: string;
1227
- /** input token address */
1228
- input: string;
1229
- /** input token amount */
1230
- inputAmount: string;
1231
- /** output token address */
1232
- output: string;
1233
- /** output token amount */
1234
- outputAmount: string;
1235
- /** fee quote token address */
1236
- feeQuote?: string;
1237
- /** fee amount */
1238
- feeAmount?: string;
1239
- /** extra infos by api provider */
1240
- extra?: Record<string, unknown>;
1241
- }
1242
- interface SwapRoute {
1243
- /** unsigned tx in base64 format */
1244
- serializedTx: string;
1245
- /** recent blockhash embedded in the unsigned Solana transaction */
1246
- recentBlockhash?: string;
1247
- /** last block height at which the embedded Solana blockhash remains valid */
1248
- lastValidBlockHeight?: number;
1249
- /** swap plans */
1250
- plans: Array<SwapRoutePlan>;
1251
- /** extra infos by api provider */
1252
- extra?: Record<string, unknown>;
1253
- }
1254
- interface LatestBlockParams {
1255
- /** chain id */
1256
- chain: Chain;
1257
- }
1258
- interface BlockchainLatestBlock {
1259
- /** latest block hash */
1260
- blockhash: string;
1261
- /** last valid block height for transactions built with the latest blockhash */
1262
- lastValidBlockHeight: number;
1263
- }
1264
- interface SendTxParams {
1265
- /** chain id */
1266
- chain: Chain;
1267
- /** signed tx in base64 format */
1268
- serializedTx: string;
1269
- /** extra infos needed by api provider */
1270
- extra?: Record<string, unknown>;
1271
- }
1272
- interface SendTxResult {
1273
- /** tx hash */
1274
- txHash: string;
1275
- /** extra infos by api provider */
1276
- extra?: Record<string, unknown>;
1277
- }
1278
- /**
1279
- * Options for getting trades
1280
- */
1281
- interface GetTradesOptions extends CursorListOptions {
1282
- /** filter trades before this timestamp */
1283
- before?: Date;
1284
- /** filter trades after this timestamp */
1285
- after?: Date;
1286
- /** filter trades before this block height */
1287
- beforeBlockHeight?: number;
1288
- /** filter trades after this block height */
1289
- afterBlockHeight?: number;
1290
- /** filter trades by type */
1291
- type?: "buy" | "sell";
1292
- /** filter trades by pool address */
1293
- poolAddress?: string;
1294
- }
1295
- /**
1296
- * Sort field for activity list (Phase 3).
1297
- * - `timestamp` — order by activity time (default, descending)
1298
- * - `totalUsd` — order by USD amount (useful for finding whale trades)
1299
- */
1300
- type ActivitiesSortBy = "timestamp" | "totalUsd";
1301
- /**
1302
- * Options for getting activities
1303
- */
1304
- interface GetActivitiesOptions extends CursorListOptions {
1305
- /** filter activities before this timestamp */
1306
- before?: Date;
1307
- /** filter activities after this timestamp */
1308
- after?: Date;
1309
- /** filter activities before this block height */
1310
- beforeBlockHeight?: number;
1311
- /** filter activities after this block height */
1312
- afterBlockHeight?: number;
1313
- /** filter activities by type */
1314
- type?: ActivityType;
1315
- /** filter activities by pool address */
1316
- poolAddress?: string;
1317
- /**
1318
- * Sort field (Phase 3). Defaults to `timestamp` on the server. When changing
1319
- * `sortBy`, the caller must discard the previous cursor and restart from page 1.
1320
- */
1321
- sortBy?: ActivitiesSortBy;
1322
- }
1323
- /**
1324
- * Sort field for token holder list (Phase 3).
1325
- * - `holdingUsd` — order by holding value in USD (default, descending)
1326
- * - `lastActiveAt` — order by wallet's last activity time
1327
- * - `realizedPnl` — order by realized PnL on this token; used by the
1328
- * Top Traders view, which shares the same endpoint but
1329
- * surfaces traders ranked by profit. Server support for
1330
- * this sort key is required by `getTopTokenTraders`.
1331
- */
1332
- type TokenHoldersSortBy = "holdingUsd" | "lastActiveAt" | "realizedPnl";
1333
- /**
1334
- * Options for getting token holders (Phase 3).
1335
- */
1336
- interface GetTokenHoldersOptions extends CursorListOptions {
1337
- /**
1338
- * Sort field. Defaults to `holdingUsd` on the server.
1339
- * Switching `sortBy` requires discarding the old cursor and restarting from page 1.
1340
- */
1341
- sortBy?: TokenHoldersSortBy;
1342
- }
1343
- /**
1344
- * Resolution window for wallet PnL queries (Phase 3).
1345
- */
1346
- type WalletPnlResolution = "7d" | "30d" | "90d";
1347
- /**
1348
- * Position state filter for wallet PnL details (Phase 3).
1349
- * - `open` — only tokens with current balance > 0 (default)
1350
- * - `closed` — only tokens with balance == 0 (historical realized PnL)
1351
- * - `all` — both open and closed positions
1352
- */
1353
- type PositionState = "open" | "closed" | "all";
1354
- /**
1355
- * Sort field for wallet PnL details (Phase 3).
1356
- */
1357
- type WalletPnlSortBy = "totalPnl" | "realizedPnl" | "unrealizedPnl";
1358
- /**
1359
- * Options for getting wallet portfolio PnL details (Phase 3).
1360
- */
1361
- interface GetWalletPortfolioPnlsOptions extends CursorListOptions {
1362
- /**
1363
- * Statistics time window. Defaults to `30d` in the Client implementation
1364
- * for backward compatibility; the server requires this parameter and will
1365
- * return 400 if it is missing.
1366
- */
1367
- resolution?: WalletPnlResolution;
1368
- /** Position state filter. Defaults to `open` on the server. */
1369
- positionState?: PositionState;
1370
- /**
1371
- * Sort field. Defaults to `totalPnl` on the server.
1372
- * Switching `sortBy` requires discarding the old cursor.
1373
- */
1374
- sortBy?: WalletPnlSortBy;
1375
- }
1376
- /**
1377
- * Resolution subset supported by the trending token list.
1378
- */
1379
- type TrendingResolution = Extract<TokenResolution, "1m" | "5m" | "1h" | "4h" | "24h">;
1380
- /**
1381
- * Options for listing a wallet's limit orders.
1382
- *
1383
- * NOTE: The server does not yet implement a limit-orders endpoint. The
1384
- * `Client.getWalletLimitOrders` method throws a `NotImplementedError` and
1385
- * the React hook surfaces an empty result so the widget layer can be built
1386
- * ahead of backend availability.
1387
- */
1388
- interface GetWalletLimitOrdersOptions extends CursorListOptions {
1389
- /** filter by order state; defaults to `active`. */
1390
- state?: LimitOrderState;
1391
- /** restrict to a single token when provided. */
1392
- tokenAddress?: string;
1393
- }
1394
- /**
1395
- * Options for listing tokens created by a given wallet (the "Dev Tokens" tab).
1396
- *
1397
- * NOTE: The server does not yet implement a creator-index endpoint. The
1398
- * `Client.getTokensByCreator` method throws a `NotImplementedError` and the
1399
- * React hook surfaces an empty result for now.
1400
- */
1401
- interface GetTokensByCreatorOptions extends CursorListOptions {
1402
- /** optional sort field; server behaviour will be defined when endpoint ships. */
1403
- sortBy?: TokenFieldOption;
1404
- /** sort direction. */
1405
- sortDirection?: "asc" | "desc";
1406
- }
1407
- /**
1408
- * API client interface
1409
- */
1410
- interface IClient {
1411
- /**
1412
- * fetch token info
1413
- * @param chain chain id
1414
- * @param address token address
1415
- * @returns token info
1416
- */
1417
- getToken(chain: Chain, address: string): Promise<Token>;
1418
- /**
1419
- * fetch token infos in batch
1420
- * @param chain chain id
1421
- * @param addresses token addresses
1422
- * @returns token infos
1423
- */
1424
- getTokens(chain: Chain, addresses: Array<string>): Promise<Array<Token>>;
1425
- /**
1426
- * fetch token candles
1427
- * @param chain chain id
1428
- * @param address token address
1429
- * @param resolution token resolution
1430
- * @param options optional query options
1431
- * @returns token candles
1432
- */
1433
- getTokenCandles(chain: Chain, address: string, resolution: TokenResolution, options?: GetTokenCandlesOptions): Promise<Array<TokenCandle>>;
1434
- /**
1435
- * fetch token security
1436
- * @param chain chain id
1437
- * @param address token address
1438
- * @returns token security
1439
- */
1440
- getTokenSecurity(chain: Chain, address: string): Promise<TokenSecurity>;
1441
- /**
1442
- * fetch token stats
1443
- * @param chain chain id
1444
- * @param address token address
1445
- * @returns token stats
1446
- */
1447
- getTokenStats(chain: Chain, address: string): Promise<TokenStats>;
1448
- /**
1449
- * fetch token holders
1450
- * @param chain chain id
1451
- * @param address token address
1452
- * @param options optional query options (Phase 3: sortBy)
1453
- * @returns token holders
1454
- */
1455
- getTokenHolders(chain: Chain, address: string, options?: GetTokenHoldersOptions): Promise<CursorList<TokenHolder>>;
1456
- /**
1457
- * fetch token market data
1458
- * @param chain chain id
1459
- * @param address token address
1460
- * @returns token market data
1461
- */
1462
- getTokenMarketData(chain: Chain, address: string): Promise<TokenMarketData>;
1463
- /**
1464
- * fetch `New` token list
1465
- * @param chain chain id
1466
- * @param options optional query options
1467
- * @returns `New` token list
1468
- */
1469
- getNewTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1470
- /**
1471
- * fetch `Final Stretch` token list
1472
- * @param chain chain id
1473
- * @param options optional query options
1474
- * @returns `Final Stretch` token list
1475
- */
1476
- getFinalStretchTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1477
- /**
1478
- * fetch `Migrated` token list
1479
- * @param chain chain id
1480
- * @param options optional query options
1481
- * @returns `Migrated` token list
1482
- */
1483
- getMigratedTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1484
- /**
1485
- * fetch `Trending` token list
1486
- * @param chain chain id
1487
- * @param resolution query resolution, e.g. "1m", "5m", "1h", "4h", "24h"
1488
- * @param options optional query options
1489
- * @returns `Trending` token list
1490
- */
1491
- getTrendingTokens(chain: Chain, resolution: TrendingResolution, options?: GetTokenListOptions): Promise<Array<Token>>;
1492
- /**
1493
- * fetch `Stock` token list
1494
- * @param chain chain id
1495
- * @param options optional query options
1496
- * @returns `Stock` token list
1497
- */
1498
- getStockTokens(chain: Chain, options?: GetTokenListOptions): Promise<Array<Token>>;
1499
- /**
1500
- * search tokens
1501
- * @param options optional query options
1502
- * @returns search token cursor list
1503
- */
1504
- searchTokens(options?: SearchTokensOptions): Promise<SearchTokenCursorList>;
1505
- /**
1506
- * fetch swap route plans
1507
- * @param params swap params
1508
- * @returns swap route plans
1509
- */
1510
- swapRoute(params: SwapParams): Promise<SwapRoute>;
1511
- /**
1512
- * fetch latest block metadata
1513
- * @param params latest block params
1514
- * @returns latest block metadata
1515
- */
1516
- getLatestBlock(params: LatestBlockParams): Promise<BlockchainLatestBlock>;
1517
- /**
1518
- * send tx
1519
- * @param params send tx params
1520
- * @returns send tx result
1521
- */
1522
- sendTx(params: SendTxParams): Promise<SendTxResult>;
1523
- /**
1524
- * check if tx is successful
1525
- * @param chain chain id
1526
- * @param txHash tx hash
1527
- * @param timeout timeout in milliseconds
1528
- * @returns true if tx is successful, false otherwise
1529
- */
1530
- checkTxSuccess(chain: Chain, txHash: string, timeout?: number): Promise<boolean>;
1531
- /**
1532
- * fetch wallet portfolios
1533
- * @param chain chain id
1534
- * @param address wallet address
1535
- * @param options optional pagination options
1536
- * @returns wallet portfolios
1537
- */
1538
- getWalletPortfolios(chain: Chain, address: string, options?: {
1539
- cursor?: string;
1540
- limit?: number;
1541
- }): Promise<WalletPortfolios>;
1542
- /**
1543
- * fetch wallet PnL summary
1544
- * @param chain chain id
1545
- * @param address wallet address
1546
- * @param resolution pnl resolution (e.g. "7d", "30d")
1547
- * @returns wallet pnl summary
1548
- */
1549
- getWalletPnl(chain: Chain, address: string, resolution?: string): Promise<WalletPnl>;
1550
- /**
1551
- * fetch wallet portfolio PnL details (per-token)
1552
- * @param chain chain id
1553
- * @param address wallet address
1554
- * @param options optional query options (Phase 3: resolution, positionState, sortBy)
1555
- * @returns portfolio pnl list with summary
1556
- */
1557
- getWalletPortfolioPnls(chain: Chain, address: string, options?: GetWalletPortfolioPnlsOptions): Promise<WalletPortfolioPnls>;
1558
- /**
1559
- * fetch wallet portfolios for specific tokens
1560
- * @param chain chain id
1561
- * @param address wallet address
1562
- * @param tokenAddresses token addresses to query
1563
- * @returns portfolio list for the specified tokens
1564
- */
1565
- getWalletPortfoliosByTokens(chain: Chain, address: string, tokenAddresses: Array<string>): Promise<Array<Portfolio>>;
1566
- /**
1567
- * fetch wallet portfolio PnL for specific tokens
1568
- * @param chain chain id
1569
- * @param address wallet address
1570
- * @param tokenAddresses token addresses to query
1571
- * @returns portfolio pnl list for the specified tokens
1572
- */
1573
- getWalletPortfolioPnlsByTokens(chain: Chain, address: string, tokenAddresses: Array<string>): Promise<Array<PortfolioPnl>>;
1574
- /**
1575
- * fetch wallet's trade activities
1576
- * @param chain chain id
1577
- * @param address wallet address
1578
- * @param options optional query options
1579
- * @returns wallet's trade activities
1580
- */
1581
- getWalletTrades(chain: Chain, address: string, options?: GetTradesOptions): Promise<CursorList<Trade>>;
1582
- /**
1583
- * fetch token's trade activities
1584
- * @param chain chain id
1585
- * @param address token address
1586
- * @param options optional query options
1587
- * @returns token's trade activities
1588
- */
1589
- getTokenTrades(chain: Chain, address: string, options?: GetTradesOptions): Promise<CursorList<Trade>>;
1590
- /**
1591
- * fetch wallet's activities (trades, liquidity, red packets, etc.)
1592
- * @param chain chain id
1593
- * @param address wallet address
1594
- * @param options optional query options
1595
- * @returns wallet's activities
1596
- */
1597
- getWalletActivities(chain: Chain, address: string, options?: GetActivitiesOptions): Promise<CursorList<Activity>>;
1598
- /**
1599
- * fetch token's activities (trades, liquidity, red packets, etc.)
1600
- * @param chain chain id
1601
- * @param address token address
1602
- * @param options optional query options
1603
- * @returns token's activities
1604
- */
1605
- getTokenActivities(chain: Chain, address: string, options?: GetActivitiesOptions): Promise<CursorList<Activity>>;
1606
- /**
1607
- * get presigned upload url
1608
- * @returns presigned upload url
1609
- */
1610
- getPresignedUploadUrl(): Promise<string>;
1611
- /**
1612
- * fetch a wallet's limit orders.
1613
- *
1614
- * Currently unsupported by the backend; implementations throw
1615
- * `NotImplementedError` to make the gap explicit while the widget-layer
1616
- * clone of Axiom's Orders tab is being developed.
1617
- * @param chain chain id
1618
- * @param address wallet address
1619
- * @param options optional query options
1620
- */
1621
- getWalletLimitOrders(chain: Chain, address: string, options?: GetWalletLimitOrdersOptions): Promise<CursorList<LimitOrder>>;
1622
- /**
1623
- * fetch tokens created by a wallet ("Dev Tokens").
1624
- *
1625
- * Currently unsupported by the backend; implementations throw
1626
- * `NotImplementedError`.
1627
- * @param chain chain id
1628
- * @param creator creator wallet address
1629
- * @param options optional query options
1630
- */
1631
- getTokensByCreator(chain: Chain, creator: string, options?: GetTokensByCreatorOptions): Promise<CursorList<Token>>;
1632
- }
1633
- interface ISubscription {
1634
- unsubscribe(): void;
1635
- }
1636
- /**
1637
- * Incremental token update from subscriptions.
1638
- * `chain` + `address` identify the token; all other fields are optional —
1639
- * `undefined` means this push did not carry that field.
1640
- */
1641
- type TokenSubscribed = Partial<Omit<Token, "chain" | "address">> & Pick<Token, "chain" | "address">;
1642
- interface WalletPnlSubscribed extends WalletPnl {
1643
- /** pnl resolution (e.g. "7d", "30d") */
1644
- resolution?: string;
1645
- }
1646
- interface PortfolioSubscribed {
1647
- /** chain id */
1648
- chain: Chain;
1649
- /** wallet address */
1650
- walletAddress: string;
1651
- /** token address */
1652
- tokenAddress: string;
1653
- /** token current price in usd */
1654
- priceInUsd?: string;
1655
- /** holding token amount */
1656
- amount?: string;
1657
- }
1658
- type PortfolioPnlSubscribed = Partial<Omit<PortfolioPnl, "address" | "name" | "symbol" | "image">> & {
1659
- /** wallet address */
1660
- walletAddress: string;
1661
- /** token address */
1662
- tokenAddress: string;
1663
- };
1664
- /**
1665
- * Subscribe client interface
1666
- */
1667
- interface ISubscribeClient {
1668
- /**
1669
- * Subscribe to a token's real-time data updates (stats, market data,
1670
- * holders, liquidity, etc.). The client internally manages multiple
1671
- * backend channels and delivers incremental updates via `callback`.
1672
- * @param chain chain id
1673
- * @param address token address
1674
- * @param callback receives incremental token updates
1675
- * @returns subscription
1676
- */
1677
- subscribeToken(chain: Chain, address: string, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1678
- /**
1679
- * Subscribe token new candles
1680
- * @param chain chain id
1681
- * @param address token address
1682
- * @param resolution token resolution
1683
- * @param callback callback function
1684
- * @returns subscription
1685
- */
1686
- subscribeTokenCandles(chain: Chain, address: string, resolution: TokenResolution, callback: (candles: Array<TokenCandle>) => void): ISubscription;
1687
- /**
1688
- * Subscribe wallet's pnl changes
1689
- * @param chain chain id
1690
- * @param address wallet address
1691
- * @param callback callback function
1692
- * @returns subscription
1693
- */
1694
- subscribeWalletPnl(chain: Chain, address: string, callback: (pnls: Array<WalletPnlSubscribed>) => void): ISubscription;
1695
- /**
1696
- * Subscribe wallet's portfolio changes
1697
- * @param chain chain id
1698
- * @param address wallet address
1699
- * @param callback callback function
1700
- * @returns subscription
1701
- */
1702
- subscribeWalletPortfolios(chain: Chain, address: string, callback: (portfolios: Array<PortfolioSubscribed>) => void): ISubscription;
1703
- /**
1704
- * Subscribe wallet's portfolio pnl changes
1705
- * @param chain chain id
1706
- * @param address wallet address
1707
- * @param callback callback function
1708
- * @returns subscription
1709
- */
1710
- subscribeWalletPortfolioPnls(chain: Chain, address: string, callback: (portfolioPnls: Array<PortfolioPnlSubscribed>) => void): ISubscription;
1711
- /**
1712
- * Subscribe wallet's new trade activities
1713
- * @param chain chain id
1714
- * @param address wallet address
1715
- * @param callback callback function
1716
- * @returns subscription
1717
- */
1718
- subscribeWalletTrades(chain: Chain, address: string, callback: (trades: Array<Trade>) => void): ISubscription;
1719
- /**
1720
- * Subscribe token's new trade activities
1721
- * @param chain chain id
1722
- * @param address token address
1723
- * @param callback callback function
1724
- * @returns subscription
1725
- */
1726
- subscribeTokenTrades(chain: Chain, address: string, callback: (trades: Array<Trade>) => void): ISubscription;
1727
- /**
1728
- * Subscribe wallet's new activities (trades, liquidity, etc.)
1729
- * @param chain chain id
1730
- * @param address wallet address
1731
- * @param callback callback function
1732
- * @returns subscription
1733
- */
1734
- subscribeWalletActivities(chain: Chain, address: string, callback: (activities: Array<Activity>) => void): ISubscription;
1735
- /**
1736
- * Subscribe token's new activities (trades, liquidity, etc.)
1737
- * @param chain chain id
1738
- * @param address token address
1739
- * @param callback callback function
1740
- * @returns subscription
1741
- */
1742
- subscribeTokenActivities(chain: Chain, address: string, callback: (activities: Array<Activity>) => void): ISubscription;
1743
- /**
1744
- * Subscribe to `New` token list real-time updates. The client internally
1745
- * manages multiple backend channels (new token events, metadata, stats,
1746
- * holders, supply, liquidity, bonding curve) and delivers incremental
1747
- * updates via `callback`.
1748
- * @param chain chain id
1749
- * @param callback receives incremental token updates
1750
- * @returns subscription
1751
- */
1752
- subscribeNewTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1753
- /**
1754
- * Subscribe to `Trending` token list real-time updates. The client
1755
- * internally manages multiple backend channels (stats, holders, supply,
1756
- * liquidity) and delivers incremental updates via `callback`.
1757
- * @param chain chain id
1758
- * @param callback receives incremental token updates
1759
- * @returns subscription
1760
- */
1761
- subscribeTrendingTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1762
- /**
1763
- * Subscribe to `Migrated` token list real-time updates. The client
1764
- * internally manages multiple backend channels (stats, holders, supply,
1765
- * liquidity) and delivers incremental updates via `callback`.
1766
- * @param chain chain id
1767
- * @param callback receives incremental token updates
1768
- * @returns subscription
1769
- */
1770
- subscribeMigratedTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1771
- /**
1772
- * Subscribe to `FinalStretch` token list real-time updates. The client
1773
- * internally manages multiple backend channels (stats, holders, supply,
1774
- * liquidity, bonding curve) and delivers incremental updates via `callback`.
1775
- * @param chain chain id
1776
- * @param callback receives incremental token updates
1777
- * @returns subscription
1778
- */
1779
- subscribeFinalStretchTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1780
- /**
1781
- * Subscribe to `Stock` token list real-time updates. The client internally
1782
- * manages multiple backend channels (stats, holders, supply, liquidity)
1783
- * and delivers incremental updates via `callback`.
1784
- * @param chain chain id
1785
- * @param callback receives incremental token updates
1786
- * @returns subscription
1787
- */
1788
- subscribeStockTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1789
- }
1790
-
1791
- type index_ActivitiesSortBy = ActivitiesSortBy;
1792
- type index_BlockchainLatestBlock = BlockchainLatestBlock;
1793
- type index_CursorList<T> = CursorList<T>;
1794
- type index_CursorListOptions = CursorListOptions;
1795
- type index_CursorPagination = CursorPagination;
1796
- type index_GetActivitiesOptions = GetActivitiesOptions;
1797
- type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
1798
- type index_GetTokenHoldersOptions = GetTokenHoldersOptions;
1799
- type index_GetTokenListOptions = GetTokenListOptions;
1800
- type index_GetTokensByCreatorOptions = GetTokensByCreatorOptions;
1801
- type index_GetTradesOptions = GetTradesOptions;
1802
- type index_GetWalletLimitOrdersOptions = GetWalletLimitOrdersOptions;
1803
- type index_GetWalletPortfolioPnlsOptions = GetWalletPortfolioPnlsOptions;
1804
- type index_IClient = IClient;
1805
- type index_ISubscribeClient = ISubscribeClient;
1806
- type index_ISubscription = ISubscription;
1807
- type index_LatestBlockParams = LatestBlockParams;
1808
- type index_PortfolioPnlSubscribed = PortfolioPnlSubscribed;
1809
- type index_PortfolioSubscribed = PortfolioSubscribed;
1810
- type index_PositionState = PositionState;
1811
- type index_SearchTokenCursorList = SearchTokenCursorList;
1812
- type index_SearchTokensOptions = SearchTokensOptions;
1813
- type index_SendTxParams = SendTxParams;
1814
- type index_SendTxResult = SendTxResult;
1815
- type index_SwapDex = SwapDex;
1816
- type index_SwapMode = SwapMode;
1817
- declare const index_SwapMode: typeof SwapMode;
1818
- type index_SwapParams = SwapParams;
1819
- type index_SwapRoute = SwapRoute;
1820
- type index_SwapRoutePlan = SwapRoutePlan;
1821
- type index_TokenFieldOption = TokenFieldOption;
1822
- type index_TokenFilterOption = TokenFilterOption;
1823
- type index_TokenHoldersSortBy = TokenHoldersSortBy;
1824
- type index_TokenSubscribed = TokenSubscribed;
1825
- type index_TrendingResolution = TrendingResolution;
1826
- type index_WalletPnlResolution = WalletPnlResolution;
1827
- type index_WalletPnlSortBy = WalletPnlSortBy;
1828
- type index_WalletPnlSubscribed = WalletPnlSubscribed;
1829
- declare namespace index {
1830
- 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_GetTokensByCreatorOptions as GetTokensByCreatorOptions, type index_GetTradesOptions as GetTradesOptions, type index_GetWalletLimitOrdersOptions as GetWalletLimitOrdersOptions, 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 };
1831
- }
1832
-
1833
- declare global {
1834
- interface Window {
1835
- __LIBERFI_VERSION__?: {
1836
- [key: string]: string;
1837
- };
1838
- }
1839
- }
1840
- declare const _default: "0.3.12";
1841
-
1842
- 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 GetTokensByCreatorOptions, type GetTradesOptions, type GetWalletLimitOrdersOptions, type GetWalletPortfolioPnlsOptions, type HolderTag, type IClient, type ISubscribeClient, type ISubscription, type LatestBlockParams, type LimitOrder, type LimitOrderSide, type LimitOrderState, 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 };
1
+ export { ActivitiesSortBy, c as Activity, a as ActivityDex, A as ActivityToken, b as ActivityType, BlockchainLatestBlock, C as Chain, d as ChainNamespace, CursorList, CursorListOptions, CursorPagination, GetActivitiesOptions, GetTokenCandlesOptions, GetTokenHoldersOptions, GetTokenListOptions, GetTokensByCreatorOptions, GetTradesOptions, GetWalletLimitOrdersOptions, GetWalletPortfolioPnlsOptions, IClient, ISubscribeClient, ISubscription, LatestBlockParams, f as LimitOrder, L as LimitOrderSide, e as LimitOrderState, v as Portfolio, P as PortfolioPnl, PortfolioPnlSubscribed, PortfolioSubscribed, PositionState, h as SOLANA_TOKEN_PROTOCOLS, SearchTokenCursorList, SearchTokensOptions, SendTxParams, SendTxResult, S as SolanaTokenProtocol, SwapDex, SwapMode, SwapParams, SwapRoute, SwapRoutePlan, i as Token, t as TokenCandle, j as TokenCreator, TokenFieldOption, TokenFilterOption, u as TokenHolder, TokenHoldersSortBy, k as TokenLaunchedFrom, q as TokenLiquidity, p as TokenMarketData, l as TokenMigratedTo, g as TokenProtocol, s as TokenResolution, r as TokenSecurity, m as TokenSocialMedias, n as TokenStats, o as TokenStatsByResolution, TokenSubscribed, T as Trade, TrendingResolution, w as WalletPnl, WalletPnlResolution, WalletPnlSortBy, WalletPnlSubscribed, x as WalletPortfolioPnls, y as WalletPortfolios, W as WalletTag } from './api/index.js';