@nightlylabs/dex-sdk 0.0.95 → 0.0.96

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.cjs CHANGED
@@ -673,6 +673,8 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
673
673
  EndpointsV12["SetUserReferralParams"] = "/v1/set_user_referral_params";
674
674
  EndpointsV12["GetBorrowLendHistoricalData"] = "/v1/get_borrow_lend_historical_data";
675
675
  EndpointsV12["GetBorrowLendAggregatedData"] = "/v1/get_borrow_lend_aggregated_data";
676
+ EndpointsV12["GetTokensStats"] = "/v1/get_tokens_stats";
677
+ EndpointsV12["GetTokensAggregatedStats"] = "/v1/get_tokens_aggregated_stats";
676
678
  return EndpointsV12;
677
679
  })(EndpointsV1 || {});
678
680
  var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
@@ -1257,6 +1259,17 @@ var Client = class _Client {
1257
1259
  const response = await this.sendGetJson("/v1/get_borrow_lend_aggregated_data" /* GetBorrowLendAggregatedData */, request);
1258
1260
  return response;
1259
1261
  };
1262
+ this.getTokenStats = async (request) => {
1263
+ if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
1264
+ throw new Error("olderTimestampMs must be lower than newerTimestampMs");
1265
+ }
1266
+ const response = await this.sendGetJson("/v1/get_tokens_stats" /* GetTokensStats */, request);
1267
+ return response;
1268
+ };
1269
+ this.getTokenAggregatedStats = async (request) => {
1270
+ const response = await this.sendGetJson("/v1/get_tokens_aggregated_stats" /* GetTokensAggregatedStats */, request);
1271
+ return response;
1272
+ };
1260
1273
  // Meta
