@nightlylabs/dex-sdk 0.1.67 → 0.1.69
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 +90 -17
- package/dist/index.d.ts +90 -17
- 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
|
@@ -78,6 +78,13 @@ declare enum BoxRewardTier {
|
|
|
78
78
|
Legendary = "Legendary",
|
|
79
79
|
Mystic = "Mystic"
|
|
80
80
|
}
|
|
81
|
+
interface BoxReward {
|
|
82
|
+
tier: BoxRewardTier;
|
|
83
|
+
tokenAddress?: string;
|
|
84
|
+
tokenAmount?: string;
|
|
85
|
+
pointsAmount?: string;
|
|
86
|
+
badgeType?: BoxRewardTier;
|
|
87
|
+
}
|
|
81
88
|
interface BoxOpeningEvent {
|
|
82
89
|
txHash: string;
|
|
83
90
|
userId: string;
|
|
@@ -89,20 +96,6 @@ interface BoxOpeningEvent {
|
|
|
89
96
|
pointsCost: string;
|
|
90
97
|
timestamp: string;
|
|
91
98
|
}
|
|
92
|
-
interface BoxReward {
|
|
93
|
-
tier: string;
|
|
94
|
-
tokenAddress?: string;
|
|
95
|
-
tokenAmount?: string;
|
|
96
|
-
pointsAmount?: string;
|
|
97
|
-
badgeType?: BoxRewardTier;
|
|
98
|
-
}
|
|
99
|
-
interface BoxReward {
|
|
100
|
-
tier: string;
|
|
101
|
-
tokenAddress?: string;
|
|
102
|
-
tokenAmount?: string;
|
|
103
|
-
pointsAmount?: string;
|
|
104
|
-
badgeType?: BoxRewardTier;
|
|
105
|
-
}
|
|
106
99
|
interface CanceledPerpOrders {
|
|
107
100
|
market: string;
|
|
108
101
|
userId: string;
|
|
@@ -494,6 +487,21 @@ interface GetTokensConfigResponse {
|
|
|
494
487
|
tokens: Record<string, TokenConfigEntry>;
|
|
495
488
|
usdcAddress?: string;
|
|
496
489
|
}
|
|
490
|
+
interface GetUserAggregatedBoxRewardsStatsRequest {
|
|
491
|
+
userId: string;
|
|
492
|
+
}
|
|
493
|
+
interface UserAggregatedBoxRewardsStats {
|
|
494
|
+
userId: string;
|
|
495
|
+
boxOpeningCount: Record<string, string>;
|
|
496
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
497
|
+
tokenRewards: Record<string, string>;
|
|
498
|
+
badges: Record<BoxRewardTier, string>;
|
|
499
|
+
pointsRewardsTotal: string;
|
|
500
|
+
pointsCostTotal: string;
|
|
501
|
+
}
|
|
502
|
+
interface GetUserAggregatedBoxRewardsStatsResponse {
|
|
503
|
+
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStats;
|
|
504
|
+
}
|
|
497
505
|
interface GetUserAggregatedReferralStatsRequest {
|
|
498
506
|
userId: string;
|
|
499
507
|
paginationCursor?: PaginationCursor;
|
|
@@ -548,6 +556,50 @@ interface UserAggregatedVaultStats {
|
|
|
548
556
|
interface GetUserAggregatedVaultStatsResponse {
|
|
549
557
|
userAggregatedVaultStats: UserAggregatedVaultStats[];
|
|
550
558
|
}
|
|
559
|
+
interface GetUserBoxRewardsStatsHistoryRequest {
|
|
560
|
+
userId: string;
|
|
561
|
+
olderTimestampMs?: string;
|
|
562
|
+
newerTimestampMs?: string;
|
|
563
|
+
paginationCursor?: PaginationCursor;
|
|
564
|
+
}
|
|
565
|
+
interface HistoricalBoxRewardsStats {
|
|
566
|
+
userId: string;
|
|
567
|
+
boxOpeningCount: Record<string, string>;
|
|
568
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
569
|
+
tokenRewards: Record<string, string>;
|
|
570
|
+
badges: Record<BoxRewardTier, string>;
|
|
571
|
+
pointsRewardsTotal: string;
|
|
572
|
+
pointsCostTotal: string;
|
|
573
|
+
timestampOpen: string;
|
|
574
|
+
timestampClose: string;
|
|
575
|
+
}
|
|
576
|
+
interface GetUserBoxRewardsStatsHistoryResponse {
|
|
577
|
+
stats: HistoricalBoxRewardsStats[];
|
|
578
|
+
paginationCursor?: PaginationCursor;
|
|
579
|
+
}
|
|
580
|
+
interface GetUserBoxesHistoryRequest {
|
|
581
|
+
userId: string;
|
|
582
|
+
olderTimestampMs?: string;
|
|
583
|
+
newerTimestampMs?: string;
|
|
584
|
+
paginationCursor?: PaginationCursor;
|
|
585
|
+
}
|
|
586
|
+
interface HistoricBoxReward {
|
|
587
|
+
userId: string;
|
|
588
|
+
txHash: string;
|
|
589
|
+
boxId: string;
|
|
590
|
+
boxIndex: number;
|
|
591
|
+
rewardTier: BoxRewardTier;
|
|
592
|
+
tokenAddress?: string;
|
|
593
|
+
tokenAmount?: string;
|
|
594
|
+
pointsAmount?: string;
|
|
595
|
+
badgeType?: BoxRewardTier;
|
|
596
|
+
boxCost: string;
|
|
597
|
+
timestamp: string;
|
|
598
|
+
}
|
|
599
|
+
interface GetUserBoxesHistoryResponse {
|
|
600
|
+
boxes: HistoricBoxReward[];
|
|
601
|
+
paginationCursor?: PaginationCursor;
|
|
602
|
+
}
|
|
551
603
|
interface GetUserClaimedKickbackHistoryRequest {
|
|
552
604
|
userId: string;
|
|
553
605
|
olderTimestampMs?: string;
|
|
@@ -1025,6 +1077,18 @@ interface UpdateUserFeeTier {
|
|
|
1025
1077
|
userId: string;
|
|
1026
1078
|
newTierIndex: string;
|
|
1027
1079
|
}
|
|
1080
|
+
interface UserBoxOpeningEvent {
|
|
1081
|
+
txHash: string;
|
|
1082
|
+
userId: string;
|
|
1083
|
+
boxId: string;
|
|
1084
|
+
rewards: BoxReward[];
|
|
1085
|
+
tokenAddress?: string;
|
|
1086
|
+
totalToken?: string;
|
|
1087
|
+
totalPoints: string;
|
|
1088
|
+
pointsCost: string;
|
|
1089
|
+
timestamp: string;
|
|
1090
|
+
userPointsBalance: string;
|
|
1091
|
+
}
|
|
1028
1092
|
interface UserTransfer {
|
|
1029
1093
|
senderId: string;
|
|
1030
1094
|
receiverId: string;
|
|
@@ -1085,8 +1149,10 @@ declare enum EndpointsV1 {
|
|
|
1085
1149
|
SyncStatus = "/v1/sync_status",
|
|
1086
1150
|
GetUserAggregatedReferral = "/v1/get_user_aggregated_referral",
|
|
1087
1151
|
GetUserAggregatedStats = "/v1/get_user_aggregated_stats",
|
|
1152
|
+
GetUserAggregatedBoxRewardsStats = "/v1/get_user_aggregated_box_rewards_stats",
|
|
1088
1153
|
GetUserReferralStats = "/v1/get_user_referral_stats",
|
|
1089
1154
|
GetUserTradeStats = "/v1/get_user_trade_stats",
|
|
1155
|
+
GetUserBoxRewardsStats = "/v1/get_user_box_rewards_stats",
|
|
1090
1156
|
GetUserClaimedKickback = "/v1/get_user_claimed_kickback",
|
|
1091
1157
|
GetUserClaimedReferral = "/v1/get_user_claimed_referral",
|
|
1092
1158
|
GetUserTransfers = "/v1/get_user_transfers",
|
|
@@ -1108,7 +1174,8 @@ declare enum EndpointsV1 {
|
|
|
1108
1174
|
GetVaultDeposits = "/v1/get_vault_deposits",
|
|
1109
1175
|
GetUserVolumeForReferral = "/v1/get_required_volume_for_referral",
|
|
1110
1176
|
GetUserRewardsValue = "/v1/get_user_rewards_value",
|
|
1111
|
-
OpenBoxes = "/v1/open_boxes"
|
|
1177
|
+
OpenBoxes = "/v1/open_boxes",
|
|
1178
|
+
GetUserBoxesHistory = "/v1/get_user_boxes_history"
|
|
1112
1179
|
}
|
|
1113
1180
|
declare enum SpotMarketStatus {
|
|
1114
1181
|
Halted = "halted",
|
|
@@ -1310,6 +1377,9 @@ type WsMessage = {
|
|
|
1310
1377
|
} | {
|
|
1311
1378
|
type: "BoxOpening";
|
|
1312
1379
|
content: BoxOpeningEvent;
|
|
1380
|
+
} | {
|
|
1381
|
+
type: "UserBoxOpening";
|
|
1382
|
+
content: UserBoxOpeningEvent;
|
|
1313
1383
|
} | {
|
|
1314
1384
|
type: "Liquidation";
|
|
1315
1385
|
content: Liquidation;
|
|
@@ -1484,7 +1554,7 @@ type WsOracleUpdates = Extract<WsMessage, {
|
|
|
1484
1554
|
type: 'OracleUpdates';
|
|
1485
1555
|
}>;
|
|
1486
1556
|
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' | '
|
|
1557
|
+
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
1558
|
}>;
|
|
1489
1559
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
1490
1560
|
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
@@ -1683,6 +1753,8 @@ declare class Client {
|
|
|
1683
1753
|
getUserRewardsValueHistory: (request: GetUserRewardsValueRequest) => Promise<GetUserRewardsValueResponse>;
|
|
1684
1754
|
getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
|
|
1685
1755
|
getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
|
|
1756
|
+
getUserBoxRewardsStatsHistory: (request: GetUserBoxRewardsStatsHistoryRequest) => Promise<GetUserBoxRewardsStatsHistoryResponse>;
|
|
1757
|
+
getUserAggregatedBoxRewardsStats: (request: GetUserAggregatedBoxRewardsStatsRequest) => Promise<GetUserAggregatedBoxRewardsStatsResponse>;
|
|
1686
1758
|
getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
|
|
1687
1759
|
getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
|
|
1688
1760
|
getUserClaimedKickbackHistory: (request: GetUserClaimedKickbackHistoryRequest) => Promise<GetUserClaimedKickbackHistoryResponse>;
|
|
@@ -1703,6 +1775,7 @@ declare class Client {
|
|
|
1703
1775
|
getIndexerStatus: () => Promise<GetIndexerStatusResponse>;
|
|
1704
1776
|
getVaultHistoricalDeposits: (request: GetVaultDepositsRequest) => Promise<GetVaultDepositsResponse>;
|
|
1705
1777
|
getVaultWithdrawals: (request: GetVaultWithdrawalsRequest) => Promise<GetVaultWithdrawalsResponse>;
|
|
1778
|
+
getUserBoxesHistory: (request: GetUserBoxesHistoryRequest) => Promise<GetUserBoxesHistoryResponse>;
|
|
1706
1779
|
getUserRequiredVolumeForReferral: (request: GetUserVolumeForReferralRequest) => Promise<GetUserVolumeForReferralResponse>;
|
|
1707
1780
|
getTime: () => Promise<string>;
|
|
1708
1781
|
}
|
|
@@ -1735,4 +1808,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1735
1808
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1736
1809
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1737
1810
|
|
|
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 };
|
|
1811
|
+
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 HistoricBoxReward, 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
|
@@ -78,6 +78,13 @@ declare enum BoxRewardTier {
|
|
|
78
78
|
Legendary = "Legendary",
|
|
79
79
|
Mystic = "Mystic"
|
|
80
80
|
}
|
|
81
|
+
interface BoxReward {
|
|
82
|
+
tier: BoxRewardTier;
|
|
83
|
+
tokenAddress?: string;
|
|
84
|
+
tokenAmount?: string;
|
|
85
|
+
pointsAmount?: string;
|
|
86
|
+
badgeType?: BoxRewardTier;
|
|
87
|
+
}
|
|
81
88
|
interface BoxOpeningEvent {
|
|
82
89
|
txHash: string;
|
|
83
90
|
userId: string;
|
|
@@ -89,20 +96,6 @@ interface BoxOpeningEvent {
|
|
|
89
96
|
pointsCost: string;
|
|
90
97
|
timestamp: string;
|
|
91
98
|
}
|
|
92
|
-
interface BoxReward {
|
|
93
|
-
tier: string;
|
|
94
|
-
tokenAddress?: string;
|
|
95
|
-
tokenAmount?: string;
|
|
96
|
-
pointsAmount?: string;
|
|
97
|
-
badgeType?: BoxRewardTier;
|
|
98
|
-
}
|
|
99
|
-
interface BoxReward {
|
|
100
|
-
tier: string;
|
|
101
|
-
tokenAddress?: string;
|
|
102
|
-
tokenAmount?: string;
|
|
103
|
-
pointsAmount?: string;
|
|
104
|
-
badgeType?: BoxRewardTier;
|
|
105
|
-
}
|
|
106
99
|
interface CanceledPerpOrders {
|
|
107
100
|
market: string;
|
|
108
101
|
userId: string;
|
|
@@ -494,6 +487,21 @@ interface GetTokensConfigResponse {
|
|
|
494
487
|
tokens: Record<string, TokenConfigEntry>;
|
|
495
488
|
usdcAddress?: string;
|
|
496
489
|
}
|
|
490
|
+
interface GetUserAggregatedBoxRewardsStatsRequest {
|
|
491
|
+
userId: string;
|
|
492
|
+
}
|
|
493
|
+
interface UserAggregatedBoxRewardsStats {
|
|
494
|
+
userId: string;
|
|
495
|
+
boxOpeningCount: Record<string, string>;
|
|
496
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
497
|
+
tokenRewards: Record<string, string>;
|
|
498
|
+
badges: Record<BoxRewardTier, string>;
|
|
499
|
+
pointsRewardsTotal: string;
|
|
500
|
+
pointsCostTotal: string;
|
|
501
|
+
}
|
|
502
|
+
interface GetUserAggregatedBoxRewardsStatsResponse {
|
|
503
|
+
userAggregatedBoxRewardsStats: UserAggregatedBoxRewardsStats;
|
|
504
|
+
}
|
|
497
505
|
interface GetUserAggregatedReferralStatsRequest {
|
|
498
506
|
userId: string;
|
|
499
507
|
paginationCursor?: PaginationCursor;
|
|
@@ -548,6 +556,50 @@ interface UserAggregatedVaultStats {
|
|
|
548
556
|
interface GetUserAggregatedVaultStatsResponse {
|
|
549
557
|
userAggregatedVaultStats: UserAggregatedVaultStats[];
|
|
550
558
|
}
|
|
559
|
+
interface GetUserBoxRewardsStatsHistoryRequest {
|
|
560
|
+
userId: string;
|
|
561
|
+
olderTimestampMs?: string;
|
|
562
|
+
newerTimestampMs?: string;
|
|
563
|
+
paginationCursor?: PaginationCursor;
|
|
564
|
+
}
|
|
565
|
+
interface HistoricalBoxRewardsStats {
|
|
566
|
+
userId: string;
|
|
567
|
+
boxOpeningCount: Record<string, string>;
|
|
568
|
+
boxTierRewards: Record<BoxRewardTier, string>;
|
|
569
|
+
tokenRewards: Record<string, string>;
|
|
570
|
+
badges: Record<BoxRewardTier, string>;
|
|
571
|
+
pointsRewardsTotal: string;
|
|
572
|
+
pointsCostTotal: string;
|
|
573
|
+
timestampOpen: string;
|
|
574
|
+
timestampClose: string;
|
|
575
|
+
}
|
|
576
|
+
interface GetUserBoxRewardsStatsHistoryResponse {
|
|
577
|
+
stats: HistoricalBoxRewardsStats[];
|
|
578
|
+
paginationCursor?: PaginationCursor;
|
|
579
|
+
}
|
|
580
|
+
interface GetUserBoxesHistoryRequest {
|
|
581
|
+
userId: string;
|
|
582
|
+
olderTimestampMs?: string;
|
|
583
|
+
newerTimestampMs?: string;
|
|
584
|
+
paginationCursor?: PaginationCursor;
|
|
585
|
+
}
|
|
586
|
+
interface HistoricBoxReward {
|
|
587
|
+
userId: string;
|
|
588
|
+
txHash: string;
|
|
589
|
+
boxId: string;
|
|
590
|
+
boxIndex: number;
|
|
591
|
+
rewardTier: BoxRewardTier;
|
|
592
|
+
tokenAddress?: string;
|
|
593
|
+
tokenAmount?: string;
|
|
594
|
+
pointsAmount?: string;
|
|
595
|
+
badgeType?: BoxRewardTier;
|
|
596
|
+
boxCost: string;
|
|
597
|
+
timestamp: string;
|
|
598
|
+
}
|
|
599
|
+
interface GetUserBoxesHistoryResponse {
|
|
600
|
+
boxes: HistoricBoxReward[];
|
|
601
|
+
paginationCursor?: PaginationCursor;
|
|
602
|
+
}
|
|
551
603
|
interface GetUserClaimedKickbackHistoryRequest {
|
|
552
604
|
userId: string;
|
|
553
605
|
olderTimestampMs?: string;
|
|
@@ -1025,6 +1077,18 @@ interface UpdateUserFeeTier {
|
|
|
1025
1077
|
userId: string;
|
|
1026
1078
|
newTierIndex: string;
|
|
1027
1079
|
}
|
|
1080
|
+
interface UserBoxOpeningEvent {
|
|
1081
|
+
txHash: string;
|
|
1082
|
+
userId: string;
|
|
1083
|
+
boxId: string;
|
|
1084
|
+
rewards: BoxReward[];
|
|
1085
|
+
tokenAddress?: string;
|
|
1086
|
+
totalToken?: string;
|
|
1087
|
+
totalPoints: string;
|
|
1088
|
+
pointsCost: string;
|
|
1089
|
+
timestamp: string;
|
|
1090
|
+
userPointsBalance: string;
|
|
1091
|
+
}
|
|
1028
1092
|
interface UserTransfer {
|
|
1029
1093
|
senderId: string;
|
|
1030
1094
|
receiverId: string;
|
|
@@ -1085,8 +1149,10 @@ declare enum EndpointsV1 {
|
|
|
1085
1149
|
SyncStatus = "/v1/sync_status",
|
|
1086
1150
|
GetUserAggregatedReferral = "/v1/get_user_aggregated_referral",
|
|
1087
1151
|
GetUserAggregatedStats = "/v1/get_user_aggregated_stats",
|
|
1152
|
+
GetUserAggregatedBoxRewardsStats = "/v1/get_user_aggregated_box_rewards_stats",
|
|
1088
1153
|
GetUserReferralStats = "/v1/get_user_referral_stats",
|
|
1089
1154
|
GetUserTradeStats = "/v1/get_user_trade_stats",
|
|
1155
|
+
GetUserBoxRewardsStats = "/v1/get_user_box_rewards_stats",
|
|
1090
1156
|
GetUserClaimedKickback = "/v1/get_user_claimed_kickback",
|
|
1091
1157
|
GetUserClaimedReferral = "/v1/get_user_claimed_referral",
|
|
1092
1158
|
GetUserTransfers = "/v1/get_user_transfers",
|
|
@@ -1108,7 +1174,8 @@ declare enum EndpointsV1 {
|
|
|
1108
1174
|
GetVaultDeposits = "/v1/get_vault_deposits",
|
|
1109
1175
|
GetUserVolumeForReferral = "/v1/get_required_volume_for_referral",
|
|
1110
1176
|
GetUserRewardsValue = "/v1/get_user_rewards_value",
|
|
1111
|
-
OpenBoxes = "/v1/open_boxes"
|
|
1177
|
+
OpenBoxes = "/v1/open_boxes",
|
|
1178
|
+
GetUserBoxesHistory = "/v1/get_user_boxes_history"
|
|
1112
1179
|
}
|
|
1113
1180
|
declare enum SpotMarketStatus {
|
|
1114
1181
|
Halted = "halted",
|
|
@@ -1310,6 +1377,9 @@ type WsMessage = {
|
|
|
1310
1377
|
} | {
|
|
1311
1378
|
type: "BoxOpening";
|
|
1312
1379
|
content: BoxOpeningEvent;
|
|
1380
|
+
} | {
|
|
1381
|
+
type: "UserBoxOpening";
|
|
1382
|
+
content: UserBoxOpeningEvent;
|
|
1313
1383
|
} | {
|
|
1314
1384
|
type: "Liquidation";
|
|
1315
1385
|
content: Liquidation;
|
|
@@ -1484,7 +1554,7 @@ type WsOracleUpdates = Extract<WsMessage, {
|
|
|
1484
1554
|
type: 'OracleUpdates';
|
|
1485
1555
|
}>;
|
|
1486
1556
|
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' | '
|
|
1557
|
+
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
1558
|
}>;
|
|
1489
1559
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
1490
1560
|
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
@@ -1683,6 +1753,8 @@ declare class Client {
|
|
|
1683
1753
|
getUserRewardsValueHistory: (request: GetUserRewardsValueRequest) => Promise<GetUserRewardsValueResponse>;
|
|
1684
1754
|
getUserTradeStatsHistory: (request: GetUserTradeStatsHistoryRequest) => Promise<GetUserTradeStatsHistoryResponse>;
|
|
1685
1755
|
getUserAggregatedStats: (request: GetUserAggregatedStatsRequest) => Promise<GetUserAggregatedStatsResponse>;
|
|
1756
|
+
getUserBoxRewardsStatsHistory: (request: GetUserBoxRewardsStatsHistoryRequest) => Promise<GetUserBoxRewardsStatsHistoryResponse>;
|
|
1757
|
+
getUserAggregatedBoxRewardsStats: (request: GetUserAggregatedBoxRewardsStatsRequest) => Promise<GetUserAggregatedBoxRewardsStatsResponse>;
|
|
1686
1758
|
getUserReferralStatsHistory: (request: GetUserReferralStatsHistoryRequest) => Promise<GetUserReferralStatsHistoryResponse>;
|
|
1687
1759
|
getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
|
|
1688
1760
|
getUserClaimedKickbackHistory: (request: GetUserClaimedKickbackHistoryRequest) => Promise<GetUserClaimedKickbackHistoryResponse>;
|
|
@@ -1703,6 +1775,7 @@ declare class Client {
|
|
|
1703
1775
|
getIndexerStatus: () => Promise<GetIndexerStatusResponse>;
|
|
1704
1776
|
getVaultHistoricalDeposits: (request: GetVaultDepositsRequest) => Promise<GetVaultDepositsResponse>;
|
|
1705
1777
|
getVaultWithdrawals: (request: GetVaultWithdrawalsRequest) => Promise<GetVaultWithdrawalsResponse>;
|
|
1778
|
+
getUserBoxesHistory: (request: GetUserBoxesHistoryRequest) => Promise<GetUserBoxesHistoryResponse>;
|
|
1706
1779
|
getUserRequiredVolumeForReferral: (request: GetUserVolumeForReferralRequest) => Promise<GetUserVolumeForReferralResponse>;
|
|
1707
1780
|
getTime: () => Promise<string>;
|
|
1708
1781
|
}
|
|
@@ -1735,4 +1808,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1735
1808
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1736
1809
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1737
1810
|
|
|
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 };
|
|
1811
|
+
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 HistoricBoxReward, 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;
|