@nightlylabs/dex-sdk 1.0.13 → 1.0.14
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 +151 -2
- package/dist/index.d.cts +264 -1
- package/dist/index.d.ts +264 -1
- package/dist/index.js +150 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
ChartInterval: () => ChartInterval,
|
|
28
28
|
Client: () => Client,
|
|
29
29
|
EndpointsV1: () => EndpointsV1,
|
|
30
|
+
EndpointsV2: () => EndpointsV2,
|
|
30
31
|
ExchangeProxies: () => ExchangeProxies,
|
|
31
32
|
GLOBAL_DENOMINATOR: () => GLOBAL_DENOMINATOR,
|
|
32
33
|
MAINNET_CONFIG: () => MAINNET_CONFIG,
|
|
@@ -181,6 +182,18 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
181
182
|
EndpointsV12["GetExchangeStatsHistory"] = "/v1/get_exchange_stats_history";
|
|
182
183
|
return EndpointsV12;
|
|
183
184
|
})(EndpointsV1 || {});
|
|
185
|
+
var EndpointsV2 = /* @__PURE__ */ ((EndpointsV22) => {
|
|
186
|
+
EndpointsV22["GetUserAggregatedStats"] = "/v2/get_user_aggregated_stats";
|
|
187
|
+
EndpointsV22["GetUserAggregatedReferral"] = "/v2/get_user_aggregated_referral";
|
|
188
|
+
EndpointsV22["GetUserReferralStats"] = "/v2/get_user_referral_stats";
|
|
189
|
+
EndpointsV22["GetUserTradeStats"] = "/v2/get_user_trade_stats";
|
|
190
|
+
EndpointsV22["GetUserAggregatedBoxRewardsStats"] = "/v2/get_user_aggregated_box_rewards_stats";
|
|
191
|
+
EndpointsV22["GetUserBoxRewardsStats"] = "/v2/get_user_box_rewards_stats";
|
|
192
|
+
EndpointsV22["GetUserRewardsValue"] = "/v2/get_user_rewards_value";
|
|
193
|
+
EndpointsV22["GetUserAggregatedRewardsValue"] = "/v2/get_user_aggregated_rewards_value";
|
|
194
|
+
EndpointsV22["GetUserAggregatedLiquidationStats"] = "/v2/get_user_aggregated_liquidation_stats";
|
|
195
|
+
return EndpointsV22;
|
|
196
|
+
})(EndpointsV2 || {});
|
|
184
197
|
var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
185
198
|
UserStatus2["Active"] = "Active";
|
|
186
199
|
UserStatus2["Locked"] = "Locked";
|
|
@@ -24181,7 +24194,7 @@ var Client = class _Client {
|
|
|
24181
24194
|
maxGasAmount: tx.rawTransaction.max_gas_amount.toString(),
|
|
24182
24195
|
gasUnitPrice: tx.rawTransaction.gas_unit_price.toString(),
|
|
24183
24196
|
expirationTimestampSecs: tx.rawTransaction.expiration_timestamp_secs.toString(),
|
|
24184
|
-
chainId:
|
|
24197
|
+
chainId: tx.rawTransaction.chain_id.chainId.toString(),
|
|
24185
24198
|
authenticator: Array.from(signature.bcsToBytes()),
|
|
24186
24199
|
secondarySigners: [],
|
|
24187
24200
|
secondarySignersAuthenticators: []
|
|
@@ -24209,7 +24222,7 @@ var Client = class _Client {
|
|
|
24209
24222
|
maxGasAmount: tx.rawTransaction.max_gas_amount.toString(),
|
|
24210
24223
|
gasUnitPrice: tx.rawTransaction.gas_unit_price.toString(),
|
|
24211
24224
|
expirationTimestampSecs: tx.rawTransaction.expiration_timestamp_secs.toString(),
|
|
24212
|
-
chainId:
|
|
24225
|
+
chainId: tx.rawTransaction.chain_id.chainId.toString(),
|
|
24213
24226
|
authenticator: Array.from(signature.bcsToBytes()),
|
|
24214
24227
|
secondarySigners: tx.secondarySignerAddresses.map((s) => s.toString()),
|
|
24215
24228
|
secondarySignersAuthenticators: secondarySignersAuthenticators.map(
|
|
@@ -24607,6 +24620,7 @@ var Client = class _Client {
|
|
|
24607
24620
|
/**
|
|
24608
24621
|
* getUserRewardsValueHistory.
|
|
24609
24622
|
*
|
|
24623
|
+
* @deprecated Use {@link getUserRewardsValueHistoryV2} — per-token amount and USD value breakdown.
|
|
24610
24624
|
* @param request - See {@link GetUserRewardsValueRequest}.
|
|
24611
24625
|
*/
|
|
24612
24626
|
this.getUserRewardsValueHistory = async (request) => {
|
|
@@ -24622,6 +24636,7 @@ var Client = class _Client {
|
|
|
24622
24636
|
/**
|
|
24623
24637
|
* getUserTradeStatsHistory.
|
|
24624
24638
|
*
|
|
24639
|
+
* @deprecated Use {@link getUserTradeStatsHistoryV2} — per-market trade breakdown via MarketStats.
|
|
24625
24640
|
* @param request - See {@link GetUserTradeStatsHistoryRequest}.
|
|
24626
24641
|
*/
|
|
24627
24642
|
this.getUserTradeStatsHistory = async (request) => {
|
|
@@ -24637,6 +24652,7 @@ var Client = class _Client {
|
|
|
24637
24652
|
/**
|
|
24638
24653
|
* getUserAggregatedStats.
|
|
24639
24654
|
*
|
|
24655
|
+
* @deprecated Use {@link getUserAggregatedStatsV2} — per-market breakdown and per-token USD values.
|
|
24640
24656
|
* @param request - See {@link GetUserAggregatedStatsRequest}.
|
|
24641
24657
|
*/
|
|
24642
24658
|
this.getUserAggregatedStats = async (request) => {
|
|
@@ -24649,6 +24665,7 @@ var Client = class _Client {
|
|
|
24649
24665
|
/**
|
|
24650
24666
|
* getUserBoxRewardsStatsHistory.
|
|
24651
24667
|
*
|
|
24668
|
+
* @deprecated Use {@link getUserBoxRewardsStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
24652
24669
|
* @param request - See {@link GetUserBoxRewardsStatsHistoryRequest}.
|
|
24653
24670
|
*/
|
|
24654
24671
|
this.getUserBoxRewardsStatsHistory = async (request) => {
|
|
@@ -24664,6 +24681,7 @@ var Client = class _Client {
|
|
|
24664
24681
|
/**
|
|
24665
24682
|
* getUserAggregatedBoxRewardsStats.
|
|
24666
24683
|
*
|
|
24684
|
+
* @deprecated Use {@link getUserAggregatedBoxRewardsStatsV2} — per-token amount and USD value breakdown.
|
|
24667
24685
|
* @param request - See {@link GetUserAggregatedBoxRewardsStatsRequest}.
|
|
24668
24686
|
*/
|
|
24669
24687
|
this.getUserAggregatedBoxRewardsStats = async (request) => {
|
|
@@ -24676,6 +24694,7 @@ var Client = class _Client {
|
|
|
24676
24694
|
/**
|
|
24677
24695
|
* getUserReferralStatsHistory.
|
|
24678
24696
|
*
|
|
24697
|
+
* @deprecated Use {@link getUserReferralStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
24679
24698
|
* @param request - See {@link GetUserReferralStatsHistoryRequest}.
|
|
24680
24699
|
*/
|
|
24681
24700
|
this.getUserReferralStatsHistory = async (request) => {
|
|
@@ -24691,6 +24710,7 @@ var Client = class _Client {
|
|
|
24691
24710
|
/**
|
|
24692
24711
|
* getUserAggregatedReferralStats.
|
|
24693
24712
|
*
|
|
24713
|
+
* @deprecated Use {@link getUserAggregatedReferralStatsV2} — per-token amount and USD value breakdown.
|
|
24694
24714
|
* @param request - See {@link GetUserAggregatedReferralStatsRequest}.
|
|
24695
24715
|
*/
|
|
24696
24716
|
this.getUserAggregatedReferralStats = async (request) => {
|
|
@@ -24700,6 +24720,134 @@ var Client = class _Client {
|
|
|
24700
24720
|
);
|
|
24701
24721
|
return response;
|
|
24702
24722
|
};
|
|
24723
|
+
// ─── v2 endpoints ──────────────────────────────────────────────────────────
|
|
24724
|
+
// Per-market trade breakdowns and per-token (amount, usdValue) tuples.
|
|
24725
|
+
/**
|
|
24726
|
+
* getUserRewardsValueHistoryV2.
|
|
24727
|
+
*
|
|
24728
|
+
* @param request - See {@link GetUserRewardsValueV2Request}.
|
|
24729
|
+
*/
|
|
24730
|
+
this.getUserRewardsValueHistoryV2 = async (request) => {
|
|
24731
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24732
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24733
|
+
}
|
|
24734
|
+
const response = await this.sendGetJson(
|
|
24735
|
+
"/v2/get_user_rewards_value" /* GetUserRewardsValue */,
|
|
24736
|
+
request
|
|
24737
|
+
);
|
|
24738
|
+
return response;
|
|
24739
|
+
};
|
|
24740
|
+
/**
|
|
24741
|
+
* getUserTradeStatsHistoryV2.
|
|
24742
|
+
*
|
|
24743
|
+
* @param request - See {@link GetUserTradeStatsV2HistoryRequest}.
|
|
24744
|
+
*/
|
|
24745
|
+
this.getUserTradeStatsHistoryV2 = async (request) => {
|
|
24746
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24747
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24748
|
+
}
|
|
24749
|
+
const response = await this.sendGetJson(
|
|
24750
|
+
"/v2/get_user_trade_stats" /* GetUserTradeStats */,
|
|
24751
|
+
request
|
|
24752
|
+
);
|
|
24753
|
+
return response;
|
|
24754
|
+
};
|
|
24755
|
+
/**
|
|
24756
|
+
* getUserAggregatedStatsV2.
|
|
24757
|
+
*
|
|
24758
|
+
* @param request - See {@link GetUserAggregatedStatsV2Request}.
|
|
24759
|
+
*/
|
|
24760
|
+
this.getUserAggregatedStatsV2 = async (request) => {
|
|
24761
|
+
const response = await this.sendGetJson(
|
|
24762
|
+
"/v2/get_user_aggregated_stats" /* GetUserAggregatedStats */,
|
|
24763
|
+
request
|
|
24764
|
+
);
|
|
24765
|
+
return response;
|
|
24766
|
+
};
|
|
24767
|
+
/**
|
|
24768
|
+
* getUserBoxRewardsStatsHistoryV2.
|
|
24769
|
+
*
|
|
24770
|
+
* @param request - See {@link GetUserBoxRewardsStatsV2HistoryRequest}.
|
|
24771
|
+
*/
|
|
24772
|
+
this.getUserBoxRewardsStatsHistoryV2 = async (request) => {
|
|
24773
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24774
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24775
|
+
}
|
|
24776
|
+
const response = await this.sendGetJson(
|
|
24777
|
+
"/v2/get_user_box_rewards_stats" /* GetUserBoxRewardsStats */,
|
|
24778
|
+
request
|
|
24779
|
+
);
|
|
24780
|
+
return response;
|
|
24781
|
+
};
|
|
24782
|
+
/**
|
|
24783
|
+
* getUserAggregatedBoxRewardsStatsV2.
|
|
24784
|
+
*
|
|
24785
|
+
* @param request - See {@link GetUserAggregatedBoxRewardsStatsV2Request}.
|
|
24786
|
+
*/
|
|
24787
|
+
this.getUserAggregatedBoxRewardsStatsV2 = async (request) => {
|
|
24788
|
+
const response = await this.sendGetJson(
|
|
24789
|
+
"/v2/get_user_aggregated_box_rewards_stats" /* GetUserAggregatedBoxRewardsStats */,
|
|
24790
|
+
request
|
|
24791
|
+
);
|
|
24792
|
+
return response;
|
|
24793
|
+
};
|
|
24794
|
+
/**
|
|
24795
|
+
* getUserReferralStatsHistoryV2.
|
|
24796
|
+
*
|
|
24797
|
+
* @param request - See {@link GetUserReferralStatsV2HistoryRequest}.
|
|
24798
|
+
*/
|
|
24799
|
+
this.getUserReferralStatsHistoryV2 = async (request) => {
|
|
24800
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24801
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24802
|
+
}
|
|
24803
|
+
const response = await this.sendGetJson(
|
|
24804
|
+
"/v2/get_user_referral_stats" /* GetUserReferralStats */,
|
|
24805
|
+
request
|
|
24806
|
+
);
|
|
24807
|
+
return response;
|
|
24808
|
+
};
|
|
24809
|
+
/**
|
|
24810
|
+
* getUserAggregatedReferralStatsV2.
|
|
24811
|
+
*
|
|
24812
|
+
* @param request - See {@link GetUserAggregatedReferralStatsV2Request}.
|
|
24813
|
+
*/
|
|
24814
|
+
this.getUserAggregatedReferralStatsV2 = async (request) => {
|
|
24815
|
+
const response = await this.sendGetJson(
|
|
24816
|
+
"/v2/get_user_aggregated_referral" /* GetUserAggregatedReferral */,
|
|
24817
|
+
request
|
|
24818
|
+
);
|
|
24819
|
+
return response;
|
|
24820
|
+
};
|
|
24821
|
+
/**
|
|
24822
|
+
* getUserAggregatedRewardsValue.
|
|
24823
|
+
*
|
|
24824
|
+
* Lifetime aggregated reward earnings with per-token amount and USD value breakdown.
|
|
24825
|
+
* v2-only — no v1 equivalent.
|
|
24826
|
+
*
|
|
24827
|
+
* @param request - See {@link GetUserAggregatedRewardsValueRequest}.
|
|
24828
|
+
*/
|
|
24829
|
+
this.getUserAggregatedRewardsValue = async (request) => {
|
|
24830
|
+
const response = await this.sendGetJson(
|
|
24831
|
+
"/v2/get_user_aggregated_rewards_value" /* GetUserAggregatedRewardsValue */,
|
|
24832
|
+
request
|
|
24833
|
+
);
|
|
24834
|
+
return response;
|
|
24835
|
+
};
|
|
24836
|
+
/**
|
|
24837
|
+
* getUserAggregatedLiquidationStats.
|
|
24838
|
+
*
|
|
24839
|
+
* Lifetime liquidation stats with per-market and per-token breakdowns.
|
|
24840
|
+
* v2-only — no v1 equivalent.
|
|
24841
|
+
*
|
|
24842
|
+
* @param request - See {@link GetUserAggregatedLiquidationStatsRequest}.
|
|
24843
|
+
*/
|
|
24844
|
+
this.getUserAggregatedLiquidationStats = async (request) => {
|
|
24845
|
+
const response = await this.sendGetJson(
|
|
24846
|
+
"/v2/get_user_aggregated_liquidation_stats" /* GetUserAggregatedLiquidationStats */,
|
|
24847
|
+
request
|
|
24848
|
+
);
|
|
24849
|
+
return response;
|
|
24850
|
+
};
|
|
24703
24851
|
/**
|
|
24704
24852
|
* getUserClaimedKickbackHistory.
|
|
24705
24853
|
*
|
|
@@ -26830,6 +26978,7 @@ var TestFaucet = class _TestFaucet extends client_default {
|
|
|
26830
26978
|
ChartInterval,
|
|
26831
26979
|
Client,
|
|
26832
26980
|
EndpointsV1,
|
|
26981
|
+
EndpointsV2,
|
|
26833
26982
|
ExchangeProxies,
|
|
26834
26983
|
GLOBAL_DENOMINATOR,
|
|
26835
26984
|
MAINNET_CONFIG,
|
package/dist/index.d.cts
CHANGED
|
@@ -753,6 +753,63 @@ interface UserAggregatedBoxRewardsStats {
|
|
|
753
753
|
interface GetUserAggregatedBoxRewardsStatsResponse {
|
|
754
754
|
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStats;
|
|
755
755
|
}
|
|
756
|
+
interface GetUserAggregatedBoxRewardsStatsV2Request {
|
|
757
|
+
userId: string;
|
|
758
|
+
}
|
|
759
|
+
interface TokenAmountUsd {
|
|
760
|
+
amount: string;
|
|
761
|
+
valueUsd: string;
|
|
762
|
+
}
|
|
763
|
+
interface UserAggregatedBoxRewardsStatsV2 {
|
|
764
|
+
userId: string;
|
|
765
|
+
boxOpeningCount: Record<string, string>;
|
|
766
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
767
|
+
tokenRewards: Record<string, TokenAmountUsd>;
|
|
768
|
+
badges: Record<BoxRewardTier, string>;
|
|
769
|
+
pointsRewardsTotal: string;
|
|
770
|
+
pointsCostTotal: string;
|
|
771
|
+
totalEarnedInUsd: string;
|
|
772
|
+
}
|
|
773
|
+
interface GetUserAggregatedBoxRewardsStatsV2Response {
|
|
774
|
+
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStatsV2;
|
|
775
|
+
}
|
|
776
|
+
interface GetUserAggregatedLiquidationStatsRequest {
|
|
777
|
+
userId: string;
|
|
778
|
+
}
|
|
779
|
+
interface MarketLiquidationStats {
|
|
780
|
+
fullSize: string;
|
|
781
|
+
fullNotionalUsd: string;
|
|
782
|
+
fullPenaltyUsd: string;
|
|
783
|
+
fullCount: string;
|
|
784
|
+
partialSize: string;
|
|
785
|
+
partialNotionalUsd: string;
|
|
786
|
+
partialPenaltyUsd: string;
|
|
787
|
+
partialCount: string;
|
|
788
|
+
}
|
|
789
|
+
interface TokenLiquidationStats {
|
|
790
|
+
borrowShares: string;
|
|
791
|
+
borrowPenaltyUsd: string;
|
|
792
|
+
lendShares: string;
|
|
793
|
+
lendDebtReductionUsd: string;
|
|
794
|
+
lendPenaltyUsd: string;
|
|
795
|
+
collateralAmount: string;
|
|
796
|
+
collateralDebtReductionUsd: string;
|
|
797
|
+
collateralPenaltyUsd: string;
|
|
798
|
+
liquidationCount: string;
|
|
799
|
+
}
|
|
800
|
+
interface UserAggregatedLiquidationStats {
|
|
801
|
+
userId: string;
|
|
802
|
+
fullLiquidationCount: string;
|
|
803
|
+
partialLiquidationCount: string;
|
|
804
|
+
totalFullLiquidationValueUsd: string;
|
|
805
|
+
totalPartialLiquidationValueUsd: string;
|
|
806
|
+
totalUnpaidDebtUsd: string;
|
|
807
|
+
marketStats: Record<string, MarketLiquidationStats>;
|
|
808
|
+
tokenStats: Record<string, TokenLiquidationStats>;
|
|
809
|
+
}
|
|
810
|
+
interface GetUserAggregatedLiquidationStatsResponse {
|
|
811
|
+
userAggregatedLiquidationStats: UserAggregatedLiquidationStats;
|
|
812
|
+
}
|
|
756
813
|
interface GetUserAggregatedReferralStatsRequest {
|
|
757
814
|
userId: string;
|
|
758
815
|
paginationCursor?: PaginationCursor;
|
|
@@ -770,6 +827,34 @@ interface GetUserAggregatedReferralStatsResponse {
|
|
|
770
827
|
stats: UserAggregatedReferralStats[];
|
|
771
828
|
paginationCursor?: PaginationCursor;
|
|
772
829
|
}
|
|
830
|
+
interface GetUserAggregatedReferralStatsV2Request {
|
|
831
|
+
userId: string;
|
|
832
|
+
paginationCursor?: PaginationCursor;
|
|
833
|
+
}
|
|
834
|
+
interface UserAggregatedReferralStatsV2 {
|
|
835
|
+
referralOwnerId: string;
|
|
836
|
+
referralUserId: string;
|
|
837
|
+
referralUserAlias: string;
|
|
838
|
+
referralUserRegistrationTimestamp: string;
|
|
839
|
+
accReferralValue: Record<string, TokenAmountUsd>;
|
|
840
|
+
referredUserVolume: string;
|
|
841
|
+
totalEarnedInUsd: string;
|
|
842
|
+
}
|
|
843
|
+
interface GetUserAggregatedReferralStatsV2Response {
|
|
844
|
+
stats: UserAggregatedReferralStatsV2[];
|
|
845
|
+
paginationCursor?: PaginationCursor;
|
|
846
|
+
}
|
|
847
|
+
interface GetUserAggregatedRewardsValueRequest {
|
|
848
|
+
userId: string;
|
|
849
|
+
}
|
|
850
|
+
interface UserAggregatedRewardsValue {
|
|
851
|
+
userId: string;
|
|
852
|
+
rewardsValue: Record<string, TokenAmountUsd>;
|
|
853
|
+
totalEarnedInUsd: string;
|
|
854
|
+
}
|
|
855
|
+
interface GetUserAggregatedRewardsValueResponse {
|
|
856
|
+
userAggregatedRewardsValue: UserAggregatedRewardsValue;
|
|
857
|
+
}
|
|
773
858
|
interface GetUserAggregatedStatsRequest {
|
|
774
859
|
userId: string;
|
|
775
860
|
}
|
|
@@ -793,6 +878,30 @@ interface UserAggregatedStats {
|
|
|
793
878
|
interface GetUserAggregatedStatsResponse {
|
|
794
879
|
userAggregatedStats: UserAggregatedStats;
|
|
795
880
|
}
|
|
881
|
+
interface GetUserAggregatedStatsV2Request {
|
|
882
|
+
userId: string;
|
|
883
|
+
}
|
|
884
|
+
interface MarketStatsResponse {
|
|
885
|
+
tradeVolumeMaker: string;
|
|
886
|
+
tradeVolumeTaker: string;
|
|
887
|
+
tradeCountMaker: string;
|
|
888
|
+
tradeCountTaker: string;
|
|
889
|
+
paidFeeMaker: string;
|
|
890
|
+
paidFeeTaker: string;
|
|
891
|
+
}
|
|
892
|
+
interface UserAggregatedStatsV2 {
|
|
893
|
+
userId: string;
|
|
894
|
+
spotStats: Record<string, MarketStatsResponse>;
|
|
895
|
+
perpStats: Record<string, MarketStatsResponse>;
|
|
896
|
+
earnedFee: Record<string, TokenAmountUsd>;
|
|
897
|
+
tokenDepositAmounts: Record<string, TokenAmountUsd>;
|
|
898
|
+
tokenWithdrawAmounts: Record<string, TokenAmountUsd>;
|
|
899
|
+
tokenTransferInAmounts: Record<string, TokenAmountUsd>;
|
|
900
|
+
tokenTransferOutAmounts: Record<string, TokenAmountUsd>;
|
|
901
|
+
}
|
|
902
|
+
interface GetUserAggregatedStatsV2Response {
|
|
903
|
+
userAggregatedStats: UserAggregatedStatsV2;
|
|
904
|
+
}
|
|
796
905
|
interface GetUserAggregatedVaultStatsRequest {
|
|
797
906
|
userId: string;
|
|
798
907
|
vaultId?: string;
|
|
@@ -829,6 +938,28 @@ interface GetUserBoxRewardsStatsHistoryResponse {
|
|
|
829
938
|
stats: HistoricalBoxRewardsStats[];
|
|
830
939
|
paginationCursor?: PaginationCursor;
|
|
831
940
|
}
|
|
941
|
+
interface GetUserBoxRewardsStatsV2HistoryRequest {
|
|
942
|
+
userId: string;
|
|
943
|
+
olderTimestampMs?: string;
|
|
944
|
+
newerTimestampMs?: string;
|
|
945
|
+
paginationCursor?: PaginationCursor;
|
|
946
|
+
}
|
|
947
|
+
interface HistoricalBoxRewardsStatsV2 {
|
|
948
|
+
userId: string;
|
|
949
|
+
boxOpeningCount: Record<string, string>;
|
|
950
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
951
|
+
tokenRewards: Record<string, TokenAmountUsd>;
|
|
952
|
+
badges: Record<BoxRewardTier, string>;
|
|
953
|
+
pointsRewardsTotal: string;
|
|
954
|
+
pointsCostTotal: string;
|
|
955
|
+
valueInUsd: string;
|
|
956
|
+
timestampOpen: string;
|
|
957
|
+
timestampClose: string;
|
|
958
|
+
}
|
|
959
|
+
interface GetUserBoxRewardsStatsV2HistoryResponse {
|
|
960
|
+
stats: HistoricalBoxRewardsStatsV2[];
|
|
961
|
+
paginationCursor?: PaginationCursor;
|
|
962
|
+
}
|
|
832
963
|
interface GetUserBoxesHistoryRequest {
|
|
833
964
|
userId: string;
|
|
834
965
|
olderTimestampMs?: string;
|
|
@@ -1147,6 +1278,22 @@ interface GetUserReferralStatsHistoryResponse {
|
|
|
1147
1278
|
stats: HistoricalReferralStats[];
|
|
1148
1279
|
paginationCursor?: PaginationCursor;
|
|
1149
1280
|
}
|
|
1281
|
+
interface GetUserReferralStatsV2HistoryRequest {
|
|
1282
|
+
userId: string;
|
|
1283
|
+
olderTimestampMs?: string;
|
|
1284
|
+
newerTimestampMs?: string;
|
|
1285
|
+
paginationCursor?: PaginationCursor;
|
|
1286
|
+
}
|
|
1287
|
+
interface HistoricalReferralStatsV2 {
|
|
1288
|
+
userId: string;
|
|
1289
|
+
referralsValue: Record<string, Record<string, TokenAmountUsd>>;
|
|
1290
|
+
timestampOpen: string;
|
|
1291
|
+
timestampClose: string;
|
|
1292
|
+
}
|
|
1293
|
+
interface GetUserReferralStatsV2HistoryResponse {
|
|
1294
|
+
stats: HistoricalReferralStatsV2[];
|
|
1295
|
+
paginationCursor?: PaginationCursor;
|
|
1296
|
+
}
|
|
1150
1297
|
interface GetUserRewardsValueRequest {
|
|
1151
1298
|
userId: string;
|
|
1152
1299
|
olderTimestampMs?: string;
|
|
@@ -1163,6 +1310,22 @@ interface GetUserRewardsValueResponse {
|
|
|
1163
1310
|
rewardsValues: UserRewardsValue[];
|
|
1164
1311
|
paginationCursor?: PaginationCursor;
|
|
1165
1312
|
}
|
|
1313
|
+
interface GetUserRewardsValueV2Request {
|
|
1314
|
+
userId: string;
|
|
1315
|
+
olderTimestampMs?: string;
|
|
1316
|
+
newerTimestampMs?: string;
|
|
1317
|
+
paginationCursor?: PaginationCursor;
|
|
1318
|
+
}
|
|
1319
|
+
interface UserRewardsValueV2 {
|
|
1320
|
+
userId: string;
|
|
1321
|
+
rewards: Record<string, TokenAmountUsd>;
|
|
1322
|
+
timestampOpen: string;
|
|
1323
|
+
timestampClose: string;
|
|
1324
|
+
}
|
|
1325
|
+
interface GetUserRewardsValueV2Response {
|
|
1326
|
+
rewardsValues: UserRewardsValueV2[];
|
|
1327
|
+
paginationCursor?: PaginationCursor;
|
|
1328
|
+
}
|
|
1166
1329
|
interface GetUserTradeStatsHistoryRequest {
|
|
1167
1330
|
userId: string;
|
|
1168
1331
|
olderTimestampMs?: string;
|
|
@@ -1189,6 +1352,28 @@ interface GetUserTradeStatsHistoryResponse {
|
|
|
1189
1352
|
stats: HistoricalTradeStats[];
|
|
1190
1353
|
paginationCursor?: PaginationCursor;
|
|
1191
1354
|
}
|
|
1355
|
+
interface GetUserTradeStatsV2HistoryRequest {
|
|
1356
|
+
userId: string;
|
|
1357
|
+
olderTimestampMs?: string;
|
|
1358
|
+
newerTimestampMs?: string;
|
|
1359
|
+
paginationCursor?: PaginationCursor;
|
|
1360
|
+
}
|
|
1361
|
+
interface HistoricalTradeStatsV2 {
|
|
1362
|
+
userId: string;
|
|
1363
|
+
spotStats: Record<string, MarketStatsResponse>;
|
|
1364
|
+
perpStats: Record<string, MarketStatsResponse>;
|
|
1365
|
+
earnedFee: Record<string, TokenAmountUsd>;
|
|
1366
|
+
timestampOpen: string;
|
|
1367
|
+
timestampClose: string;
|
|
1368
|
+
tokenDepositAmounts: Record<string, TokenAmountUsd>;
|
|
1369
|
+
tokenWithdrawAmounts: Record<string, TokenAmountUsd>;
|
|
1370
|
+
tokenTransferInAmounts: Record<string, TokenAmountUsd>;
|
|
1371
|
+
tokenTransferOutAmounts: Record<string, TokenAmountUsd>;
|
|
1372
|
+
}
|
|
1373
|
+
interface GetUserTradeStatsV2HistoryResponse {
|
|
1374
|
+
stats: HistoricalTradeStatsV2[];
|
|
1375
|
+
paginationCursor?: PaginationCursor;
|
|
1376
|
+
}
|
|
1192
1377
|
interface GetUserTransferHistoryRequest {
|
|
1193
1378
|
userId: string;
|
|
1194
1379
|
olderTimestampMs?: string;
|
|
@@ -1831,6 +2016,17 @@ declare enum EndpointsV1 {
|
|
|
1831
2016
|
GetUserAccountValueRanking = "/v1/get_user_account_value_ranking",
|
|
1832
2017
|
GetExchangeStatsHistory = "/v1/get_exchange_stats_history"
|
|
1833
2018
|
}
|
|
2019
|
+
declare enum EndpointsV2 {
|
|
2020
|
+
GetUserAggregatedStats = "/v2/get_user_aggregated_stats",
|
|
2021
|
+
GetUserAggregatedReferral = "/v2/get_user_aggregated_referral",
|
|
2022
|
+
GetUserReferralStats = "/v2/get_user_referral_stats",
|
|
2023
|
+
GetUserTradeStats = "/v2/get_user_trade_stats",
|
|
2024
|
+
GetUserAggregatedBoxRewardsStats = "/v2/get_user_aggregated_box_rewards_stats",
|
|
2025
|
+
GetUserBoxRewardsStats = "/v2/get_user_box_rewards_stats",
|
|
2026
|
+
GetUserRewardsValue = "/v2/get_user_rewards_value",
|
|
2027
|
+
GetUserAggregatedRewardsValue = "/v2/get_user_aggregated_rewards_value",
|
|
2028
|
+
GetUserAggregatedLiquidationStats = "/v2/get_user_aggregated_liquidation_stats"
|
|
2029
|
+
}
|
|
1834
2030
|
type Topic = {
|
|
1835
2031
|
type: 'PerpMarket';
|
|
1836
2032
|
content: string;
|
|
@@ -7023,45 +7219,112 @@ declare class Client {
|
|
|
7023
7219
|
/**
|
|
7024
7220
|
* getUserRewardsValueHistory.
|
|
7025
7221
|
*
|
|
7222
|
+
* @deprecated Use {@link getUserRewardsValueHistoryV2} — per-token amount and USD value breakdown.
|
|
7026
7223
|
* @param request - See {@link GetUserRewardsValueRequest}.
|
|
7027
7224
|
*/
|
|
7028
7225
|
getUserRewardsValueHistory: (request: GetUserRewardsValueRequest) => Promise<GetUserRewardsValueResponse>;
|
|
7029
7226
|
/**
|
|
7030
7227
|
* getUserTradeStatsHistory.
|
|
7031
7228
|
*
|
|
7229
|
+
* @deprecated Use {@link getUserTradeStatsHistoryV2} — per-market trade breakdown via MarketStats.
|
|
7032
7230
|
* @param request - See {@link GetUserTradeStatsHistoryRequest}.
|
|
7033
7231
|
*/
|
|
7034
7232
|
getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
|
|
7035
7233
|
/**
|
|
7036
7234
|
* getUserAggregatedStats.
|
|
7037
7235
|
*
|
|
7236
|
+
* @deprecated Use {@link getUserAggregatedStatsV2} — per-market breakdown and per-token USD values.
|
|
7038
7237
|
* @param request - See {@link GetUserAggregatedStatsRequest}.
|
|
7039
7238
|
*/
|
|
7040
7239
|
getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
|
|
7041
7240
|
/**
|
|
7042
7241
|
* getUserBoxRewardsStatsHistory.
|
|
7043
7242
|
*
|
|
7243
|
+
* @deprecated Use {@link getUserBoxRewardsStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
7044
7244
|
* @param request - See {@link GetUserBoxRewardsStatsHistoryRequest}.
|
|
7045
7245
|
*/
|
|
7046
7246
|
getUserBoxRewardsStatsHistory: (request: GetUserBoxRewardsStatsHistoryRequest) => Promise<GetUserBoxRewardsStatsHistoryResponse>;
|
|
7047
7247
|
/**
|
|
7048
7248
|
* getUserAggregatedBoxRewardsStats.
|
|
7049
7249
|
*
|
|
7250
|
+
* @deprecated Use {@link getUserAggregatedBoxRewardsStatsV2} — per-token amount and USD value breakdown.
|
|
7050
7251
|
* @param request - See {@link GetUserAggregatedBoxRewardsStatsRequest}.
|
|
7051
7252
|
*/
|
|
7052
7253
|
getUserAggregatedBoxRewardsStats: (request: GetUserAggregatedBoxRewardsStatsRequest) => Promise<GetUserAggregatedBoxRewardsStatsResponse>;
|
|
7053
7254
|
/**
|
|
7054
7255
|
* getUserReferralStatsHistory.
|
|
7055
7256
|
*
|
|
7257
|
+
* @deprecated Use {@link getUserReferralStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
7056
7258
|
* @param request - See {@link GetUserReferralStatsHistoryRequest}.
|
|
7057
7259
|
*/
|
|
7058
7260
|
getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
|
|
7059
7261
|
/**
|
|
7060
7262
|
* getUserAggregatedReferralStats.
|
|
7061
7263
|
*
|
|
7264
|
+
* @deprecated Use {@link getUserAggregatedReferralStatsV2} — per-token amount and USD value breakdown.
|
|
7062
7265
|
* @param request - See {@link GetUserAggregatedReferralStatsRequest}.
|
|
7063
7266
|
*/
|
|
7064
7267
|
getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
|
|
7268
|
+
/**
|
|
7269
|
+
* getUserRewardsValueHistoryV2.
|
|
7270
|
+
*
|
|
7271
|
+
* @param request - See {@link GetUserRewardsValueV2Request}.
|
|
7272
|
+
*/
|
|
7273
|
+
getUserRewardsValueHistoryV2: (request: GetUserRewardsValueV2Request) => Promise<GetUserRewardsValueV2Response>;
|
|
7274
|
+
/**
|
|
7275
|
+
* getUserTradeStatsHistoryV2.
|
|
7276
|
+
*
|
|
7277
|
+
* @param request - See {@link GetUserTradeStatsV2HistoryRequest}.
|
|
7278
|
+
*/
|
|
7279
|
+
getUserTradeStatsHistoryV2: (request: GetUserTradeStatsV2HistoryRequest) => Promise<GetUserTradeStatsV2HistoryResponse>;
|
|
7280
|
+
/**
|
|
7281
|
+
* getUserAggregatedStatsV2.
|
|
7282
|
+
*
|
|
7283
|
+
* @param request - See {@link GetUserAggregatedStatsV2Request}.
|
|
7284
|
+
*/
|
|
7285
|
+
getUserAggregatedStatsV2: (request: GetUserAggregatedStatsV2Request) => Promise<GetUserAggregatedStatsV2Response>;
|
|
7286
|
+
/**
|
|
7287
|
+
* getUserBoxRewardsStatsHistoryV2.
|
|
7288
|
+
*
|
|
7289
|
+
* @param request - See {@link GetUserBoxRewardsStatsV2HistoryRequest}.
|
|
7290
|
+
*/
|
|
7291
|
+
getUserBoxRewardsStatsHistoryV2: (request: GetUserBoxRewardsStatsV2HistoryRequest) => Promise<GetUserBoxRewardsStatsV2HistoryResponse>;
|
|
7292
|
+
/**
|
|
7293
|
+
* getUserAggregatedBoxRewardsStatsV2.
|
|
7294
|
+
*
|
|
7295
|
+
* @param request - See {@link GetUserAggregatedBoxRewardsStatsV2Request}.
|
|
7296
|
+
*/
|
|
7297
|
+
getUserAggregatedBoxRewardsStatsV2: (request: GetUserAggregatedBoxRewardsStatsV2Request) => Promise<GetUserAggregatedBoxRewardsStatsV2Response>;
|
|
7298
|
+
/**
|
|
7299
|
+
* getUserReferralStatsHistoryV2.
|
|
7300
|
+
*
|
|
7301
|
+
* @param request - See {@link GetUserReferralStatsV2HistoryRequest}.
|
|
7302
|
+
*/
|
|
7303
|
+
getUserReferralStatsHistoryV2: (request: GetUserReferralStatsV2HistoryRequest) => Promise<GetUserReferralStatsV2HistoryResponse>;
|
|
7304
|
+
/**
|
|
7305
|
+
* getUserAggregatedReferralStatsV2.
|
|
7306
|
+
*
|
|
7307
|
+
* @param request - See {@link GetUserAggregatedReferralStatsV2Request}.
|
|
7308
|
+
*/
|
|
7309
|
+
getUserAggregatedReferralStatsV2: (request: GetUserAggregatedReferralStatsV2Request) => Promise<GetUserAggregatedReferralStatsV2Response>;
|
|
7310
|
+
/**
|
|
7311
|
+
* getUserAggregatedRewardsValue.
|
|
7312
|
+
*
|
|
7313
|
+
* Lifetime aggregated reward earnings with per-token amount and USD value breakdown.
|
|
7314
|
+
* v2-only — no v1 equivalent.
|
|
7315
|
+
*
|
|
7316
|
+
* @param request - See {@link GetUserAggregatedRewardsValueRequest}.
|
|
7317
|
+
*/
|
|
7318
|
+
getUserAggregatedRewardsValue: (request: GetUserAggregatedRewardsValueRequest) => Promise<GetUserAggregatedRewardsValueResponse>;
|
|
7319
|
+
/**
|
|
7320
|
+
* getUserAggregatedLiquidationStats.
|
|
7321
|
+
*
|
|
7322
|
+
* Lifetime liquidation stats with per-market and per-token breakdowns.
|
|
7323
|
+
* v2-only — no v1 equivalent.
|
|
7324
|
+
*
|
|
7325
|
+
* @param request - See {@link GetUserAggregatedLiquidationStatsRequest}.
|
|
7326
|
+
*/
|
|
7327
|
+
getUserAggregatedLiquidationStats: (request: GetUserAggregatedLiquidationStatsRequest) => Promise<GetUserAggregatedLiquidationStatsResponse>;
|
|
7065
7328
|
/**
|
|
7066
7329
|
* getUserClaimedKickbackHistory.
|
|
7067
7330
|
*
|
|
@@ -7362,4 +7625,4 @@ declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
|
7362
7625
|
*/
|
|
7363
7626
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
7364
7627
|
|
|
7365
|
-
export { ABIs, type AccountValueRankingEntry, type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendState, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type ClientConfig, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type ExchangeStatsEntry, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetAccountValueRankingRequest, type GetAccountValueRankingResponse, type GetAllVaultsIdsResponse, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetExchangeStatsHistoryRequest, type GetExchangeStatsHistoryResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexPricesResponse, type GetIndexerStatusResponse, type GetOrderBookDataRequest, type GetOrderBookDataResponse, type GetPerpMarketsConfigResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpUserTriggerOrdersRequest, type GetPerpUserTriggerOrdersResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetSpotMarketsConfigResponse, type GetSpotMarketsDataRequest, type GetSpotMarketsDataResponse, type GetSpotRecentTradesRequest, type GetSpotRecentTradesResponse, type GetSpotUserFillsRequest, type GetSpotUserFillsResponse, type GetSpotUserOrdersRequest, type GetSpotUserOrdersResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetTopPointsRankingResponse, type GetUserAccountValueRankingRequest, type GetUserAccountValueRankingResponse, type GetUserAggregatedBoxRewardsStatsRequest, type GetUserAggregatedBoxRewardsStatsResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserBoxRewardsStatsHistoryRequest, type GetUserBoxRewardsStatsHistoryResponse, type GetUserBoxesHistoryRequest, type GetUserBoxesHistoryResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFullLiquidationsHistoryRequest, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsCancelHistoryResponse, type GetUserLiquidationsCancelOrdersHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPartialLiquidationsHistoryRequest, type GetUserPartialLiquidationsHistoryResponse, type GetUserPersonalPointsRankingRequest, type GetUserPersonalPointsRankingResponse, type GetUserPointsHistoryRequest, type GetUserPointsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserPositionsRequest, type GetUserPositionsResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserRewardsValueRequest, type GetUserRewardsValueResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type GlobalLiquidation, type GlobalPartialLiquidation, type HistoricBoxReward, type HistoricalBoxRewardsStats, type HistoricalDeposit, type HistoricalFullLiquidation, type HistoricalFunding, type HistoricalLiquidatedBorrow, type HistoricalLiquidatedCollateral, type HistoricalLiquidatedLend, type HistoricalLiquidatedPosition, type HistoricalLiquidationCancelOrders, type HistoricalPartialLiquidatedPosition, type HistoricalPartialLiquidation, type HistoricalPerpOrder, type HistoricalPoints, type HistoricalPosition, type HistoricalReferralStats, type HistoricalSpotOrder, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IndexPriceHistory, type IndexPriceLive, type Lend, type LendTokenParams, type Liquidation, type LiquidationCancelledOrderData, type LiquidationCancelledTriggerOrderData, MAINNET_CONFIG, type MarginStep, type NetworkConfig, type NetworkMode, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleState, type OracleUpdate, type OracleUpdates, type OrderBookData, OrderSide, OrderStatus, OrderType, type PaginationCursor, type PartialLiquidation, type PerpFill, type PerpMarketConfigEntry, type PerpMarketData, type PerpMarketDataUpdate, type PerpOrder, type PerpOrderData, type PerpOrderDataForMarket, type PerpOrderFills, type PerpOrderbookState, type PerpOrderbookUpdate, type PerpPosition, type PerpTrade, type PerpTradesUpdate, type PerpTriggerOrder, type PerpTriggerOrderTriggered, type PlaceMultiplePerpOrdersParams, type PlaceMultipleSpotOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PlacePerpTriggerOrder, type PlacePerpTriggerOrderParams, type PlaceSpotLimitOrder, type PlaceSpotMarketOrder, type PlaceSpotOrderParams, type PointsRankingEntry, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type ReplaceMultipleSpotOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, type SpotFill, type SpotMarketConfigEntry, type SpotMarketData, type SpotMarketDataUpdate, type SpotOrder, type SpotOrderData, type SpotOrderDataForMarket, type SpotOrderFills, type SpotOrderbookState, type SpotOrderbookUpdate, type SpotTrade, type SpotTradesUpdate, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TESTNET_CONFIG, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, TransferAction, type TransferToUserParams, type TriggerOrder, type TvlTokenEntry, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPointsBreakdown, type UserPortfolioValue, type UserRewardsValue, type UserState, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WithdrawTokenParams, type WsBorrowLendUpdate, type WsBoxOpeningUpdate, type WsCommand, type WsFill, type WsLiquidatedBorrow, type WsLiquidatedCollateral, type WsLiquidatedLend, type WsLiquidatedPosition, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPartialLiquidatedPosition, type WsPerpMarketDataUpdate, type WsPerpMarketUpdates, type WsSpotMarketDataUpdate, type WsSpotMarketUpdates, type WsUserUpdates, createAptosClient, createAptosClientFromEnv, generateApiKey, getABIsForNetwork, getNetworkConfig, getNetworkModeFromEnv, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, nowInMilliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
7628
|
+
export { ABIs, type AccountValueRankingEntry, type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendState, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type ClientConfig, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, EndpointsV2, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type ExchangeStatsEntry, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetAccountValueRankingRequest, type GetAccountValueRankingResponse, type GetAllVaultsIdsResponse, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetExchangeStatsHistoryRequest, type GetExchangeStatsHistoryResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexPricesResponse, type GetIndexerStatusResponse, type GetOrderBookDataRequest, type GetOrderBookDataResponse, type GetPerpMarketsConfigResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpUserTriggerOrdersRequest, type GetPerpUserTriggerOrdersResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetSpotMarketsConfigResponse, type GetSpotMarketsDataRequest, type GetSpotMarketsDataResponse, type GetSpotRecentTradesRequest, type GetSpotRecentTradesResponse, type GetSpotUserFillsRequest, type GetSpotUserFillsResponse, type GetSpotUserOrdersRequest, type GetSpotUserOrdersResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetTopPointsRankingResponse, type GetUserAccountValueRankingRequest, type GetUserAccountValueRankingResponse, type GetUserAggregatedBoxRewardsStatsRequest, type GetUserAggregatedBoxRewardsStatsResponse, type GetUserAggregatedBoxRewardsStatsV2Request, type GetUserAggregatedBoxRewardsStatsV2Response, type GetUserAggregatedLiquidationStatsRequest, type GetUserAggregatedLiquidationStatsResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedReferralStatsV2Request, type GetUserAggregatedReferralStatsV2Response, type GetUserAggregatedRewardsValueRequest, type GetUserAggregatedRewardsValueResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedStatsV2Request, type GetUserAggregatedStatsV2Response, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserBoxRewardsStatsHistoryRequest, type GetUserBoxRewardsStatsHistoryResponse, type GetUserBoxRewardsStatsV2HistoryRequest, type GetUserBoxRewardsStatsV2HistoryResponse, type GetUserBoxesHistoryRequest, type GetUserBoxesHistoryResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFullLiquidationsHistoryRequest, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsCancelHistoryResponse, type GetUserLiquidationsCancelOrdersHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPartialLiquidationsHistoryRequest, type GetUserPartialLiquidationsHistoryResponse, type GetUserPersonalPointsRankingRequest, type GetUserPersonalPointsRankingResponse, type GetUserPointsHistoryRequest, type GetUserPointsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserPositionsRequest, type GetUserPositionsResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserReferralStatsV2HistoryRequest, type GetUserReferralStatsV2HistoryResponse, type GetUserRewardsValueRequest, type GetUserRewardsValueResponse, type GetUserRewardsValueV2Request, type GetUserRewardsValueV2Response, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTradeStatsV2HistoryRequest, type GetUserTradeStatsV2HistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type GlobalLiquidation, type GlobalPartialLiquidation, type HistoricBoxReward, type HistoricalBoxRewardsStats, type HistoricalBoxRewardsStatsV2, type HistoricalDeposit, type HistoricalFullLiquidation, type HistoricalFunding, type HistoricalLiquidatedBorrow, type HistoricalLiquidatedCollateral, type HistoricalLiquidatedLend, type HistoricalLiquidatedPosition, type HistoricalLiquidationCancelOrders, type HistoricalPartialLiquidatedPosition, type HistoricalPartialLiquidation, type HistoricalPerpOrder, type HistoricalPoints, type HistoricalPosition, type HistoricalReferralStats, type HistoricalReferralStatsV2, type HistoricalSpotOrder, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalTradeStatsV2, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IndexPriceHistory, type IndexPriceLive, type Lend, type LendTokenParams, type Liquidation, type LiquidationCancelledOrderData, type LiquidationCancelledTriggerOrderData, MAINNET_CONFIG, type MarginStep, type MarketLiquidationStats, type MarketStatsResponse, type NetworkConfig, type NetworkMode, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleState, type OracleUpdate, type OracleUpdates, type OrderBookData, OrderSide, OrderStatus, OrderType, type PaginationCursor, type PartialLiquidation, type PerpFill, type PerpMarketConfigEntry, type PerpMarketData, type PerpMarketDataUpdate, type PerpOrder, type PerpOrderData, type PerpOrderDataForMarket, type PerpOrderFills, type PerpOrderbookState, type PerpOrderbookUpdate, type PerpPosition, type PerpTrade, type PerpTradesUpdate, type PerpTriggerOrder, type PerpTriggerOrderTriggered, type PlaceMultiplePerpOrdersParams, type PlaceMultipleSpotOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PlacePerpTriggerOrder, type PlacePerpTriggerOrderParams, type PlaceSpotLimitOrder, type PlaceSpotMarketOrder, type PlaceSpotOrderParams, type PointsRankingEntry, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type ReplaceMultipleSpotOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, type SpotFill, type SpotMarketConfigEntry, type SpotMarketData, type SpotMarketDataUpdate, type SpotOrder, type SpotOrderData, type SpotOrderDataForMarket, type SpotOrderFills, type SpotOrderbookState, type SpotOrderbookUpdate, type SpotTrade, type SpotTradesUpdate, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TESTNET_CONFIG, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenAmountUsd, type TokenConfigEntry, type TokenLiquidationStats, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, TransferAction, type TransferToUserParams, type TriggerOrder, type TvlTokenEntry, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedBoxRewardsStatsV2, type UserAggregatedLiquidationStats, type UserAggregatedReferralStats, type UserAggregatedReferralStatsV2, type UserAggregatedRewardsValue, type UserAggregatedStats, type UserAggregatedStatsV2, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPointsBreakdown, type UserPortfolioValue, type UserRewardsValue, type UserRewardsValueV2, type UserState, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WithdrawTokenParams, type WsBorrowLendUpdate, type WsBoxOpeningUpdate, type WsCommand, type WsFill, type WsLiquidatedBorrow, type WsLiquidatedCollateral, type WsLiquidatedLend, type WsLiquidatedPosition, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPartialLiquidatedPosition, type WsPerpMarketDataUpdate, type WsPerpMarketUpdates, type WsSpotMarketDataUpdate, type WsSpotMarketUpdates, type WsUserUpdates, createAptosClient, createAptosClientFromEnv, generateApiKey, getABIsForNetwork, getNetworkConfig, getNetworkModeFromEnv, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, nowInMilliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -753,6 +753,63 @@ interface UserAggregatedBoxRewardsStats {
|
|
|
753
753
|
interface GetUserAggregatedBoxRewardsStatsResponse {
|
|
754
754
|
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStats;
|
|
755
755
|
}
|
|
756
|
+
interface GetUserAggregatedBoxRewardsStatsV2Request {
|
|
757
|
+
userId: string;
|
|
758
|
+
}
|
|
759
|
+
interface TokenAmountUsd {
|
|
760
|
+
amount: string;
|
|
761
|
+
valueUsd: string;
|
|
762
|
+
}
|
|
763
|
+
interface UserAggregatedBoxRewardsStatsV2 {
|
|
764
|
+
userId: string;
|
|
765
|
+
boxOpeningCount: Record<string, string>;
|
|
766
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
767
|
+
tokenRewards: Record<string, TokenAmountUsd>;
|
|
768
|
+
badges: Record<BoxRewardTier, string>;
|
|
769
|
+
pointsRewardsTotal: string;
|
|
770
|
+
pointsCostTotal: string;
|
|
771
|
+
totalEarnedInUsd: string;
|
|
772
|
+
}
|
|
773
|
+
interface GetUserAggregatedBoxRewardsStatsV2Response {
|
|
774
|
+
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStatsV2;
|
|
775
|
+
}
|
|
776
|
+
interface GetUserAggregatedLiquidationStatsRequest {
|
|
777
|
+
userId: string;
|
|
778
|
+
}
|
|
779
|
+
interface MarketLiquidationStats {
|
|
780
|
+
fullSize: string;
|
|
781
|
+
fullNotionalUsd: string;
|
|
782
|
+
fullPenaltyUsd: string;
|
|
783
|
+
fullCount: string;
|
|
784
|
+
partialSize: string;
|
|
785
|
+
partialNotionalUsd: string;
|
|
786
|
+
partialPenaltyUsd: string;
|
|
787
|
+
partialCount: string;
|
|
788
|
+
}
|
|
789
|
+
interface TokenLiquidationStats {
|
|
790
|
+
borrowShares: string;
|
|
791
|
+
borrowPenaltyUsd: string;
|
|
792
|
+
lendShares: string;
|
|
793
|
+
lendDebtReductionUsd: string;
|
|
794
|
+
lendPenaltyUsd: string;
|
|
795
|
+
collateralAmount: string;
|
|
796
|
+
collateralDebtReductionUsd: string;
|
|
797
|
+
collateralPenaltyUsd: string;
|
|
798
|
+
liquidationCount: string;
|
|
799
|
+
}
|
|
800
|
+
interface UserAggregatedLiquidationStats {
|
|
801
|
+
userId: string;
|
|
802
|
+
fullLiquidationCount: string;
|
|
803
|
+
partialLiquidationCount: string;
|
|
804
|
+
totalFullLiquidationValueUsd: string;
|
|
805
|
+
totalPartialLiquidationValueUsd: string;
|
|
806
|
+
totalUnpaidDebtUsd: string;
|
|
807
|
+
marketStats: Record<string, MarketLiquidationStats>;
|
|
808
|
+
tokenStats: Record<string, TokenLiquidationStats>;
|
|
809
|
+
}
|
|
810
|
+
interface GetUserAggregatedLiquidationStatsResponse {
|
|
811
|
+
userAggregatedLiquidationStats: UserAggregatedLiquidationStats;
|
|
812
|
+
}
|
|
756
813
|
interface GetUserAggregatedReferralStatsRequest {
|
|
757
814
|
userId: string;
|
|
758
815
|
paginationCursor?: PaginationCursor;
|
|
@@ -770,6 +827,34 @@ interface GetUserAggregatedReferralStatsResponse {
|
|
|
770
827
|
stats: UserAggregatedReferralStats[];
|
|
771
828
|
paginationCursor?: PaginationCursor;
|
|
772
829
|
}
|
|
830
|
+
interface GetUserAggregatedReferralStatsV2Request {
|
|
831
|
+
userId: string;
|
|
832
|
+
paginationCursor?: PaginationCursor;
|
|
833
|
+
}
|
|
834
|
+
interface UserAggregatedReferralStatsV2 {
|
|
835
|
+
referralOwnerId: string;
|
|
836
|
+
referralUserId: string;
|
|
837
|
+
referralUserAlias: string;
|
|
838
|
+
referralUserRegistrationTimestamp: string;
|
|
839
|
+
accReferralValue: Record<string, TokenAmountUsd>;
|
|
840
|
+
referredUserVolume: string;
|
|
841
|
+
totalEarnedInUsd: string;
|
|
842
|
+
}
|
|
843
|
+
interface GetUserAggregatedReferralStatsV2Response {
|
|
844
|
+
stats: UserAggregatedReferralStatsV2[];
|
|
845
|
+
paginationCursor?: PaginationCursor;
|
|
846
|
+
}
|
|
847
|
+
interface GetUserAggregatedRewardsValueRequest {
|
|
848
|
+
userId: string;
|
|
849
|
+
}
|
|
850
|
+
interface UserAggregatedRewardsValue {
|
|
851
|
+
userId: string;
|
|
852
|
+
rewardsValue: Record<string, TokenAmountUsd>;
|
|
853
|
+
totalEarnedInUsd: string;
|
|
854
|
+
}
|
|
855
|
+
interface GetUserAggregatedRewardsValueResponse {
|
|
856
|
+
userAggregatedRewardsValue: UserAggregatedRewardsValue;
|
|
857
|
+
}
|
|
773
858
|
interface GetUserAggregatedStatsRequest {
|
|
774
859
|
userId: string;
|
|
775
860
|
}
|
|
@@ -793,6 +878,30 @@ interface UserAggregatedStats {
|
|
|
793
878
|
interface GetUserAggregatedStatsResponse {
|
|
794
879
|
userAggregatedStats: UserAggregatedStats;
|
|
795
880
|
}
|
|
881
|
+
interface GetUserAggregatedStatsV2Request {
|
|
882
|
+
userId: string;
|
|
883
|
+
}
|
|
884
|
+
interface MarketStatsResponse {
|
|
885
|
+
tradeVolumeMaker: string;
|
|
886
|
+
tradeVolumeTaker: string;
|
|
887
|
+
tradeCountMaker: string;
|
|
888
|
+
tradeCountTaker: string;
|
|
889
|
+
paidFeeMaker: string;
|
|
890
|
+
paidFeeTaker: string;
|
|
891
|
+
}
|
|
892
|
+
interface UserAggregatedStatsV2 {
|
|
893
|
+
userId: string;
|
|
894
|
+
spotStats: Record<string, MarketStatsResponse>;
|
|
895
|
+
perpStats: Record<string, MarketStatsResponse>;
|
|
896
|
+
earnedFee: Record<string, TokenAmountUsd>;
|
|
897
|
+
tokenDepositAmounts: Record<string, TokenAmountUsd>;
|
|
898
|
+
tokenWithdrawAmounts: Record<string, TokenAmountUsd>;
|
|
899
|
+
tokenTransferInAmounts: Record<string, TokenAmountUsd>;
|
|
900
|
+
tokenTransferOutAmounts: Record<string, TokenAmountUsd>;
|
|
901
|
+
}
|
|
902
|
+
interface GetUserAggregatedStatsV2Response {
|
|
903
|
+
userAggregatedStats: UserAggregatedStatsV2;
|
|
904
|
+
}
|
|
796
905
|
interface GetUserAggregatedVaultStatsRequest {
|
|
797
906
|
userId: string;
|
|
798
907
|
vaultId?: string;
|
|
@@ -829,6 +938,28 @@ interface GetUserBoxRewardsStatsHistoryResponse {
|
|
|
829
938
|
stats: HistoricalBoxRewardsStats[];
|
|
830
939
|
paginationCursor?: PaginationCursor;
|
|
831
940
|
}
|
|
941
|
+
interface GetUserBoxRewardsStatsV2HistoryRequest {
|
|
942
|
+
userId: string;
|
|
943
|
+
olderTimestampMs?: string;
|
|
944
|
+
newerTimestampMs?: string;
|
|
945
|
+
paginationCursor?: PaginationCursor;
|
|
946
|
+
}
|
|
947
|
+
interface HistoricalBoxRewardsStatsV2 {
|
|
948
|
+
userId: string;
|
|
949
|
+
boxOpeningCount: Record<string, string>;
|
|
950
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
951
|
+
tokenRewards: Record<string, TokenAmountUsd>;
|
|
952
|
+
badges: Record<BoxRewardTier, string>;
|
|
953
|
+
pointsRewardsTotal: string;
|
|
954
|
+
pointsCostTotal: string;
|
|
955
|
+
valueInUsd: string;
|
|
956
|
+
timestampOpen: string;
|
|
957
|
+
timestampClose: string;
|
|
958
|
+
}
|
|
959
|
+
interface GetUserBoxRewardsStatsV2HistoryResponse {
|
|
960
|
+
stats: HistoricalBoxRewardsStatsV2[];
|
|
961
|
+
paginationCursor?: PaginationCursor;
|
|
962
|
+
}
|
|
832
963
|
interface GetUserBoxesHistoryRequest {
|
|
833
964
|
userId: string;
|
|
834
965
|
olderTimestampMs?: string;
|
|
@@ -1147,6 +1278,22 @@ interface GetUserReferralStatsHistoryResponse {
|
|
|
1147
1278
|
stats: HistoricalReferralStats[];
|
|
1148
1279
|
paginationCursor?: PaginationCursor;
|
|
1149
1280
|
}
|
|
1281
|
+
interface GetUserReferralStatsV2HistoryRequest {
|
|
1282
|
+
userId: string;
|
|
1283
|
+
olderTimestampMs?: string;
|
|
1284
|
+
newerTimestampMs?: string;
|
|
1285
|
+
paginationCursor?: PaginationCursor;
|
|
1286
|
+
}
|
|
1287
|
+
interface HistoricalReferralStatsV2 {
|
|
1288
|
+
userId: string;
|
|
1289
|
+
referralsValue: Record<string, Record<string, TokenAmountUsd>>;
|
|
1290
|
+
timestampOpen: string;
|
|
1291
|
+
timestampClose: string;
|
|
1292
|
+
}
|
|
1293
|
+
interface GetUserReferralStatsV2HistoryResponse {
|
|
1294
|
+
stats: HistoricalReferralStatsV2[];
|
|
1295
|
+
paginationCursor?: PaginationCursor;
|
|
1296
|
+
}
|
|
1150
1297
|
interface GetUserRewardsValueRequest {
|
|
1151
1298
|
userId: string;
|
|
1152
1299
|
olderTimestampMs?: string;
|
|
@@ -1163,6 +1310,22 @@ interface GetUserRewardsValueResponse {
|
|
|
1163
1310
|
rewardsValues: UserRewardsValue[];
|
|
1164
1311
|
paginationCursor?: PaginationCursor;
|
|
1165
1312
|
}
|
|
1313
|
+
interface GetUserRewardsValueV2Request {
|
|
1314
|
+
userId: string;
|
|
1315
|
+
olderTimestampMs?: string;
|
|
1316
|
+
newerTimestampMs?: string;
|
|
1317
|
+
paginationCursor?: PaginationCursor;
|
|
1318
|
+
}
|
|
1319
|
+
interface UserRewardsValueV2 {
|
|
1320
|
+
userId: string;
|
|
1321
|
+
rewards: Record<string, TokenAmountUsd>;
|
|
1322
|
+
timestampOpen: string;
|
|
1323
|
+
timestampClose: string;
|
|
1324
|
+
}
|
|
1325
|
+
interface GetUserRewardsValueV2Response {
|
|
1326
|
+
rewardsValues: UserRewardsValueV2[];
|
|
1327
|
+
paginationCursor?: PaginationCursor;
|
|
1328
|
+
}
|
|
1166
1329
|
interface GetUserTradeStatsHistoryRequest {
|
|
1167
1330
|
userId: string;
|
|
1168
1331
|
olderTimestampMs?: string;
|
|
@@ -1189,6 +1352,28 @@ interface GetUserTradeStatsHistoryResponse {
|
|
|
1189
1352
|
stats: HistoricalTradeStats[];
|
|
1190
1353
|
paginationCursor?: PaginationCursor;
|
|
1191
1354
|
}
|
|
1355
|
+
interface GetUserTradeStatsV2HistoryRequest {
|
|
1356
|
+
userId: string;
|
|
1357
|
+
olderTimestampMs?: string;
|
|
1358
|
+
newerTimestampMs?: string;
|
|
1359
|
+
paginationCursor?: PaginationCursor;
|
|
1360
|
+
}
|
|
1361
|
+
interface HistoricalTradeStatsV2 {
|
|
1362
|
+
userId: string;
|
|
1363
|
+
spotStats: Record<string, MarketStatsResponse>;
|
|
1364
|
+
perpStats: Record<string, MarketStatsResponse>;
|
|
1365
|
+
earnedFee: Record<string, TokenAmountUsd>;
|
|
1366
|
+
timestampOpen: string;
|
|
1367
|
+
timestampClose: string;
|
|
1368
|
+
tokenDepositAmounts: Record<string, TokenAmountUsd>;
|
|
1369
|
+
tokenWithdrawAmounts: Record<string, TokenAmountUsd>;
|
|
1370
|
+
tokenTransferInAmounts: Record<string, TokenAmountUsd>;
|
|
1371
|
+
tokenTransferOutAmounts: Record<string, TokenAmountUsd>;
|
|
1372
|
+
}
|
|
1373
|
+
interface GetUserTradeStatsV2HistoryResponse {
|
|
1374
|
+
stats: HistoricalTradeStatsV2[];
|
|
1375
|
+
paginationCursor?: PaginationCursor;
|
|
1376
|
+
}
|
|
1192
1377
|
interface GetUserTransferHistoryRequest {
|
|
1193
1378
|
userId: string;
|
|
1194
1379
|
olderTimestampMs?: string;
|
|
@@ -1831,6 +2016,17 @@ declare enum EndpointsV1 {
|
|
|
1831
2016
|
GetUserAccountValueRanking = "/v1/get_user_account_value_ranking",
|
|
1832
2017
|
GetExchangeStatsHistory = "/v1/get_exchange_stats_history"
|
|
1833
2018
|
}
|
|
2019
|
+
declare enum EndpointsV2 {
|
|
2020
|
+
GetUserAggregatedStats = "/v2/get_user_aggregated_stats",
|
|
2021
|
+
GetUserAggregatedReferral = "/v2/get_user_aggregated_referral",
|
|
2022
|
+
GetUserReferralStats = "/v2/get_user_referral_stats",
|
|
2023
|
+
GetUserTradeStats = "/v2/get_user_trade_stats",
|
|
2024
|
+
GetUserAggregatedBoxRewardsStats = "/v2/get_user_aggregated_box_rewards_stats",
|
|
2025
|
+
GetUserBoxRewardsStats = "/v2/get_user_box_rewards_stats",
|
|
2026
|
+
GetUserRewardsValue = "/v2/get_user_rewards_value",
|
|
2027
|
+
GetUserAggregatedRewardsValue = "/v2/get_user_aggregated_rewards_value",
|
|
2028
|
+
GetUserAggregatedLiquidationStats = "/v2/get_user_aggregated_liquidation_stats"
|
|
2029
|
+
}
|
|
1834
2030
|
type Topic = {
|
|
1835
2031
|
type: 'PerpMarket';
|
|
1836
2032
|
content: string;
|
|
@@ -7023,45 +7219,112 @@ declare class Client {
|
|
|
7023
7219
|
/**
|
|
7024
7220
|
* getUserRewardsValueHistory.
|
|
7025
7221
|
*
|
|
7222
|
+
* @deprecated Use {@link getUserRewardsValueHistoryV2} — per-token amount and USD value breakdown.
|
|
7026
7223
|
* @param request - See {@link GetUserRewardsValueRequest}.
|
|
7027
7224
|
*/
|
|
7028
7225
|
getUserRewardsValueHistory: (request: GetUserRewardsValueRequest) => Promise<GetUserRewardsValueResponse>;
|
|
7029
7226
|
/**
|
|
7030
7227
|
* getUserTradeStatsHistory.
|
|
7031
7228
|
*
|
|
7229
|
+
* @deprecated Use {@link getUserTradeStatsHistoryV2} — per-market trade breakdown via MarketStats.
|
|
7032
7230
|
* @param request - See {@link GetUserTradeStatsHistoryRequest}.
|
|
7033
7231
|
*/
|
|
7034
7232
|
getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
|
|
7035
7233
|
/**
|
|
7036
7234
|
* getUserAggregatedStats.
|
|
7037
7235
|
*
|
|
7236
|
+
* @deprecated Use {@link getUserAggregatedStatsV2} — per-market breakdown and per-token USD values.
|
|
7038
7237
|
* @param request - See {@link GetUserAggregatedStatsRequest}.
|
|
7039
7238
|
*/
|
|
7040
7239
|
getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
|
|
7041
7240
|
/**
|
|
7042
7241
|
* getUserBoxRewardsStatsHistory.
|
|
7043
7242
|
*
|
|
7243
|
+
* @deprecated Use {@link getUserBoxRewardsStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
7044
7244
|
* @param request - See {@link GetUserBoxRewardsStatsHistoryRequest}.
|
|
7045
7245
|
*/
|
|
7046
7246
|
getUserBoxRewardsStatsHistory: (request: GetUserBoxRewardsStatsHistoryRequest) => Promise<GetUserBoxRewardsStatsHistoryResponse>;
|
|
7047
7247
|
/**
|
|
7048
7248
|
* getUserAggregatedBoxRewardsStats.
|
|
7049
7249
|
*
|
|
7250
|
+
* @deprecated Use {@link getUserAggregatedBoxRewardsStatsV2} — per-token amount and USD value breakdown.
|
|
7050
7251
|
* @param request - See {@link GetUserAggregatedBoxRewardsStatsRequest}.
|
|
7051
7252
|
*/
|
|
7052
7253
|
getUserAggregatedBoxRewardsStats: (request: GetUserAggregatedBoxRewardsStatsRequest) => Promise<GetUserAggregatedBoxRewardsStatsResponse>;
|
|
7053
7254
|
/**
|
|
7054
7255
|
* getUserReferralStatsHistory.
|
|
7055
7256
|
*
|
|
7257
|
+
* @deprecated Use {@link getUserReferralStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
7056
7258
|
* @param request - See {@link GetUserReferralStatsHistoryRequest}.
|
|
7057
7259
|
*/
|
|
7058
7260
|
getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
|
|
7059
7261
|
/**
|
|
7060
7262
|
* getUserAggregatedReferralStats.
|
|
7061
7263
|
*
|
|
7264
|
+
* @deprecated Use {@link getUserAggregatedReferralStatsV2} — per-token amount and USD value breakdown.
|
|
7062
7265
|
* @param request - See {@link GetUserAggregatedReferralStatsRequest}.
|
|
7063
7266
|
*/
|
|
7064
7267
|
getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
|
|
7268
|
+
/**
|
|
7269
|
+
* getUserRewardsValueHistoryV2.
|
|
7270
|
+
*
|
|
7271
|
+
* @param request - See {@link GetUserRewardsValueV2Request}.
|
|
7272
|
+
*/
|
|
7273
|
+
getUserRewardsValueHistoryV2: (request: GetUserRewardsValueV2Request) => Promise<GetUserRewardsValueV2Response>;
|
|
7274
|
+
/**
|
|
7275
|
+
* getUserTradeStatsHistoryV2.
|
|
7276
|
+
*
|
|
7277
|
+
* @param request - See {@link GetUserTradeStatsV2HistoryRequest}.
|
|
7278
|
+
*/
|
|
7279
|
+
getUserTradeStatsHistoryV2: (request: GetUserTradeStatsV2HistoryRequest) => Promise<GetUserTradeStatsV2HistoryResponse>;
|
|
7280
|
+
/**
|
|
7281
|
+
* getUserAggregatedStatsV2.
|
|
7282
|
+
*
|
|
7283
|
+
* @param request - See {@link GetUserAggregatedStatsV2Request}.
|
|
7284
|
+
*/
|
|
7285
|
+
getUserAggregatedStatsV2: (request: GetUserAggregatedStatsV2Request) => Promise<GetUserAggregatedStatsV2Response>;
|
|
7286
|
+
/**
|
|
7287
|
+
* getUserBoxRewardsStatsHistoryV2.
|
|
7288
|
+
*
|
|
7289
|
+
* @param request - See {@link GetUserBoxRewardsStatsV2HistoryRequest}.
|
|
7290
|
+
*/
|
|
7291
|
+
getUserBoxRewardsStatsHistoryV2: (request: GetUserBoxRewardsStatsV2HistoryRequest) => Promise<GetUserBoxRewardsStatsV2HistoryResponse>;
|
|
7292
|
+
/**
|
|
7293
|
+
* getUserAggregatedBoxRewardsStatsV2.
|
|
7294
|
+
*
|
|
7295
|
+
* @param request - See {@link GetUserAggregatedBoxRewardsStatsV2Request}.
|
|
7296
|
+
*/
|
|
7297
|
+
getUserAggregatedBoxRewardsStatsV2: (request: GetUserAggregatedBoxRewardsStatsV2Request) => Promise<GetUserAggregatedBoxRewardsStatsV2Response>;
|
|
7298
|
+
/**
|
|
7299
|
+
* getUserReferralStatsHistoryV2.
|
|
7300
|
+
*
|
|
7301
|
+
* @param request - See {@link GetUserReferralStatsV2HistoryRequest}.
|
|
7302
|
+
*/
|
|
7303
|
+
getUserReferralStatsHistoryV2: (request: GetUserReferralStatsV2HistoryRequest) => Promise<GetUserReferralStatsV2HistoryResponse>;
|
|
7304
|
+
/**
|
|
7305
|
+
* getUserAggregatedReferralStatsV2.
|
|
7306
|
+
*
|
|
7307
|
+
* @param request - See {@link GetUserAggregatedReferralStatsV2Request}.
|
|
7308
|
+
*/
|
|
7309
|
+
getUserAggregatedReferralStatsV2: (request: GetUserAggregatedReferralStatsV2Request) => Promise<GetUserAggregatedReferralStatsV2Response>;
|
|
7310
|
+
/**
|
|
7311
|
+
* getUserAggregatedRewardsValue.
|
|
7312
|
+
*
|
|
7313
|
+
* Lifetime aggregated reward earnings with per-token amount and USD value breakdown.
|
|
7314
|
+
* v2-only — no v1 equivalent.
|
|
7315
|
+
*
|
|
7316
|
+
* @param request - See {@link GetUserAggregatedRewardsValueRequest}.
|
|
7317
|
+
*/
|
|
7318
|
+
getUserAggregatedRewardsValue: (request: GetUserAggregatedRewardsValueRequest) => Promise<GetUserAggregatedRewardsValueResponse>;
|
|
7319
|
+
/**
|
|
7320
|
+
* getUserAggregatedLiquidationStats.
|
|
7321
|
+
*
|
|
7322
|
+
* Lifetime liquidation stats with per-market and per-token breakdowns.
|
|
7323
|
+
* v2-only — no v1 equivalent.
|
|
7324
|
+
*
|
|
7325
|
+
* @param request - See {@link GetUserAggregatedLiquidationStatsRequest}.
|
|
7326
|
+
*/
|
|
7327
|
+
getUserAggregatedLiquidationStats: (request: GetUserAggregatedLiquidationStatsRequest) => Promise<GetUserAggregatedLiquidationStatsResponse>;
|
|
7065
7328
|
/**
|
|
7066
7329
|
* getUserClaimedKickbackHistory.
|
|
7067
7330
|
*
|
|
@@ -7362,4 +7625,4 @@ declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
|
7362
7625
|
*/
|
|
7363
7626
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
7364
7627
|
|
|
7365
|
-
export { ABIs, type AccountValueRankingEntry, type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendState, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type ClientConfig, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type ExchangeStatsEntry, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetAccountValueRankingRequest, type GetAccountValueRankingResponse, type GetAllVaultsIdsResponse, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetExchangeStatsHistoryRequest, type GetExchangeStatsHistoryResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexPricesResponse, type GetIndexerStatusResponse, type GetOrderBookDataRequest, type GetOrderBookDataResponse, type GetPerpMarketsConfigResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpUserTriggerOrdersRequest, type GetPerpUserTriggerOrdersResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetSpotMarketsConfigResponse, type GetSpotMarketsDataRequest, type GetSpotMarketsDataResponse, type GetSpotRecentTradesRequest, type GetSpotRecentTradesResponse, type GetSpotUserFillsRequest, type GetSpotUserFillsResponse, type GetSpotUserOrdersRequest, type GetSpotUserOrdersResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetTopPointsRankingResponse, type GetUserAccountValueRankingRequest, type GetUserAccountValueRankingResponse, type GetUserAggregatedBoxRewardsStatsRequest, type GetUserAggregatedBoxRewardsStatsResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserBoxRewardsStatsHistoryRequest, type GetUserBoxRewardsStatsHistoryResponse, type GetUserBoxesHistoryRequest, type GetUserBoxesHistoryResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFullLiquidationsHistoryRequest, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsCancelHistoryResponse, type GetUserLiquidationsCancelOrdersHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPartialLiquidationsHistoryRequest, type GetUserPartialLiquidationsHistoryResponse, type GetUserPersonalPointsRankingRequest, type GetUserPersonalPointsRankingResponse, type GetUserPointsHistoryRequest, type GetUserPointsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserPositionsRequest, type GetUserPositionsResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserRewardsValueRequest, type GetUserRewardsValueResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type GlobalLiquidation, type GlobalPartialLiquidation, type HistoricBoxReward, type HistoricalBoxRewardsStats, type HistoricalDeposit, type HistoricalFullLiquidation, type HistoricalFunding, type HistoricalLiquidatedBorrow, type HistoricalLiquidatedCollateral, type HistoricalLiquidatedLend, type HistoricalLiquidatedPosition, type HistoricalLiquidationCancelOrders, type HistoricalPartialLiquidatedPosition, type HistoricalPartialLiquidation, type HistoricalPerpOrder, type HistoricalPoints, type HistoricalPosition, type HistoricalReferralStats, type HistoricalSpotOrder, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IndexPriceHistory, type IndexPriceLive, type Lend, type LendTokenParams, type Liquidation, type LiquidationCancelledOrderData, type LiquidationCancelledTriggerOrderData, MAINNET_CONFIG, type MarginStep, type NetworkConfig, type NetworkMode, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleState, type OracleUpdate, type OracleUpdates, type OrderBookData, OrderSide, OrderStatus, OrderType, type PaginationCursor, type PartialLiquidation, type PerpFill, type PerpMarketConfigEntry, type PerpMarketData, type PerpMarketDataUpdate, type PerpOrder, type PerpOrderData, type PerpOrderDataForMarket, type PerpOrderFills, type PerpOrderbookState, type PerpOrderbookUpdate, type PerpPosition, type PerpTrade, type PerpTradesUpdate, type PerpTriggerOrder, type PerpTriggerOrderTriggered, type PlaceMultiplePerpOrdersParams, type PlaceMultipleSpotOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PlacePerpTriggerOrder, type PlacePerpTriggerOrderParams, type PlaceSpotLimitOrder, type PlaceSpotMarketOrder, type PlaceSpotOrderParams, type PointsRankingEntry, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type ReplaceMultipleSpotOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, type SpotFill, type SpotMarketConfigEntry, type SpotMarketData, type SpotMarketDataUpdate, type SpotOrder, type SpotOrderData, type SpotOrderDataForMarket, type SpotOrderFills, type SpotOrderbookState, type SpotOrderbookUpdate, type SpotTrade, type SpotTradesUpdate, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TESTNET_CONFIG, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, TransferAction, type TransferToUserParams, type TriggerOrder, type TvlTokenEntry, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPointsBreakdown, type UserPortfolioValue, type UserRewardsValue, type UserState, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WithdrawTokenParams, type WsBorrowLendUpdate, type WsBoxOpeningUpdate, type WsCommand, type WsFill, type WsLiquidatedBorrow, type WsLiquidatedCollateral, type WsLiquidatedLend, type WsLiquidatedPosition, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPartialLiquidatedPosition, type WsPerpMarketDataUpdate, type WsPerpMarketUpdates, type WsSpotMarketDataUpdate, type WsSpotMarketUpdates, type WsUserUpdates, createAptosClient, createAptosClientFromEnv, generateApiKey, getABIsForNetwork, getNetworkConfig, getNetworkModeFromEnv, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, nowInMilliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
7628
|
+
export { ABIs, type AccountValueRankingEntry, type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendState, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type ClientConfig, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, EndpointsV2, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type ExchangeStatsEntry, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetAccountValueRankingRequest, type GetAccountValueRankingResponse, type GetAllVaultsIdsResponse, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetExchangeStatsHistoryRequest, type GetExchangeStatsHistoryResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexPricesResponse, type GetIndexerStatusResponse, type GetOrderBookDataRequest, type GetOrderBookDataResponse, type GetPerpMarketsConfigResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpUserTriggerOrdersRequest, type GetPerpUserTriggerOrdersResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetSpotMarketsConfigResponse, type GetSpotMarketsDataRequest, type GetSpotMarketsDataResponse, type GetSpotRecentTradesRequest, type GetSpotRecentTradesResponse, type GetSpotUserFillsRequest, type GetSpotUserFillsResponse, type GetSpotUserOrdersRequest, type GetSpotUserOrdersResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetTopPointsRankingResponse, type GetUserAccountValueRankingRequest, type GetUserAccountValueRankingResponse, type GetUserAggregatedBoxRewardsStatsRequest, type GetUserAggregatedBoxRewardsStatsResponse, type GetUserAggregatedBoxRewardsStatsV2Request, type GetUserAggregatedBoxRewardsStatsV2Response, type GetUserAggregatedLiquidationStatsRequest, type GetUserAggregatedLiquidationStatsResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedReferralStatsV2Request, type GetUserAggregatedReferralStatsV2Response, type GetUserAggregatedRewardsValueRequest, type GetUserAggregatedRewardsValueResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedStatsV2Request, type GetUserAggregatedStatsV2Response, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserBoxRewardsStatsHistoryRequest, type GetUserBoxRewardsStatsHistoryResponse, type GetUserBoxRewardsStatsV2HistoryRequest, type GetUserBoxRewardsStatsV2HistoryResponse, type GetUserBoxesHistoryRequest, type GetUserBoxesHistoryResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFullLiquidationsHistoryRequest, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsCancelHistoryResponse, type GetUserLiquidationsCancelOrdersHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPartialLiquidationsHistoryRequest, type GetUserPartialLiquidationsHistoryResponse, type GetUserPersonalPointsRankingRequest, type GetUserPersonalPointsRankingResponse, type GetUserPointsHistoryRequest, type GetUserPointsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserPositionsRequest, type GetUserPositionsResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserReferralStatsV2HistoryRequest, type GetUserReferralStatsV2HistoryResponse, type GetUserRewardsValueRequest, type GetUserRewardsValueResponse, type GetUserRewardsValueV2Request, type GetUserRewardsValueV2Response, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTradeStatsV2HistoryRequest, type GetUserTradeStatsV2HistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type GlobalLiquidation, type GlobalPartialLiquidation, type HistoricBoxReward, type HistoricalBoxRewardsStats, type HistoricalBoxRewardsStatsV2, type HistoricalDeposit, type HistoricalFullLiquidation, type HistoricalFunding, type HistoricalLiquidatedBorrow, type HistoricalLiquidatedCollateral, type HistoricalLiquidatedLend, type HistoricalLiquidatedPosition, type HistoricalLiquidationCancelOrders, type HistoricalPartialLiquidatedPosition, type HistoricalPartialLiquidation, type HistoricalPerpOrder, type HistoricalPoints, type HistoricalPosition, type HistoricalReferralStats, type HistoricalReferralStatsV2, type HistoricalSpotOrder, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalTradeStatsV2, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IndexPriceHistory, type IndexPriceLive, type Lend, type LendTokenParams, type Liquidation, type LiquidationCancelledOrderData, type LiquidationCancelledTriggerOrderData, MAINNET_CONFIG, type MarginStep, type MarketLiquidationStats, type MarketStatsResponse, type NetworkConfig, type NetworkMode, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleState, type OracleUpdate, type OracleUpdates, type OrderBookData, OrderSide, OrderStatus, OrderType, type PaginationCursor, type PartialLiquidation, type PerpFill, type PerpMarketConfigEntry, type PerpMarketData, type PerpMarketDataUpdate, type PerpOrder, type PerpOrderData, type PerpOrderDataForMarket, type PerpOrderFills, type PerpOrderbookState, type PerpOrderbookUpdate, type PerpPosition, type PerpTrade, type PerpTradesUpdate, type PerpTriggerOrder, type PerpTriggerOrderTriggered, type PlaceMultiplePerpOrdersParams, type PlaceMultipleSpotOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PlacePerpTriggerOrder, type PlacePerpTriggerOrderParams, type PlaceSpotLimitOrder, type PlaceSpotMarketOrder, type PlaceSpotOrderParams, type PointsRankingEntry, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type ReplaceMultipleSpotOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, type SpotFill, type SpotMarketConfigEntry, type SpotMarketData, type SpotMarketDataUpdate, type SpotOrder, type SpotOrderData, type SpotOrderDataForMarket, type SpotOrderFills, type SpotOrderbookState, type SpotOrderbookUpdate, type SpotTrade, type SpotTradesUpdate, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TESTNET_CONFIG, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenAmountUsd, type TokenConfigEntry, type TokenLiquidationStats, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, TransferAction, type TransferToUserParams, type TriggerOrder, type TvlTokenEntry, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedBoxRewardsStatsV2, type UserAggregatedLiquidationStats, type UserAggregatedReferralStats, type UserAggregatedReferralStatsV2, type UserAggregatedRewardsValue, type UserAggregatedStats, type UserAggregatedStatsV2, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPointsBreakdown, type UserPortfolioValue, type UserRewardsValue, type UserRewardsValueV2, type UserState, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WithdrawTokenParams, type WsBorrowLendUpdate, type WsBoxOpeningUpdate, type WsCommand, type WsFill, type WsLiquidatedBorrow, type WsLiquidatedCollateral, type WsLiquidatedLend, type WsLiquidatedPosition, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPartialLiquidatedPosition, type WsPerpMarketDataUpdate, type WsPerpMarketUpdates, type WsSpotMarketDataUpdate, type WsSpotMarketUpdates, type WsUserUpdates, createAptosClient, createAptosClientFromEnv, generateApiKey, getABIsForNetwork, getNetworkConfig, getNetworkModeFromEnv, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, nowInMilliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.js
CHANGED
|
@@ -130,6 +130,18 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
130
130
|
EndpointsV12["GetExchangeStatsHistory"] = "/v1/get_exchange_stats_history";
|
|
131
131
|
return EndpointsV12;
|
|
132
132
|
})(EndpointsV1 || {});
|
|
133
|
+
var EndpointsV2 = /* @__PURE__ */ ((EndpointsV22) => {
|
|
134
|
+
EndpointsV22["GetUserAggregatedStats"] = "/v2/get_user_aggregated_stats";
|
|
135
|
+
EndpointsV22["GetUserAggregatedReferral"] = "/v2/get_user_aggregated_referral";
|
|
136
|
+
EndpointsV22["GetUserReferralStats"] = "/v2/get_user_referral_stats";
|
|
137
|
+
EndpointsV22["GetUserTradeStats"] = "/v2/get_user_trade_stats";
|
|
138
|
+
EndpointsV22["GetUserAggregatedBoxRewardsStats"] = "/v2/get_user_aggregated_box_rewards_stats";
|
|
139
|
+
EndpointsV22["GetUserBoxRewardsStats"] = "/v2/get_user_box_rewards_stats";
|
|
140
|
+
EndpointsV22["GetUserRewardsValue"] = "/v2/get_user_rewards_value";
|
|
141
|
+
EndpointsV22["GetUserAggregatedRewardsValue"] = "/v2/get_user_aggregated_rewards_value";
|
|
142
|
+
EndpointsV22["GetUserAggregatedLiquidationStats"] = "/v2/get_user_aggregated_liquidation_stats";
|
|
143
|
+
return EndpointsV22;
|
|
144
|
+
})(EndpointsV2 || {});
|
|
133
145
|
var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
134
146
|
UserStatus2["Active"] = "Active";
|
|
135
147
|
UserStatus2["Locked"] = "Locked";
|
|
@@ -24140,7 +24152,7 @@ var Client = class _Client {
|
|
|
24140
24152
|
maxGasAmount: tx.rawTransaction.max_gas_amount.toString(),
|
|
24141
24153
|
gasUnitPrice: tx.rawTransaction.gas_unit_price.toString(),
|
|
24142
24154
|
expirationTimestampSecs: tx.rawTransaction.expiration_timestamp_secs.toString(),
|
|
24143
|
-
chainId:
|
|
24155
|
+
chainId: tx.rawTransaction.chain_id.chainId.toString(),
|
|
24144
24156
|
authenticator: Array.from(signature.bcsToBytes()),
|
|
24145
24157
|
secondarySigners: [],
|
|
24146
24158
|
secondarySignersAuthenticators: []
|
|
@@ -24168,7 +24180,7 @@ var Client = class _Client {
|
|
|
24168
24180
|
maxGasAmount: tx.rawTransaction.max_gas_amount.toString(),
|
|
24169
24181
|
gasUnitPrice: tx.rawTransaction.gas_unit_price.toString(),
|
|
24170
24182
|
expirationTimestampSecs: tx.rawTransaction.expiration_timestamp_secs.toString(),
|
|
24171
|
-
chainId:
|
|
24183
|
+
chainId: tx.rawTransaction.chain_id.chainId.toString(),
|
|
24172
24184
|
authenticator: Array.from(signature.bcsToBytes()),
|
|
24173
24185
|
secondarySigners: tx.secondarySignerAddresses.map((s) => s.toString()),
|
|
24174
24186
|
secondarySignersAuthenticators: secondarySignersAuthenticators.map(
|
|
@@ -24566,6 +24578,7 @@ var Client = class _Client {
|
|
|
24566
24578
|
/**
|
|
24567
24579
|
* getUserRewardsValueHistory.
|
|
24568
24580
|
*
|
|
24581
|
+
* @deprecated Use {@link getUserRewardsValueHistoryV2} — per-token amount and USD value breakdown.
|
|
24569
24582
|
* @param request - See {@link GetUserRewardsValueRequest}.
|
|
24570
24583
|
*/
|
|
24571
24584
|
this.getUserRewardsValueHistory = async (request) => {
|
|
@@ -24581,6 +24594,7 @@ var Client = class _Client {
|
|
|
24581
24594
|
/**
|
|
24582
24595
|
* getUserTradeStatsHistory.
|
|
24583
24596
|
*
|
|
24597
|
+
* @deprecated Use {@link getUserTradeStatsHistoryV2} — per-market trade breakdown via MarketStats.
|
|
24584
24598
|
* @param request - See {@link GetUserTradeStatsHistoryRequest}.
|
|
24585
24599
|
*/
|
|
24586
24600
|
this.getUserTradeStatsHistory = async (request) => {
|
|
@@ -24596,6 +24610,7 @@ var Client = class _Client {
|
|
|
24596
24610
|
/**
|
|
24597
24611
|
* getUserAggregatedStats.
|
|
24598
24612
|
*
|
|
24613
|
+
* @deprecated Use {@link getUserAggregatedStatsV2} — per-market breakdown and per-token USD values.
|
|
24599
24614
|
* @param request - See {@link GetUserAggregatedStatsRequest}.
|
|
24600
24615
|
*/
|
|
24601
24616
|
this.getUserAggregatedStats = async (request) => {
|
|
@@ -24608,6 +24623,7 @@ var Client = class _Client {
|
|
|
24608
24623
|
/**
|
|
24609
24624
|
* getUserBoxRewardsStatsHistory.
|
|
24610
24625
|
*
|
|
24626
|
+
* @deprecated Use {@link getUserBoxRewardsStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
24611
24627
|
* @param request - See {@link GetUserBoxRewardsStatsHistoryRequest}.
|
|
24612
24628
|
*/
|
|
24613
24629
|
this.getUserBoxRewardsStatsHistory = async (request) => {
|
|
@@ -24623,6 +24639,7 @@ var Client = class _Client {
|
|
|
24623
24639
|
/**
|
|
24624
24640
|
* getUserAggregatedBoxRewardsStats.
|
|
24625
24641
|
*
|
|
24642
|
+
* @deprecated Use {@link getUserAggregatedBoxRewardsStatsV2} — per-token amount and USD value breakdown.
|
|
24626
24643
|
* @param request - See {@link GetUserAggregatedBoxRewardsStatsRequest}.
|
|
24627
24644
|
*/
|
|
24628
24645
|
this.getUserAggregatedBoxRewardsStats = async (request) => {
|
|
@@ -24635,6 +24652,7 @@ var Client = class _Client {
|
|
|
24635
24652
|
/**
|
|
24636
24653
|
* getUserReferralStatsHistory.
|
|
24637
24654
|
*
|
|
24655
|
+
* @deprecated Use {@link getUserReferralStatsHistoryV2} — per-token amount and USD value breakdown.
|
|
24638
24656
|
* @param request - See {@link GetUserReferralStatsHistoryRequest}.
|
|
24639
24657
|
*/
|
|
24640
24658
|
this.getUserReferralStatsHistory = async (request) => {
|
|
@@ -24650,6 +24668,7 @@ var Client = class _Client {
|
|
|
24650
24668
|
/**
|
|
24651
24669
|
* getUserAggregatedReferralStats.
|
|
24652
24670
|
*
|
|
24671
|
+
* @deprecated Use {@link getUserAggregatedReferralStatsV2} — per-token amount and USD value breakdown.
|
|
24653
24672
|
* @param request - See {@link GetUserAggregatedReferralStatsRequest}.
|
|
24654
24673
|
*/
|
|
24655
24674
|
this.getUserAggregatedReferralStats = async (request) => {
|
|
@@ -24659,6 +24678,134 @@ var Client = class _Client {
|
|
|
24659
24678
|
);
|
|
24660
24679
|
return response;
|
|
24661
24680
|
};
|
|
24681
|
+
// ─── v2 endpoints ──────────────────────────────────────────────────────────
|
|
24682
|
+
// Per-market trade breakdowns and per-token (amount, usdValue) tuples.
|
|
24683
|
+
/**
|
|
24684
|
+
* getUserRewardsValueHistoryV2.
|
|
24685
|
+
*
|
|
24686
|
+
* @param request - See {@link GetUserRewardsValueV2Request}.
|
|
24687
|
+
*/
|
|
24688
|
+
this.getUserRewardsValueHistoryV2 = async (request) => {
|
|
24689
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24690
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24691
|
+
}
|
|
24692
|
+
const response = await this.sendGetJson(
|
|
24693
|
+
"/v2/get_user_rewards_value" /* GetUserRewardsValue */,
|
|
24694
|
+
request
|
|
24695
|
+
);
|
|
24696
|
+
return response;
|
|
24697
|
+
};
|
|
24698
|
+
/**
|
|
24699
|
+
* getUserTradeStatsHistoryV2.
|
|
24700
|
+
*
|
|
24701
|
+
* @param request - See {@link GetUserTradeStatsV2HistoryRequest}.
|
|
24702
|
+
*/
|
|
24703
|
+
this.getUserTradeStatsHistoryV2 = async (request) => {
|
|
24704
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24705
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24706
|
+
}
|
|
24707
|
+
const response = await this.sendGetJson(
|
|
24708
|
+
"/v2/get_user_trade_stats" /* GetUserTradeStats */,
|
|
24709
|
+
request
|
|
24710
|
+
);
|
|
24711
|
+
return response;
|
|
24712
|
+
};
|
|
24713
|
+
/**
|
|
24714
|
+
* getUserAggregatedStatsV2.
|
|
24715
|
+
*
|
|
24716
|
+
* @param request - See {@link GetUserAggregatedStatsV2Request}.
|
|
24717
|
+
*/
|
|
24718
|
+
this.getUserAggregatedStatsV2 = async (request) => {
|
|
24719
|
+
const response = await this.sendGetJson(
|
|
24720
|
+
"/v2/get_user_aggregated_stats" /* GetUserAggregatedStats */,
|
|
24721
|
+
request
|
|
24722
|
+
);
|
|
24723
|
+
return response;
|
|
24724
|
+
};
|
|
24725
|
+
/**
|
|
24726
|
+
* getUserBoxRewardsStatsHistoryV2.
|
|
24727
|
+
*
|
|
24728
|
+
* @param request - See {@link GetUserBoxRewardsStatsV2HistoryRequest}.
|
|
24729
|
+
*/
|
|
24730
|
+
this.getUserBoxRewardsStatsHistoryV2 = async (request) => {
|
|
24731
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24732
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24733
|
+
}
|
|
24734
|
+
const response = await this.sendGetJson(
|
|
24735
|
+
"/v2/get_user_box_rewards_stats" /* GetUserBoxRewardsStats */,
|
|
24736
|
+
request
|
|
24737
|
+
);
|
|
24738
|
+
return response;
|
|
24739
|
+
};
|
|
24740
|
+
/**
|
|
24741
|
+
* getUserAggregatedBoxRewardsStatsV2.
|
|
24742
|
+
*
|
|
24743
|
+
* @param request - See {@link GetUserAggregatedBoxRewardsStatsV2Request}.
|
|
24744
|
+
*/
|
|
24745
|
+
this.getUserAggregatedBoxRewardsStatsV2 = async (request) => {
|
|
24746
|
+
const response = await this.sendGetJson(
|
|
24747
|
+
"/v2/get_user_aggregated_box_rewards_stats" /* GetUserAggregatedBoxRewardsStats */,
|
|
24748
|
+
request
|
|
24749
|
+
);
|
|
24750
|
+
return response;
|
|
24751
|
+
};
|
|
24752
|
+
/**
|
|
24753
|
+
* getUserReferralStatsHistoryV2.
|
|
24754
|
+
*
|
|
24755
|
+
* @param request - See {@link GetUserReferralStatsV2HistoryRequest}.
|
|
24756
|
+
*/
|
|
24757
|
+
this.getUserReferralStatsHistoryV2 = async (request) => {
|
|
24758
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24759
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24760
|
+
}
|
|
24761
|
+
const response = await this.sendGetJson(
|
|
24762
|
+
"/v2/get_user_referral_stats" /* GetUserReferralStats */,
|
|
24763
|
+
request
|
|
24764
|
+
);
|
|
24765
|
+
return response;
|
|
24766
|
+
};
|
|
24767
|
+
/**
|
|
24768
|
+
* getUserAggregatedReferralStatsV2.
|
|
24769
|
+
*
|
|
24770
|
+
* @param request - See {@link GetUserAggregatedReferralStatsV2Request}.
|
|
24771
|
+
*/
|
|
24772
|
+
this.getUserAggregatedReferralStatsV2 = async (request) => {
|
|
24773
|
+
const response = await this.sendGetJson(
|
|
24774
|
+
"/v2/get_user_aggregated_referral" /* GetUserAggregatedReferral */,
|
|
24775
|
+
request
|
|
24776
|
+
);
|
|
24777
|
+
return response;
|
|
24778
|
+
};
|
|
24779
|
+
/**
|
|
24780
|
+
* getUserAggregatedRewardsValue.
|
|
24781
|
+
*
|
|
24782
|
+
* Lifetime aggregated reward earnings with per-token amount and USD value breakdown.
|
|
24783
|
+
* v2-only — no v1 equivalent.
|
|
24784
|
+
*
|
|
24785
|
+
* @param request - See {@link GetUserAggregatedRewardsValueRequest}.
|
|
24786
|
+
*/
|
|
24787
|
+
this.getUserAggregatedRewardsValue = async (request) => {
|
|
24788
|
+
const response = await this.sendGetJson(
|
|
24789
|
+
"/v2/get_user_aggregated_rewards_value" /* GetUserAggregatedRewardsValue */,
|
|
24790
|
+
request
|
|
24791
|
+
);
|
|
24792
|
+
return response;
|
|
24793
|
+
};
|
|
24794
|
+
/**
|
|
24795
|
+
* getUserAggregatedLiquidationStats.
|
|
24796
|
+
*
|
|
24797
|
+
* Lifetime liquidation stats with per-market and per-token breakdowns.
|
|
24798
|
+
* v2-only — no v1 equivalent.
|
|
24799
|
+
*
|
|
24800
|
+
* @param request - See {@link GetUserAggregatedLiquidationStatsRequest}.
|
|
24801
|
+
*/
|
|
24802
|
+
this.getUserAggregatedLiquidationStats = async (request) => {
|
|
24803
|
+
const response = await this.sendGetJson(
|
|
24804
|
+
"/v2/get_user_aggregated_liquidation_stats" /* GetUserAggregatedLiquidationStats */,
|
|
24805
|
+
request
|
|
24806
|
+
);
|
|
24807
|
+
return response;
|
|
24808
|
+
};
|
|
24662
24809
|
/**
|
|
24663
24810
|
* getUserClaimedKickbackHistory.
|
|
24664
24811
|
*
|
|
@@ -26793,6 +26940,7 @@ export {
|
|
|
26793
26940
|
ChartInterval,
|
|
26794
26941
|
Client,
|
|
26795
26942
|
EndpointsV1,
|
|
26943
|
+
EndpointsV2,
|
|
26796
26944
|
ExchangeProxies,
|
|
26797
26945
|
GLOBAL_DENOMINATOR,
|
|
26798
26946
|
MAINNET_CONFIG,
|