@nightlylabs/dex-sdk 0.0.95 → 0.0.97
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 +40 -27
- package/dist/index.d.cts +51 -2
- package/dist/index.d.ts +51 -2
- package/dist/index.js +40 -27
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ var import_uuid = require("uuid");
|
|
|
66
66
|
|
|
67
67
|
// generated_types/addApiKey.ts
|
|
68
68
|
var ABI = {
|
|
69
|
-
"address": "
|
|
69
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
70
70
|
"name": "add_api_key",
|
|
71
71
|
"friends": [],
|
|
72
72
|
"exposed_functions": [
|
|
@@ -91,7 +91,7 @@ var addApiKey_default = ABI;
|
|
|
91
91
|
|
|
92
92
|
// generated_types/cancelAllPerpOrders.ts
|
|
93
93
|
var ABI2 = {
|
|
94
|
-
"address": "
|
|
94
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
95
95
|
"name": "cancel_all_perp_orders",
|
|
96
96
|
"friends": [],
|
|
97
97
|
"exposed_functions": [
|
|
@@ -114,7 +114,7 @@ var cancelAllPerpOrders_default = ABI2;
|
|
|
114
114
|
|
|
115
115
|
// generated_types/cancelPerpOrders.ts
|
|
116
116
|
var ABI3 = {
|
|
117
|
-
"address": "
|
|
117
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
118
118
|
"name": "cancel_perp_orders",
|
|
119
119
|
"friends": [],
|
|
120
120
|
"exposed_functions": [
|
|
@@ -139,7 +139,7 @@ var cancelPerpOrders_default = ABI3;
|
|
|
139
139
|
|
|
140
140
|
// generated_types/createUser.ts
|
|
141
141
|
var ABI4 = {
|
|
142
|
-
"address": "
|
|
142
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
143
143
|
"name": "create_user",
|
|
144
144
|
"friends": [],
|
|
145
145
|
"exposed_functions": [
|
|
@@ -164,7 +164,7 @@ var createUser_default = ABI4;
|
|
|
164
164
|
|
|
165
165
|
// generated_types/depositToVault.ts
|
|
166
166
|
var ABI5 = {
|
|
167
|
-
"address": "
|
|
167
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
168
168
|
"name": "deposit_to_vault",
|
|
169
169
|
"friends": [],
|
|
170
170
|
"exposed_functions": [
|
|
@@ -189,7 +189,7 @@ var depositToVault_default = ABI5;
|
|
|
189
189
|
|
|
190
190
|
// generated_types/depositToken.ts
|
|
191
191
|
var ABI6 = {
|
|
192
|
-
"address": "
|
|
192
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
193
193
|
"name": "deposit_token",
|
|
194
194
|
"friends": [],
|
|
195
195
|
"exposed_functions": [
|
|
@@ -214,7 +214,7 @@ var depositToken_default = ABI6;
|
|
|
214
214
|
|
|
215
215
|
// generated_types/lendToken.ts
|
|
216
216
|
var ABI7 = {
|
|
217
|
-
"address": "
|
|
217
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
218
218
|
"name": "lend_token",
|
|
219
219
|
"friends": [],
|
|
220
220
|
"exposed_functions": [
|
|
@@ -240,7 +240,7 @@ var lendToken_default = ABI7;
|
|
|
240
240
|
|
|
241
241
|
// generated_types/placePerpLimitOrder.ts
|
|
242
242
|
var ABI8 = {
|
|
243
|
-
"address": "
|
|
243
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
244
244
|
"name": "place_perp_limit_order",
|
|
245
245
|
"friends": [],
|
|
246
246
|
"exposed_functions": [
|
|
@@ -269,7 +269,7 @@ var placePerpLimitOrder_default = ABI8;
|
|
|
269
269
|
|
|
270
270
|
// generated_types/changePerpOrderPrice.ts
|
|
271
271
|
var ABI9 = {
|
|
272
|
-
"address": "
|
|
272
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
273
273
|
"name": "change_perp_order_price",
|
|
274
274
|
"friends": [],
|
|
275
275
|
"exposed_functions": [
|
|
@@ -296,7 +296,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
296
296
|
|
|
297
297
|
// generated_types/placePerpMarketOrder.ts
|
|
298
298
|
var ABI10 = {
|
|
299
|
-
"address": "
|
|
299
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
300
300
|
"name": "place_perp_market_order",
|
|
301
301
|
"friends": [],
|
|
302
302
|
"exposed_functions": [
|
|
@@ -324,7 +324,7 @@ var placePerpMarketOrder_default = ABI10;
|
|
|
324
324
|
|
|
325
325
|
// generated_types/redeemToken.ts
|
|
326
326
|
var ABI11 = {
|
|
327
|
-
"address": "
|
|
327
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
328
328
|
"name": "redeem_token",
|
|
329
329
|
"friends": [],
|
|
330
330
|
"exposed_functions": [
|
|
@@ -350,7 +350,7 @@ var redeemToken_default = ABI11;
|
|
|
350
350
|
|
|
351
351
|
// generated_types/removeApiKey.ts
|
|
352
352
|
var ABI12 = {
|
|
353
|
-
"address": "
|
|
353
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
354
354
|
"name": "remove_api_key",
|
|
355
355
|
"friends": [],
|
|
356
356
|
"exposed_functions": [
|
|
@@ -374,7 +374,7 @@ var removeApiKey_default = ABI12;
|
|
|
374
374
|
|
|
375
375
|
// generated_types/setAliasName.ts
|
|
376
376
|
var ABI13 = {
|
|
377
|
-
"address": "
|
|
377
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
378
378
|
"name": "set_alias_name",
|
|
379
379
|
"friends": [],
|
|
380
380
|
"exposed_functions": [
|
|
@@ -398,7 +398,7 @@ var setAliasName_default = ABI13;
|
|
|
398
398
|
|
|
399
399
|
// generated_types/setAutolend.ts
|
|
400
400
|
var ABI14 = {
|
|
401
|
-
"address": "
|
|
401
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
402
402
|
"name": "set_autolend",
|
|
403
403
|
"friends": [],
|
|
404
404
|
"exposed_functions": [
|
|
@@ -422,7 +422,7 @@ var setAutolend_default = ABI14;
|
|
|
422
422
|
|
|
423
423
|
// generated_types/claimReferralFees.ts
|
|
424
424
|
var ABI15 = {
|
|
425
|
-
"address": "
|
|
425
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
426
426
|
"name": "claim_referral_fees",
|
|
427
427
|
"friends": [],
|
|
428
428
|
"exposed_functions": [
|
|
@@ -446,7 +446,7 @@ var claimReferralFees_default = ABI15;
|
|
|
446
446
|
|
|
447
447
|
// generated_types/transferToUser.ts
|
|
448
448
|
var ABI16 = {
|
|
449
|
-
"address": "
|
|
449
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
450
450
|
"name": "transfer_to_user",
|
|
451
451
|
"friends": [],
|
|
452
452
|
"exposed_functions": [
|
|
@@ -473,7 +473,7 @@ var transferToUser_default = ABI16;
|
|
|
473
473
|
|
|
474
474
|
// generated_types/placeMultiplePerpOrders.ts
|
|
475
475
|
var ABI17 = {
|
|
476
|
-
"address": "
|
|
476
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
477
477
|
"name": "place_multiple_perp_orders",
|
|
478
478
|
"friends": [],
|
|
479
479
|
"exposed_functions": [
|
|
@@ -502,7 +502,7 @@ var placeMultiplePerpOrders_default = ABI17;
|
|
|
502
502
|
|
|
503
503
|
// generated_types/claimKickbackFee.ts
|
|
504
504
|
var ABI18 = {
|
|
505
|
-
"address": "
|
|
505
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
506
506
|
"name": "claim_kickback_fee",
|
|
507
507
|
"friends": [],
|
|
508
508
|
"exposed_functions": [
|
|
@@ -525,7 +525,7 @@ var claimKickbackFee_default = ABI18;
|
|
|
525
525
|
|
|
526
526
|
// generated_types/replaceMultipleOrders.ts
|
|
527
527
|
var ABI19 = {
|
|
528
|
-
"address": "
|
|
528
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
529
529
|
"name": "replace_multiple_orders",
|
|
530
530
|
"friends": [],
|
|
531
531
|
"exposed_functions": [
|
|
@@ -553,7 +553,7 @@ var replaceMultipleOrders_default = ABI19;
|
|
|
553
553
|
|
|
554
554
|
// generated_types/claimDeposit.ts
|
|
555
555
|
var ABI20 = {
|
|
556
|
-
"address": "
|
|
556
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
557
557
|
"name": "claim_deposit",
|
|
558
558
|
"friends": [],
|
|
559
559
|
"exposed_functions": [
|
|
@@ -577,7 +577,7 @@ var claimDeposit_default = ABI20;
|
|
|
577
577
|
|
|
578
578
|
// generated_types/removeApiKeySigner.ts
|
|
579
579
|
var ABI21 = {
|
|
580
|
-
"address": "
|
|
580
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
581
581
|
"name": "remove_api_key_signer",
|
|
582
582
|
"friends": [],
|
|
583
583
|
"exposed_functions": [
|
|
@@ -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) => {
|
|
@@ -695,7 +697,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
695
697
|
|
|
696
698
|
// generated_types/withdrawFromVault.ts
|
|
697
699
|
var ABI22 = {
|
|
698
|
-
"address": "
|
|
700
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
699
701
|
"name": "withdraw_from_vault",
|
|
700
702
|
"friends": [],
|
|
701
703
|
"exposed_functions": [
|
|
@@ -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 */);
|
|
@@ -1917,7 +1930,7 @@ var import_surf2 = require("@thalalabs/surf");
|
|
|
1917
1930
|
|
|
1918
1931
|
// generated_types/faucetEntrypoints.ts
|
|
1919
1932
|
var ABI23 = {
|
|
1920
|
-
"address": "
|
|
1933
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
1921
1934
|
"name": "faucet_entrypoints",
|
|
1922
1935
|
"friends": [],
|
|
1923
1936
|
"exposed_functions": [
|
|
@@ -1952,7 +1965,7 @@ var faucetEntrypoints_default = ABI23;
|
|
|
1952
1965
|
|
|
1953
1966
|
// generated_types/testFaucet.ts
|
|
1954
1967
|
var ABI24 = {
|
|
1955
|
-
"address": "
|
|
1968
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
1956
1969
|
"name": "test_faucet",
|
|
1957
1970
|
"friends": [],
|
|
1958
1971
|
"exposed_functions": [
|
|
@@ -1989,7 +2002,7 @@ var ABI24 = {
|
|
|
1989
2002
|
],
|
|
1990
2003
|
"return": [
|
|
1991
2004
|
"0x1::object::ConstructorRef",
|
|
1992
|
-
"0x1::object::Object<
|
|
2005
|
+
"0x1::object::Object<0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9::test_faucet::Token>"
|
|
1993
2006
|
]
|
|
1994
2007
|
},
|
|
1995
2008
|
{
|
|
@@ -2140,7 +2153,7 @@ var ABI24 = {
|
|
|
2140
2153
|
"0x1::object::Object<0x1::fungible_asset::Metadata>"
|
|
2141
2154
|
],
|
|
2142
2155
|
"return": [
|
|
2143
|
-
"
|
|
2156
|
+
"0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9::test_faucet::FaucetToken"
|
|
2144
2157
|
]
|
|
2145
2158
|
}
|
|
2146
2159
|
],
|
|
@@ -2172,7 +2185,7 @@ var ABI24 = {
|
|
|
2172
2185
|
"fields": [
|
|
2173
2186
|
{
|
|
2174
2187
|
"name": "tokens",
|
|
2175
|
-
"type": "0x1::smart_table::SmartTable<vector<u8>,
|
|
2188
|
+
"type": "0x1::smart_table::SmartTable<vector<u8>, 0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9::test_faucet::FaucetToken>"
|
|
2176
2189
|
}
|
|
2177
2190
|
]
|
|
2178
2191
|
},
|
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",
|
|
@@ -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",
|
|
@@ -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
|
@@ -16,7 +16,7 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
16
16
|
|
|
17
17
|
// generated_types/addApiKey.ts
|
|
18
18
|
var ABI = {
|
|
19
|
-
"address": "
|
|
19
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
20
20
|
"name": "add_api_key",
|
|
21
21
|
"friends": [],
|
|
22
22
|
"exposed_functions": [
|
|
@@ -41,7 +41,7 @@ var addApiKey_default = ABI;
|
|
|
41
41
|
|
|
42
42
|
// generated_types/cancelAllPerpOrders.ts
|
|
43
43
|
var ABI2 = {
|
|
44
|
-
"address": "
|
|
44
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
45
45
|
"name": "cancel_all_perp_orders",
|
|
46
46
|
"friends": [],
|
|
47
47
|
"exposed_functions": [
|
|
@@ -64,7 +64,7 @@ var cancelAllPerpOrders_default = ABI2;
|
|
|
64
64
|
|
|
65
65
|
// generated_types/cancelPerpOrders.ts
|
|
66
66
|
var ABI3 = {
|
|
67
|
-
"address": "
|
|
67
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
68
68
|
"name": "cancel_perp_orders",
|
|
69
69
|
"friends": [],
|
|
70
70
|
"exposed_functions": [
|
|
@@ -89,7 +89,7 @@ var cancelPerpOrders_default = ABI3;
|
|
|
89
89
|
|
|
90
90
|
// generated_types/createUser.ts
|
|
91
91
|
var ABI4 = {
|
|
92
|
-
"address": "
|
|
92
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
93
93
|
"name": "create_user",
|
|
94
94
|
"friends": [],
|
|
95
95
|
"exposed_functions": [
|
|
@@ -114,7 +114,7 @@ var createUser_default = ABI4;
|
|
|
114
114
|
|
|
115
115
|
// generated_types/depositToVault.ts
|
|
116
116
|
var ABI5 = {
|
|
117
|
-
"address": "
|
|
117
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
118
118
|
"name": "deposit_to_vault",
|
|
119
119
|
"friends": [],
|
|
120
120
|
"exposed_functions": [
|
|
@@ -139,7 +139,7 @@ var depositToVault_default = ABI5;
|
|
|
139
139
|
|
|
140
140
|
// generated_types/depositToken.ts
|
|
141
141
|
var ABI6 = {
|
|
142
|
-
"address": "
|
|
142
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
143
143
|
"name": "deposit_token",
|
|
144
144
|
"friends": [],
|
|
145
145
|
"exposed_functions": [
|
|
@@ -164,7 +164,7 @@ var depositToken_default = ABI6;
|
|
|
164
164
|
|
|
165
165
|
// generated_types/lendToken.ts
|
|
166
166
|
var ABI7 = {
|
|
167
|
-
"address": "
|
|
167
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
168
168
|
"name": "lend_token",
|
|
169
169
|
"friends": [],
|
|
170
170
|
"exposed_functions": [
|
|
@@ -190,7 +190,7 @@ var lendToken_default = ABI7;
|
|
|
190
190
|
|
|
191
191
|
// generated_types/placePerpLimitOrder.ts
|
|
192
192
|
var ABI8 = {
|
|
193
|
-
"address": "
|
|
193
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
194
194
|
"name": "place_perp_limit_order",
|
|
195
195
|
"friends": [],
|
|
196
196
|
"exposed_functions": [
|
|
@@ -219,7 +219,7 @@ var placePerpLimitOrder_default = ABI8;
|
|
|
219
219
|
|
|
220
220
|
// generated_types/changePerpOrderPrice.ts
|
|
221
221
|
var ABI9 = {
|
|
222
|
-
"address": "
|
|
222
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
223
223
|
"name": "change_perp_order_price",
|
|
224
224
|
"friends": [],
|
|
225
225
|
"exposed_functions": [
|
|
@@ -246,7 +246,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
246
246
|
|
|
247
247
|
// generated_types/placePerpMarketOrder.ts
|
|
248
248
|
var ABI10 = {
|
|
249
|
-
"address": "
|
|
249
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
250
250
|
"name": "place_perp_market_order",
|
|
251
251
|
"friends": [],
|
|
252
252
|
"exposed_functions": [
|
|
@@ -274,7 +274,7 @@ var placePerpMarketOrder_default = ABI10;
|
|
|
274
274
|
|
|
275
275
|
// generated_types/redeemToken.ts
|
|
276
276
|
var ABI11 = {
|
|
277
|
-
"address": "
|
|
277
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
278
278
|
"name": "redeem_token",
|
|
279
279
|
"friends": [],
|
|
280
280
|
"exposed_functions": [
|
|
@@ -300,7 +300,7 @@ var redeemToken_default = ABI11;
|
|
|
300
300
|
|
|
301
301
|
// generated_types/removeApiKey.ts
|
|
302
302
|
var ABI12 = {
|
|
303
|
-
"address": "
|
|
303
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
304
304
|
"name": "remove_api_key",
|
|
305
305
|
"friends": [],
|
|
306
306
|
"exposed_functions": [
|
|
@@ -324,7 +324,7 @@ var removeApiKey_default = ABI12;
|
|
|
324
324
|
|
|
325
325
|
// generated_types/setAliasName.ts
|
|
326
326
|
var ABI13 = {
|
|
327
|
-
"address": "
|
|
327
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
328
328
|
"name": "set_alias_name",
|
|
329
329
|
"friends": [],
|
|
330
330
|
"exposed_functions": [
|
|
@@ -348,7 +348,7 @@ var setAliasName_default = ABI13;
|
|
|
348
348
|
|
|
349
349
|
// generated_types/setAutolend.ts
|
|
350
350
|
var ABI14 = {
|
|
351
|
-
"address": "
|
|
351
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
352
352
|
"name": "set_autolend",
|
|
353
353
|
"friends": [],
|
|
354
354
|
"exposed_functions": [
|
|
@@ -372,7 +372,7 @@ var setAutolend_default = ABI14;
|
|
|
372
372
|
|
|
373
373
|
// generated_types/claimReferralFees.ts
|
|
374
374
|
var ABI15 = {
|
|
375
|
-
"address": "
|
|
375
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
376
376
|
"name": "claim_referral_fees",
|
|
377
377
|
"friends": [],
|
|
378
378
|
"exposed_functions": [
|
|
@@ -396,7 +396,7 @@ var claimReferralFees_default = ABI15;
|
|
|
396
396
|
|
|
397
397
|
// generated_types/transferToUser.ts
|
|
398
398
|
var ABI16 = {
|
|
399
|
-
"address": "
|
|
399
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
400
400
|
"name": "transfer_to_user",
|
|
401
401
|
"friends": [],
|
|
402
402
|
"exposed_functions": [
|
|
@@ -423,7 +423,7 @@ var transferToUser_default = ABI16;
|
|
|
423
423
|
|
|
424
424
|
// generated_types/placeMultiplePerpOrders.ts
|
|
425
425
|
var ABI17 = {
|
|
426
|
-
"address": "
|
|
426
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
427
427
|
"name": "place_multiple_perp_orders",
|
|
428
428
|
"friends": [],
|
|
429
429
|
"exposed_functions": [
|
|
@@ -452,7 +452,7 @@ var placeMultiplePerpOrders_default = ABI17;
|
|
|
452
452
|
|
|
453
453
|
// generated_types/claimKickbackFee.ts
|
|
454
454
|
var ABI18 = {
|
|
455
|
-
"address": "
|
|
455
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
456
456
|
"name": "claim_kickback_fee",
|
|
457
457
|
"friends": [],
|
|
458
458
|
"exposed_functions": [
|
|
@@ -475,7 +475,7 @@ var claimKickbackFee_default = ABI18;
|
|
|
475
475
|
|
|
476
476
|
// generated_types/replaceMultipleOrders.ts
|
|
477
477
|
var ABI19 = {
|
|
478
|
-
"address": "
|
|
478
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
479
479
|
"name": "replace_multiple_orders",
|
|
480
480
|
"friends": [],
|
|
481
481
|
"exposed_functions": [
|
|
@@ -503,7 +503,7 @@ var replaceMultipleOrders_default = ABI19;
|
|
|
503
503
|
|
|
504
504
|
// generated_types/claimDeposit.ts
|
|
505
505
|
var ABI20 = {
|
|
506
|
-
"address": "
|
|
506
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
507
507
|
"name": "claim_deposit",
|
|
508
508
|
"friends": [],
|
|
509
509
|
"exposed_functions": [
|
|
@@ -527,7 +527,7 @@ var claimDeposit_default = ABI20;
|
|
|
527
527
|
|
|
528
528
|
// generated_types/removeApiKeySigner.ts
|
|
529
529
|
var ABI21 = {
|
|
530
|
-
"address": "
|
|
530
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
531
531
|
"name": "remove_api_key_signer",
|
|
532
532
|
"friends": [],
|
|
533
533
|
"exposed_functions": [
|
|
@@ -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) => {
|
|
@@ -645,7 +647,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
645
647
|
|
|
646
648
|
// generated_types/withdrawFromVault.ts
|
|
647
649
|
var ABI22 = {
|
|
648
|
-
"address": "
|
|
650
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
649
651
|
"name": "withdraw_from_vault",
|
|
650
652
|
"friends": [],
|
|
651
653
|
"exposed_functions": [
|
|
@@ -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 */);
|
|
@@ -1867,7 +1880,7 @@ import { createEntryPayload } from "@thalalabs/surf";
|
|
|
1867
1880
|
|
|
1868
1881
|
// generated_types/faucetEntrypoints.ts
|
|
1869
1882
|
var ABI23 = {
|
|
1870
|
-
"address": "
|
|
1883
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
1871
1884
|
"name": "faucet_entrypoints",
|
|
1872
1885
|
"friends": [],
|
|
1873
1886
|
"exposed_functions": [
|
|
@@ -1902,7 +1915,7 @@ var faucetEntrypoints_default = ABI23;
|
|
|
1902
1915
|
|
|
1903
1916
|
// generated_types/testFaucet.ts
|
|
1904
1917
|
var ABI24 = {
|
|
1905
|
-
"address": "
|
|
1918
|
+
"address": "0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9",
|
|
1906
1919
|
"name": "test_faucet",
|
|
1907
1920
|
"friends": [],
|
|
1908
1921
|
"exposed_functions": [
|
|
@@ -1939,7 +1952,7 @@ var ABI24 = {
|
|
|
1939
1952
|
],
|
|
1940
1953
|
"return": [
|
|
1941
1954
|
"0x1::object::ConstructorRef",
|
|
1942
|
-
"0x1::object::Object<
|
|
1955
|
+
"0x1::object::Object<0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9::test_faucet::Token>"
|
|
1943
1956
|
]
|
|
1944
1957
|
},
|
|
1945
1958
|
{
|
|
@@ -2090,7 +2103,7 @@ var ABI24 = {
|
|
|
2090
2103
|
"0x1::object::Object<0x1::fungible_asset::Metadata>"
|
|
2091
2104
|
],
|
|
2092
2105
|
"return": [
|
|
2093
|
-
"
|
|
2106
|
+
"0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9::test_faucet::FaucetToken"
|
|
2094
2107
|
]
|
|
2095
2108
|
}
|
|
2096
2109
|
],
|
|
@@ -2122,7 +2135,7 @@ var ABI24 = {
|
|
|
2122
2135
|
"fields": [
|
|
2123
2136
|
{
|
|
2124
2137
|
"name": "tokens",
|
|
2125
|
-
"type": "0x1::smart_table::SmartTable<vector<u8>,
|
|
2138
|
+
"type": "0x1::smart_table::SmartTable<vector<u8>, 0xf1b3a715cc939541c3441149a8f111785ee55b7b07047634e3518282a37859c9::test_faucet::FaucetToken>"
|
|
2126
2139
|
}
|
|
2127
2140
|
]
|
|
2128
2141
|
},
|