@nightlylabs/dex-sdk 0.0.68 → 0.0.70

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
@@ -490,6 +490,10 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
490
490
  EndpointsV12["GetUserFundingHistory"] = "/v1/get_user_funding_history";
491
491
  EndpointsV12["GetUserPortfolioValue"] = "/v1/get_user_portfolio_value";
492
492
  EndpointsV12["SyncStatus"] = "/v1/sync_status";
493
+ EndpointsV12["GetUserAggregatedReferral"] = "/v1/get_user_aggregated_referral";
494
+ EndpointsV12["GetUserAggregatedStats"] = "/v1/get_user_aggregated_stats";
495
+ EndpointsV12["GetUserReferralStats"] = "/v1/get_user_referral_stats";
496
+ EndpointsV12["GetUserTradeStats"] = "/v1/get_user_trade_stats";
493
497
  return EndpointsV12;
494
498
  })(EndpointsV1 || {});
495
499
  var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
@@ -990,6 +994,28 @@ var Client = class _Client {
990
994
  const response = await this.sendGetJson("/v1/get_user_portfolio_value" /* GetUserPortfolioValue */, request);
991
995
  return response;
992
996
  };
997
+ this.getUserTradeStatsHistory = async (request) => {
998
+ if (request.timestampEndMs && request.timestampStartMs && request.timestampEndMs > request.timestampStartMs) {
999
+ throw new Error("timestampEndMs must be lower than timestampStartMs");
1000
+ }
1001
+ const response = await this.sendGetJson("/v1/get_user_trade_stats" /* GetUserTradeStats */, request);
1002
+ return response;
1003
+ };
1004
+ this.getUserAggregatedStats = async (request) => {
1005
+ const response = await this.sendGetJson("/v1/get_user_aggregated_stats" /* GetUserAggregatedStats */, request);
1006
+ return response;
1007
+ };
1008
+ this.getUserReferralStatsHistory = async (request) => {
1009
+ if (request.timestampEndMs && request.timestampStartMs && request.timestampEndMs > request.timestampStartMs) {
1010
+ throw new Error("timestampEndMs must be lower than timestampStartMs");
1011
+ }
1012
+ const response = await this.sendGetJson("/v1/get_user_referral_stats" /* GetUserReferralStats */, request);
1013
+ return response;
1014
+ };
1015
+ this.getUserAggregatedReferralStats = async (request) => {
1016
+ const response = await this.sendGetJson("/v1/get_user_aggregated_referral" /* GetUserAggregatedReferral */, request);
1017
+ return response;
1018
+ };
993
1019
  // Meta
