@liberfi.io/types 0.1.23 → 0.1.25

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.mts CHANGED
@@ -874,7 +874,7 @@ interface WalletPortfolios {
874
874
  /**
875
875
  * Cursor list result data
876
876
  */
877
- interface CursorList$1<T> {
877
+ interface CursorList<T> {
878
878
  startCursor?: string;
879
879
  endCursor?: string;
880
880
  hasPrev?: boolean;
@@ -932,7 +932,7 @@ interface SearchTokensOptions extends CursorListOptions {
932
932
  /**
933
933
  * Search token cursor list
934
934
  */
935
- interface SearchTokenCursorList extends CursorList$1<Token> {
935
+ interface SearchTokenCursorList extends CursorList<Token> {
936
936
  total?: number;
937
937
  extra?: any;
938
938
  }
@@ -1035,7 +1035,7 @@ interface IClient {
1035
1035
  * @param options optional query options
1036
1036
  * @returns token holders
1037
1037
  */
1038
- getTokenHolders(chain: Chain, address: string, options?: CursorListOptions): Promise<CursorList$1<TokenHolder>>;
1038
+ getTokenHolders(chain: Chain, address: string, options?: CursorListOptions): Promise<CursorList<TokenHolder>>;
1039
1039
  /**
1040
1040
  * fetch token market data
1041
1041
  * @param chain chain id
@@ -1158,7 +1158,7 @@ interface IClient {
1158
1158
  * @param options optional query options
1159
1159
  * @returns wallet's trade activities
1160
1160
  */
1161
- getWalletTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList$1<TradeActivity>>;
1161
+ getWalletTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList<TradeActivity>>;
1162
1162
  /**
1163
1163
  * fetch token's trade activities
1164
1164
  * @param chain chain id
@@ -1166,7 +1166,7 @@ interface IClient {
1166
1166
  * @param options optional query options
1167
1167
  * @returns token's trade activities
1168
1168
  */
1169
- getTokenTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList$1<TradeActivity>>;
1169
+ getTokenTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList<TradeActivity>>;
1170
1170
  /**
1171
1171
  * get presigned upload url
1172
1172
  * @returns presigned upload url
@@ -1307,391 +1307,20 @@ interface ISubscribeClient {
1307
1307
  subscribeStockTokens(chain: Chain, callback: (data: Array<TokenSubscribed>) => void): ISubscription;
1308
1308
  }
1309
1309
 
1310
- /**
1311
- * Media to track
1312
- */
1313
- interface IMedia {
1314
- /** media id */
1315
- id: string;
1316
- /** media type */
1317
- type: "tweet" | (string & {});
1318
- /** token type */
1319
- tokenType?: string;
1320
- /** token mentioned in the media */
1321
- token?: MediaToken;
1322
- }
1323
- /**
1324
- * Tweet media to track
1325
- */
1326
- interface TweetMedia extends IMedia {
1327
- /** media type */
1328
- type: "tweet";
1329
- /** tweet */
1330
- tweet: Tweet;
1331
- /** source tweet, quote or retweet or reply */
1332
- sourceTweet?: SourceTweet;
1333
- }
1334
- /**
1335
- * Token mentioned in the media
1336
- */
1337
- interface MediaToken {
1338
- /** chain */
1339
- chain: Chain;
1340
- /** token address */
1341
- address: string;
1342
- /** token symbol */
1343
- symbol: string;
1344
- /** token image url */
1345
- image?: string;
1346
- /** token latest price in usd */
1347
- latestPrice?: string;
1348
- /** token previous price in usd */
1349
- previousPrice?: string;
1350
- /** price change ratio, range is 0-100 */
1351
- priceChange?: string;
1352
- }
1353
- interface Tweet {
1354
- /** tweet id */
1355
- tweetId: string;
1356
- /** tweet type */
1357
- type: "tweet" | "reply" | "quote" | (string & {});
1358
- /** tweet author */
1359
- user: TweetUser;
1360
- /** tweet unix timestamp in milliseconds */
1361
- timestamp: number;
1362
- /** tweet content */
1363
- content: TweetContent;
1364
- }
1365
- interface SourceTweet {
1366
- /** tweet id */
1367
- tweetId: string;
1368
- /** tweet author */
1369
- user: TweetUser;
1370
- /** tweet content */
1371
- content: TweetContent;
1372
- }
1373
- interface TweetUser {
1374
- /** username */
1375
- username: string;
1376
- /** screen name */
1377
- screenName?: string;
1378
- /** avatar */
1379
- avatar?: string;
1380
- /** tags */
1381
- tags?: Array<string>;
1382
- }
1383
- interface TweetContent {
1384
- /** tweet text content */
1385
- text?: string;
1386
- /** tweet medias, e.g. image, video .etc */
1387
- medias?: Array<TweetContentMedia>;
1388
- }
1389
- interface TweetContentMedia {
1390
- type: "image" | "video" | (string & {});
1391
- url: string;
1392
- }
1393
-
1394
- /**
1395
- * AI generated meme information
1396
- */
1397
- interface GeneratedMemeInfo {
1398
- /** token symbol */
1399
- symbol: string;
1400
- /** token name */
1401
- name?: string;
1402
- /** token image url */
1403
- image?: string;
1404
- }
1405
- interface SubscribeTweetMediasOptions {
1406
- /**
1407
- * Callback function to handle new tweet medias
1408
- * @param tweetMedia new tweet media
1409
- * @returns
1410
- */
1411
- callback: (tweetMedia: TweetMedia) => void;
1412
- }
1413
- /**
1414
- * Interfaces for media track client
1415
- */
1416
- interface IMediaTrackClient {
1417
- /**
1418
- * Translate media content text
1419
- * @param media media to translate
1420
- * @param targetLanguage target language
1421
- * @param options translate options
1422
- * @param options.sourceLanguage source language
1423
- * @param options.sourceTweet if true, the source tweet will be translated
1424
- * @returns translated text
1425
- */
1426
- translate(media: IMedia, targetLanguage: string, options?: {
1427
- sourceLanguage?: string;
1428
- sourceTweet?: boolean;
1429
- }): Promise<string>;
1430
- /**
1431
- * AI Generated Meme Launch Info
1432
- * @param media media to generate meme
1433
- */
1434
- generateMeme(media: IMedia): Promise<GeneratedMemeInfo>;
1435
- /**
1436
- * Subscribe to new tweet medias
1437
- * @param options subscribe tweet medias options
1438
- * @returns subscription
1439
- */
1440
- subscribeTweetMedia(options: SubscribeTweetMediasOptions): ISubscription;
1441
- /**
1442
- * Subscribe to tweet media tokens changes
1443
- * @param options subscribe tweet media tokens options
1444
- * @returns subscription
1445
- */
1446
- subscribeTweetMediaToken(options: SubscribeTweetMediasOptions): ISubscription;
1447
- }
1448
-
1449
- interface Channel {
1450
- /** channel id */
1451
- id: string;
1452
- /** owner user id */
1453
- owner_id: string;
1454
- /** channel name */
1455
- name: string;
1456
- /** channel description */
1457
- description?: string;
1458
- /** channel icon */
1459
- icon?: string;
1460
- /** channel chain */
1461
- chain: Chain;
1462
- /** channel privacy */
1463
- privacy: "public" | "private";
1464
- /** whether the current user is subscribed to the channel */
1465
- is_subscribed: boolean;
1466
- /** number of subscribers */
1467
- subscribe_count: number;
1468
- /** number of sources */
1469
- source_count: number;
1470
- /** channel sources */
1471
- sources?: Array<ChannelSource>;
1472
- /** channel sinks */
1473
- sinks?: Array<ChannelSink>;
1474
- /** channel telegram url */
1475
- telegram?: string;
1476
- /** channel discord url */
1477
- discord?: string;
1478
- /** channel twitter url */
1479
- twitter?: string;
1480
- /** channel created at */
1481
- created_at: string;
1482
- /** channel updated at */
1483
- updated_at: string;
1484
- }
1485
- interface ChannelSource {
1486
- /** source id */
1487
- id: string;
1488
- /** channel id */
1489
- channel_id: string;
1490
- /** source type */
1491
- type: string;
1492
- /** source alias */
1493
- alias?: string;
1494
- /** source value */
1495
- value?: string;
1496
- /** source config */
1497
- configs?: Record<string, any>;
1498
- /** source created at */
1499
- created_at: string;
1500
- /** source updated at */
1501
- updated_at: string;
1502
- }
1503
- interface BaseChannelEvent {
1504
- /** event type */
1505
- type: string;
1506
- /** event created at */
1507
- timestamp: number;
1508
- }
1509
- interface ChannelTradeEvent extends BaseChannelEvent {
1510
- data: {
1511
- wallet_address: string;
1512
- chain: Chain;
1513
- type: "buy" | "sell";
1514
- base_icon: string;
1515
- base_symbol: string;
1516
- base_name: string;
1517
- base_amount: string;
1518
- base_address: string;
1519
- quote_symbol: string;
1520
- quote_address: string;
1521
- quote_amount: string;
1522
- quote_price: string;
1523
- quote_price_usd: string;
1524
- tx_hash: string;
1525
- dex: string;
1526
- launchpad: string;
1527
- block_height: number;
1528
- timestamp: string;
1529
- };
1530
- }
1531
- type ChannelEvent = ChannelTradeEvent;
1532
- interface ChannelSink {
1533
- /** sink id */
1534
- id: string;
1535
- /** sink type */
1536
- type: string;
1537
- /** sink url */
1538
- url?: string;
1539
- /** sink config */
1540
- config?: Record<string, any>;
1541
- /** sink created at */
1542
- created_at: string;
1543
- /** sink updated at */
1544
- updated_at: string;
1545
- }
1546
-
1547
- interface PageList<T> {
1548
- list: Array<T>;
1549
- page: number;
1550
- size: number;
1551
- total: number;
1552
- total_pages: number;
1553
- }
1554
- interface CursorList<T> {
1555
- data: Array<T>;
1556
- total: number;
1557
- next_timestamp?: number;
1558
- has_more: boolean;
1559
- }
1560
- interface CreateChannelOptions {
1561
- /** channel name */
1562
- name: string;
1563
- /** channel description */
1564
- description?: string;
1565
- /** channel icon */
1566
- icon: string;
1567
- /** channel chain */
1568
- chain: string;
1569
- /** channel privacy */
1570
- privacy: "public" | "private";
1571
- }
1572
- interface UpdateChannelOptions {
1573
- /** channel id */
1574
- id: string;
1575
- /** channel name */
1576
- name?: string;
1577
- /** channel description */
1578
- description?: string;
1579
- /** channel icon */
1580
- icon?: string;
1581
- /** channel chain */
1582
- chain?: string;
1583
- /** channel privacy */
1584
- privacy?: "public" | "private";
1585
- }
1586
- interface UpdateChannelSourcesOptions {
1587
- /** channel id */
1588
- channel_id: string;
1589
- /** wallet sources */
1590
- sources: Array<ChannelSourceOption>;
1591
- /** source type */
1592
- type: string;
1593
- }
1594
- interface ChannelSourceOption {
1595
- /** source type */
1596
- type: string;
1597
- /** source alias */
1598
- alias?: string;
1599
- /** source value */
1600
- value?: string;
1601
- /** source configs */
1602
- configs?: any;
1603
- }
1604
- interface ListChannelsOptions {
1605
- /** page number, starting from 1 */
1606
- page?: number;
1607
- /** number of items per page */
1608
- size?: number;
1609
- /** filter by chain id */
1610
- chain?: string;
1611
- /** fuzzy search by name */
1612
- search?: string;
1613
- /** sort field */
1614
- sort?: string;
1615
- /** sort order */
1616
- order?: "asc" | "desc";
1617
- }
1618
- interface ListChannelEventsOptions {
1619
- /** Timestamp filter: 0 = get latest 20, >0 = get events after this timestamp */
1620
- timestamp?: number;
1621
- /** Pagination: true = get events after timestamp (older), false = get events before timestamp (newer) */
1622
- next_page?: boolean;
1623
- /** Number of events to return, default 50, max 100 */
1624
- limit?: number;
1625
- }
1626
- type ChannelsList = PageList<Channel>;
1627
- type ChannelEventsList = CursorList<ChannelEvent>;
1628
- /**
1629
- * X (Twitter) Eligibility Information
1630
- */
1631
- interface XEligibilityInfo {
1632
- /** Authorization status: "not_authorized" | "authorized" | "auth_failed" */
1633
- status: string;
1634
- /** Status message */
1635
- message?: string;
1636
- /** Twitter user ID */
1637
- twitter_id?: string;
1638
- /** Twitter username */
1639
- twitter_name?: string;
1640
- /** Follower count */
1641
- follower_count?: string;
1642
- /** Account age in days */
1643
- account_age_days?: string;
1644
- /** Whether account has violations */
1645
- has_violations?: boolean;
1646
- }
1647
- interface IChannelsClient {
1648
- get(id: string): Promise<Channel>;
1649
- getChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1650
- getMyChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1651
- getSubscribedChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1652
- subscribe(id: string): Promise<void>;
1653
- unsubscribe(id: string): Promise<void>;
1654
- getChannelEvents(channelId: string, options?: ListChannelEventsOptions): Promise<ChannelEventsList>;
1655
- create(options: CreateChannelOptions): Promise<Channel>;
1656
- update(options: UpdateChannelOptions): Promise<Channel>;
1657
- updateSources(options: UpdateChannelSourcesOptions): Promise<Array<ChannelSource>>;
1658
- getSources(channelId: string): Promise<Array<ChannelSource>>;
1659
- /**
1660
- * Check X (Twitter) eligibility status
1661
- * @returns X eligibility information including authorization status
1662
- */
1663
- checkXEligibility(): Promise<XEligibilityInfo>;
1664
- /**
1665
- * Get X (Twitter) OAuth authorization URL
1666
- * @param returnUrl - Optional return URL after authorization
1667
- * @returns Authorization URL
1668
- */
1669
- getXAuthorizeUrl(returnUrl?: string): Promise<string>;
1670
- }
1671
-
1672
- type index_ChannelEventsList = ChannelEventsList;
1673
- type index_ChannelSourceOption = ChannelSourceOption;
1674
- type index_ChannelsList = ChannelsList;
1675
- type index_CreateChannelOptions = CreateChannelOptions;
1310
+ type index_CursorList<T> = CursorList<T>;
1676
1311
  type index_CursorListOptions = CursorListOptions;
1677
- type index_GeneratedMemeInfo = GeneratedMemeInfo;
1678
1312
  type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
1679
1313
  type index_GetTokenListOptions = GetTokenListOptions;
1680
1314
  type index_GetTradeActivitiesOptions = GetTradeActivitiesOptions;
1681
- type index_IChannelsClient = IChannelsClient;
1682
1315
  type index_IClient = IClient;
1683
- type index_IMediaTrackClient = IMediaTrackClient;
1684
1316
  type index_ISubscribeClient = ISubscribeClient;
1685
1317
  type index_ISubscription = ISubscription;
1686
- type index_ListChannelEventsOptions = ListChannelEventsOptions;
1687
- type index_ListChannelsOptions = ListChannelsOptions;
1688
1318
  type index_PortfolioPnlSubscribed = PortfolioPnlSubscribed;
1689
1319
  type index_PortfolioSubscribed = PortfolioSubscribed;
1690
1320
  type index_SearchTokenCursorList = SearchTokenCursorList;
1691
1321
  type index_SearchTokensOptions = SearchTokensOptions;
1692
1322
  type index_SendTxParams = SendTxParams;
1693
1323
  type index_SendTxResult = SendTxResult;
1694
- type index_SubscribeTweetMediasOptions = SubscribeTweetMediasOptions;
1695
1324
  type index_SwapMode = SwapMode;
1696
1325
  declare const index_SwapMode: typeof SwapMode;
1697
1326
  type index_SwapParams = SwapParams;
@@ -1700,12 +1329,9 @@ type index_SwapRoutePlan = SwapRoutePlan;
1700
1329
  type index_TokenFieldOption = TokenFieldOption;
1701
1330
  type index_TokenFilterOption = TokenFilterOption;
1702
1331
  type index_TokenSubscribed = TokenSubscribed;
1703
- type index_UpdateChannelOptions = UpdateChannelOptions;
1704
- type index_UpdateChannelSourcesOptions = UpdateChannelSourcesOptions;
1705
1332
  type index_WalletPnlSubscribed = WalletPnlSubscribed;
1706
- type index_XEligibilityInfo = XEligibilityInfo;
1707
1333
  declare namespace index {
1708
- export { type index_ChannelEventsList as ChannelEventsList, type index_ChannelSourceOption as ChannelSourceOption, type index_ChannelsList as ChannelsList, type index_CreateChannelOptions as CreateChannelOptions, type CursorList$1 as CursorList, type index_CursorListOptions as CursorListOptions, type index_GeneratedMemeInfo as GeneratedMemeInfo, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradeActivitiesOptions as GetTradeActivitiesOptions, type index_IChannelsClient as IChannelsClient, type index_IClient as IClient, type index_IMediaTrackClient as IMediaTrackClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_ListChannelEventsOptions as ListChannelEventsOptions, type index_ListChannelsOptions as ListChannelsOptions, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, type index_SubscribeTweetMediasOptions as SubscribeTweetMediasOptions, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenSubscribed as TokenSubscribed, type index_UpdateChannelOptions as UpdateChannelOptions, type index_UpdateChannelSourcesOptions as UpdateChannelSourcesOptions, type index_WalletPnlSubscribed as WalletPnlSubscribed, type index_XEligibilityInfo as XEligibilityInfo };
1334
+ export { type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradeActivitiesOptions as GetTradeActivitiesOptions, type index_IClient as IClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenSubscribed as TokenSubscribed, type index_WalletPnlSubscribed as WalletPnlSubscribed };
1709
1335
  }
1710
1336
 
1711
1337
  declare global {
@@ -1715,15 +1341,10 @@ declare global {
1715
1341
  };
1716
1342
  }
1717
1343
  }
1718
- declare const _default: "0.1.23";
1344
+ declare const _default: "0.1.25";
1719
1345
 
1720
1346
  type NetworkId = "testnet" | "mainnet";
1721
1347
 
1722
- declare class ApiError extends Error {
1723
- readonly code: number;
1724
- constructor(message: string, code: number);
1725
- }
1726
-
1727
1348
  declare enum SolanaTokenProtocol {
1728
1349
  BAGS = "bags",
1729
1350
  BELIEVE = "believe",
@@ -1745,4 +1366,4 @@ declare enum SolanaTokenProtocol {
1745
1366
  type TokenProtocol = keyof typeof SolanaTokenProtocol | (string & {});
1746
1367
  declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
1747
1368
 
1748
- export { index as API, ApiError, type BaseChannelEvent, Chain, ChainNamespace, type Channel, type ChannelEvent, type ChannelEventsList, type ChannelSink, type ChannelSource, type ChannelSourceOption, type ChannelTradeEvent, type ChannelsList, type CreateChannelOptions, type CursorList$1 as CursorList, type CursorListOptions, type GeneratedMemeInfo, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradeActivitiesOptions, type IChannelsClient, type IClient, type IMedia, type IMediaTrackClient, type ISubscribeClient, type ISubscription, type ListChannelEventsOptions, type ListChannelsOptions, type MediaToken, type NetworkId, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, type SourceTweet, type SubscribeTweetMediasOptions, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHistoryPriceObject, type TokenHolder, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type TradeActivity, type TradeDex, type TradeToken, type Tweet, type TweetContent, type TweetContentMedia, type TweetMedia, type TweetUser, type UpdateChannelOptions, type UpdateChannelSourcesOptions, type WalletPnl, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, type XEligibilityInfo, _default as version };
1369
+ export { index as API, Chain, ChainNamespace, type CursorList, type CursorListOptions, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradeActivitiesOptions, type IClient, type ISubscribeClient, type ISubscription, type NetworkId, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHistoryPriceObject, type TokenHolder, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type TradeActivity, type TradeDex, type TradeToken, type WalletPnl, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, _default as version };