@liberfi.io/types 0.1.7 → 0.1.9

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
@@ -721,7 +721,7 @@ interface WalletPortfolios {
721
721
  /**
722
722
  * Cursor list result data
723
723
  */
724
- interface CursorList<T> {
724
+ interface CursorList$1<T> {
725
725
  startCursor?: string;
726
726
  endCursor?: string;
727
727
  hasPrev?: boolean;
@@ -779,7 +779,7 @@ interface SearchTokensOptions extends CursorListOptions {
779
779
  /**
780
780
  * Search token cursor list
781
781
  */
782
- interface SearchTokenCursorList extends CursorList<Token> {
782
+ interface SearchTokenCursorList extends CursorList$1<Token> {
783
783
  total?: number;
784
784
  extra?: any;
785
785
  }
@@ -882,7 +882,7 @@ interface IClient {
882
882
  * @param options optional query options
883
883
  * @returns token holders
884
884
  */
885
- getTokenHolders(chain: Chain, address: string, options?: CursorListOptions): Promise<CursorList<TokenHolder>>;
885
+ getTokenHolders(chain: Chain, address: string, options?: CursorListOptions): Promise<CursorList$1<TokenHolder>>;
886
886
  /**
887
887
  * fetch token market data
888
888
  * @param chain chain id
@@ -966,7 +966,7 @@ interface IClient {
966
966
  * @param options optional query options
967
967
  * @returns wallet's trade activities
968
968
  */
969
- getWalletTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList<TradeActivity>>;
969
+ getWalletTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList$1<TradeActivity>>;
970
970
  /**
971
971
  * fetch token's trade activities
972
972
  * @param chain chain id
@@ -974,7 +974,7 @@ interface IClient {
974
974
  * @param options optional query options
975
975
  * @returns token's trade activities
976
976
  */
977
- getTokenTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList<TradeActivity>>;
977
+ getTokenTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList$1<TradeActivity>>;
978
978
  /**
979
979
  * get presigned upload url
980
980
  * @returns presigned upload url
@@ -1276,34 +1276,71 @@ interface Channel {
1276
1276
  /** whether the current user is subscribed to the channel */
1277
1277
  is_subscribed: boolean;
1278
1278
  /** number of subscribers */
1279
- subscribers_count: number;
1279
+ subscribe_count: number;
1280
+ /** number of sources */
1281
+ source_count: number;
1280
1282
  /** channel sources */
1281
1283
  sources?: Array<ChannelSource>;
1282
1284
  /** channel sinks */
1283
1285
  sinks?: Array<ChannelSink>;
1286
+ /** channel telegram url */
1287
+ telegram?: string;
1288
+ /** channel discord url */
1289
+ discord?: string;
1290
+ /** channel twitter url */
1291
+ twitter?: string;
1284
1292
  /** channel created at */
1285
- created_at: Date;
1293
+ created_at: string;
1286
1294
  /** channel updated at */
1287
- updated_at: Date;
1295
+ updated_at: string;
1288
1296
  }
1289
1297
  interface ChannelSource {
1290
1298
  /** source id */
1291
1299
  id: string;
1300
+ /** channel id */
1301
+ channel_id: string;
1292
1302
  /** source type */
1293
1303
  type: string;
1294
1304
  /** source alias */
1295
1305
  alias?: string;
1296
- /** source url */
1297
- url?: string;
1298
1306
  /** source value */
1299
1307
  value?: string;
1300
1308
  /** source config */
1301
- config?: Record<string, any>;
1309
+ configs?: Record<string, any>;
1302
1310
  /** source created at */
1303
- created_at: Date;
1311
+ created_at: string;
1304
1312
  /** source updated at */
1305
- updated_at: Date;
1313
+ updated_at: string;
1314
+ }
1315
+ interface BaseChannelEvent {
1316
+ /** event type */
1317
+ type: string;
1318
+ /** event created at */
1319
+ timestamp: number;
1306
1320
  }
1321
+ interface ChannelTradeEvent extends BaseChannelEvent {
1322
+ data: {
1323
+ wallet_address: string;
1324
+ chain: Chain;
1325
+ type: "buy" | "sell";
1326
+ base_icon: string;
1327
+ base_symbol: string;
1328
+ base_name: string;
1329
+ base_amount: string;
1330
+ base_address: string;
1331
+ quote_symbol: string;
1332
+ quote_address: string;
1333
+ quote_amount: string;
1334
+ quote_price: string;
1335
+ quote_price_usd: string;
1336
+ tx_hash: string;
1337
+ dex: string;
1338
+ launchpad: string;
1339
+ block_height: number;
1340
+ timestamp: string;
1341
+ };
1342
+ }
1343
+ type ChannelEvent = ChannelTradeEvent;
1307
1344
  interface ChannelSink {
1308
1345
  /** sink id */
1309
1346
  id: string;
@@ -1314,20 +1351,33 @@ interface ChannelSink {
1314
1351
  /** sink config */
1315
1352
  config?: Record<string, any>;
1316
1353
  /** sink created at */
1317
- created_at: Date;
1354
+ created_at: string;
1318
1355
  /** sink updated at */
1319
- updated_at: Date;
1356
+ updated_at: string;
1320
1357
  }
1321
1358
 
1359
+ interface PageList<T> {
1360
+ list: Array<T>;
1361
+ page: number;
1362
+ size: number;
1363
+ total: number;
1364
+ total_pages: number;
1365
+ }
1366
+ interface CursorList<T> {
1367
+ data: Array<T>;
1368
+ total: number;
1369
+ next_timestamp?: number;
1370
+ has_more: boolean;
1371
+ }
1322
1372
  interface CreateChannelOptions {
1323
1373
  /** channel name */
1324
1374
  name: string;
1325
1375
  /** channel description */
1326
1376
  description?: string;
1327
1377
  /** channel icon */
1328
- icon?: string;
1378
+ icon: string;
1329
1379
  /** channel chain */
1330
- chain: Chain;
1380
+ chain: string;
1331
1381
  /** channel privacy */
1332
1382
  privacy: "public" | "private";
1333
1383
  }
@@ -1341,30 +1391,70 @@ interface UpdateChannelOptions {
1341
1391
  /** channel icon */
1342
1392
  icon?: string;
1343
1393
  /** channel chain */
1344
- chain?: Chain;
1394
+ chain?: string;
1345
1395
  /** channel privacy */
1346
1396
  privacy?: "public" | "private";
1347
1397
  }
1398
+ interface UpdateChannelSourcesOptions {
1399
+ /** channel id */
1400
+ channel_id: string;
1401
+ /** wallet sources */
1402
+ sources: Array<ChannelSourceOption>;
1403
+ /** source type */
1404
+ type: string;
1405
+ }
1406
+ interface ChannelSourceOption {
1407
+ /** source type */
1408
+ type: string;
1409
+ /** source alias */
1410
+ alias?: string;
1411
+ /** source value */
1412
+ value?: string;
1413
+ /** source configs */
1414
+ configs?: any;
1415
+ }
1416
+ interface ListChannelsOptions {
1417
+ /** page number, starting from 1 */
1418
+ page?: number;
1419
+ /** number of items per page */
1420
+ size?: number;
1421
+ /** filter by chain id */
1422
+ chain?: string;
1423
+ /** fuzzy search by name */
1424
+ search?: string;
1425
+ /** sort field */
1426
+ sort?: string;
1427
+ /** sort order */
1428
+ order?: "asc" | "desc";
1429
+ }
1430
+ interface ListChannelEventsOptions {
1431
+ /** Timestamp filter: 0 = get latest 20, >0 = get events after this timestamp */
1432
+ timestamp?: number;
1433
+ /** Pagination: true = get events after timestamp (older), false = get events before timestamp (newer) */
1434
+ next_page?: boolean;
1435
+ /** Number of events to return, default 50, max 100 */
1436
+ limit?: number;
1437
+ }
1438
+ type ChannelsList = PageList<Channel>;
1439
+ type ChannelEventsList = CursorList<ChannelEvent>;
1348
1440
  interface IChannelsClient {
1349
- /**
1350
- * Get a channel by id
1351
- * @param id channel id
1352
- */
1353
1441
  get(id: string): Promise<Channel>;
1354
- /**
1355
- * Create a new channel
1356
- * @param options create channel options
1357
- */
1442
+ getChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1443
+ getMyChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1444
+ getSubscribedChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1445
+ subscribe(id: string): Promise<void>;
1446
+ unsubscribe(id: string): Promise<void>;
1447
+ getChannelEvents(channelId: string, options?: ListChannelEventsOptions): Promise<ChannelEventsList>;
1358
1448
  create(options: CreateChannelOptions): Promise<Channel>;
1359
- /**
1360
- * Update a channel
1361
- * @param options update channel options
1362
- */
1363
1449
  update(options: UpdateChannelOptions): Promise<Channel>;
1450
+ updateSources(options: UpdateChannelSourcesOptions): Promise<Array<ChannelSource>>;
1451
+ getSources(channelId: string): Promise<Array<ChannelSource>>;
1364
1452
  }
1365
1453
 
1454
+ type index_ChannelEventsList = ChannelEventsList;
1455
+ type index_ChannelSourceOption = ChannelSourceOption;
1456
+ type index_ChannelsList = ChannelsList;
1366
1457
  type index_CreateChannelOptions = CreateChannelOptions;
1367
- type index_CursorList<T> = CursorList<T>;
1368
1458
  type index_CursorListOptions = CursorListOptions;
1369
1459
  type index_GeneratedMemeInfo = GeneratedMemeInfo;
1370
1460
  type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
@@ -1375,6 +1465,8 @@ type index_IClient = IClient;
1375
1465
  type index_IMediaTrackClient = IMediaTrackClient;
1376
1466
  type index_ISubscribeClient = ISubscribeClient;
1377
1467
  type index_ISubscription = ISubscription;
1468
+ type index_ListChannelEventsOptions = ListChannelEventsOptions;
1469
+ type index_ListChannelsOptions = ListChannelsOptions;
1378
1470
  type index_PortfolioPnlSubscribed = PortfolioPnlSubscribed;
1379
1471
  type index_PortfolioSubscribed = PortfolioSubscribed;
1380
1472
  type index_SearchTokenCursorList = SearchTokenCursorList;
@@ -1391,9 +1483,10 @@ type index_TokenFieldOption = TokenFieldOption;
1391
1483
  type index_TokenFilterOption = TokenFilterOption;
1392
1484
  type index_TokenSubscribed = TokenSubscribed;
1393
1485
  type index_UpdateChannelOptions = UpdateChannelOptions;
1486
+ type index_UpdateChannelSourcesOptions = UpdateChannelSourcesOptions;
1394
1487
  type index_WalletPnlSubscribed = WalletPnlSubscribed;
1395
1488
  declare namespace index {
1396
- export { type index_CreateChannelOptions as CreateChannelOptions, type index_CursorList 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_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_WalletPnlSubscribed as WalletPnlSubscribed };
1489
+ 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 };
1397
1490
  }
1398
1491
 
1399
1492
  declare global {
@@ -1433,4 +1526,4 @@ declare enum SolanaTokenProtocol {
1433
1526
  type TokenProtocol = keyof typeof SolanaTokenProtocol | (string & {});
1434
1527
  declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
1435
1528
 
1436
- export { index as API, ApiError, Chain, ChainNamespace, type Channel, type ChannelSink, type ChannelSource, type CreateChannelOptions, type CursorList, type CursorListOptions, type GeneratedMemeInfo, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradeActivitiesOptions, type IChannelsClient, type IClient, type IMedia, type IMediaTrackClient, type ISubscribeClient, type ISubscription, 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 WalletPnlSubscribed, type WalletPortfolios, _default as version };
1529
+ 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 WalletPnlSubscribed, type WalletPortfolios, _default as version };
package/dist/index.d.ts CHANGED
@@ -721,7 +721,7 @@ interface WalletPortfolios {
721
721
  /**
722
722
  * Cursor list result data
723
723
  */
724
- interface CursorList<T> {
724
+ interface CursorList$1<T> {
725
725
  startCursor?: string;
726
726
  endCursor?: string;
727
727
  hasPrev?: boolean;
@@ -779,7 +779,7 @@ interface SearchTokensOptions extends CursorListOptions {
779
779
  /**
780
780
  * Search token cursor list
781
781
  */
782
- interface SearchTokenCursorList extends CursorList<Token> {
782
+ interface SearchTokenCursorList extends CursorList$1<Token> {
783
783
  total?: number;
784
784
  extra?: any;
785
785
  }
@@ -882,7 +882,7 @@ interface IClient {
882
882
  * @param options optional query options
883
883
  * @returns token holders
884
884
  */
885
- getTokenHolders(chain: Chain, address: string, options?: CursorListOptions): Promise<CursorList<TokenHolder>>;
885
+ getTokenHolders(chain: Chain, address: string, options?: CursorListOptions): Promise<CursorList$1<TokenHolder>>;
886
886
  /**
887
887
  * fetch token market data
888
888
  * @param chain chain id
@@ -966,7 +966,7 @@ interface IClient {
966
966
  * @param options optional query options
967
967
  * @returns wallet's trade activities
968
968
  */
969
- getWalletTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList<TradeActivity>>;
969
+ getWalletTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList$1<TradeActivity>>;
970
970
  /**
971
971
  * fetch token's trade activities
972
972
  * @param chain chain id
@@ -974,7 +974,7 @@ interface IClient {
974
974
  * @param options optional query options
975
975
  * @returns token's trade activities
976
976
  */
977
- getTokenTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList<TradeActivity>>;
977
+ getTokenTradeActivities(chain: Chain, address: string, options?: GetTradeActivitiesOptions): Promise<CursorList$1<TradeActivity>>;
978
978
  /**
979
979
  * get presigned upload url
980
980
  * @returns presigned upload url
@@ -1276,34 +1276,71 @@ interface Channel {
1276
1276
  /** whether the current user is subscribed to the channel */
1277
1277
  is_subscribed: boolean;
1278
1278
  /** number of subscribers */
1279
- subscribers_count: number;
1279
+ subscribe_count: number;
1280
+ /** number of sources */
1281
+ source_count: number;
1280
1282
  /** channel sources */
1281
1283
  sources?: Array<ChannelSource>;
1282
1284
  /** channel sinks */
1283
1285
  sinks?: Array<ChannelSink>;
1286
+ /** channel telegram url */
1287
+ telegram?: string;
1288
+ /** channel discord url */
1289
+ discord?: string;
1290
+ /** channel twitter url */
1291
+ twitter?: string;
1284
1292
  /** channel created at */
1285
- created_at: Date;
1293
+ created_at: string;
1286
1294
  /** channel updated at */
1287
- updated_at: Date;
1295
+ updated_at: string;
1288
1296
  }
1289
1297
  interface ChannelSource {
1290
1298
  /** source id */
1291
1299
  id: string;
1300
+ /** channel id */
1301
+ channel_id: string;
1292
1302
  /** source type */
1293
1303
  type: string;
1294
1304
  /** source alias */
1295
1305
  alias?: string;
1296
- /** source url */
1297
- url?: string;
1298
1306
  /** source value */
1299
1307
  value?: string;
1300
1308
  /** source config */
1301
- config?: Record<string, any>;
1309
+ configs?: Record<string, any>;
1302
1310
  /** source created at */
1303
- created_at: Date;
1311
+ created_at: string;
1304
1312
  /** source updated at */
1305
- updated_at: Date;
1313
+ updated_at: string;
1314
+ }
1315
+ interface BaseChannelEvent {
1316
+ /** event type */
1317
+ type: string;
1318
+ /** event created at */
1319
+ timestamp: number;
1306
1320
  }
1321
+ interface ChannelTradeEvent extends BaseChannelEvent {
1322
+ data: {
1323
+ wallet_address: string;
1324
+ chain: Chain;
1325
+ type: "buy" | "sell";
1326
+ base_icon: string;
1327
+ base_symbol: string;
1328
+ base_name: string;
1329
+ base_amount: string;
1330
+ base_address: string;
1331
+ quote_symbol: string;
1332
+ quote_address: string;
1333
+ quote_amount: string;
1334
+ quote_price: string;
1335
+ quote_price_usd: string;
1336
+ tx_hash: string;
1337
+ dex: string;
1338
+ launchpad: string;
1339
+ block_height: number;
1340
+ timestamp: string;
1341
+ };
1342
+ }
1343
+ type ChannelEvent = ChannelTradeEvent;
1307
1344
  interface ChannelSink {
1308
1345
  /** sink id */
1309
1346
  id: string;
@@ -1314,20 +1351,33 @@ interface ChannelSink {
1314
1351
  /** sink config */
1315
1352
  config?: Record<string, any>;
1316
1353
  /** sink created at */
1317
- created_at: Date;
1354
+ created_at: string;
1318
1355
  /** sink updated at */
1319
- updated_at: Date;
1356
+ updated_at: string;
1320
1357
  }
1321
1358
 
1359
+ interface PageList<T> {
1360
+ list: Array<T>;
1361
+ page: number;
1362
+ size: number;
1363
+ total: number;
1364
+ total_pages: number;
1365
+ }
1366
+ interface CursorList<T> {
1367
+ data: Array<T>;
1368
+ total: number;
1369
+ next_timestamp?: number;
1370
+ has_more: boolean;
1371
+ }
1322
1372
  interface CreateChannelOptions {
1323
1373
  /** channel name */
1324
1374
  name: string;
1325
1375
  /** channel description */
1326
1376
  description?: string;
1327
1377
  /** channel icon */
1328
- icon?: string;
1378
+ icon: string;
1329
1379
  /** channel chain */
1330
- chain: Chain;
1380
+ chain: string;
1331
1381
  /** channel privacy */
1332
1382
  privacy: "public" | "private";
1333
1383
  }
@@ -1341,30 +1391,70 @@ interface UpdateChannelOptions {
1341
1391
  /** channel icon */
1342
1392
  icon?: string;
1343
1393
  /** channel chain */
1344
- chain?: Chain;
1394
+ chain?: string;
1345
1395
  /** channel privacy */
1346
1396
  privacy?: "public" | "private";
1347
1397
  }
1398
+ interface UpdateChannelSourcesOptions {
1399
+ /** channel id */
1400
+ channel_id: string;
1401
+ /** wallet sources */
1402
+ sources: Array<ChannelSourceOption>;
1403
+ /** source type */
1404
+ type: string;
1405
+ }
1406
+ interface ChannelSourceOption {
1407
+ /** source type */
1408
+ type: string;
1409
+ /** source alias */
1410
+ alias?: string;
1411
+ /** source value */
1412
+ value?: string;
1413
+ /** source configs */
1414
+ configs?: any;
1415
+ }
1416
+ interface ListChannelsOptions {
1417
+ /** page number, starting from 1 */
1418
+ page?: number;
1419
+ /** number of items per page */
1420
+ size?: number;
1421
+ /** filter by chain id */
1422
+ chain?: string;
1423
+ /** fuzzy search by name */
1424
+ search?: string;
1425
+ /** sort field */
1426
+ sort?: string;
1427
+ /** sort order */
1428
+ order?: "asc" | "desc";
1429
+ }
1430
+ interface ListChannelEventsOptions {
1431
+ /** Timestamp filter: 0 = get latest 20, >0 = get events after this timestamp */
1432
+ timestamp?: number;
1433
+ /** Pagination: true = get events after timestamp (older), false = get events before timestamp (newer) */
1434
+ next_page?: boolean;
1435
+ /** Number of events to return, default 50, max 100 */
1436
+ limit?: number;
1437
+ }
1438
+ type ChannelsList = PageList<Channel>;
1439
+ type ChannelEventsList = CursorList<ChannelEvent>;
1348
1440
  interface IChannelsClient {
1349
- /**
1350
- * Get a channel by id
1351
- * @param id channel id
1352
- */
1353
1441
  get(id: string): Promise<Channel>;
1354
- /**
1355
- * Create a new channel
1356
- * @param options create channel options
1357
- */
1442
+ getChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1443
+ getMyChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1444
+ getSubscribedChannels(options?: ListChannelsOptions): Promise<ChannelsList>;
1445
+ subscribe(id: string): Promise<void>;
1446
+ unsubscribe(id: string): Promise<void>;
1447
+ getChannelEvents(channelId: string, options?: ListChannelEventsOptions): Promise<ChannelEventsList>;
1358
1448
  create(options: CreateChannelOptions): Promise<Channel>;
1359
- /**
1360
- * Update a channel
1361
- * @param options update channel options
1362
- */
1363
1449
  update(options: UpdateChannelOptions): Promise<Channel>;
1450
+ updateSources(options: UpdateChannelSourcesOptions): Promise<Array<ChannelSource>>;
1451
+ getSources(channelId: string): Promise<Array<ChannelSource>>;
1364
1452
  }
1365
1453
 
1454
+ type index_ChannelEventsList = ChannelEventsList;
1455
+ type index_ChannelSourceOption = ChannelSourceOption;
1456
+ type index_ChannelsList = ChannelsList;
1366
1457
  type index_CreateChannelOptions = CreateChannelOptions;
1367
- type index_CursorList<T> = CursorList<T>;
1368
1458
  type index_CursorListOptions = CursorListOptions;
1369
1459
  type index_GeneratedMemeInfo = GeneratedMemeInfo;
1370
1460
  type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
@@ -1375,6 +1465,8 @@ type index_IClient = IClient;
1375
1465
  type index_IMediaTrackClient = IMediaTrackClient;
1376
1466
  type index_ISubscribeClient = ISubscribeClient;
1377
1467
  type index_ISubscription = ISubscription;
1468
+ type index_ListChannelEventsOptions = ListChannelEventsOptions;
1469
+ type index_ListChannelsOptions = ListChannelsOptions;
1378
1470
  type index_PortfolioPnlSubscribed = PortfolioPnlSubscribed;
1379
1471
  type index_PortfolioSubscribed = PortfolioSubscribed;
1380
1472
  type index_SearchTokenCursorList = SearchTokenCursorList;
@@ -1391,9 +1483,10 @@ type index_TokenFieldOption = TokenFieldOption;
1391
1483
  type index_TokenFilterOption = TokenFilterOption;
1392
1484
  type index_TokenSubscribed = TokenSubscribed;
1393
1485
  type index_UpdateChannelOptions = UpdateChannelOptions;
1486
+ type index_UpdateChannelSourcesOptions = UpdateChannelSourcesOptions;
1394
1487
  type index_WalletPnlSubscribed = WalletPnlSubscribed;
1395
1488
  declare namespace index {
1396
- export { type index_CreateChannelOptions as CreateChannelOptions, type index_CursorList 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_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_WalletPnlSubscribed as WalletPnlSubscribed };
1489
+ 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 };
1397
1490
  }
1398
1491
 
1399
1492
  declare global {
@@ -1433,4 +1526,4 @@ declare enum SolanaTokenProtocol {
1433
1526
  type TokenProtocol = keyof typeof SolanaTokenProtocol | (string & {});
1434
1527
  declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
1435
1528
 
1436
- export { index as API, ApiError, Chain, ChainNamespace, type Channel, type ChannelSink, type ChannelSource, type CreateChannelOptions, type CursorList, type CursorListOptions, type GeneratedMemeInfo, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradeActivitiesOptions, type IChannelsClient, type IClient, type IMedia, type IMediaTrackClient, type ISubscribeClient, type ISubscription, 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 WalletPnlSubscribed, type WalletPortfolios, _default as version };
1529
+ 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 WalletPnlSubscribed, type WalletPortfolios, _default as version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberfi.io/types",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Liberfi React SDK types",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",