994
1020
  this.getTime = async () => {
995
1021
  const response = await this.sendGetJson("/time" /* Time */);
package/dist/index.d.cts CHANGED
@@ -297,6 +297,36 @@ interface GetTokensConfigResponse {
297
297
  tokens: Record<string, TokenConfigEntry>;
298
298
  usdcAddress?: string;
299
299
  }
300
+ interface GetUserAggregatedReferralStatsRequest {
301
+ userId: string;
302
+ paginationCursor?: PaginationCursor;
303
+ }
304
+ interface UserAggregatedReferralStats {
305
+ referralOwnerId: string;
306
+ referralUserId: string;
307
+ accReferralValue: string;
308
+ referredUserVolume: string;
309
+ }
310
+ interface GetUserAggregatedReferralStatsResponse {
311
+ stats: UserAggregatedReferralStats[];
312
+ paginationCursor?: PaginationCursor;
313
+ }
314
+ interface GetUserAggregatedStatsRequest {
315
+ userId: string;
316
+ }
317
+ interface UserAggregatedStats {
318
+ userId: string;
319
+ spotVolume: string;
320
+ perpVolume: string;
321
+ liquidationVolume: string;
322
+ depositValue: string;
323
+ paidFee: string;
324
+ spotTradesCount: string;
325
+ perpTradesCount: string;
326
+ }
327
+ interface GetUserAggregatedStatsResponse {
328
+ userAggregatedStats: UserAggregatedStats;
329
+ }
300
330
  interface GetUserDataRequest {
301
331
  userId: string;
302
332
  }
@@ -390,6 +420,41 @@ interface GetUserPortfolioValueResponse {
390
420
  portfolioValues: UserPortfolioValue[];
391
421
  paginationCursor?: PaginationCursor;
392
422
  }
423
+ interface GetUserReferralStatsHistoryRequest {
424
+ userId: string;
425
+ timestampStartMs?: string;
426
+ timestampEndMs?: string;
427
+ paginationCursor?: PaginationCursor;
428
+ }
429
+ interface HistoricalReferralStats {
430
+ userId: string;
431
+ referralsValue: Record<string, string>;
432
+ timestampOpen: string;
433
+ timestampClose: string;
434
+ }
435
+ interface GetUserReferralStatsHistoryResponse {
436
+ stats: HistoricalReferralStats[];
437
+ paginationCursor?: PaginationCursor;
438
+ }
439
+ interface GetUserTradeStatsHistoryRequest {
440
+ userId: string;
441
+ timestampStartMs?: string;
442
+ timestampEndMs?: string;
443
+ paginationCursor?: PaginationCursor;
444
+ }
445
+ interface HistoricalTradeStats {
446
+ userId: string;
447
+ tradeVolumeSpot: string;
448
+ tradeVolumePerp: string;
449
+ tradeCountSpot: string;
450
+ tradeCountPerp: string;
451
+ timestampOpen: string;
452
+ timestampClose: string;
453
+ }
454
+ interface GetUserTradeStatsHistoryResponse {
455
+ stats: HistoricalTradeStats[];
456
+ paginationCursor?: PaginationCursor;
457
+ }
393
458
  interface GetUserWithdrawalsRequest {
394
459
  userId: string;
395
460
  paginationCursor?: PaginationCursor;
@@ -559,7 +624,11 @@ declare enum EndpointsV1 {
559
624
  GetUserWithdrawals = "/v1/get_user_withdrawals",
560
625
  GetUserFundingHistory = "/v1/get_user_funding_history",
561
626
  GetUserPortfolioValue = "/v1/get_user_portfolio_value",
562
- SyncStatus = "/v1/sync_status"
627
+ SyncStatus = "/v1/sync_status",
628
+ GetUserAggregatedReferral = "/v1/get_user_aggregated_referral",
629
+ GetUserAggregatedStats = "/v1/get_user_aggregated_stats",
630
+ GetUserReferralStats = "/v1/get_user_referral_stats",
631
+ GetUserTradeStats = "/v1/get_user_trade_stats"
563
632
  }
564
633
  type Topic = {
565
634
  type: "Market";
@@ -859,6 +928,10 @@ declare class Client {
859
928
  getUserHistoricalDeposits: (request: GetUserDepositsRequest) => Promise<GetUserDepositsResponse>;
860
929
  getUserWithdrawalsHistory: (request: GetUserWithdrawalsRequest) => Promise<GetUserWithdrawalsResponse>;
861
930
  getUserPortfolioValueHistory: (request: GetUserPortfolioValueRequest) => Promise<GetUserPortfolioValueResponse>;
931
+ getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
932
+ getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
933
+ getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
934
+ getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
862
935
  getTime: () => Promise<string>;
863
936
  }
864
937
  interface ChangePerpOrderPriceParams {
@@ -992,4 +1065,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
992
1065
  declare const getTopicFromCommand: (data: WsCommand) => string;
993
1066
  declare const getTopicFromMessage: (data: WsMessage) => string;
994
1067
 
995
- export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, 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 PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlacePerpLimitOrder, type PlacePerpLimitOrderParams, type PlacePerpMarketOrder, type PlacePerpMarketOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type User, type UserPortfolioValue, UserStatus, 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 };
1068
+ export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, 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 PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlacePerpLimitOrder, type PlacePerpLimitOrderParams, type PlacePerpMarketOrder, type PlacePerpMarketOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, 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
@@ -297,6 +297,36 @@ interface GetTokensConfigResponse {
297
297
  tokens: Record<string, TokenConfigEntry>;
298
298
  usdcAddress?: string;
299
299
  }
300
+ interface GetUserAggregatedReferralStatsRequest {
301
+ userId: string;
302
+ paginationCursor?: PaginationCursor;
303
+ }
304
+ interface UserAggregatedReferralStats {
305
+ referralOwnerId: string;
306
+ referralUserId: string;
307
+ accReferralValue: string;
308
+ referredUserVolume: string;
309
+ }
310
+ interface GetUserAggregatedReferralStatsResponse {
311
+ stats: UserAggregatedReferralStats[];
312
+ paginationCursor?: PaginationCursor;
313
+ }
314
+ interface GetUserAggregatedStatsRequest {
315
+ userId: string;
316
+ }
317
+ interface UserAggregatedStats {
318
+ userId: string;
319
+ spotVolume: string;
320
+ perpVolume: string;
321
+ liquidationVolume: string;
322
+ depositValue: string;
323
+ paidFee: string;
324
+ spotTradesCount: string;
325
+ perpTradesCount: string;
326
+ }
327
+ interface GetUserAggregatedStatsResponse {
328
+ userAggregatedStats: UserAggregatedStats;
329
+ }
300
330
  interface GetUserDataRequest {
301
331
  userId: string;
302
332
  }
@@ -390,6 +420,41 @@ interface GetUserPortfolioValueResponse {
390
420
  portfolioValues: UserPortfolioValue[];
391
421
  paginationCursor?: PaginationCursor;
392
422
  }
423
+ interface GetUserReferralStatsHistoryRequest {
424
+ userId: string;
425
+ timestampStartMs?: string;
426
+ timestampEndMs?: string;
427
+ paginationCursor?: PaginationCursor;
428
+ }
429
+ interface HistoricalReferralStats {
430
+ userId: string;
431
+ referralsValue: Record<string, string>;
432
+ timestampOpen: string;
433
+ timestampClose: string;
434
+ }
435
+ interface GetUserReferralStatsHistoryResponse {
436
+ stats: HistoricalReferralStats[];
437
+ paginationCursor?: PaginationCursor;
438
+ }
439
+ interface GetUserTradeStatsHistoryRequest {
440
+ userId: string;
441
+ timestampStartMs?: string;
442
+ timestampEndMs?: string;
443
+ paginationCursor?: PaginationCursor;
444
+ }
445
+ interface HistoricalTradeStats {
446
+ userId: string;
447
+ tradeVolumeSpot: string;
448
+ tradeVolumePerp: string;
449
+ tradeCountSpot: string;
450
+ tradeCountPerp: string;
451
+ timestampOpen: string;
452
+ timestampClose: string;
453
+ }
454
+ interface GetUserTradeStatsHistoryResponse {
455
+ stats: HistoricalTradeStats[];
456
+ paginationCursor?: PaginationCursor;
457
+ }
393
458
  interface GetUserWithdrawalsRequest {
394
459
  userId: string;
395
460
  paginationCursor?: PaginationCursor;
@@ -559,7 +624,11 @@ declare enum EndpointsV1 {
559
624
  GetUserWithdrawals = "/v1/get_user_withdrawals",
560
625
  GetUserFundingHistory = "/v1/get_user_funding_history",
561
626
  GetUserPortfolioValue = "/v1/get_user_portfolio_value",
562
- SyncStatus = "/v1/sync_status"
627
+ SyncStatus = "/v1/sync_status",
628
+ GetUserAggregatedReferral = "/v1/get_user_aggregated_referral",
629
+ GetUserAggregatedStats = "/v1/get_user_aggregated_stats",
630
+ GetUserReferralStats = "/v1/get_user_referral_stats",
631
+ GetUserTradeStats = "/v1/get_user_trade_stats"
563
632
  }
564
633
  type Topic = {
565
634
  type: "Market";
@@ -859,6 +928,10 @@ declare class Client {
859
928
  getUserHistoricalDeposits: (request: GetUserDepositsRequest) => Promise<GetUserDepositsResponse>;
860
929
  getUserWithdrawalsHistory: (request: GetUserWithdrawalsRequest) => Promise<GetUserWithdrawalsResponse>;
861
930
  getUserPortfolioValueHistory: (request: GetUserPortfolioValueRequest) => Promise<GetUserPortfolioValueResponse>;
931
+ getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
932
+ getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
933
+ getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
934
+ getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
862
935
  getTime: () => Promise<string>;
863
936
  }
864
937
  interface ChangePerpOrderPriceParams {
@@ -992,4 +1065,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
992
1065
  declare const getTopicFromCommand: (data: WsCommand) => string;
993
1066
  declare const getTopicFromMessage: (data: WsMessage) => string;
994
1067
 
995
- export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, 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 PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlacePerpLimitOrder, type PlacePerpLimitOrderParams, type PlacePerpMarketOrder, type PlacePerpMarketOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type User, type UserPortfolioValue, UserStatus, 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 };
1068
+ export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, 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 PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlacePerpLimitOrder, type PlacePerpLimitOrderParams, type PlacePerpMarketOrder, type PlacePerpMarketOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, 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
@@ -439,6 +439,10 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
439
439
  EndpointsV12["GetUserFundingHistory"] = "/v1/get_user_funding_history";
440
440
  EndpointsV12["GetUserPortfolioValue"] = "/v1/get_user_portfolio_value";
441
441
  EndpointsV12["SyncStatus"] = "/v1/sync_status";
442
+ EndpointsV12["GetUserAggregatedReferral"] = "/v1/get_user_aggregated_referral";
443
+ EndpointsV12["GetUserAggregatedStats"] = "/v1/get_user_aggregated_stats";
444
+ EndpointsV12["GetUserReferralStats"] = "/v1/get_user_referral_stats";
445
+ EndpointsV12["GetUserTradeStats"] = "/v1/get_user_trade_stats";
442
446
  return EndpointsV12;
443
447
  })(EndpointsV1 || {});
444
448
  var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
@@ -939,6 +943,28 @@ var Client = class _Client {
939
943
  const response = await this.sendGetJson("/v1/get_user_portfolio_value" /* GetUserPortfolioValue */, request);
940
944
  return response;
941
945
  };
946
+ this.getUserTradeStatsHistory = async (request) => {
947
+ if (request.timestampEndMs && request.timestampStartMs && request.timestampEndMs > request.timestampStartMs) {
948
+ throw new Error("timestampEndMs must be lower than timestampStartMs");
949
+ }
950
+ const response = await this.sendGetJson("/v1/get_user_trade_stats" /* GetUserTradeStats */, request);
951
+ return response;
952
+ };
953
+ this.getUserAggregatedStats = async (request) => {
954
+ const response = await this.sendGetJson("/v1/get_user_aggregated_stats" /* GetUserAggregatedStats */, request);
955
+ return response;
956
+ };
957
+ this.getUserReferralStatsHistory = async (request) => {
958
+ if (request.timestampEndMs && request.timestampStartMs && request.timestampEndMs > request.timestampStartMs) {
959
+ throw new Error("timestampEndMs must be lower than timestampStartMs");
960
+ }
961
+ const response = await this.sendGetJson("/v1/get_user_referral_stats" /* GetUserReferralStats */, request);
962
+ return response;
963
+ };
964
+ this.getUserAggregatedReferralStats = async (request) => {
965
+ const response = await this.sendGetJson("/v1/get_user_aggregated_referral" /* GetUserAggregatedReferral */, request);
966
+ return response;
967
+ };
942
968
  // Meta
943
969
  this.getTime = async () => {
944
970
  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.68",
3
+ "version": "0.0.70",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -40,8 +40,8 @@
40
40
  "license": "ISC",
41
41
  "packageManager": "pnpm@9.3.0+sha512.ee7b93e0c2bd11409c6424f92b866f31d3ea1bef5fbe47d3c7500cdc3c9668833d2e55681ad66df5b640c61fa9dc25d546efa54d76d7f8bf54b13614ac293631",
42
42
  "dependencies": {
43
- "@aptos-labs/ts-sdk": "1.35.0",
44
- "@thalalabs/surf": "1.8.1",
43
+ "@aptos-labs/ts-sdk": "1.38.0",
44
+ "@thalalabs/surf": "1.9.2",
45
45
  "decimal.js": "^10.5.0",
46
46
  "isomorphic-ws": "^5.0.0",
47
47
  "uuid": "^11.0.5"