@nightlylabs/dex-sdk 0.1.20 → 0.1.21
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 +8 -0
- package/dist/index.d.cts +39 -9
- package/dist/index.d.ts +39 -9
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -753,6 +753,7 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
753
753
|
EndpointsV12["GetIndexPriceHistory"] = "/v1/get_index_price_history";
|
|
754
754
|
EndpointsV12["ServicesStatus"] = "/v1/services_status";
|
|
755
755
|
EndpointsV12["GetUserAggregatedVaultStats"] = "/v1/get_user_aggregated_vault_stats";
|
|
756
|
+
EndpointsV12["GetUserLiquidations"] = "/v1/get_user_liquidations";
|
|
756
757
|
return EndpointsV12;
|
|
757
758
|
})(EndpointsV1 || {});
|
|
758
759
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -1358,6 +1359,13 @@ var Client = class _Client {
|
|
|
1358
1359
|
const response = await this.sendGetJson("/v1/get_user_transfers" /* GetUserTransfers */, request);
|
|
1359
1360
|
return response;
|
|
1360
1361
|
};
|
|
1362
|
+
this.getUserLiquidations = async (request) => {
|
|
1363
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1364
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1365
|
+
}
|
|
1366
|
+
const response = await this.sendGetJson("/v1/get_user_liquidations" /* GetUserLiquidations */, request);
|
|
1367
|
+
return response;
|
|
1368
|
+
};
|
|
1361
1369
|
this.getBorrowLendHistoricalState = async (request) => {
|
|
1362
1370
|
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1363
1371
|
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
package/dist/index.d.cts
CHANGED
|
@@ -481,6 +481,7 @@ interface UserAggregatedStats {
|
|
|
481
481
|
perpVolumeTaker: string;
|
|
482
482
|
liquidationVolume: string;
|
|
483
483
|
depositValue: string;
|
|
484
|
+
withdrawValue: string;
|
|
484
485
|
paidFeeMaker: string;
|
|
485
486
|
paidFeeTaker: string;
|
|
486
487
|
spotTradesCountMaker: string;
|
|
@@ -608,6 +609,25 @@ interface GetUserFundingHistoryResponse {
|
|
|
608
609
|
funding: HistoricalFunding[];
|
|
609
610
|
paginationCursor?: PaginationCursor;
|
|
610
611
|
}
|
|
612
|
+
interface GetUserLiquidationsHistoryRequest {
|
|
613
|
+
userId: string;
|
|
614
|
+
olderTimestampMs?: string;
|
|
615
|
+
newerTimestampMs?: string;
|
|
616
|
+
paginationCursor?: PaginationCursor;
|
|
617
|
+
}
|
|
618
|
+
interface HistoricalLiquidation {
|
|
619
|
+
userId: string;
|
|
620
|
+
liquidatedPositions: Record<string, string>;
|
|
621
|
+
liquidatedBorrowShares: Record<string, string>;
|
|
622
|
+
liquidatedLendShares: Record<string, string>;
|
|
623
|
+
liquidatedCollaterals: Record<string, string>;
|
|
624
|
+
liquidationValue: string;
|
|
625
|
+
timestamp: string;
|
|
626
|
+
}
|
|
627
|
+
interface GetUserLiquidationsHistoryResponse {
|
|
628
|
+
liquidations: HistoricalLiquidation[];
|
|
629
|
+
paginationCursor?: PaginationCursor;
|
|
630
|
+
}
|
|
611
631
|
interface GetUserPortfolioValueRequest {
|
|
612
632
|
userId: string;
|
|
613
633
|
olderTimestampMs?: string;
|
|
@@ -688,13 +708,6 @@ interface GetUserVaultDepositsRequest {
|
|
|
688
708
|
newerTimestampMs?: string;
|
|
689
709
|
paginationCursor?: PaginationCursor;
|
|
690
710
|
}
|
|
691
|
-
interface HistoricalVaultDeposit {
|
|
692
|
-
vaultId: string;
|
|
693
|
-
usdDepositAmount: string;
|
|
694
|
-
sharesReceived: string;
|
|
695
|
-
tokensReceived: string;
|
|
696
|
-
timestamp: string;
|
|
697
|
-
}
|
|
698
711
|
interface GetUserVaultDepositsResponse {
|
|
699
712
|
vaultDeposits: HistoricalVaultDeposit[];
|
|
700
713
|
paginationCursor?: PaginationCursor;
|
|
@@ -767,6 +780,21 @@ interface GetVaultHistoricalDataResponse {
|
|
|
767
780
|
data: VaultHistoricalData[];
|
|
768
781
|
paginationCursor?: PaginationCursor;
|
|
769
782
|
}
|
|
783
|
+
interface HistoricalVaultDeposit {
|
|
784
|
+
userId: string;
|
|
785
|
+
vaultId: string;
|
|
786
|
+
usdDepositAmount: string;
|
|
787
|
+
sharesReceived: string;
|
|
788
|
+
tokensReceived: string;
|
|
789
|
+
timestamp: string;
|
|
790
|
+
}
|
|
791
|
+
interface HistoricalVaultDeposit {
|
|
792
|
+
vaultId: string;
|
|
793
|
+
usdDepositAmount: string;
|
|
794
|
+
sharesReceived: string;
|
|
795
|
+
tokensReceived: string;
|
|
796
|
+
timestamp: string;
|
|
797
|
+
}
|
|
770
798
|
interface Lend {
|
|
771
799
|
userId: string;
|
|
772
800
|
tokenAddress: string;
|
|
@@ -978,7 +1006,8 @@ declare enum EndpointsV1 {
|
|
|
978
1006
|
GetVaultHistoricalData = "/v1/get_vault_historical_data",
|
|
979
1007
|
GetIndexPriceHistory = "/v1/get_index_price_history",
|
|
980
1008
|
ServicesStatus = "/v1/services_status",
|
|
981
|
-
GetUserAggregatedVaultStats = "/v1/get_user_aggregated_vault_stats"
|
|
1009
|
+
GetUserAggregatedVaultStats = "/v1/get_user_aggregated_vault_stats",
|
|
1010
|
+
GetUserLiquidations = "/v1/get_user_liquidations"
|
|
982
1011
|
}
|
|
983
1012
|
declare enum SpotMarketStatus {
|
|
984
1013
|
Halted = "halted",
|
|
@@ -1499,6 +1528,7 @@ declare class Client {
|
|
|
1499
1528
|
getUserClaimedKickbackHistory: (request: GetUserClaimedKickbackHistoryRequest) => Promise<GetUserClaimedKickbackHistoryResponse>;
|
|
1500
1529
|
getUserClaimedReferralKickbackHistory: (request: GetUserClaimedReferralKickbackHistoryRequest) => Promise<GetUserClaimedReferralKickbackHistoryResponse>;
|
|
1501
1530
|
getUserTransfersHistory: (request: GetUserTransferHistoryRequest) => Promise<GetUserTransferHistoryResponse>;
|
|
1531
|
+
getUserLiquidations: (request: GetUserLiquidationsHistoryRequest) => Promise<GetUserLiquidationsHistoryResponse>;
|
|
1502
1532
|
getBorrowLendHistoricalState: (request: GetBorrowLendingHistoricalDataRequest) => Promise<GetBorrowLendingHistoricalDataResponse>;
|
|
1503
1533
|
getBorrowLendAggregatedStats: (request: GetBorrowLendingAggregatedStatsRequest) => Promise<GetBorrowLendingAggregatedStatsResponse>;
|
|
1504
1534
|
getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
|
|
@@ -1541,4 +1571,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1541
1571
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1542
1572
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1543
1573
|
|
|
1544
|
-
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 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 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 GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type NodeStatus, 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, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1574
|
+
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 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 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 GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, 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 MarginStep, type MarketStatusChange, Network, type NodeStatus, 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, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -481,6 +481,7 @@ interface UserAggregatedStats {
|
|
|
481
481
|
perpVolumeTaker: string;
|
|
482
482
|
liquidationVolume: string;
|
|
483
483
|
depositValue: string;
|
|
484
|
+
withdrawValue: string;
|
|
484
485
|
paidFeeMaker: string;
|
|
485
486
|
paidFeeTaker: string;
|
|
486
487
|
spotTradesCountMaker: string;
|
|
@@ -608,6 +609,25 @@ interface GetUserFundingHistoryResponse {
|
|
|
608
609
|
funding: HistoricalFunding[];
|
|
609
610
|
paginationCursor?: PaginationCursor;
|
|
610
611
|
}
|
|
612
|
+
interface GetUserLiquidationsHistoryRequest {
|
|
613
|
+
userId: string;
|
|
614
|
+
olderTimestampMs?: string;
|
|
615
|
+
newerTimestampMs?: string;
|
|
616
|
+
paginationCursor?: PaginationCursor;
|
|
617
|
+
}
|
|
618
|
+
interface HistoricalLiquidation {
|
|
619
|
+
userId: string;
|
|
620
|
+
liquidatedPositions: Record<string, string>;
|
|
621
|
+
liquidatedBorrowShares: Record<string, string>;
|
|
622
|
+
liquidatedLendShares: Record<string, string>;
|
|
623
|
+
liquidatedCollaterals: Record<string, string>;
|
|
624
|
+
liquidationValue: string;
|
|
625
|
+
timestamp: string;
|
|
626
|
+
}
|
|
627
|
+
interface GetUserLiquidationsHistoryResponse {
|
|
628
|
+
liquidations: HistoricalLiquidation[];
|
|
629
|
+
paginationCursor?: PaginationCursor;
|
|
630
|
+
}
|
|
611
631
|
interface GetUserPortfolioValueRequest {
|
|
612
632
|
userId: string;
|
|
613
633
|
olderTimestampMs?: string;
|
|
@@ -688,13 +708,6 @@ interface GetUserVaultDepositsRequest {
|
|
|
688
708
|
newerTimestampMs?: string;
|
|
689
709
|
paginationCursor?: PaginationCursor;
|
|
690
710
|
}
|
|
691
|
-
interface HistoricalVaultDeposit {
|
|
692
|
-
vaultId: string;
|
|
693
|
-
usdDepositAmount: string;
|
|
694
|
-
sharesReceived: string;
|
|
695
|
-
tokensReceived: string;
|
|
696
|
-
timestamp: string;
|
|
697
|
-
}
|
|
698
711
|
interface GetUserVaultDepositsResponse {
|
|
699
712
|
vaultDeposits: HistoricalVaultDeposit[];
|
|
700
713
|
paginationCursor?: PaginationCursor;
|
|
@@ -767,6 +780,21 @@ interface GetVaultHistoricalDataResponse {
|
|
|
767
780
|
data: VaultHistoricalData[];
|
|
768
781
|
paginationCursor?: PaginationCursor;
|
|
769
782
|
}
|
|
783
|
+
interface HistoricalVaultDeposit {
|
|
784
|
+
userId: string;
|
|
785
|
+
vaultId: string;
|
|
786
|
+
usdDepositAmount: string;
|
|
787
|
+
sharesReceived: string;
|
|
788
|
+
tokensReceived: string;
|
|
789
|
+
timestamp: string;
|
|
790
|
+
}
|
|
791
|
+
interface HistoricalVaultDeposit {
|
|
792
|
+
vaultId: string;
|
|
793
|
+
usdDepositAmount: string;
|
|
794
|
+
sharesReceived: string;
|
|
795
|
+
tokensReceived: string;
|
|
796
|
+
timestamp: string;
|
|
797
|
+
}
|
|
770
798
|
interface Lend {
|
|
771
799
|
userId: string;
|
|
772
800
|
tokenAddress: string;
|
|
@@ -978,7 +1006,8 @@ declare enum EndpointsV1 {
|
|
|
978
1006
|
GetVaultHistoricalData = "/v1/get_vault_historical_data",
|
|
979
1007
|
GetIndexPriceHistory = "/v1/get_index_price_history",
|
|
980
1008
|
ServicesStatus = "/v1/services_status",
|
|
981
|
-
GetUserAggregatedVaultStats = "/v1/get_user_aggregated_vault_stats"
|
|
1009
|
+
GetUserAggregatedVaultStats = "/v1/get_user_aggregated_vault_stats",
|
|
1010
|
+
GetUserLiquidations = "/v1/get_user_liquidations"
|
|
982
1011
|
}
|
|
983
1012
|
declare enum SpotMarketStatus {
|
|
984
1013
|
Halted = "halted",
|
|
@@ -1499,6 +1528,7 @@ declare class Client {
|
|
|
1499
1528
|
getUserClaimedKickbackHistory: (request: GetUserClaimedKickbackHistoryRequest) => Promise<GetUserClaimedKickbackHistoryResponse>;
|
|
1500
1529
|
getUserClaimedReferralKickbackHistory: (request: GetUserClaimedReferralKickbackHistoryRequest) => Promise<GetUserClaimedReferralKickbackHistoryResponse>;
|
|
1501
1530
|
getUserTransfersHistory: (request: GetUserTransferHistoryRequest) => Promise<GetUserTransferHistoryResponse>;
|
|
1531
|
+
getUserLiquidations: (request: GetUserLiquidationsHistoryRequest) => Promise<GetUserLiquidationsHistoryResponse>;
|
|
1502
1532
|
getBorrowLendHistoricalState: (request: GetBorrowLendingHistoricalDataRequest) => Promise<GetBorrowLendingHistoricalDataResponse>;
|
|
1503
1533
|
getBorrowLendAggregatedStats: (request: GetBorrowLendingAggregatedStatsRequest) => Promise<GetBorrowLendingAggregatedStatsResponse>;
|
|
1504
1534
|
getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
|
|
@@ -1541,4 +1571,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1541
1571
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1542
1572
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1543
1573
|
|
|
1544
|
-
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 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 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 GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type NodeStatus, 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, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1574
|
+
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 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 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 GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, 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 MarginStep, type MarketStatusChange, Network, type NodeStatus, 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, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.js
CHANGED
|
@@ -703,6 +703,7 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
703
703
|
EndpointsV12["GetIndexPriceHistory"] = "/v1/get_index_price_history";
|
|
704
704
|
EndpointsV12["ServicesStatus"] = "/v1/services_status";
|
|
705
705
|
EndpointsV12["GetUserAggregatedVaultStats"] = "/v1/get_user_aggregated_vault_stats";
|
|
706
|
+
EndpointsV12["GetUserLiquidations"] = "/v1/get_user_liquidations";
|
|
706
707
|
return EndpointsV12;
|
|
707
708
|
})(EndpointsV1 || {});
|
|
708
709
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -1308,6 +1309,13 @@ var Client = class _Client {
|
|
|
1308
1309
|
const response = await this.sendGetJson("/v1/get_user_transfers" /* GetUserTransfers */, request);
|
|
1309
1310
|
return response;
|
|
1310
1311
|
};
|
|
1312
|
+
this.getUserLiquidations = async (request) => {
|
|
1313
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1314
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1315
|
+
}
|
|
1316
|
+
const response = await this.sendGetJson("/v1/get_user_liquidations" /* GetUserLiquidations */, request);
|
|
1317
|
+
return response;
|
|
1318
|
+
};
|
|
1311
1319
|
this.getBorrowLendHistoricalState = async (request) => {
|
|
1312
1320
|
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1313
1321
|
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|