@nightlylabs/dex-sdk 0.1.67 → 0.1.68
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 +26 -0
- package/dist/index.d.cts +83 -3
- package/dist/index.d.ts +83 -3
- package/dist/index.js +26 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -780,8 +780,10 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
780
780
|
EndpointsV12["SyncStatus"] = "/v1/sync_status";
|
|
781
781
|
EndpointsV12["GetUserAggregatedReferral"] = "/v1/get_user_aggregated_referral";
|
|
782
782
|
EndpointsV12["GetUserAggregatedStats"] = "/v1/get_user_aggregated_stats";
|
|
783
|
+
EndpointsV12["GetUserAggregatedBoxRewardsStats"] = "/v1/get_user_aggregated_box_rewards_stats";
|
|
783
784
|
EndpointsV12["GetUserReferralStats"] = "/v1/get_user_referral_stats";
|
|
784
785
|
EndpointsV12["GetUserTradeStats"] = "/v1/get_user_trade_stats";
|
|
786
|
+
EndpointsV12["GetUserBoxRewardsStats"] = "/v1/get_user_box_rewards_stats";
|
|
785
787
|
EndpointsV12["GetUserClaimedKickback"] = "/v1/get_user_claimed_kickback";
|
|
786
788
|
EndpointsV12["GetUserClaimedReferral"] = "/v1/get_user_claimed_referral";
|
|
787
789
|
EndpointsV12["GetUserTransfers"] = "/v1/get_user_transfers";
|
|
@@ -804,6 +806,7 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
804
806
|
EndpointsV12["GetUserVolumeForReferral"] = "/v1/get_required_volume_for_referral";
|
|
805
807
|
EndpointsV12["GetUserRewardsValue"] = "/v1/get_user_rewards_value";
|
|
806
808
|
EndpointsV12["OpenBoxes"] = "/v1/open_boxes";
|
|
809
|
+
EndpointsV12["GetUserBoxesHistory"] = "/v1/get_user_boxes_history";
|
|
807
810
|
return EndpointsV12;
|
|
808
811
|
})(EndpointsV1 || {});
|
|
809
812
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -956,6 +959,8 @@ var getTopicFromMessage = (data) => {
|
|
|
956
959
|
return data.type;
|
|
957
960
|
case "BoxOpening":
|
|
958
961
|
return data.type;
|
|
962
|
+
case "UserBoxOpening":
|
|
963
|
+
return data.type;
|
|
959
964
|
case "ClaimReferralFee":
|
|
960
965
|
return data.content.userId;
|
|
961
966
|
case "UpdateUserFeeTier":
|
|
@@ -1391,6 +1396,20 @@ var Client = class _Client {
|
|
|
1391
1396
|
const response = await this.sendGetJson("/v1/get_user_aggregated_stats" /* GetUserAggregatedStats */, request);
|
|
1392
1397
|
return response;
|
|
1393
1398
|
};
|
|
1399
|
+
this.getUserBoxRewardsStatsHistory = async (request) => {
|
|
1400
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1401
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1402
|
+
}
|
|
1403
|
+
const response = await this.sendGetJson("/v1/get_user_box_rewards_stats" /* GetUserBoxRewardsStats */, request);
|
|
1404
|
+
return response;
|
|
1405
|
+
};
|
|
1406
|
+
this.getUserAggregatedBoxRewardsStats = async (request) => {
|
|
1407
|
+
const response = await this.sendGetJson(
|
|
1408
|
+
"/v1/get_user_aggregated_box_rewards_stats" /* GetUserAggregatedBoxRewardsStats */,
|
|
1409
|
+
request
|
|
1410
|
+
);
|
|
1411
|
+
return response;
|
|
1412
|
+
};
|
|
1394
1413
|
this.getUserReferralStatsHistory = async (request) => {
|
|
1395
1414
|
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1396
1415
|
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
@@ -1508,6 +1527,13 @@ var Client = class _Client {
|
|
|
1508
1527
|
const response = await this.sendGetJson("/v1/get_vault_withdrawals" /* GetVaultWithdrawals */, request);
|
|
1509
1528
|
return response;
|
|
1510
1529
|
};
|
|
1530
|
+
this.getUserBoxesHistory = async (request) => {
|
|
1531
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1532
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1533
|
+
}
|
|
1534
|
+
const response = await this.sendGetJson("/v1/get_user_boxes_history" /* GetUserBoxesHistory */, request);
|
|
1535
|
+
return response;
|
|
1536
|
+
};
|
|
1511
1537
|
this.getUserRequiredVolumeForReferral = async (request) => {
|
|
1512
1538
|
const response = await this.sendGetJson("/v1/get_required_volume_for_referral" /* GetUserVolumeForReferral */, request);
|
|
1513
1539
|
return response;
|
package/dist/index.d.cts
CHANGED
|
@@ -96,6 +96,19 @@ interface BoxReward {
|
|
|
96
96
|
pointsAmount?: string;
|
|
97
97
|
badgeType?: BoxRewardTier;
|
|
98
98
|
}
|
|
99
|
+
interface BoxReward {
|
|
100
|
+
userId: string;
|
|
101
|
+
txHash: string;
|
|
102
|
+
boxId: string;
|
|
103
|
+
boxIndex: number;
|
|
104
|
+
rewardTier: BoxRewardTier;
|
|
105
|
+
tokenAddress?: string;
|
|
106
|
+
tokenAmount?: string;
|
|
107
|
+
pointsAmount?: string;
|
|
108
|
+
badgeType?: BoxRewardTier;
|
|
109
|
+
boxCost: string;
|
|
110
|
+
timestamp: string;
|
|
111
|
+
}
|
|
99
112
|
interface BoxReward {
|
|
100
113
|
tier: string;
|
|
101
114
|
tokenAddress?: string;
|
|
@@ -494,6 +507,21 @@ interface GetTokensConfigResponse {
|
|
|
494
507
|
tokens: Record<string, TokenConfigEntry>;
|
|
495
508
|
usdcAddress?: string;
|
|
496
509
|
}
|
|
510
|
+
interface GetUserAggregatedBoxRewardsStatsRequest {
|
|
511
|
+
userId: string;
|
|
512
|
+
}
|
|
513
|
+
interface UserAggregatedBoxRewardsStats {
|
|
514
|
+
userId: string;
|
|
515
|
+
boxOpeningCount: Record<string, string>;
|
|
516
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
517
|
+
tokenRewards: Record<string, string>;
|
|
518
|
+
badges: Record<BoxRewardTier, string>;
|
|
519
|
+
pointsRewardsTotal: string;
|
|
520
|
+
pointsCostTotal: string;
|
|
521
|
+
}
|
|
522
|
+
interface GetUserAggregatedBoxRewardsStatsResponse {
|
|
523
|
+
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStats;
|
|
524
|
+
}
|
|
497
525
|
interface GetUserAggregatedReferralStatsRequest {
|
|
498
526
|
userId: string;
|
|
499
527
|
paginationCursor?: PaginationCursor;
|
|
@@ -548,6 +576,37 @@ interface UserAggregatedVaultStats {
|
|
|
548
576
|
interface GetUserAggregatedVaultStatsResponse {
|
|
549
577
|
userAggregatedVaultStats: UserAggregatedVaultStats[];
|
|
550
578
|
}
|
|
579
|
+
interface GetUserBoxRewardsStatsHistoryRequest {
|
|
580
|
+
userId: string;
|
|
581
|
+
olderTimestampMs?: string;
|
|
582
|
+
newerTimestampMs?: string;
|
|
583
|
+
paginationCursor?: PaginationCursor;
|
|
584
|
+
}
|
|
585
|
+
interface HistoricalBoxRewardsStats {
|
|
586
|
+
userId: string;
|
|
587
|
+
boxOpeningCount: Record<string, string>;
|
|
588
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
589
|
+
tokenRewards: Record<string, string>;
|
|
590
|
+
badges: Record<BoxRewardTier, string>;
|
|
591
|
+
pointsRewardsTotal: string;
|
|
592
|
+
pointsCostTotal: string;
|
|
593
|
+
timestampOpen: string;
|
|
594
|
+
timestampClose: string;
|
|
595
|
+
}
|
|
596
|
+
interface GetUserBoxRewardsStatsHistoryResponse {
|
|
597
|
+
stats: HistoricalBoxRewardsStats[];
|
|
598
|
+
paginationCursor?: PaginationCursor;
|
|
599
|
+
}
|
|
600
|
+
interface GetUserBoxesHistoryRequest {
|
|
601
|
+
userId: string;
|
|
602
|
+
olderTimestampMs?: string;
|
|
603
|
+
newerTimestampMs?: string;
|
|
604
|
+
paginationCursor?: PaginationCursor;
|
|
605
|
+
}
|
|
606
|
+
interface GetUserBoxesHistoryResponse {
|
|
607
|
+
boxes: BoxReward[];
|
|
608
|
+
paginationCursor?: PaginationCursor;
|
|
609
|
+
}
|
|
551
610
|
interface GetUserClaimedKickbackHistoryRequest {
|
|
552
611
|
userId: string;
|
|
553
612
|
olderTimestampMs?: string;
|
|
@@ -1025,6 +1084,18 @@ interface UpdateUserFeeTier {
|
|
|
1025
1084
|
userId: string;
|
|
1026
1085
|
newTierIndex: string;
|
|
1027
1086
|
}
|
|
1087
|
+
interface UserBoxOpeningEvent {
|
|
1088
|
+
txHash: string;
|
|
1089
|
+
userId: string;
|
|
1090
|
+
boxId: string;
|
|
1091
|
+
rewards: BoxReward[];
|
|
1092
|
+
tokenAddress?: string;
|
|
1093
|
+
totalToken?: string;
|
|
1094
|
+
totalPoints: string;
|
|
1095
|
+
pointsCost: string;
|
|
1096
|
+
timestamp: string;
|
|
1097
|
+
userPointsBalance: string;
|
|
1098
|
+
}
|
|
1028
1099
|
interface UserTransfer {
|
|
1029
1100
|
senderId: string;
|
|
1030
1101
|
receiverId: string;
|
|
@@ -1085,8 +1156,10 @@ declare enum EndpointsV1 {
|
|
|
1085
1156
|
SyncStatus = "/v1/sync_status",
|
|
1086
1157
|
GetUserAggregatedReferral = "/v1/get_user_aggregated_referral",
|
|
1087
1158
|
GetUserAggregatedStats = "/v1/get_user_aggregated_stats",
|
|
1159
|
+
GetUserAggregatedBoxRewardsStats = "/v1/get_user_aggregated_box_rewards_stats",
|
|
1088
1160
|
GetUserReferralStats = "/v1/get_user_referral_stats",
|
|
1089
1161
|
GetUserTradeStats = "/v1/get_user_trade_stats",
|
|
1162
|
+
GetUserBoxRewardsStats = "/v1/get_user_box_rewards_stats",
|
|
1090
1163
|
GetUserClaimedKickback = "/v1/get_user_claimed_kickback",
|
|
1091
1164
|
GetUserClaimedReferral = "/v1/get_user_claimed_referral",
|
|
1092
1165
|
GetUserTransfers = "/v1/get_user_transfers",
|
|
@@ -1108,7 +1181,8 @@ declare enum EndpointsV1 {
|
|
|
1108
1181
|
GetVaultDeposits = "/v1/get_vault_deposits",
|
|
1109
1182
|
GetUserVolumeForReferral = "/v1/get_required_volume_for_referral",
|
|
1110
1183
|
GetUserRewardsValue = "/v1/get_user_rewards_value",
|
|
1111
|
-
OpenBoxes = "/v1/open_boxes"
|
|
1184
|
+
OpenBoxes = "/v1/open_boxes",
|
|
1185
|
+
GetUserBoxesHistory = "/v1/get_user_boxes_history"
|
|
1112
1186
|
}
|
|
1113
1187
|
declare enum SpotMarketStatus {
|
|
1114
1188
|
Halted = "halted",
|
|
@@ -1310,6 +1384,9 @@ type WsMessage = {
|
|
|
1310
1384
|
} | {
|
|
1311
1385
|
type: "BoxOpening";
|
|
1312
1386
|
content: BoxOpeningEvent;
|
|
1387
|
+
} | {
|
|
1388
|
+
type: "UserBoxOpening";
|
|
1389
|
+
content: UserBoxOpeningEvent;
|
|
1313
1390
|
} | {
|
|
1314
1391
|
type: "Liquidation";
|
|
1315
1392
|
content: Liquidation;
|
|
@@ -1484,7 +1561,7 @@ type WsOracleUpdates = Extract<WsMessage, {
|
|
|
1484
1561
|
type: 'OracleUpdates';
|
|
1485
1562
|
}>;
|
|
1486
1563
|
type WsUserUpdates = Extract<WsMessage, {
|
|
1487
|
-
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange' | 'VaultDeposit' | 'VaultWithdraw' | '
|
|
1564
|
+
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange' | 'VaultDeposit' | 'VaultWithdraw' | 'UserBoxOpening' | 'Liquidation';
|
|
1488
1565
|
}>;
|
|
1489
1566
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
1490
1567
|
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
@@ -1683,6 +1760,8 @@ declare class Client {
|
|
|
1683
1760
|
getUserRewardsValueHistory: (request: GetUserRewardsValueRequest) => Promise<GetUserRewardsValueResponse>;
|
|
1684
1761
|
getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
|
|
1685
1762
|
getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
|
|
1763
|
+
getUserBoxRewardsStatsHistory: (request: GetUserBoxRewardsStatsHistoryRequest) => Promise<GetUserBoxRewardsStatsHistoryResponse>;
|
|
1764
|
+
getUserAggregatedBoxRewardsStats: (request: GetUserAggregatedBoxRewardsStatsRequest) => Promise<GetUserAggregatedBoxRewardsStatsResponse>;
|
|
1686
1765
|
getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
|
|
1687
1766
|
getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
|
|
1688
1767
|
getUserClaimedKickbackHistory: (request: GetUserClaimedKickbackHistoryRequest) => Promise<GetUserClaimedKickbackHistoryResponse>;
|
|
@@ -1703,6 +1782,7 @@ declare class Client {
|
|
|
1703
1782
|
getIndexerStatus: () => Promise<GetIndexerStatusResponse>;
|
|
1704
1783
|
getVaultHistoricalDeposits: (request: GetVaultDepositsRequest) => Promise<GetVaultDepositsResponse>;
|
|
1705
1784
|
getVaultWithdrawals: (request: GetVaultWithdrawalsRequest) => Promise<GetVaultWithdrawalsResponse>;
|
|
1785
|
+
getUserBoxesHistory: (request: GetUserBoxesHistoryRequest) => Promise<GetUserBoxesHistoryResponse>;
|
|
1706
1786
|
getUserRequiredVolumeForReferral: (request: GetUserVolumeForReferralRequest) => Promise<GetUserVolumeForReferralResponse>;
|
|
1707
1787
|
getTime: () => Promise<string>;
|
|
1708
1788
|
}
|
|
@@ -1735,4 +1815,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1735
1815
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1736
1816
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1737
1817
|
|
|
1738
|
-
export { type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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 HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, type UserRewardsValue, 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 WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1818
|
+
export { type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, 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 GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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 HistoricalBoxRewardsStats, type HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPortfolioValue, type UserRewardsValue, 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 WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,19 @@ interface BoxReward {
|
|
|
96
96
|
pointsAmount?: string;
|
|
97
97
|
badgeType?: BoxRewardTier;
|
|
98
98
|
}
|
|
99
|
+
interface BoxReward {
|
|
100
|
+
userId: string;
|
|
101
|
+
txHash: string;
|
|
102
|
+
boxId: string;
|
|
103
|
+
boxIndex: number;
|
|
104
|
+
rewardTier: BoxRewardTier;
|
|
105
|
+
tokenAddress?: string;
|
|
106
|
+
tokenAmount?: string;
|
|
107
|
+
pointsAmount?: string;
|
|
108
|
+
badgeType?: BoxRewardTier;
|
|
109
|
+
boxCost: string;
|
|
110
|
+
timestamp: string;
|
|
111
|
+
}
|
|
99
112
|
interface BoxReward {
|
|
100
113
|
tier: string;
|
|
101
114
|
tokenAddress?: string;
|
|
@@ -494,6 +507,21 @@ interface GetTokensConfigResponse {
|
|
|
494
507
|
tokens: Record<string, TokenConfigEntry>;
|
|
495
508
|
usdcAddress?: string;
|
|
496
509
|
}
|
|
510
|
+
interface GetUserAggregatedBoxRewardsStatsRequest {
|
|
511
|
+
userId: string;
|
|
512
|
+
}
|
|
513
|
+
interface UserAggregatedBoxRewardsStats {
|
|
514
|
+
userId: string;
|
|
515
|
+
boxOpeningCount: Record<string, string>;
|
|
516
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
517
|
+
tokenRewards: Record<string, string>;
|
|
518
|
+
badges: Record<BoxRewardTier, string>;
|
|
519
|
+
pointsRewardsTotal: string;
|
|
520
|
+
pointsCostTotal: string;
|
|
521
|
+
}
|
|
522
|
+
interface GetUserAggregatedBoxRewardsStatsResponse {
|
|
523
|
+
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStats;
|
|
524
|
+
}
|
|
497
525
|
interface GetUserAggregatedReferralStatsRequest {
|
|
498
526
|
userId: string;
|
|
499
527
|
paginationCursor?: PaginationCursor;
|
|
@@ -548,6 +576,37 @@ interface UserAggregatedVaultStats {
|
|
|
548
576
|
interface GetUserAggregatedVaultStatsResponse {
|
|
549
577
|
userAggregatedVaultStats: UserAggregatedVaultStats[];
|
|
550
578
|
}
|
|
579
|
+
interface GetUserBoxRewardsStatsHistoryRequest {
|
|
580
|
+
userId: string;
|
|
581
|
+
olderTimestampMs?: string;
|
|
582
|
+
newerTimestampMs?: string;
|
|
583
|
+
paginationCursor?: PaginationCursor;
|
|
584
|
+
}
|
|
585
|
+
interface HistoricalBoxRewardsStats {
|
|
586
|
+
userId: string;
|
|
587
|
+
boxOpeningCount: Record<string, string>;
|
|
588
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
589
|
+
tokenRewards: Record<string, string>;
|
|
590
|
+
badges: Record<BoxRewardTier, string>;
|
|
591
|
+
pointsRewardsTotal: string;
|
|
592
|
+
pointsCostTotal: string;
|
|
593
|
+
timestampOpen: string;
|
|
594
|
+
timestampClose: string;
|
|
595
|
+
}
|
|
596
|
+
interface GetUserBoxRewardsStatsHistoryResponse {
|
|
597
|
+
stats: HistoricalBoxRewardsStats[];
|
|
598
|
+
paginationCursor?: PaginationCursor;
|
|
599
|
+
}
|
|
600
|
+
interface GetUserBoxesHistoryRequest {
|
|
601
|
+
userId: string;
|
|
602
|
+
olderTimestampMs?: string;
|
|
603
|
+
newerTimestampMs?: string;
|
|
604
|
+
paginationCursor?: PaginationCursor;
|
|
605
|
+
}
|
|
606
|
+
interface GetUserBoxesHistoryResponse {
|
|
607
|
+
boxes: BoxReward[];
|
|
608
|
+
paginationCursor?: PaginationCursor;
|
|
609
|
+
}
|
|
551
610
|
interface GetUserClaimedKickbackHistoryRequest {
|
|
552
611
|
userId: string;
|
|
553
612
|
olderTimestampMs?: string;
|
|
@@ -1025,6 +1084,18 @@ interface UpdateUserFeeTier {
|
|
|
1025
1084
|
userId: string;
|
|
1026
1085
|
newTierIndex: string;
|
|
1027
1086
|
}
|
|
1087
|
+
interface UserBoxOpeningEvent {
|
|
1088
|
+
txHash: string;
|
|
1089
|
+
userId: string;
|
|
1090
|
+
boxId: string;
|
|
1091
|
+
rewards: BoxReward[];
|
|
1092
|
+
tokenAddress?: string;
|
|
1093
|
+
totalToken?: string;
|
|
1094
|
+
totalPoints: string;
|
|
1095
|
+
pointsCost: string;
|
|
1096
|
+
timestamp: string;
|
|
1097
|
+
userPointsBalance: string;
|
|
1098
|
+
}
|
|
1028
1099
|
interface UserTransfer {
|
|
1029
1100
|
senderId: string;
|
|
1030
1101
|
receiverId: string;
|
|
@@ -1085,8 +1156,10 @@ declare enum EndpointsV1 {
|
|
|
1085
1156
|
SyncStatus = "/v1/sync_status",
|
|
1086
1157
|
GetUserAggregatedReferral = "/v1/get_user_aggregated_referral",
|
|
1087
1158
|
GetUserAggregatedStats = "/v1/get_user_aggregated_stats",
|
|
1159
|
+
GetUserAggregatedBoxRewardsStats = "/v1/get_user_aggregated_box_rewards_stats",
|
|
1088
1160
|
GetUserReferralStats = "/v1/get_user_referral_stats",
|
|
1089
1161
|
GetUserTradeStats = "/v1/get_user_trade_stats",
|
|
1162
|
+
GetUserBoxRewardsStats = "/v1/get_user_box_rewards_stats",
|
|
1090
1163
|
GetUserClaimedKickback = "/v1/get_user_claimed_kickback",
|
|
1091
1164
|
GetUserClaimedReferral = "/v1/get_user_claimed_referral",
|
|
1092
1165
|
GetUserTransfers = "/v1/get_user_transfers",
|
|
@@ -1108,7 +1181,8 @@ declare enum EndpointsV1 {
|
|
|
1108
1181
|
GetVaultDeposits = "/v1/get_vault_deposits",
|
|
1109
1182
|
GetUserVolumeForReferral = "/v1/get_required_volume_for_referral",
|
|
1110
1183
|
GetUserRewardsValue = "/v1/get_user_rewards_value",
|
|
1111
|
-
OpenBoxes = "/v1/open_boxes"
|
|
1184
|
+
OpenBoxes = "/v1/open_boxes",
|
|
1185
|
+
GetUserBoxesHistory = "/v1/get_user_boxes_history"
|
|
1112
1186
|
}
|
|
1113
1187
|
declare enum SpotMarketStatus {
|
|
1114
1188
|
Halted = "halted",
|
|
@@ -1310,6 +1384,9 @@ type WsMessage = {
|
|
|
1310
1384
|
} | {
|
|
1311
1385
|
type: "BoxOpening";
|
|
1312
1386
|
content: BoxOpeningEvent;
|
|
1387
|
+
} | {
|
|
1388
|
+
type: "UserBoxOpening";
|
|
1389
|
+
content: UserBoxOpeningEvent;
|
|
1313
1390
|
} | {
|
|
1314
1391
|
type: "Liquidation";
|
|
1315
1392
|
content: Liquidation;
|
|
@@ -1484,7 +1561,7 @@ type WsOracleUpdates = Extract<WsMessage, {
|
|
|
1484
1561
|
type: 'OracleUpdates';
|
|
1485
1562
|
}>;
|
|
1486
1563
|
type WsUserUpdates = Extract<WsMessage, {
|
|
1487
|
-
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange' | 'VaultDeposit' | 'VaultWithdraw' | '
|
|
1564
|
+
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange' | 'VaultDeposit' | 'VaultWithdraw' | 'UserBoxOpening' | 'Liquidation';
|
|
1488
1565
|
}>;
|
|
1489
1566
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
1490
1567
|
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
@@ -1683,6 +1760,8 @@ declare class Client {
|
|
|
1683
1760
|
getUserRewardsValueHistory: (request: GetUserRewardsValueRequest) => Promise<GetUserRewardsValueResponse>;
|
|
1684
1761
|
getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
|
|
1685
1762
|
getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
|
|
1763
|
+
getUserBoxRewardsStatsHistory: (request: GetUserBoxRewardsStatsHistoryRequest) => Promise<GetUserBoxRewardsStatsHistoryResponse>;
|
|
1764
|
+
getUserAggregatedBoxRewardsStats: (request: GetUserAggregatedBoxRewardsStatsRequest) => Promise<GetUserAggregatedBoxRewardsStatsResponse>;
|
|
1686
1765
|
getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
|
|
1687
1766
|
getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
|
|
1688
1767
|
getUserClaimedKickbackHistory: (request: GetUserClaimedKickbackHistoryRequest) => Promise<GetUserClaimedKickbackHistoryResponse>;
|
|
@@ -1703,6 +1782,7 @@ declare class Client {
|
|
|
1703
1782
|
getIndexerStatus: () => Promise<GetIndexerStatusResponse>;
|
|
1704
1783
|
getVaultHistoricalDeposits: (request: GetVaultDepositsRequest) => Promise<GetVaultDepositsResponse>;
|
|
1705
1784
|
getVaultWithdrawals: (request: GetVaultWithdrawalsRequest) => Promise<GetVaultWithdrawalsResponse>;
|
|
1785
|
+
getUserBoxesHistory: (request: GetUserBoxesHistoryRequest) => Promise<GetUserBoxesHistoryResponse>;
|
|
1706
1786
|
getUserRequiredVolumeForReferral: (request: GetUserVolumeForReferralRequest) => Promise<GetUserVolumeForReferralResponse>;
|
|
1707
1787
|
getTime: () => Promise<string>;
|
|
1708
1788
|
}
|
|
@@ -1735,4 +1815,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1735
1815
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1736
1816
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1737
1817
|
|
|
1738
|
-
export { type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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 HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, type UserRewardsValue, 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 WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1818
|
+
export { type AddApiCreditsParams, type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiCreditsChange, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type BorrowLendingAggregatedData, type BorrowLendingHistoricalData, type BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, 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 GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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 HistoricalBoxRewardsStats, type HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPortfolioValue, type UserRewardsValue, 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 WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.js
CHANGED
|
@@ -729,8 +729,10 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
729
729
|
EndpointsV12["SyncStatus"] = "/v1/sync_status";
|
|
730
730
|
EndpointsV12["GetUserAggregatedReferral"] = "/v1/get_user_aggregated_referral";
|
|
731
731
|
EndpointsV12["GetUserAggregatedStats"] = "/v1/get_user_aggregated_stats";
|
|
732
|
+
EndpointsV12["GetUserAggregatedBoxRewardsStats"] = "/v1/get_user_aggregated_box_rewards_stats";
|
|
732
733
|
EndpointsV12["GetUserReferralStats"] = "/v1/get_user_referral_stats";
|
|
733
734
|
EndpointsV12["GetUserTradeStats"] = "/v1/get_user_trade_stats";
|
|
735
|
+
EndpointsV12["GetUserBoxRewardsStats"] = "/v1/get_user_box_rewards_stats";
|
|
734
736
|
EndpointsV12["GetUserClaimedKickback"] = "/v1/get_user_claimed_kickback";
|
|
735
737
|
EndpointsV12["GetUserClaimedReferral"] = "/v1/get_user_claimed_referral";
|
|
736
738
|
EndpointsV12["GetUserTransfers"] = "/v1/get_user_transfers";
|
|
@@ -753,6 +755,7 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
753
755
|
EndpointsV12["GetUserVolumeForReferral"] = "/v1/get_required_volume_for_referral";
|
|
754
756
|
EndpointsV12["GetUserRewardsValue"] = "/v1/get_user_rewards_value";
|
|
755
757
|
EndpointsV12["OpenBoxes"] = "/v1/open_boxes";
|
|
758
|
+
EndpointsV12["GetUserBoxesHistory"] = "/v1/get_user_boxes_history";
|
|
756
759
|
return EndpointsV12;
|
|
757
760
|
})(EndpointsV1 || {});
|
|
758
761
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -905,6 +908,8 @@ var getTopicFromMessage = (data) => {
|
|
|
905
908
|
return data.type;
|
|
906
909
|
case "BoxOpening":
|
|
907
910
|
return data.type;
|
|
911
|
+
case "UserBoxOpening":
|
|
912
|
+
return data.type;
|
|
908
913
|
case "ClaimReferralFee":
|
|
909
914
|
return data.content.userId;
|
|
910
915
|
case "UpdateUserFeeTier":
|
|
@@ -1340,6 +1345,20 @@ var Client = class _Client {
|
|
|
1340
1345
|
const response = await this.sendGetJson("/v1/get_user_aggregated_stats" /* GetUserAggregatedStats */, request);
|
|
1341
1346
|
return response;
|
|
1342
1347
|
};
|
|
1348
|
+
this.getUserBoxRewardsStatsHistory = async (request) => {
|
|
1349
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1350
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1351
|
+
}
|
|
1352
|
+
const response = await this.sendGetJson("/v1/get_user_box_rewards_stats" /* GetUserBoxRewardsStats */, request);
|
|
1353
|
+
return response;
|
|
1354
|
+
};
|
|
1355
|
+
this.getUserAggregatedBoxRewardsStats = async (request) => {
|
|
1356
|
+
const response = await this.sendGetJson(
|
|
1357
|
+
"/v1/get_user_aggregated_box_rewards_stats" /* GetUserAggregatedBoxRewardsStats */,
|
|
1358
|
+
request
|
|
1359
|
+
);
|
|
1360
|
+
return response;
|
|
1361
|
+
};
|
|
1343
1362
|
this.getUserReferralStatsHistory = async (request) => {
|
|
1344
1363
|
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1345
1364
|
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
@@ -1457,6 +1476,13 @@ var Client = class _Client {
|
|
|
1457
1476
|
const response = await this.sendGetJson("/v1/get_vault_withdrawals" /* GetVaultWithdrawals */, request);
|
|
1458
1477
|
return response;
|
|
1459
1478
|
};
|
|
1479
|
+
this.getUserBoxesHistory = async (request) => {
|
|
1480
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1481
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1482
|
+
}
|
|
1483
|
+
const response = await this.sendGetJson("/v1/get_user_boxes_history" /* GetUserBoxesHistory */, request);
|
|
1484
|
+
return response;
|
|
1485
|
+
};
|
|
1460
1486
|
this.getUserRequiredVolumeForReferral = async (request) => {
|
|
1461
1487
|
const response = await this.sendGetJson("/v1/get_required_volume_for_referral" /* GetUserVolumeForReferral */, request);
|
|
1462
1488
|
return response;
|