@nightlylabs/dex-sdk 0.0.94 → 0.0.96
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 +18 -5
- package/dist/index.d.cts +52 -3
- package/dist/index.d.ts +52 -3
- package/dist/index.js +18 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -673,6 +673,8 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
673
673
|
EndpointsV12["SetUserReferralParams"] = "/v1/set_user_referral_params";
|
|
674
674
|
EndpointsV12["GetBorrowLendHistoricalData"] = "/v1/get_borrow_lend_historical_data";
|
|
675
675
|
EndpointsV12["GetBorrowLendAggregatedData"] = "/v1/get_borrow_lend_aggregated_data";
|
|
676
|
+
EndpointsV12["GetTokensStats"] = "/v1/get_tokens_stats";
|
|
677
|
+
EndpointsV12["GetTokensAggregatedStats"] = "/v1/get_tokens_aggregated_stats";
|
|
676
678
|
return EndpointsV12;
|
|
677
679
|
})(EndpointsV1 || {});
|
|
678
680
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -1257,6 +1259,17 @@ var Client = class _Client {
|
|
|
1257
1259
|
const response = await this.sendGetJson("/v1/get_borrow_lend_aggregated_data" /* GetBorrowLendAggregatedData */, request);
|
|
1258
1260
|
return response;
|
|
1259
1261
|
};
|
|
1262
|
+
this.getTokenStats = async (request) => {
|
|
1263
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1264
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1265
|
+
}
|
|
1266
|
+
const response = await this.sendGetJson("/v1/get_tokens_stats" /* GetTokensStats */, request);
|
|
1267
|
+
return response;
|
|
1268
|
+
};
|
|
1269
|
+
this.getTokenAggregatedStats = async (request) => {
|
|
1270
|
+
const response = await this.sendGetJson("/v1/get_tokens_aggregated_stats" /* GetTokensAggregatedStats */, request);
|
|
1271
|
+
return response;
|
|
1272
|
+
};
|
|
1260
1273
|
// Meta
|
|
1261
1274
|
this.getTime = async () => {
|
|
1262
1275
|
const response = await this.sendGetJson("/time" /* Time */);
|
|
@@ -1822,10 +1835,10 @@ var Client = class _Client {
|
|
|
1822
1835
|
});
|
|
1823
1836
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1824
1837
|
}
|
|
1825
|
-
async
|
|
1838
|
+
async replaceMultipleOrders(params) {
|
|
1826
1839
|
const isBids = params.orders.map((order) => order.isBid);
|
|
1827
|
-
const prices = params.orders.map((order) =>
|
|
1828
|
-
const sizes = params.orders.map((order) =>
|
|
1840
|
+
const prices = params.orders.map((order) => order.price);
|
|
1841
|
+
const sizes = params.orders.map((order) => order.size);
|
|
1829
1842
|
const postOnly = params.orders.map((order) => order.postOnly);
|
|
1830
1843
|
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
1831
1844
|
aptosConfig: this._aptos.config,
|
|
@@ -1844,8 +1857,8 @@ var Client = class _Client {
|
|
|
1844
1857
|
async placeMultiplePerpOrders(params) {
|
|
1845
1858
|
const markets = params.perpOrders.map((order) => order.market);
|
|
1846
1859
|
const isBids = params.perpOrders.map((order) => order.isBid);
|
|
1847
|
-
const prices = params.perpOrders.map((order) =>
|
|
1848
|
-
const sizes = params.perpOrders.map((order) =>
|
|
1860
|
+
const prices = params.perpOrders.map((order) => order.price);
|
|
1861
|
+
const sizes = params.perpOrders.map((order) => order.size);
|
|
1849
1862
|
const postOnly = params.perpOrders.map((order) => order.postOnly || false);
|
|
1850
1863
|
const reduceOnly = params.perpOrders.map((order) => order.reduceOnly || false);
|
|
1851
1864
|
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
package/dist/index.d.cts
CHANGED
|
@@ -33,6 +33,8 @@ interface BorrowLendUpdate {
|
|
|
33
33
|
lendAmount: string;
|
|
34
34
|
borrowShares: string;
|
|
35
35
|
borrowAmount: string;
|
|
36
|
+
suppliers: string;
|
|
37
|
+
borrowers: string;
|
|
36
38
|
}
|
|
37
39
|
interface UtilizationCurve {
|
|
38
40
|
base: string;
|
|
@@ -46,6 +48,8 @@ interface BorrowLending {
|
|
|
46
48
|
lendAmount: string;
|
|
47
49
|
borrowShares: string;
|
|
48
50
|
borrowAmount: string;
|
|
51
|
+
suppliers: string;
|
|
52
|
+
borrowers: string;
|
|
49
53
|
utilizationCurve: UtilizationCurve;
|
|
50
54
|
borrowEnabled: boolean;
|
|
51
55
|
lastUpdated: string;
|
|
@@ -61,6 +65,8 @@ interface BorrowLendingHistoricalData {
|
|
|
61
65
|
lendAmount: string;
|
|
62
66
|
borrowShares: string;
|
|
63
67
|
borrowAmount: string;
|
|
68
|
+
suppliers: string;
|
|
69
|
+
borrowers: string;
|
|
64
70
|
timestamp: string;
|
|
65
71
|
}
|
|
66
72
|
interface CanceledPerpOrders {
|
|
@@ -357,6 +363,45 @@ interface PriceIndex {
|
|
|
357
363
|
interface GetPriceIndexesResponse {
|
|
358
364
|
prices: Record<string, PriceIndex>;
|
|
359
365
|
}
|
|
366
|
+
interface GetTokenAggregatedStatsRequest {
|
|
367
|
+
tokenAddress: string[];
|
|
368
|
+
}
|
|
369
|
+
interface TokenAggregatedStats {
|
|
370
|
+
tokenAddress: string;
|
|
371
|
+
totalDepositAmount: string;
|
|
372
|
+
totalDepositValue: string;
|
|
373
|
+
totalDepositCount: string;
|
|
374
|
+
totalWithdrawAmount: string;
|
|
375
|
+
totalWithdrawValue: string;
|
|
376
|
+
totalWithdrawCount: string;
|
|
377
|
+
athHolders: string;
|
|
378
|
+
}
|
|
379
|
+
interface GetTokenAggregatedStatsResponse {
|
|
380
|
+
tokenAggregatedStats: TokenAggregatedStats[];
|
|
381
|
+
}
|
|
382
|
+
interface GetTokenStatsHistoryRequest {
|
|
383
|
+
tokenAddress: string;
|
|
384
|
+
olderTimestampMs?: string;
|
|
385
|
+
newerTimestampMs?: string;
|
|
386
|
+
paginationCursor?: PaginationCursor;
|
|
387
|
+
}
|
|
388
|
+
interface HistoricalTokenStats {
|
|
389
|
+
tokenAddress: string;
|
|
390
|
+
totalDepositAmount: string;
|
|
391
|
+
totalDepositValue: string;
|
|
392
|
+
totalDepositCount: string;
|
|
393
|
+
totalWithdrawAmount: string;
|
|
394
|
+
totalWithdrawValue: string;
|
|
395
|
+
totalWithdrawCount: string;
|
|
396
|
+
holders: string;
|
|
397
|
+
tokenSupply: string;
|
|
398
|
+
timestampOpen: string;
|
|
399
|
+
timestampClose: string;
|
|
400
|
+
}
|
|
401
|
+
interface GetTokenStatsHistoryResponse {
|
|
402
|
+
stats: HistoricalTokenStats[];
|
|
403
|
+
paginationCursor?: PaginationCursor;
|
|
404
|
+
}
|
|
360
405
|
interface GetTokensConfigResponse {
|
|
361
406
|
tokens: Record<string, TokenConfigEntry>;
|
|
362
407
|
usdcAddress?: string;
|
|
@@ -775,7 +820,9 @@ declare enum EndpointsV1 {
|
|
|
775
820
|
GetUserTransfers = "/v1/get_user_transfers",
|
|
776
821
|
SetUserReferralParams = "/v1/set_user_referral_params",
|
|
777
822
|
GetBorrowLendHistoricalData = "/v1/get_borrow_lend_historical_data",
|
|
778
|
-
GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data"
|
|
823
|
+
GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data",
|
|
824
|
+
GetTokensStats = "/v1/get_tokens_stats",
|
|
825
|
+
GetTokensAggregatedStats = "/v1/get_tokens_aggregated_stats"
|
|
779
826
|
}
|
|
780
827
|
declare enum SpotMarketStatus {
|
|
781
828
|
Halted = "halted",
|
|
@@ -1227,7 +1274,7 @@ declare class Client {
|
|
|
1227
1274
|
claimReferralFees(params: ClaimReferralFeesParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1228
1275
|
claimKickbackFee(params: ClaimKickbackFeeParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1229
1276
|
transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1230
|
-
|
|
1277
|
+
replaceMultipleOrders(params: ReplaceMultipleOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1231
1278
|
placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1232
1279
|
claimDeposit(params: ClaimDepositParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1233
1280
|
setReferralParams: (request: SetReferralParamsRequest) => Promise<void>;
|
|
@@ -1261,6 +1308,8 @@ declare class Client {
|
|
|
1261
1308
|
getUserTransfersHistory: (request: GetUserTransferHistoryRequest) => Promise<GetUserTransferHistoryResponse>;
|
|
1262
1309
|
getBorrowLendHistoricalState: (request: GetBorrowLendingHistoricalDataRequest) => Promise<GetBorrowLendingHistoricalDataResponse>;
|
|
1263
1310
|
getBorrowLendAggregatedStats: (request: GetBorrowLendingAggregatedStatsRequest) => Promise<GetBorrowLendingAggregatedStatsResponse>;
|
|
1311
|
+
getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
|
|
1312
|
+
getTokenAggregatedStats: (request: GetTokenAggregatedStatsRequest) => Promise<GetTokenAggregatedStatsResponse>;
|
|
1264
1313
|
getTime: () => Promise<string>;
|
|
1265
1314
|
}
|
|
1266
1315
|
|
|
@@ -1293,4 +1342,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1293
1342
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1294
1343
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1295
1344
|
|
|
1296
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, 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 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 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 GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, 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 GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, 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 SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, 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 };
|
|
1345
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, 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 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 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 GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, 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 GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, 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 SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, 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
|
@@ -33,6 +33,8 @@ interface BorrowLendUpdate {
|
|
|
33
33
|
lendAmount: string;
|
|
34
34
|
borrowShares: string;
|
|
35
35
|
borrowAmount: string;
|
|
36
|
+
suppliers: string;
|
|
37
|
+
borrowers: string;
|
|
36
38
|
}
|
|
37
39
|
interface UtilizationCurve {
|
|
38
40
|
base: string;
|
|
@@ -46,6 +48,8 @@ interface BorrowLending {
|
|
|
46
48
|
lendAmount: string;
|
|
47
49
|
borrowShares: string;
|
|
48
50
|
borrowAmount: string;
|
|
51
|
+
suppliers: string;
|
|
52
|
+
borrowers: string;
|
|
49
53
|
utilizationCurve: UtilizationCurve;
|
|
50
54
|
borrowEnabled: boolean;
|
|
51
55
|
lastUpdated: string;
|
|
@@ -61,6 +65,8 @@ interface BorrowLendingHistoricalData {
|
|
|
61
65
|
lendAmount: string;
|
|
62
66
|
borrowShares: string;
|
|
63
67
|
borrowAmount: string;
|
|
68
|
+
suppliers: string;
|
|
69
|
+
borrowers: string;
|
|
64
70
|
timestamp: string;
|
|
65
71
|
}
|
|
66
72
|
interface CanceledPerpOrders {
|
|
@@ -357,6 +363,45 @@ interface PriceIndex {
|
|
|
357
363
|
interface GetPriceIndexesResponse {
|
|
358
364
|
prices: Record<string, PriceIndex>;
|
|
359
365
|
}
|
|
366
|
+
interface GetTokenAggregatedStatsRequest {
|
|
367
|
+
tokenAddress: string[];
|
|
368
|
+
}
|
|
369
|
+
interface TokenAggregatedStats {
|
|
370
|
+
tokenAddress: string;
|
|
371
|
+
totalDepositAmount: string;
|
|
372
|
+
totalDepositValue: string;
|
|
373
|
+
totalDepositCount: string;
|
|
374
|
+
totalWithdrawAmount: string;
|
|
375
|
+
totalWithdrawValue: string;
|
|
376
|
+
totalWithdrawCount: string;
|
|
377
|
+
athHolders: string;
|
|
378
|
+
}
|
|
379
|
+
interface GetTokenAggregatedStatsResponse {
|
|
380
|
+
tokenAggregatedStats: TokenAggregatedStats[];
|
|
381
|
+
}
|
|
382
|
+
interface GetTokenStatsHistoryRequest {
|
|
383
|
+
tokenAddress: string;
|
|
384
|
+
olderTimestampMs?: string;
|
|
385
|
+
newerTimestampMs?: string;
|
|
386
|
+
paginationCursor?: PaginationCursor;
|
|
387
|
+
}
|
|
388
|
+
interface HistoricalTokenStats {
|
|
389
|
+
tokenAddress: string;
|
|
390
|
+
totalDepositAmount: string;
|
|
391
|
+
totalDepositValue: string;
|
|
392
|
+
totalDepositCount: string;
|
|
393
|
+
totalWithdrawAmount: string;
|
|
394
|
+
totalWithdrawValue: string;
|
|
395
|
+
totalWithdrawCount: string;
|
|
396
|
+
holders: string;
|
|
397
|
+
tokenSupply: string;
|
|
398
|
+
timestampOpen: string;
|
|
399
|
+
timestampClose: string;
|
|
400
|
+
}
|
|
401
|
+
interface GetTokenStatsHistoryResponse {
|
|
402
|
+
stats: HistoricalTokenStats[];
|
|
403
|
+
paginationCursor?: PaginationCursor;
|
|
404
|
+
}
|
|
360
405
|
interface GetTokensConfigResponse {
|
|
361
406
|
tokens: Record<string, TokenConfigEntry>;
|
|
362
407
|
usdcAddress?: string;
|
|
@@ -775,7 +820,9 @@ declare enum EndpointsV1 {
|
|
|
775
820
|
GetUserTransfers = "/v1/get_user_transfers",
|
|
776
821
|
SetUserReferralParams = "/v1/set_user_referral_params",
|
|
777
822
|
GetBorrowLendHistoricalData = "/v1/get_borrow_lend_historical_data",
|
|
778
|
-
GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data"
|
|
823
|
+
GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data",
|
|
824
|
+
GetTokensStats = "/v1/get_tokens_stats",
|
|
825
|
+
GetTokensAggregatedStats = "/v1/get_tokens_aggregated_stats"
|
|
779
826
|
}
|
|
780
827
|
declare enum SpotMarketStatus {
|
|
781
828
|
Halted = "halted",
|
|
@@ -1227,7 +1274,7 @@ declare class Client {
|
|
|
1227
1274
|
claimReferralFees(params: ClaimReferralFeesParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1228
1275
|
claimKickbackFee(params: ClaimKickbackFeeParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1229
1276
|
transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1230
|
-
|
|
1277
|
+
replaceMultipleOrders(params: ReplaceMultipleOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1231
1278
|
placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1232
1279
|
claimDeposit(params: ClaimDepositParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1233
1280
|
setReferralParams: (request: SetReferralParamsRequest) => Promise<void>;
|
|
@@ -1261,6 +1308,8 @@ declare class Client {
|
|
|
1261
1308
|
getUserTransfersHistory: (request: GetUserTransferHistoryRequest) => Promise<GetUserTransferHistoryResponse>;
|
|
1262
1309
|
getBorrowLendHistoricalState: (request: GetBorrowLendingHistoricalDataRequest) => Promise<GetBorrowLendingHistoricalDataResponse>;
|
|
1263
1310
|
getBorrowLendAggregatedStats: (request: GetBorrowLendingAggregatedStatsRequest) => Promise<GetBorrowLendingAggregatedStatsResponse>;
|
|
1311
|
+
getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
|
|
1312
|
+
getTokenAggregatedStats: (request: GetTokenAggregatedStatsRequest) => Promise<GetTokenAggregatedStatsResponse>;
|
|
1264
1313
|
getTime: () => Promise<string>;
|
|
1265
1314
|
}
|
|
1266
1315
|
|
|
@@ -1293,4 +1342,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1293
1342
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1294
1343
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1295
1344
|
|
|
1296
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, 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 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 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 GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, 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 GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, 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 SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, 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 };
|
|
1345
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, 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 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 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 GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, 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 GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, 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 SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, 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
|
@@ -623,6 +623,8 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
623
623
|
EndpointsV12["SetUserReferralParams"] = "/v1/set_user_referral_params";
|
|
624
624
|
EndpointsV12["GetBorrowLendHistoricalData"] = "/v1/get_borrow_lend_historical_data";
|
|
625
625
|
EndpointsV12["GetBorrowLendAggregatedData"] = "/v1/get_borrow_lend_aggregated_data";
|
|
626
|
+
EndpointsV12["GetTokensStats"] = "/v1/get_tokens_stats";
|
|
627
|
+
EndpointsV12["GetTokensAggregatedStats"] = "/v1/get_tokens_aggregated_stats";
|
|
626
628
|
return EndpointsV12;
|
|
627
629
|
})(EndpointsV1 || {});
|
|
628
630
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -1207,6 +1209,17 @@ var Client = class _Client {
|
|
|
1207
1209
|
const response = await this.sendGetJson("/v1/get_borrow_lend_aggregated_data" /* GetBorrowLendAggregatedData */, request);
|
|
1208
1210
|
return response;
|
|
1209
1211
|
};
|
|
1212
|
+
this.getTokenStats = async (request) => {
|
|
1213
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1214
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1215
|
+
}
|
|
1216
|
+
const response = await this.sendGetJson("/v1/get_tokens_stats" /* GetTokensStats */, request);
|
|
1217
|
+
return response;
|
|
1218
|
+
};
|
|
1219
|
+
this.getTokenAggregatedStats = async (request) => {
|
|
1220
|
+
const response = await this.sendGetJson("/v1/get_tokens_aggregated_stats" /* GetTokensAggregatedStats */, request);
|
|
1221
|
+
return response;
|
|
1222
|
+
};
|
|
1210
1223
|
// Meta
|
|
1211
1224
|
this.getTime = async () => {
|
|
1212
1225
|
const response = await this.sendGetJson("/time" /* Time */);
|
|
@@ -1772,10 +1785,10 @@ var Client = class _Client {
|
|
|
1772
1785
|
});
|
|
1773
1786
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1774
1787
|
}
|
|
1775
|
-
async
|
|
1788
|
+
async replaceMultipleOrders(params) {
|
|
1776
1789
|
const isBids = params.orders.map((order) => order.isBid);
|
|
1777
|
-
const prices = params.orders.map((order) =>
|
|
1778
|
-
const sizes = params.orders.map((order) =>
|
|
1790
|
+
const prices = params.orders.map((order) => order.price);
|
|
1791
|
+
const sizes = params.orders.map((order) => order.size);
|
|
1779
1792
|
const postOnly = params.orders.map((order) => order.postOnly);
|
|
1780
1793
|
const aptosPayload = await generateTransactionPayload({
|
|
1781
1794
|
aptosConfig: this._aptos.config,
|
|
@@ -1794,8 +1807,8 @@ var Client = class _Client {
|
|
|
1794
1807
|
async placeMultiplePerpOrders(params) {
|
|
1795
1808
|
const markets = params.perpOrders.map((order) => order.market);
|
|
1796
1809
|
const isBids = params.perpOrders.map((order) => order.isBid);
|
|
1797
|
-
const prices = params.perpOrders.map((order) =>
|
|
1798
|
-
const sizes = params.perpOrders.map((order) =>
|
|
1810
|
+
const prices = params.perpOrders.map((order) => order.price);
|
|
1811
|
+
const sizes = params.perpOrders.map((order) => order.size);
|
|
1799
1812
|
const postOnly = params.perpOrders.map((order) => order.postOnly || false);
|
|
1800
1813
|
const reduceOnly = params.perpOrders.map((order) => order.reduceOnly || false);
|
|
1801
1814
|
const aptosPayload = await generateTransactionPayload({
|