@nightlylabs/dex-sdk 0.3.36 → 0.3.38
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 +4 -18
- package/dist/index.d.cts +10 -43
- package/dist/index.d.ts +10 -43
- package/dist/index.js +4 -18
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23578,7 +23578,6 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
23578
23578
|
EndpointsV12["GetIndexPrices"] = "/v1/get_index_prices";
|
|
23579
23579
|
EndpointsV12["GetAccountValueRanking"] = "/v1/get_account_value_ranking";
|
|
23580
23580
|
EndpointsV12["GetUserAccountValueRanking"] = "/v1/get_user_account_value_ranking";
|
|
23581
|
-
EndpointsV12["GetExchangeStatsHistory"] = "/v1/get_exchange_stats_history";
|
|
23582
23581
|
return EndpointsV12;
|
|
23583
23582
|
})(EndpointsV1 || {});
|
|
23584
23583
|
var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
@@ -24091,24 +24090,11 @@ var Client = class _Client {
|
|
|
24091
24090
|
const response = await this.sendGetJson("/v1/get_borrow_lending_data" /* GetBorrowLendingData */);
|
|
24092
24091
|
return response;
|
|
24093
24092
|
};
|
|
24094
|
-
this.getChartCandlesInRange = async ({
|
|
24095
|
-
|
|
24096
|
-
|
|
24097
|
-
timestampStartMs = Math.round((/* @__PURE__ */ new Date()).getTime()),
|
|
24098
|
-
timestampEndMs = Math.round((/* @__PURE__ */ new Date()).getTime() - 24 * 60 * 60 * 1e3),
|
|
24099
|
-
// default 24 back
|
|
24100
|
-
cursor
|
|
24101
|
-
}) => {
|
|
24102
|
-
if (timestampEndMs && timestampStartMs && timestampEndMs > timestampStartMs) {
|
|
24103
|
-
throw new Error("timestampEndMs must be lower than timestampStartMs");
|
|
24093
|
+
this.getChartCandlesInRange = async (request) => {
|
|
24094
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24095
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24104
24096
|
}
|
|
24105
|
-
const response = await this.sendGetJson("/v1/public/chart_candles_in_range" /* GetChartCandlesInRange */,
|
|
24106
|
-
marketName,
|
|
24107
|
-
interval,
|
|
24108
|
-
startTimestamp: timestampStartMs.toString(),
|
|
24109
|
-
endTimestamp: timestampEndMs.toString(),
|
|
24110
|
-
paginationCursor: cursor
|
|
24111
|
-
});
|
|
24097
|
+
const response = await this.sendGetJson("/v1/public/chart_candles_in_range" /* GetChartCandlesInRange */, request);
|
|
24112
24098
|
return response;
|
|
24113
24099
|
};
|
|
24114
24100
|
this.getPriceIndexes = async () => {
|
package/dist/index.d.cts
CHANGED
|
@@ -3682,7 +3682,6 @@ interface TokenConfigEntry {
|
|
|
3682
3682
|
contractAddress: string;
|
|
3683
3683
|
tokenDecimals: number;
|
|
3684
3684
|
vaultId?: string;
|
|
3685
|
-
createdAt?: string;
|
|
3686
3685
|
}
|
|
3687
3686
|
interface MarginStep {
|
|
3688
3687
|
initialMarginRatio: string;
|
|
@@ -3710,7 +3709,6 @@ interface PerpMarketConfigEntry {
|
|
|
3710
3709
|
fundingRate: FundingRate;
|
|
3711
3710
|
basicMakerFee: string;
|
|
3712
3711
|
basicTakerFee: string;
|
|
3713
|
-
createdAt?: string;
|
|
3714
3712
|
}
|
|
3715
3713
|
interface SpotMarketConfigEntry {
|
|
3716
3714
|
marketName: string;
|
|
@@ -3720,7 +3718,6 @@ interface SpotMarketConfigEntry {
|
|
|
3720
3718
|
tickSize: string;
|
|
3721
3719
|
basicMakerFee: string;
|
|
3722
3720
|
basicTakerFee: string;
|
|
3723
|
-
createdAt?: string;
|
|
3724
3721
|
}
|
|
3725
3722
|
interface FeeData {
|
|
3726
3723
|
feeToVaultAccount: string;
|
|
@@ -3734,19 +3731,6 @@ interface ExchangeConfig {
|
|
|
3734
3731
|
feeData: FeeData;
|
|
3735
3732
|
systemHaircut: string;
|
|
3736
3733
|
}
|
|
3737
|
-
interface TvlTokenEntry {
|
|
3738
|
-
tokenAddress: string;
|
|
3739
|
-
amount: string;
|
|
3740
|
-
valueUsd: string;
|
|
3741
|
-
}
|
|
3742
|
-
interface ExchangeStatsEntry {
|
|
3743
|
-
timestampOpen: string;
|
|
3744
|
-
timestampClose: string;
|
|
3745
|
-
tvlBreakdown: TvlTokenEntry[];
|
|
3746
|
-
perpVolumeUsd: string;
|
|
3747
|
-
spotVolumeUsd: string;
|
|
3748
|
-
openInterestUsd: string;
|
|
3749
|
-
}
|
|
3750
3734
|
interface FeeTier {
|
|
3751
3735
|
volume: string;
|
|
3752
3736
|
cashback: string;
|
|
@@ -3778,6 +3762,13 @@ interface GetAccountValueRankingResponse {
|
|
|
3778
3762
|
usersRanking: AccountValueRankingEntry[];
|
|
3779
3763
|
paginationCursor?: PaginationCursor;
|
|
3780
3764
|
}
|
|
3765
|
+
interface GetUserAccountValueRankingRequest {
|
|
3766
|
+
userId?: string;
|
|
3767
|
+
userAddress?: string;
|
|
3768
|
+
}
|
|
3769
|
+
interface GetUserAccountValueRankingResponse {
|
|
3770
|
+
usersRanking: AccountValueRankingEntry[];
|
|
3771
|
+
}
|
|
3781
3772
|
interface GetAllVaultsIdsResponse {
|
|
3782
3773
|
vaultsIds: string[];
|
|
3783
3774
|
}
|
|
@@ -3820,15 +3811,6 @@ interface GetChartCandlesInRangeResponse {
|
|
|
3820
3811
|
chartCandles: ChartCandle[];
|
|
3821
3812
|
paginationCursor?: PaginationCursor;
|
|
3822
3813
|
}
|
|
3823
|
-
interface GetExchangeStatsHistoryRequest {
|
|
3824
|
-
olderTimestampMs?: string;
|
|
3825
|
-
newerTimestampMs?: string;
|
|
3826
|
-
paginationCursor?: PaginationCursor;
|
|
3827
|
-
}
|
|
3828
|
-
interface GetExchangeStatsHistoryResponse {
|
|
3829
|
-
data: ExchangeStatsEntry[];
|
|
3830
|
-
paginationCursor?: PaginationCursor;
|
|
3831
|
-
}
|
|
3832
3814
|
interface GetIndexPriceHistoryRequest {
|
|
3833
3815
|
priceIndex: string;
|
|
3834
3816
|
olderTimestampMs?: string;
|
|
@@ -4172,13 +4154,6 @@ interface PointsRankingEntry {
|
|
|
4172
4154
|
interface GetTopPointsRankingResponse {
|
|
4173
4155
|
usersRanking: PointsRankingEntry[];
|
|
4174
4156
|
}
|
|
4175
|
-
interface GetUserAccountValueRankingRequest {
|
|
4176
|
-
userId?: string;
|
|
4177
|
-
userAddress?: string;
|
|
4178
|
-
}
|
|
4179
|
-
interface GetUserAccountValueRankingResponse {
|
|
4180
|
-
usersRanking: AccountValueRankingEntry[];
|
|
4181
|
-
}
|
|
4182
4157
|
interface GetUserAggregatedBoxRewardsStatsRequest {
|
|
4183
4158
|
userId: string;
|
|
4184
4159
|
}
|
|
@@ -5184,8 +5159,7 @@ declare enum EndpointsV1 {
|
|
|
5184
5159
|
GetUserPersonalPointsRanking = "/v1/get_user_personal_points_ranking",
|
|
5185
5160
|
GetIndexPrices = "/v1/get_index_prices",
|
|
5186
5161
|
GetAccountValueRanking = "/v1/get_account_value_ranking",
|
|
5187
|
-
GetUserAccountValueRanking = "/v1/get_user_account_value_ranking"
|
|
5188
|
-
GetExchangeStatsHistory = "/v1/get_exchange_stats_history"
|
|
5162
|
+
GetUserAccountValueRanking = "/v1/get_user_account_value_ranking"
|
|
5189
5163
|
}
|
|
5190
5164
|
type Topic = {
|
|
5191
5165
|
type: "PerpMarket";
|
|
@@ -5597,13 +5571,6 @@ interface WithdrawTokenParams {
|
|
|
5597
5571
|
max: boolean;
|
|
5598
5572
|
recipient: Address;
|
|
5599
5573
|
}
|
|
5600
|
-
interface IGetChartCandlesInRange {
|
|
5601
|
-
marketName: string;
|
|
5602
|
-
interval: ChartInterval;
|
|
5603
|
-
timestampStartMs?: number;
|
|
5604
|
-
timestampEndMs?: number;
|
|
5605
|
-
cursor?: PaginationCursor;
|
|
5606
|
-
}
|
|
5607
5574
|
interface PlaceMultiplePerpOrdersParams {
|
|
5608
5575
|
userId: string;
|
|
5609
5576
|
perpOrders: PerpOrderData[];
|
|
@@ -5901,7 +5868,7 @@ declare class Client {
|
|
|
5901
5868
|
getPerpMarketsData: (markets: string[]) => Promise<GetPerpMarketsDataResponse>;
|
|
5902
5869
|
getSpotMarketsData: (markets: string[]) => Promise<GetSpotMarketsDataResponse>;
|
|
5903
5870
|
getBorrowLendingData: () => Promise<GetBorrowLendingDataResponse>;
|
|
5904
|
-
getChartCandlesInRange: (
|
|
5871
|
+
getChartCandlesInRange: (request: GetChartCandlesInRangeRequest) => Promise<GetChartCandlesInRangeResponse>;
|
|
5905
5872
|
getPriceIndexes: () => Promise<GetPriceIndexesResponse>;
|
|
5906
5873
|
getUsersByAddress: (payload: GetUsersByAddressRequest) => Promise<GetUsersByAddressResponse>;
|
|
5907
5874
|
getPerpRecentTrades: (request: GetPerpRecentTradesRequest) => Promise<GetPerpRecentTradesResponse>;
|
|
@@ -5980,4 +5947,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
5980
5947
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
5981
5948
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
5982
5949
|
|
|
5983
|
-
export { ABIs, type AccountValueRankingEntry, 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 CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type
|
|
5950
|
+
export { ABIs, type AccountValueRankingEntry, 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 CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type 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 GetAccountValueRankingRequest, type GetAccountValueRankingResponse, type GetAllVaultsIdsResponse, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexPricesResponse, type GetIndexerStatusResponse, type GetOrderBookDataRequest, type GetOrderBookDataResponse, type GetPerpMarketsConfigResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpUserTriggerOrdersRequest, type GetPerpUserTriggerOrdersResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetSpotMarketsConfigResponse, type GetSpotMarketsDataRequest, type GetSpotMarketsDataResponse, type GetSpotRecentTradesRequest, type GetSpotRecentTradesResponse, type GetSpotUserFillsRequest, type GetSpotUserFillsResponse, type GetSpotUserOrdersRequest, type GetSpotUserOrdersResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetTopPointsRankingResponse, type GetUserAccountValueRankingRequest, type GetUserAccountValueRankingResponse, type GetUserAggregatedBoxRewardsStatsRequest, type GetUserAggregatedBoxRewardsStatsResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserBoxRewardsStatsHistoryRequest, type GetUserBoxRewardsStatsHistoryResponse, type GetUserBoxesHistoryRequest, type GetUserBoxesHistoryResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFullLiquidationsHistoryRequest, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsCancelHistoryResponse, type GetUserLiquidationsCancelOrdersHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPartialLiquidationsHistoryRequest, type GetUserPartialLiquidationsHistoryResponse, type GetUserPersonalPointsRankingRequest, type GetUserPersonalPointsRankingResponse, type GetUserPointsHistoryRequest, type GetUserPointsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserRewardsValueRequest, type GetUserRewardsValueResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type GlobalLiquidation, type GlobalPartialLiquidation, type HistoricBoxReward, type HistoricalBoxRewardsStats, type HistoricalDeposit, type HistoricalFullLiquidation, type HistoricalFunding, type HistoricalLiquidatedBorrow, type HistoricalLiquidatedCollateral, type HistoricalLiquidatedLend, type HistoricalLiquidatedPosition, type HistoricalLiquidationCancelOrders, type HistoricalPartialLiquidatedPosition, type HistoricalPartialLiquidation, type HistoricalPerpOrder, type HistoricalPoints, type HistoricalReferralStats, type HistoricalSpotOrder, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IndexPriceHistory, type IndexPriceLive, type Lend, type LendTokenParams, type Liquidation, type LiquidationCancelledOrderData, type LiquidationCancelledTriggerOrderData, MAINNET_CONFIG, type MarginStep, Network, type NetworkConfig, type NetworkMode, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type OrderBookData, OrderSide, OrderStatus, OrderType, type PaginationCursor, type PartialLiquidation, type PerpFill, type PerpMarketConfigEntry, type PerpMarketData, type PerpOrder, type PerpOrderData, type PerpOrderDataForMarket, type PerpOrderFills, type PerpOrderbookState, type PerpOrderbookUpdate, type PerpPosition, type PerpTrade, type PerpTradesUpdate, type PerpTriggerOrder, type PerpTriggerOrderTriggered, type PlaceMultiplePerpOrdersParams, type PlaceMultipleSpotOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PlacePerpTriggerOrder, type PlacePerpTriggerOrderParams, type PlaceSpotLimitOrder, type PlaceSpotMarketOrder, type PlaceSpotOrderParams, type PointsRankingEntry, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type ReplaceMultipleSpotOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, type SpotFill, type SpotMarketConfigEntry, type SpotMarketData, type SpotOrder, type SpotOrderData, type SpotOrderDataForMarket, type SpotOrderFills, type SpotOrderbookState, type SpotOrderbookUpdate, type SpotTrade, type SpotTradesUpdate, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TESTNET_CONFIG, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, TransferAction, type TransferToUserParams, type TriggerOrder, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPointsBreakdown, 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 WsLiquidatedBorrow, type WsLiquidatedCollateral, type WsLiquidatedLend, type WsLiquidatedPosition, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPartialLiquidatedPosition, type WsPerpMarketUpdates, type WsSpotMarketUpdates, type WsUserUpdates, createAptosClient, createAptosClientFromEnv, generateApiKey, getABIsForNetwork, getNetworkConfig, getNetworkModeFromEnv, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -3682,7 +3682,6 @@ interface TokenConfigEntry {
|
|
|
3682
3682
|
contractAddress: string;
|
|
3683
3683
|
tokenDecimals: number;
|
|
3684
3684
|
vaultId?: string;
|
|
3685
|
-
createdAt?: string;
|
|
3686
3685
|
}
|
|
3687
3686
|
interface MarginStep {
|
|
3688
3687
|
initialMarginRatio: string;
|
|
@@ -3710,7 +3709,6 @@ interface PerpMarketConfigEntry {
|
|
|
3710
3709
|
fundingRate: FundingRate;
|
|
3711
3710
|
basicMakerFee: string;
|
|
3712
3711
|
basicTakerFee: string;
|
|
3713
|
-
createdAt?: string;
|
|
3714
3712
|
}
|
|
3715
3713
|
interface SpotMarketConfigEntry {
|
|
3716
3714
|
marketName: string;
|
|
@@ -3720,7 +3718,6 @@ interface SpotMarketConfigEntry {
|
|
|
3720
3718
|
tickSize: string;
|
|
3721
3719
|
basicMakerFee: string;
|
|
3722
3720
|
basicTakerFee: string;
|
|
3723
|
-
createdAt?: string;
|
|
3724
3721
|
}
|
|
3725
3722
|
interface FeeData {
|
|
3726
3723
|
feeToVaultAccount: string;
|
|
@@ -3734,19 +3731,6 @@ interface ExchangeConfig {
|
|
|
3734
3731
|
feeData: FeeData;
|
|
3735
3732
|
systemHaircut: string;
|
|
3736
3733
|
}
|
|
3737
|
-
interface TvlTokenEntry {
|
|
3738
|
-
tokenAddress: string;
|
|
3739
|
-
amount: string;
|
|
3740
|
-
valueUsd: string;
|
|
3741
|
-
}
|
|
3742
|
-
interface ExchangeStatsEntry {
|
|
3743
|
-
timestampOpen: string;
|
|
3744
|
-
timestampClose: string;
|
|
3745
|
-
tvlBreakdown: TvlTokenEntry[];
|
|
3746
|
-
perpVolumeUsd: string;
|
|
3747
|
-
spotVolumeUsd: string;
|
|
3748
|
-
openInterestUsd: string;
|
|
3749
|
-
}
|
|
3750
3734
|
interface FeeTier {
|
|
3751
3735
|
volume: string;
|
|
3752
3736
|
cashback: string;
|
|
@@ -3778,6 +3762,13 @@ interface GetAccountValueRankingResponse {
|
|
|
3778
3762
|
usersRanking: AccountValueRankingEntry[];
|
|
3779
3763
|
paginationCursor?: PaginationCursor;
|
|
3780
3764
|
}
|
|
3765
|
+
interface GetUserAccountValueRankingRequest {
|
|
3766
|
+
userId?: string;
|
|
3767
|
+
userAddress?: string;
|
|
3768
|
+
}
|
|
3769
|
+
interface GetUserAccountValueRankingResponse {
|
|
3770
|
+
usersRanking: AccountValueRankingEntry[];
|
|
3771
|
+
}
|
|
3781
3772
|
interface GetAllVaultsIdsResponse {
|
|
3782
3773
|
vaultsIds: string[];
|
|
3783
3774
|
}
|
|
@@ -3820,15 +3811,6 @@ interface GetChartCandlesInRangeResponse {
|
|
|
3820
3811
|
chartCandles: ChartCandle[];
|
|
3821
3812
|
paginationCursor?: PaginationCursor;
|
|
3822
3813
|
}
|
|
3823
|
-
interface GetExchangeStatsHistoryRequest {
|
|
3824
|
-
olderTimestampMs?: string;
|
|
3825
|
-
newerTimestampMs?: string;
|
|
3826
|
-
paginationCursor?: PaginationCursor;
|
|
3827
|
-
}
|
|
3828
|
-
interface GetExchangeStatsHistoryResponse {
|
|
3829
|
-
data: ExchangeStatsEntry[];
|
|
3830
|
-
paginationCursor?: PaginationCursor;
|
|
3831
|
-
}
|
|
3832
3814
|
interface GetIndexPriceHistoryRequest {
|
|
3833
3815
|
priceIndex: string;
|
|
3834
3816
|
olderTimestampMs?: string;
|
|
@@ -4172,13 +4154,6 @@ interface PointsRankingEntry {
|
|
|
4172
4154
|
interface GetTopPointsRankingResponse {
|
|
4173
4155
|
usersRanking: PointsRankingEntry[];
|
|
4174
4156
|
}
|
|
4175
|
-
interface GetUserAccountValueRankingRequest {
|
|
4176
|
-
userId?: string;
|
|
4177
|
-
userAddress?: string;
|
|
4178
|
-
}
|
|
4179
|
-
interface GetUserAccountValueRankingResponse {
|
|
4180
|
-
usersRanking: AccountValueRankingEntry[];
|
|
4181
|
-
}
|
|
4182
4157
|
interface GetUserAggregatedBoxRewardsStatsRequest {
|
|
4183
4158
|
userId: string;
|
|
4184
4159
|
}
|
|
@@ -5184,8 +5159,7 @@ declare enum EndpointsV1 {
|
|
|
5184
5159
|
GetUserPersonalPointsRanking = "/v1/get_user_personal_points_ranking",
|
|
5185
5160
|
GetIndexPrices = "/v1/get_index_prices",
|
|
5186
5161
|
GetAccountValueRanking = "/v1/get_account_value_ranking",
|
|
5187
|
-
GetUserAccountValueRanking = "/v1/get_user_account_value_ranking"
|
|
5188
|
-
GetExchangeStatsHistory = "/v1/get_exchange_stats_history"
|
|
5162
|
+
GetUserAccountValueRanking = "/v1/get_user_account_value_ranking"
|
|
5189
5163
|
}
|
|
5190
5164
|
type Topic = {
|
|
5191
5165
|
type: "PerpMarket";
|
|
@@ -5597,13 +5571,6 @@ interface WithdrawTokenParams {
|
|
|
5597
5571
|
max: boolean;
|
|
5598
5572
|
recipient: Address;
|
|
5599
5573
|
}
|
|
5600
|
-
interface IGetChartCandlesInRange {
|
|
5601
|
-
marketName: string;
|
|
5602
|
-
interval: ChartInterval;
|
|
5603
|
-
timestampStartMs?: number;
|
|
5604
|
-
timestampEndMs?: number;
|
|
5605
|
-
cursor?: PaginationCursor;
|
|
5606
|
-
}
|
|
5607
5574
|
interface PlaceMultiplePerpOrdersParams {
|
|
5608
5575
|
userId: string;
|
|
5609
5576
|
perpOrders: PerpOrderData[];
|
|
@@ -5901,7 +5868,7 @@ declare class Client {
|
|
|
5901
5868
|
getPerpMarketsData: (markets: string[]) => Promise<GetPerpMarketsDataResponse>;
|
|
5902
5869
|
getSpotMarketsData: (markets: string[]) => Promise<GetSpotMarketsDataResponse>;
|
|
5903
5870
|
getBorrowLendingData: () => Promise<GetBorrowLendingDataResponse>;
|
|
5904
|
-
getChartCandlesInRange: (
|
|
5871
|
+
getChartCandlesInRange: (request: GetChartCandlesInRangeRequest) => Promise<GetChartCandlesInRangeResponse>;
|
|
5905
5872
|
getPriceIndexes: () => Promise<GetPriceIndexesResponse>;
|
|
5906
5873
|
getUsersByAddress: (payload: GetUsersByAddressRequest) => Promise<GetUsersByAddressResponse>;
|
|
5907
5874
|
getPerpRecentTrades: (request: GetPerpRecentTradesRequest) => Promise<GetPerpRecentTradesResponse>;
|
|
@@ -5980,4 +5947,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
5980
5947
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
5981
5948
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
5982
5949
|
|
|
5983
|
-
export { ABIs, type AccountValueRankingEntry, 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 CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type
|
|
5950
|
+
export { ABIs, type AccountValueRankingEntry, 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 CancelAllSpotOrdersParams, type CancelPerpOrdersParams, type CancelSpotOrdersParams, type CanceledPerpOrderData, type CanceledPerpOrders, type CanceledPerpTriggerOrderData, type CanceledPerpTriggerOrders, type CanceledSpotOrderData, type CanceledSpotOrders, type ChangePerpOrderParams, type ChangeSpotOrderParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type 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 GetAccountValueRankingRequest, type GetAccountValueRankingResponse, type GetAllVaultsIdsResponse, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexPricesResponse, type GetIndexerStatusResponse, type GetOrderBookDataRequest, type GetOrderBookDataResponse, type GetPerpMarketsConfigResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpUserTriggerOrdersRequest, type GetPerpUserTriggerOrdersResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetSpotMarketsConfigResponse, type GetSpotMarketsDataRequest, type GetSpotMarketsDataResponse, type GetSpotRecentTradesRequest, type GetSpotRecentTradesResponse, type GetSpotUserFillsRequest, type GetSpotUserFillsResponse, type GetSpotUserOrdersRequest, type GetSpotUserOrdersResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetTopPointsRankingResponse, type GetUserAccountValueRankingRequest, type GetUserAccountValueRankingResponse, type GetUserAggregatedBoxRewardsStatsRequest, type GetUserAggregatedBoxRewardsStatsResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserBoxRewardsStatsHistoryRequest, type GetUserBoxRewardsStatsHistoryResponse, type GetUserBoxesHistoryRequest, type GetUserBoxesHistoryResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFullLiquidationsHistoryRequest, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsCancelHistoryResponse, type GetUserLiquidationsCancelOrdersHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPartialLiquidationsHistoryRequest, type GetUserPartialLiquidationsHistoryResponse, type GetUserPersonalPointsRankingRequest, type GetUserPersonalPointsRankingResponse, type GetUserPointsHistoryRequest, type GetUserPointsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserRewardsValueRequest, type GetUserRewardsValueResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type GlobalLiquidation, type GlobalPartialLiquidation, type HistoricBoxReward, type HistoricalBoxRewardsStats, type HistoricalDeposit, type HistoricalFullLiquidation, type HistoricalFunding, type HistoricalLiquidatedBorrow, type HistoricalLiquidatedCollateral, type HistoricalLiquidatedLend, type HistoricalLiquidatedPosition, type HistoricalLiquidationCancelOrders, type HistoricalPartialLiquidatedPosition, type HistoricalPartialLiquidation, type HistoricalPerpOrder, type HistoricalPoints, type HistoricalReferralStats, type HistoricalSpotOrder, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IndexPriceHistory, type IndexPriceLive, type Lend, type LendTokenParams, type Liquidation, type LiquidationCancelledOrderData, type LiquidationCancelledTriggerOrderData, MAINNET_CONFIG, type MarginStep, Network, type NetworkConfig, type NetworkMode, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type OrderBookData, OrderSide, OrderStatus, OrderType, type PaginationCursor, type PartialLiquidation, type PerpFill, type PerpMarketConfigEntry, type PerpMarketData, type PerpOrder, type PerpOrderData, type PerpOrderDataForMarket, type PerpOrderFills, type PerpOrderbookState, type PerpOrderbookUpdate, type PerpPosition, type PerpTrade, type PerpTradesUpdate, type PerpTriggerOrder, type PerpTriggerOrderTriggered, type PlaceMultiplePerpOrdersParams, type PlaceMultipleSpotOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PlacePerpTriggerOrder, type PlacePerpTriggerOrderParams, type PlaceSpotLimitOrder, type PlaceSpotMarketOrder, type PlaceSpotOrderParams, type PointsRankingEntry, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type ReplaceMultipleSpotOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, type SpotFill, type SpotMarketConfigEntry, type SpotMarketData, type SpotOrder, type SpotOrderData, type SpotOrderDataForMarket, type SpotOrderFills, type SpotOrderbookState, type SpotOrderbookUpdate, type SpotTrade, type SpotTradesUpdate, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TESTNET_CONFIG, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, TransferAction, type TransferToUserParams, type TriggerOrder, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedBoxRewardsStats, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserBoxOpeningEvent, type UserPointsBreakdown, 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 WsLiquidatedBorrow, type WsLiquidatedCollateral, type WsLiquidatedLend, type WsLiquidatedPosition, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPartialLiquidatedPosition, type WsPerpMarketUpdates, type WsSpotMarketUpdates, type WsUserUpdates, createAptosClient, createAptosClientFromEnv, generateApiKey, getABIsForNetwork, getNetworkConfig, getNetworkModeFromEnv, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.js
CHANGED
|
@@ -23536,7 +23536,6 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
23536
23536
|
EndpointsV12["GetIndexPrices"] = "/v1/get_index_prices";
|
|
23537
23537
|
EndpointsV12["GetAccountValueRanking"] = "/v1/get_account_value_ranking";
|
|
23538
23538
|
EndpointsV12["GetUserAccountValueRanking"] = "/v1/get_user_account_value_ranking";
|
|
23539
|
-
EndpointsV12["GetExchangeStatsHistory"] = "/v1/get_exchange_stats_history";
|
|
23540
23539
|
return EndpointsV12;
|
|
23541
23540
|
})(EndpointsV1 || {});
|
|
23542
23541
|
var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
@@ -24049,24 +24048,11 @@ var Client = class _Client {
|
|
|
24049
24048
|
const response = await this.sendGetJson("/v1/get_borrow_lending_data" /* GetBorrowLendingData */);
|
|
24050
24049
|
return response;
|
|
24051
24050
|
};
|
|
24052
|
-
this.getChartCandlesInRange = async ({
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
timestampStartMs = Math.round((/* @__PURE__ */ new Date()).getTime()),
|
|
24056
|
-
timestampEndMs = Math.round((/* @__PURE__ */ new Date()).getTime() - 24 * 60 * 60 * 1e3),
|
|
24057
|
-
// default 24 back
|
|
24058
|
-
cursor
|
|
24059
|
-
}) => {
|
|
24060
|
-
if (timestampEndMs && timestampStartMs && timestampEndMs > timestampStartMs) {
|
|
24061
|
-
throw new Error("timestampEndMs must be lower than timestampStartMs");
|
|
24051
|
+
this.getChartCandlesInRange = async (request) => {
|
|
24052
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
24053
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
24062
24054
|
}
|
|
24063
|
-
const response = await this.sendGetJson("/v1/public/chart_candles_in_range" /* GetChartCandlesInRange */,
|
|
24064
|
-
marketName,
|
|
24065
|
-
interval,
|
|
24066
|
-
startTimestamp: timestampStartMs.toString(),
|
|
24067
|
-
endTimestamp: timestampEndMs.toString(),
|
|
24068
|
-
paginationCursor: cursor
|
|
24069
|
-
});
|
|
24055
|
+
const response = await this.sendGetJson("/v1/public/chart_candles_in_range" /* GetChartCandlesInRange */, request);
|
|
24070
24056
|
return response;
|
|
24071
24057
|
};
|
|
24072
24058
|
this.getPriceIndexes = async () => {
|