1261
1274
  this.getTime = async () => {
1262
1275
  const response = await this.sendGetJson("/time" /* Time */);
package/dist/index.d.cts CHANGED
@@ -33,6 +33,8 @@ interface BorrowLendUpdate {
33
33
  lendAmount: string;
34
34
  borrowShares: string;
35
35
  borrowAmount: string;
36
+ suppliers: string;
37
+ borrowers: string;
36
38
  }
37
39
  interface UtilizationCurve {
38
40
  base: string;
@@ -46,6 +48,8 @@ interface BorrowLending {
46
48
  lendAmount: string;
47
49
  borrowShares: string;
48
50
  borrowAmount: string;
51
+ suppliers: string;
52
+ borrowers: string;
49
53
  utilizationCurve: UtilizationCurve;
50
54
  borrowEnabled: boolean;
51
55
  lastUpdated: string;
@@ -61,6 +65,8 @@ interface BorrowLendingHistoricalData {
61
65
  lendAmount: string;
62
66
  borrowShares: string;
63
67
  borrowAmount: string;
68
+ suppliers: string;
69
+ borrowers: string;
64
70
  timestamp: string;
65
71
  }
66
72
  interface CanceledPerpOrders {
@@ -357,6 +363,45 @@ interface PriceIndex {
357
363
  interface GetPriceIndexesResponse {
358
364
  prices: Record<string, PriceIndex>;
359
365
  }
366
+ interface GetTokenAggregatedStatsRequest {
367
+ tokenAddress: string[];
368
+ }
369
+ interface TokenAggregatedStats {
370
+ tokenAddress: string;
371
+ totalDepositAmount: string;
372
+ totalDepositValue: string;
373
+ totalDepositCount: string;
374
+ totalWithdrawAmount: string;
375
+ totalWithdrawValue: string;
376
+ totalWithdrawCount: string;
377
+ athHolders: string;
378
+ }
379
+ interface GetTokenAggregatedStatsResponse {
380
+ tokenAggregatedStats: TokenAggregatedStats[];
381
+ }
382
+ interface GetTokenStatsHistoryRequest {
383
+ tokenAddress: string;
384
+ olderTimestampMs?: string;
385
+ newerTimestampMs?: string;
386
+ paginationCursor?: PaginationCursor;
387
+ }
388
+ interface HistoricalTokenStats {
389
+ tokenAddress: string;
390
+ totalDepositAmount: string;
391
+ totalDepositValue: string;
392
+ totalDepositCount: string;
393
+ totalWithdrawAmount: string;
394
+ totalWithdrawValue: string;
395
+ totalWithdrawCount: string;
396
+ holders: string;
397
+ tokenSupply: string;
398
+ timestampOpen: string;
399
+ timestampClose: string;
400
+ }
401
+ interface GetTokenStatsHistoryResponse {
402
+ stats: HistoricalTokenStats[];
403
+ paginationCursor?: PaginationCursor;
404
+ }
360
405
  interface GetTokensConfigResponse {
361
406
  tokens: Record<string, TokenConfigEntry>;
362
407
  usdcAddress?: string;
@@ -775,7 +820,9 @@ declare enum EndpointsV1 {
775
820
  GetUserTransfers = "/v1/get_user_transfers",
776
821
  SetUserReferralParams = "/v1/set_user_referral_params",
777
822
  GetBorrowLendHistoricalData = "/v1/get_borrow_lend_historical_data",
778
- GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data"
823
+ GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data",
824
+ GetTokensStats = "/v1/get_tokens_stats",
825
+ GetTokensAggregatedStats = "/v1/get_tokens_aggregated_stats"
779
826
  }
780
827
  declare enum SpotMarketStatus {
781
828
  Halted = "halted",
@@ -1261,6 +1308,8 @@ declare class Client {
1261
1308
  getUserTransfersHistory: (request: GetUserTransferHistoryRequest) => Promise<GetUserTransferHistoryResponse>;
1262
1309
  getBorrowLendHistoricalState: (request: GetBorrowLendingHistoricalDataRequest) => Promise<GetBorrowLendingHistoricalDataResponse>;
1263
1310
  getBorrowLendAggregatedStats: (request: GetBorrowLendingAggregatedStatsRequest) => Promise<GetBorrowLendingAggregatedStatsResponse>;
1311
+ getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
1312
+ getTokenAggregatedStats: (request: GetTokenAggregatedStatsRequest) => Promise<GetTokenAggregatedStatsResponse>;
1264
1313
  getTime: () => Promise<string>;
1265
1314
  }
1266
1315
 
@@ -1293,4 +1342,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
1293
1342
  declare const getTopicFromCommand: (data: WsCommand) => string;
1294
1343
  declare const getTopicFromMessage: (data: WsMessage) => string;
1295
1344
 
1296
- export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
1345
+ export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
package/dist/index.d.ts CHANGED
@@ -33,6 +33,8 @@ interface BorrowLendUpdate {
33
33
  lendAmount: string;
34
34
  borrowShares: string;
35
35
  borrowAmount: string;
36
+ suppliers: string;
37
+ borrowers: string;
36
38
  }
37
39
  interface UtilizationCurve {
38
40
  base: string;
@@ -46,6 +48,8 @@ interface BorrowLending {
46
48
  lendAmount: string;
47
49
  borrowShares: string;
48
50
  borrowAmount: string;
51
+ suppliers: string;
52
+ borrowers: string;
49
53
  utilizationCurve: UtilizationCurve;
50
54
  borrowEnabled: boolean;
51
55
  lastUpdated: string;
@@ -61,6 +65,8 @@ interface BorrowLendingHistoricalData {
61
65
  lendAmount: string;
62
66
  borrowShares: string;
63
67
  borrowAmount: string;
68
+ suppliers: string;
69
+ borrowers: string;
64
70
  timestamp: string;
65
71
  }
66
72
  interface CanceledPerpOrders {
@@ -357,6 +363,45 @@ interface PriceIndex {
357
363
  interface GetPriceIndexesResponse {
358
364
  prices: Record<string, PriceIndex>;
359
365
  }
366
+ interface GetTokenAggregatedStatsRequest {
367
+ tokenAddress: string[];
368
+ }
369
+ interface TokenAggregatedStats {
370
+ tokenAddress: string;
371
+ totalDepositAmount: string;
372
+ totalDepositValue: string;
373
+ totalDepositCount: string;
374
+ totalWithdrawAmount: string;
375
+ totalWithdrawValue: string;
376
+ totalWithdrawCount: string;
377
+ athHolders: string;
378
+ }
379
+ interface GetTokenAggregatedStatsResponse {
380
+ tokenAggregatedStats: TokenAggregatedStats[];
381
+ }
382
+ interface GetTokenStatsHistoryRequest {
383
+ tokenAddress: string;
384
+ olderTimestampMs?: string;
385
+ newerTimestampMs?: string;
386
+ paginationCursor?: PaginationCursor;
387
+ }
388
+ interface HistoricalTokenStats {
389
+ tokenAddress: string;
390
+ totalDepositAmount: string;
391
+ totalDepositValue: string;
392
+ totalDepositCount: string;
393
+ totalWithdrawAmount: string;
394
+ totalWithdrawValue: string;
395
+ totalWithdrawCount: string;
396
+ holders: string;
397
+ tokenSupply: string;
398
+ timestampOpen: string;
399
+ timestampClose: string;
400
+ }
401
+ interface GetTokenStatsHistoryResponse {
402
+ stats: HistoricalTokenStats[];
403
+ paginationCursor?: PaginationCursor;
404
+ }
360
405
  interface GetTokensConfigResponse {
361
406
  tokens: Record<string, TokenConfigEntry>;
362
407
  usdcAddress?: string;
@@ -775,7 +820,9 @@ declare enum EndpointsV1 {
775
820
  GetUserTransfers = "/v1/get_user_transfers",
776
821
  SetUserReferralParams = "/v1/set_user_referral_params",
777
822
  GetBorrowLendHistoricalData = "/v1/get_borrow_lend_historical_data",
778
- GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data"
823
+ GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data",
824
+ GetTokensStats = "/v1/get_tokens_stats",
825
+ GetTokensAggregatedStats = "/v1/get_tokens_aggregated_stats"
779
826
  }
780
827
  declare enum SpotMarketStatus {
781
828
  Halted = "halted",
@@ -1261,6 +1308,8 @@ declare class Client {
1261
1308
  getUserTransfersHistory: (request: GetUserTransferHistoryRequest) => Promise<GetUserTransferHistoryResponse>;
1262
1309
  getBorrowLendHistoricalState: (request: GetBorrowLendingHistoricalDataRequest) => Promise<GetBorrowLendingHistoricalDataResponse>;
1263
1310
  getBorrowLendAggregatedStats: (request: GetBorrowLendingAggregatedStatsRequest) => Promise<GetBorrowLendingAggregatedStatsResponse>;
1311
+ getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
1312
+ getTokenAggregatedStats: (request: GetTokenAggregatedStatsRequest) => Promise<GetTokenAggregatedStatsResponse>;
1264
1313
  getTime: () => Promise<string>;
1265
1314
  }
1266
1315
 
@@ -1293,4 +1342,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
1293
1342
  declare const getTopicFromCommand: (data: WsCommand) => string;
1294
1343
  declare const getTopicFromMessage: (data: WsMessage) => string;
1295
1344
 
1296
- export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
1345
+ export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
package/dist/index.js CHANGED
@@ -623,6 +623,8 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
623
623
  EndpointsV12["SetUserReferralParams"] = "/v1/set_user_referral_params";
624
624
  EndpointsV12["GetBorrowLendHistoricalData"] = "/v1/get_borrow_lend_historical_data";
625
625
  EndpointsV12["GetBorrowLendAggregatedData"] = "/v1/get_borrow_lend_aggregated_data";
626
+ EndpointsV12["GetTokensStats"] = "/v1/get_tokens_stats";
627
+ EndpointsV12["GetTokensAggregatedStats"] = "/v1/get_tokens_aggregated_stats";
626
628
  return EndpointsV12;
627
629
  })(EndpointsV1 || {});
628
630
  var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
@@ -1207,6 +1209,17 @@ var Client = class _Client {
1207
1209
  const response = await this.sendGetJson("/v1/get_borrow_lend_aggregated_data" /* GetBorrowLendAggregatedData */, request);
1208
1210
  return response;
1209
1211
  };
1212
+ this.getTokenStats = async (request) => {
1213
+ if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
1214
+ throw new Error("olderTimestampMs must be lower than newerTimestampMs");
1215
+ }
1216
+ const response = await this.sendGetJson("/v1/get_tokens_stats" /* GetTokensStats */, request);
1217
+ return response;
1218
+ };
1219
+ this.getTokenAggregatedStats = async (request) => {
1220
+ const response = await this.sendGetJson("/v1/get_tokens_aggregated_stats" /* GetTokensAggregatedStats */, request);
1221
+ return response;
1222
+ };
1210
1223
  // Meta
1211
1224
  this.getTime = async () => {
1212
1225
  const response = await this.sendGetJson("/time" /* Time */);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nightlylabs/dex-sdk",
3
- "version": "0.0.95",
3
+ "version": "0.0.96",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {