@nightlylabs/dex-sdk 0.1.10 → 0.1.12
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 +56 -26
- package/dist/index.d.cts +120 -9
- package/dist/index.d.ts +120 -9
- package/dist/index.js +56 -26
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -65,7 +65,7 @@ var import_uuid = require("uuid");
|
|
|
65
65
|
|
|
66
66
|
// generated_types/addApiKey.ts
|
|
67
67
|
var ABI = {
|
|
68
|
-
"address": "
|
|
68
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
69
69
|
"name": "add_api_key",
|
|
70
70
|
"friends": [],
|
|
71
71
|
"exposed_functions": [
|
|
@@ -90,7 +90,7 @@ var addApiKey_default = ABI;
|
|
|
90
90
|
|
|
91
91
|
// generated_types/cancelAllPerpOrders.ts
|
|
92
92
|
var ABI2 = {
|
|
93
|
-
"address": "
|
|
93
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
94
94
|
"name": "cancel_all_perp_orders",
|
|
95
95
|
"friends": [],
|
|
96
96
|
"exposed_functions": [
|
|
@@ -113,7 +113,7 @@ var cancelAllPerpOrders_default = ABI2;
|
|
|
113
113
|
|
|
114
114
|
// generated_types/cancelPerpOrders.ts
|
|
115
115
|
var ABI3 = {
|
|
116
|
-
"address": "
|
|
116
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
117
117
|
"name": "cancel_perp_orders",
|
|
118
118
|
"friends": [],
|
|
119
119
|
"exposed_functions": [
|
|
@@ -138,7 +138,7 @@ var cancelPerpOrders_default = ABI3;
|
|
|
138
138
|
|
|
139
139
|
// generated_types/createUser.ts
|
|
140
140
|
var ABI4 = {
|
|
141
|
-
"address": "
|
|
141
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
142
142
|
"name": "create_user",
|
|
143
143
|
"friends": [],
|
|
144
144
|
"exposed_functions": [
|
|
@@ -163,7 +163,7 @@ var createUser_default = ABI4;
|
|
|
163
163
|
|
|
164
164
|
// generated_types/depositToVault.ts
|
|
165
165
|
var ABI5 = {
|
|
166
|
-
"address": "
|
|
166
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
167
167
|
"name": "deposit_to_vault",
|
|
168
168
|
"friends": [],
|
|
169
169
|
"exposed_functions": [
|
|
@@ -188,7 +188,7 @@ var depositToVault_default = ABI5;
|
|
|
188
188
|
|
|
189
189
|
// generated_types/depositToken.ts
|
|
190
190
|
var ABI6 = {
|
|
191
|
-
"address": "
|
|
191
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
192
192
|
"name": "deposit_token",
|
|
193
193
|
"friends": [],
|
|
194
194
|
"exposed_functions": [
|
|
@@ -213,7 +213,7 @@ var depositToken_default = ABI6;
|
|
|
213
213
|
|
|
214
214
|
// generated_types/lendToken.ts
|
|
215
215
|
var ABI7 = {
|
|
216
|
-
"address": "
|
|
216
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
217
217
|
"name": "lend_token",
|
|
218
218
|
"friends": [],
|
|
219
219
|
"exposed_functions": [
|
|
@@ -239,7 +239,7 @@ var lendToken_default = ABI7;
|
|
|
239
239
|
|
|
240
240
|
// generated_types/placePerpLimitOrder.ts
|
|
241
241
|
var ABI8 = {
|
|
242
|
-
"address": "
|
|
242
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
243
243
|
"name": "place_perp_limit_order",
|
|
244
244
|
"friends": [],
|
|
245
245
|
"exposed_functions": [
|
|
@@ -268,7 +268,7 @@ var placePerpLimitOrder_default = ABI8;
|
|
|
268
268
|
|
|
269
269
|
// generated_types/changePerpOrderPrice.ts
|
|
270
270
|
var ABI9 = {
|
|
271
|
-
"address": "
|
|
271
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
272
272
|
"name": "change_perp_order_price",
|
|
273
273
|
"friends": [],
|
|
274
274
|
"exposed_functions": [
|
|
@@ -295,7 +295,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
295
295
|
|
|
296
296
|
// generated_types/placePerpMarketOrder.ts
|
|
297
297
|
var ABI10 = {
|
|
298
|
-
"address": "
|
|
298
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
299
299
|
"name": "place_perp_market_order",
|
|
300
300
|
"friends": [],
|
|
301
301
|
"exposed_functions": [
|
|
@@ -323,7 +323,7 @@ var placePerpMarketOrder_default = ABI10;
|
|
|
323
323
|
|
|
324
324
|
// generated_types/redeemToken.ts
|
|
325
325
|
var ABI11 = {
|
|
326
|
-
"address": "
|
|
326
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
327
327
|
"name": "redeem_token",
|
|
328
328
|
"friends": [],
|
|
329
329
|
"exposed_functions": [
|
|
@@ -349,7 +349,7 @@ var redeemToken_default = ABI11;
|
|
|
349
349
|
|
|
350
350
|
// generated_types/removeApiKey.ts
|
|
351
351
|
var ABI12 = {
|
|
352
|
-
"address": "
|
|
352
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
353
353
|
"name": "remove_api_key",
|
|
354
354
|
"friends": [],
|
|
355
355
|
"exposed_functions": [
|
|
@@ -373,7 +373,7 @@ var removeApiKey_default = ABI12;
|
|
|
373
373
|
|
|
374
374
|
// generated_types/setAliasName.ts
|
|
375
375
|
var ABI13 = {
|
|
376
|
-
"address": "
|
|
376
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
377
377
|
"name": "set_alias_name",
|
|
378
378
|
"friends": [],
|
|
379
379
|
"exposed_functions": [
|
|
@@ -397,7 +397,7 @@ var setAliasName_default = ABI13;
|
|
|
397
397
|
|
|
398
398
|
// generated_types/setAutolend.ts
|
|
399
399
|
var ABI14 = {
|
|
400
|
-
"address": "
|
|
400
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
401
401
|
"name": "set_autolend",
|
|
402
402
|
"friends": [],
|
|
403
403
|
"exposed_functions": [
|
|
@@ -421,7 +421,7 @@ var setAutolend_default = ABI14;
|
|
|
421
421
|
|
|
422
422
|
// generated_types/claimReferralFees.ts
|
|
423
423
|
var ABI15 = {
|
|
424
|
-
"address": "
|
|
424
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
425
425
|
"name": "claim_referral_fees",
|
|
426
426
|
"friends": [],
|
|
427
427
|
"exposed_functions": [
|
|
@@ -445,7 +445,7 @@ var claimReferralFees_default = ABI15;
|
|
|
445
445
|
|
|
446
446
|
// generated_types/transferToUser.ts
|
|
447
447
|
var ABI16 = {
|
|
448
|
-
"address": "
|
|
448
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
449
449
|
"name": "transfer_to_user",
|
|
450
450
|
"friends": [],
|
|
451
451
|
"exposed_functions": [
|
|
@@ -472,7 +472,7 @@ var transferToUser_default = ABI16;
|
|
|
472
472
|
|
|
473
473
|
// generated_types/placeMultiplePerpOrders.ts
|
|
474
474
|
var ABI17 = {
|
|
475
|
-
"address": "
|
|
475
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
476
476
|
"name": "place_multiple_perp_orders",
|
|
477
477
|
"friends": [],
|
|
478
478
|
"exposed_functions": [
|
|
@@ -501,7 +501,7 @@ var placeMultiplePerpOrders_default = ABI17;
|
|
|
501
501
|
|
|
502
502
|
// generated_types/claimKickbackFee.ts
|
|
503
503
|
var ABI18 = {
|
|
504
|
-
"address": "
|
|
504
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
505
505
|
"name": "claim_kickback_fee",
|
|
506
506
|
"friends": [],
|
|
507
507
|
"exposed_functions": [
|
|
@@ -524,7 +524,7 @@ var claimKickbackFee_default = ABI18;
|
|
|
524
524
|
|
|
525
525
|
// generated_types/replaceMultipleOrders.ts
|
|
526
526
|
var ABI19 = {
|
|
527
|
-
"address": "
|
|
527
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
528
528
|
"name": "replace_multiple_orders",
|
|
529
529
|
"friends": [],
|
|
530
530
|
"exposed_functions": [
|
|
@@ -552,7 +552,7 @@ var replaceMultipleOrders_default = ABI19;
|
|
|
552
552
|
|
|
553
553
|
// generated_types/claimDeposit.ts
|
|
554
554
|
var ABI20 = {
|
|
555
|
-
"address": "
|
|
555
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
556
556
|
"name": "claim_deposit",
|
|
557
557
|
"friends": [],
|
|
558
558
|
"exposed_functions": [
|
|
@@ -576,7 +576,7 @@ var claimDeposit_default = ABI20;
|
|
|
576
576
|
|
|
577
577
|
// generated_types/removeApiKeySigner.ts
|
|
578
578
|
var ABI21 = {
|
|
579
|
-
"address": "
|
|
579
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
580
580
|
"name": "remove_api_key_signer",
|
|
581
581
|
"friends": [],
|
|
582
582
|
"exposed_functions": [
|
|
@@ -600,7 +600,7 @@ var removeApiKeySigner_default = ABI21;
|
|
|
600
600
|
|
|
601
601
|
// generated_types/setReferralCode.ts
|
|
602
602
|
var ABI22 = {
|
|
603
|
-
"address": "
|
|
603
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
604
604
|
"name": "set_referral_code",
|
|
605
605
|
"friends": [],
|
|
606
606
|
"exposed_functions": [
|
|
@@ -624,7 +624,7 @@ var setReferralCode_default = ABI22;
|
|
|
624
624
|
|
|
625
625
|
// generated_types/tokenizeUserVaultInvestment.ts
|
|
626
626
|
var ABI23 = {
|
|
627
|
-
"address": "
|
|
627
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
628
628
|
"name": "tokenize_user_vault_investment",
|
|
629
629
|
"friends": [],
|
|
630
630
|
"exposed_functions": [
|
|
@@ -648,7 +648,7 @@ var tokenizeUserVaultInvestment_default = ABI23;
|
|
|
648
648
|
|
|
649
649
|
// generated_types/addCredits.ts
|
|
650
650
|
var ABI24 = {
|
|
651
|
-
"address": "
|
|
651
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
652
652
|
"name": "add_credits",
|
|
653
653
|
"friends": [],
|
|
654
654
|
"exposed_functions": [
|
|
@@ -747,6 +747,10 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
747
747
|
EndpointsV12["GetTokensStats"] = "/v1/get_tokens_stats";
|
|
748
748
|
EndpointsV12["GetTokensAggregatedStats"] = "/v1/get_tokens_aggregated_stats";
|
|
749
749
|
EndpointsV12["CheckReferralCode"] = "/v1/check_referral_code";
|
|
750
|
+
EndpointsV12["GetUserVaultDeposits"] = "/v1/get_user_vault_deposits";
|
|
751
|
+
EndpointsV12["GetUserVaultWithdrawals"] = "/v1/get_user_vault_withdrawals";
|
|
752
|
+
EndpointsV12["GetVaultHistoricalData"] = "/v1/get_vault_historical_data";
|
|
753
|
+
EndpointsV12["GetIndexPriceHistory"] = "/v1/get_index_price_history";
|
|
750
754
|
return EndpointsV12;
|
|
751
755
|
})(EndpointsV1 || {});
|
|
752
756
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -769,7 +773,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
769
773
|
|
|
770
774
|
// generated_types/withdrawFromVault.ts
|
|
771
775
|
var ABI25 = {
|
|
772
|
-
"address": "
|
|
776
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
773
777
|
"name": "withdraw_from_vault",
|
|
774
778
|
"friends": [],
|
|
775
779
|
"exposed_functions": [
|
|
@@ -908,6 +912,10 @@ var getTopicFromMessage = (data) => {
|
|
|
908
912
|
return data.content.userId;
|
|
909
913
|
case "ApiCreditsChange":
|
|
910
914
|
return data.content.userId;
|
|
915
|
+
case "VaultDeposit":
|
|
916
|
+
return data.content.userId;
|
|
917
|
+
case "VaultWithdraw":
|
|
918
|
+
return data.content.userId;
|
|
911
919
|
}
|
|
912
920
|
};
|
|
913
921
|
|
|
@@ -1374,6 +1382,28 @@ var Client = class _Client {
|
|
|
1374
1382
|
const response = await this.sendGetJson("/v1/check_referral_code" /* CheckReferralCode */, request);
|
|
1375
1383
|
return response;
|
|
1376
1384
|
};
|
|
1385
|
+
this.getUserVaultDeposits = async (request) => {
|
|
1386
|
+
const response = await this.sendGetJson("/v1/get_user_vault_deposits" /* GetUserVaultDeposits */, request);
|
|
1387
|
+
return response;
|
|
1388
|
+
};
|
|
1389
|
+
this.getUserVaultWithdraws = async (request) => {
|
|
1390
|
+
const response = await this.sendGetJson("/v1/get_user_vault_withdrawals" /* GetUserVaultWithdrawals */, request);
|
|
1391
|
+
return response;
|
|
1392
|
+
};
|
|
1393
|
+
this.getVaultHistoricalData = async (request) => {
|
|
1394
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1395
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1396
|
+
}
|
|
1397
|
+
const response = await this.sendGetJson("/v1/get_vault_historical_data" /* GetVaultHistoricalData */, request);
|
|
1398
|
+
return response;
|
|
1399
|
+
};
|
|
1400
|
+
this.getHistoricalIndexPrices = async (request) => {
|
|
1401
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1402
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1403
|
+
}
|
|
1404
|
+
const response = await this.sendGetJson("/v1/get_index_price_history" /* GetIndexPriceHistory */, request);
|
|
1405
|
+
return response;
|
|
1406
|
+
};
|
|
1377
1407
|
// Meta
|
|
1378
1408
|
this.getTime = async () => {
|
|
1379
1409
|
const response = await this.sendGetJson("/time" /* Time */);
|
|
@@ -2101,7 +2131,7 @@ function parseEntryFunctionAbi(args) {
|
|
|
2101
2131
|
|
|
2102
2132
|
// generated_types/faucetEntrypoints.ts
|
|
2103
2133
|
var ABI26 = {
|
|
2104
|
-
"address": "
|
|
2134
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
2105
2135
|
"name": "faucet_entrypoints",
|
|
2106
2136
|
"friends": [],
|
|
2107
2137
|
"exposed_functions": [
|
package/dist/index.d.cts
CHANGED
|
@@ -135,6 +135,7 @@ interface TokenConfigEntry {
|
|
|
135
135
|
contractAddress: string;
|
|
136
136
|
enabled: boolean;
|
|
137
137
|
tokenDecimals: number;
|
|
138
|
+
isVaultToken: boolean;
|
|
138
139
|
}
|
|
139
140
|
interface MarginStep {
|
|
140
141
|
initialMarginRatio: string;
|
|
@@ -247,6 +248,21 @@ interface GetChartCandlesInRangeResponse {
|
|
|
247
248
|
chartCandles: ChartCandle[];
|
|
248
249
|
paginationCursor?: PaginationCursor;
|
|
249
250
|
}
|
|
251
|
+
interface GetIndexPriceHistoryRequest {
|
|
252
|
+
priceIndex: string;
|
|
253
|
+
olderTimestampMs?: string;
|
|
254
|
+
newerTimestampMs?: string;
|
|
255
|
+
paginationCursor?: PaginationCursor;
|
|
256
|
+
}
|
|
257
|
+
interface IndexPriceHistory {
|
|
258
|
+
priceIndex: string;
|
|
259
|
+
price: string;
|
|
260
|
+
timestamp: string;
|
|
261
|
+
}
|
|
262
|
+
interface GetIndexPriceHistoryResponse {
|
|
263
|
+
prices: IndexPriceHistory[];
|
|
264
|
+
paginationCursor?: PaginationCursor;
|
|
265
|
+
}
|
|
250
266
|
interface GetPerpMarketsDataRequest {
|
|
251
267
|
markets: string[];
|
|
252
268
|
}
|
|
@@ -480,10 +496,6 @@ interface PerpPosition {
|
|
|
480
496
|
entryPrice: string;
|
|
481
497
|
fundingCheckpoint: FundingCheckpoint;
|
|
482
498
|
}
|
|
483
|
-
interface VaultInvestment {
|
|
484
|
-
sharesAmount: string;
|
|
485
|
-
sharePrice: string;
|
|
486
|
-
}
|
|
487
499
|
interface Referral {
|
|
488
500
|
masterCode: string;
|
|
489
501
|
slaveKickback: string;
|
|
@@ -494,7 +506,8 @@ interface Vault {
|
|
|
494
506
|
totalShares: string;
|
|
495
507
|
minDeposit: string;
|
|
496
508
|
withdrawFee: string;
|
|
497
|
-
|
|
509
|
+
tokenAddress: string;
|
|
510
|
+
holders: string;
|
|
498
511
|
}
|
|
499
512
|
interface User {
|
|
500
513
|
userId: string;
|
|
@@ -510,7 +523,7 @@ interface User {
|
|
|
510
523
|
lendingShares: Record<string, string>;
|
|
511
524
|
borrowShares: Record<string, string>;
|
|
512
525
|
apiKeys: Record<string, string>;
|
|
513
|
-
vaultInvestments: Record<string,
|
|
526
|
+
vaultInvestments: Record<string, string>;
|
|
514
527
|
fees: Fees;
|
|
515
528
|
referral: Referral;
|
|
516
529
|
vault?: Vault;
|
|
@@ -627,6 +640,36 @@ interface GetUserTransferHistoryResponse {
|
|
|
627
640
|
transfers: HistoricalUserTransfer[];
|
|
628
641
|
paginationCursor?: PaginationCursor;
|
|
629
642
|
}
|
|
643
|
+
interface GetUserVaultDepositsRequest {
|
|
644
|
+
userId: string;
|
|
645
|
+
vaultId?: string;
|
|
646
|
+
olderTimestampMs?: string;
|
|
647
|
+
newerTimestampMs?: string;
|
|
648
|
+
paginationCursor?: PaginationCursor;
|
|
649
|
+
}
|
|
650
|
+
interface GetUserVaultDepositsResponse {
|
|
651
|
+
vaultDeposits: HistoricalVaultDeposit[];
|
|
652
|
+
paginationCursor?: PaginationCursor;
|
|
653
|
+
}
|
|
654
|
+
interface GetUserVaultWithdrawsRequest {
|
|
655
|
+
userId: string;
|
|
656
|
+
vaultId?: string;
|
|
657
|
+
olderTimestampMs?: string;
|
|
658
|
+
newerTimestampMs?: string;
|
|
659
|
+
paginationCursor?: PaginationCursor;
|
|
660
|
+
}
|
|
661
|
+
interface HistoricalVaultWithdraw {
|
|
662
|
+
userId: string;
|
|
663
|
+
vaultId: string;
|
|
664
|
+
usdWithdrawAmount: string;
|
|
665
|
+
sharesReceived: string;
|
|
666
|
+
tokensReceived: string;
|
|
667
|
+
timestamp: string;
|
|
668
|
+
}
|
|
669
|
+
interface GetUserVaultWithdrawsResponse {
|
|
670
|
+
vaultWithdraws: HistoricalVaultWithdraw[];
|
|
671
|
+
paginationCursor?: PaginationCursor;
|
|
672
|
+
}
|
|
630
673
|
interface GetUserWithdrawalsRequest {
|
|
631
674
|
userId: string;
|
|
632
675
|
paginationCursor?: PaginationCursor;
|
|
@@ -648,6 +691,49 @@ interface GetUsersByAddressRequest {
|
|
|
648
691
|
interface GetUsersByAddressResponse {
|
|
649
692
|
users: User[];
|
|
650
693
|
}
|
|
694
|
+
interface GetVaultDepositsRequest {
|
|
695
|
+
vaultId: string;
|
|
696
|
+
olderTimestampMs?: string;
|
|
697
|
+
newerTimestampMs?: string;
|
|
698
|
+
paginationCursor?: PaginationCursor;
|
|
699
|
+
}
|
|
700
|
+
interface GetVaultDepositsResponse {
|
|
701
|
+
vaultDeposits: HistoricalVaultDeposit[];
|
|
702
|
+
paginationCursor?: PaginationCursor;
|
|
703
|
+
}
|
|
704
|
+
interface GetVaultHistoricalDataRequest {
|
|
705
|
+
vaultId: string;
|
|
706
|
+
olderTimestampMs?: string;
|
|
707
|
+
newerTimestampMs?: string;
|
|
708
|
+
paginationCursor?: PaginationCursor;
|
|
709
|
+
}
|
|
710
|
+
interface VaultHistoricalData {
|
|
711
|
+
vaultId: string;
|
|
712
|
+
totalShares: string;
|
|
713
|
+
minDeposit: string;
|
|
714
|
+
tokenAddress?: string;
|
|
715
|
+
holders: string;
|
|
716
|
+
timestamp: string;
|
|
717
|
+
}
|
|
718
|
+
interface GetVaultHistoricalDataResponse {
|
|
719
|
+
data: VaultHistoricalData[];
|
|
720
|
+
paginationCursor?: PaginationCursor;
|
|
721
|
+
}
|
|
722
|
+
interface HistoricalVaultDeposit {
|
|
723
|
+
userId: string;
|
|
724
|
+
vaultId: string;
|
|
725
|
+
usdDepositAmount: string;
|
|
726
|
+
sharesReceived: string;
|
|
727
|
+
tokensReceived: string;
|
|
728
|
+
timestamp: string;
|
|
729
|
+
}
|
|
730
|
+
interface HistoricalVaultDeposit {
|
|
731
|
+
vaultId: string;
|
|
732
|
+
usdDepositAmount: string;
|
|
733
|
+
sharesReceived: string;
|
|
734
|
+
tokensReceived: string;
|
|
735
|
+
timestamp: string;
|
|
736
|
+
}
|
|
651
737
|
interface Lend {
|
|
652
738
|
userId: string;
|
|
653
739
|
tokenAddress: string;
|
|
@@ -786,6 +872,17 @@ interface UserTransfer {
|
|
|
786
872
|
tokenAddress: string;
|
|
787
873
|
amount: string;
|
|
788
874
|
}
|
|
875
|
+
interface VaultDeposit {
|
|
876
|
+
userId: string;
|
|
877
|
+
usdAmount: string;
|
|
878
|
+
}
|
|
879
|
+
interface VaultInvestment {
|
|
880
|
+
sharesAmount: string;
|
|
881
|
+
}
|
|
882
|
+
interface VaultWithdraw {
|
|
883
|
+
userId: string;
|
|
884
|
+
usdAmount: string;
|
|
885
|
+
}
|
|
789
886
|
interface Withdraw {
|
|
790
887
|
userId: string;
|
|
791
888
|
tokenAddress: string;
|
|
@@ -837,7 +934,11 @@ declare enum EndpointsV1 {
|
|
|
837
934
|
GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data",
|
|
838
935
|
GetTokensStats = "/v1/get_tokens_stats",
|
|
839
936
|
GetTokensAggregatedStats = "/v1/get_tokens_aggregated_stats",
|
|
840
|
-
CheckReferralCode = "/v1/check_referral_code"
|
|
937
|
+
CheckReferralCode = "/v1/check_referral_code",
|
|
938
|
+
GetUserVaultDeposits = "/v1/get_user_vault_deposits",
|
|
939
|
+
GetUserVaultWithdrawals = "/v1/get_user_vault_withdrawals",
|
|
940
|
+
GetVaultHistoricalData = "/v1/get_vault_historical_data",
|
|
941
|
+
GetIndexPriceHistory = "/v1/get_index_price_history"
|
|
841
942
|
}
|
|
842
943
|
declare enum SpotMarketStatus {
|
|
843
944
|
Halted = "halted",
|
|
@@ -1008,6 +1109,12 @@ type WsMessage = {
|
|
|
1008
1109
|
} | {
|
|
1009
1110
|
type: "ApiCreditsChange";
|
|
1010
1111
|
content: ApiCreditsChange;
|
|
1112
|
+
} | {
|
|
1113
|
+
type: "VaultDeposit";
|
|
1114
|
+
content: VaultDeposit;
|
|
1115
|
+
} | {
|
|
1116
|
+
type: "VaultWithdraw";
|
|
1117
|
+
content: VaultWithdraw;
|
|
1011
1118
|
};
|
|
1012
1119
|
|
|
1013
1120
|
type Address = `0x${string}`;
|
|
@@ -1162,7 +1269,7 @@ type WsOracleUpdates = Extract<WsMessage, {
|
|
|
1162
1269
|
type: 'OracleUpdates';
|
|
1163
1270
|
}>;
|
|
1164
1271
|
type WsUserUpdates = Extract<WsMessage, {
|
|
1165
|
-
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange';
|
|
1272
|
+
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange' | 'VaultDeposit' | 'VaultWithdraw';
|
|
1166
1273
|
}>;
|
|
1167
1274
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
1168
1275
|
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
@@ -1357,6 +1464,10 @@ declare class Client {
|
|
|
1357
1464
|
getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
|
|
1358
1465
|
getTokenAggregatedStats: (request: GetTokenAggregatedStatsRequest) => Promise<GetTokenAggregatedStatsResponse>;
|
|
1359
1466
|
checkReferralCode: (request: CheckReferralCodeRequest) => Promise<CheckReferralCodeResponse>;
|
|
1467
|
+
getUserVaultDeposits: (request: GetUserDepositsRequest) => Promise<GetUserVaultDepositsResponse>;
|
|
1468
|
+
getUserVaultWithdraws: (request: GetUserWithdrawalsRequest) => Promise<GetUserWithdrawalsResponse>;
|
|
1469
|
+
getVaultHistoricalData: (request: GetVaultHistoricalDataRequest) => Promise<GetVaultHistoricalDataResponse>;
|
|
1470
|
+
getHistoricalIndexPrices: (request: GetIndexPriceHistoryRequest) => Promise<GetIndexPriceHistoryResponse>;
|
|
1360
1471
|
getTime: () => Promise<string>;
|
|
1361
1472
|
}
|
|
1362
1473
|
|
|
@@ -1388,4 +1499,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1388
1499
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1389
1500
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1390
1501
|
|
|
1391
|
-
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 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 SetReferralCodeParams, type SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, 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 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 };
|
|
1502
|
+
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 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 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 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 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, SpotMarketStatus, Status, type StatusResponse, 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 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
|
@@ -135,6 +135,7 @@ interface TokenConfigEntry {
|
|
|
135
135
|
contractAddress: string;
|
|
136
136
|
enabled: boolean;
|
|
137
137
|
tokenDecimals: number;
|
|
138
|
+
isVaultToken: boolean;
|
|
138
139
|
}
|
|
139
140
|
interface MarginStep {
|
|
140
141
|
initialMarginRatio: string;
|
|
@@ -247,6 +248,21 @@ interface GetChartCandlesInRangeResponse {
|
|
|
247
248
|
chartCandles: ChartCandle[];
|
|
248
249
|
paginationCursor?: PaginationCursor;
|
|
249
250
|
}
|
|
251
|
+
interface GetIndexPriceHistoryRequest {
|
|
252
|
+
priceIndex: string;
|
|
253
|
+
olderTimestampMs?: string;
|
|
254
|
+
newerTimestampMs?: string;
|
|
255
|
+
paginationCursor?: PaginationCursor;
|
|
256
|
+
}
|
|
257
|
+
interface IndexPriceHistory {
|
|
258
|
+
priceIndex: string;
|
|
259
|
+
price: string;
|
|
260
|
+
timestamp: string;
|
|
261
|
+
}
|
|
262
|
+
interface GetIndexPriceHistoryResponse {
|
|
263
|
+
prices: IndexPriceHistory[];
|
|
264
|
+
paginationCursor?: PaginationCursor;
|
|
265
|
+
}
|
|
250
266
|
interface GetPerpMarketsDataRequest {
|
|
251
267
|
markets: string[];
|
|
252
268
|
}
|
|
@@ -480,10 +496,6 @@ interface PerpPosition {
|
|
|
480
496
|
entryPrice: string;
|
|
481
497
|
fundingCheckpoint: FundingCheckpoint;
|
|
482
498
|
}
|
|
483
|
-
interface VaultInvestment {
|
|
484
|
-
sharesAmount: string;
|
|
485
|
-
sharePrice: string;
|
|
486
|
-
}
|
|
487
499
|
interface Referral {
|
|
488
500
|
masterCode: string;
|
|
489
501
|
slaveKickback: string;
|
|
@@ -494,7 +506,8 @@ interface Vault {
|
|
|
494
506
|
totalShares: string;
|
|
495
507
|
minDeposit: string;
|
|
496
508
|
withdrawFee: string;
|
|
497
|
-
|
|
509
|
+
tokenAddress: string;
|
|
510
|
+
holders: string;
|
|
498
511
|
}
|
|
499
512
|
interface User {
|
|
500
513
|
userId: string;
|
|
@@ -510,7 +523,7 @@ interface User {
|
|
|
510
523
|
lendingShares: Record<string, string>;
|
|
511
524
|
borrowShares: Record<string, string>;
|
|
512
525
|
apiKeys: Record<string, string>;
|
|
513
|
-
vaultInvestments: Record<string,
|
|
526
|
+
vaultInvestments: Record<string, string>;
|
|
514
527
|
fees: Fees;
|
|
515
528
|
referral: Referral;
|
|
516
529
|
vault?: Vault;
|
|
@@ -627,6 +640,36 @@ interface GetUserTransferHistoryResponse {
|
|
|
627
640
|
transfers: HistoricalUserTransfer[];
|
|
628
641
|
paginationCursor?: PaginationCursor;
|
|
629
642
|
}
|
|
643
|
+
interface GetUserVaultDepositsRequest {
|
|
644
|
+
userId: string;
|
|
645
|
+
vaultId?: string;
|
|
646
|
+
olderTimestampMs?: string;
|
|
647
|
+
newerTimestampMs?: string;
|
|
648
|
+
paginationCursor?: PaginationCursor;
|
|
649
|
+
}
|
|
650
|
+
interface GetUserVaultDepositsResponse {
|
|
651
|
+
vaultDeposits: HistoricalVaultDeposit[];
|
|
652
|
+
paginationCursor?: PaginationCursor;
|
|
653
|
+
}
|
|
654
|
+
interface GetUserVaultWithdrawsRequest {
|
|
655
|
+
userId: string;
|
|
656
|
+
vaultId?: string;
|
|
657
|
+
olderTimestampMs?: string;
|
|
658
|
+
newerTimestampMs?: string;
|
|
659
|
+
paginationCursor?: PaginationCursor;
|
|
660
|
+
}
|
|
661
|
+
interface HistoricalVaultWithdraw {
|
|
662
|
+
userId: string;
|
|
663
|
+
vaultId: string;
|
|
664
|
+
usdWithdrawAmount: string;
|
|
665
|
+
sharesReceived: string;
|
|
666
|
+
tokensReceived: string;
|
|
667
|
+
timestamp: string;
|
|
668
|
+
}
|
|
669
|
+
interface GetUserVaultWithdrawsResponse {
|
|
670
|
+
vaultWithdraws: HistoricalVaultWithdraw[];
|
|
671
|
+
paginationCursor?: PaginationCursor;
|
|
672
|
+
}
|
|
630
673
|
interface GetUserWithdrawalsRequest {
|
|
631
674
|
userId: string;
|
|
632
675
|
paginationCursor?: PaginationCursor;
|
|
@@ -648,6 +691,49 @@ interface GetUsersByAddressRequest {
|
|
|
648
691
|
interface GetUsersByAddressResponse {
|
|
649
692
|
users: User[];
|
|
650
693
|
}
|
|
694
|
+
interface GetVaultDepositsRequest {
|
|
695
|
+
vaultId: string;
|
|
696
|
+
olderTimestampMs?: string;
|
|
697
|
+
newerTimestampMs?: string;
|
|
698
|
+
paginationCursor?: PaginationCursor;
|
|
699
|
+
}
|
|
700
|
+
interface GetVaultDepositsResponse {
|
|
701
|
+
vaultDeposits: HistoricalVaultDeposit[];
|
|
702
|
+
paginationCursor?: PaginationCursor;
|
|
703
|
+
}
|
|
704
|
+
interface GetVaultHistoricalDataRequest {
|
|
705
|
+
vaultId: string;
|
|
706
|
+
olderTimestampMs?: string;
|
|
707
|
+
newerTimestampMs?: string;
|
|
708
|
+
paginationCursor?: PaginationCursor;
|
|
709
|
+
}
|
|
710
|
+
interface VaultHistoricalData {
|
|
711
|
+
vaultId: string;
|
|
712
|
+
totalShares: string;
|
|
713
|
+
minDeposit: string;
|
|
714
|
+
tokenAddress?: string;
|
|
715
|
+
holders: string;
|
|
716
|
+
timestamp: string;
|
|
717
|
+
}
|
|
718
|
+
interface GetVaultHistoricalDataResponse {
|
|
719
|
+
data: VaultHistoricalData[];
|
|
720
|
+
paginationCursor?: PaginationCursor;
|
|
721
|
+
}
|
|
722
|
+
interface HistoricalVaultDeposit {
|
|
723
|
+
userId: string;
|
|
724
|
+
vaultId: string;
|
|
725
|
+
usdDepositAmount: string;
|
|
726
|
+
sharesReceived: string;
|
|
727
|
+
tokensReceived: string;
|
|
728
|
+
timestamp: string;
|
|
729
|
+
}
|
|
730
|
+
interface HistoricalVaultDeposit {
|
|
731
|
+
vaultId: string;
|
|
732
|
+
usdDepositAmount: string;
|
|
733
|
+
sharesReceived: string;
|
|
734
|
+
tokensReceived: string;
|
|
735
|
+
timestamp: string;
|
|
736
|
+
}
|
|
651
737
|
interface Lend {
|
|
652
738
|
userId: string;
|
|
653
739
|
tokenAddress: string;
|
|
@@ -786,6 +872,17 @@ interface UserTransfer {
|
|
|
786
872
|
tokenAddress: string;
|
|
787
873
|
amount: string;
|
|
788
874
|
}
|
|
875
|
+
interface VaultDeposit {
|
|
876
|
+
userId: string;
|
|
877
|
+
usdAmount: string;
|
|
878
|
+
}
|
|
879
|
+
interface VaultInvestment {
|
|
880
|
+
sharesAmount: string;
|
|
881
|
+
}
|
|
882
|
+
interface VaultWithdraw {
|
|
883
|
+
userId: string;
|
|
884
|
+
usdAmount: string;
|
|
885
|
+
}
|
|
789
886
|
interface Withdraw {
|
|
790
887
|
userId: string;
|
|
791
888
|
tokenAddress: string;
|
|
@@ -837,7 +934,11 @@ declare enum EndpointsV1 {
|
|
|
837
934
|
GetBorrowLendAggregatedData = "/v1/get_borrow_lend_aggregated_data",
|
|
838
935
|
GetTokensStats = "/v1/get_tokens_stats",
|
|
839
936
|
GetTokensAggregatedStats = "/v1/get_tokens_aggregated_stats",
|
|
840
|
-
CheckReferralCode = "/v1/check_referral_code"
|
|
937
|
+
CheckReferralCode = "/v1/check_referral_code",
|
|
938
|
+
GetUserVaultDeposits = "/v1/get_user_vault_deposits",
|
|
939
|
+
GetUserVaultWithdrawals = "/v1/get_user_vault_withdrawals",
|
|
940
|
+
GetVaultHistoricalData = "/v1/get_vault_historical_data",
|
|
941
|
+
GetIndexPriceHistory = "/v1/get_index_price_history"
|
|
841
942
|
}
|
|
842
943
|
declare enum SpotMarketStatus {
|
|
843
944
|
Halted = "halted",
|
|
@@ -1008,6 +1109,12 @@ type WsMessage = {
|
|
|
1008
1109
|
} | {
|
|
1009
1110
|
type: "ApiCreditsChange";
|
|
1010
1111
|
content: ApiCreditsChange;
|
|
1112
|
+
} | {
|
|
1113
|
+
type: "VaultDeposit";
|
|
1114
|
+
content: VaultDeposit;
|
|
1115
|
+
} | {
|
|
1116
|
+
type: "VaultWithdraw";
|
|
1117
|
+
content: VaultWithdraw;
|
|
1011
1118
|
};
|
|
1012
1119
|
|
|
1013
1120
|
type Address = `0x${string}`;
|
|
@@ -1162,7 +1269,7 @@ type WsOracleUpdates = Extract<WsMessage, {
|
|
|
1162
1269
|
type: 'OracleUpdates';
|
|
1163
1270
|
}>;
|
|
1164
1271
|
type WsUserUpdates = Extract<WsMessage, {
|
|
1165
|
-
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange';
|
|
1272
|
+
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate' | 'ApiCreditsChange' | 'VaultDeposit' | 'VaultWithdraw';
|
|
1166
1273
|
}>;
|
|
1167
1274
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
1168
1275
|
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
@@ -1357,6 +1464,10 @@ declare class Client {
|
|
|
1357
1464
|
getTokenStats: (request: GetTokenStatsHistoryRequest) => Promise<GetTokenStatsHistoryResponse>;
|
|
1358
1465
|
getTokenAggregatedStats: (request: GetTokenAggregatedStatsRequest) => Promise<GetTokenAggregatedStatsResponse>;
|
|
1359
1466
|
checkReferralCode: (request: CheckReferralCodeRequest) => Promise<CheckReferralCodeResponse>;
|
|
1467
|
+
getUserVaultDeposits: (request: GetUserDepositsRequest) => Promise<GetUserVaultDepositsResponse>;
|
|
1468
|
+
getUserVaultWithdraws: (request: GetUserWithdrawalsRequest) => Promise<GetUserWithdrawalsResponse>;
|
|
1469
|
+
getVaultHistoricalData: (request: GetVaultHistoricalDataRequest) => Promise<GetVaultHistoricalDataResponse>;
|
|
1470
|
+
getHistoricalIndexPrices: (request: GetIndexPriceHistoryRequest) => Promise<GetIndexPriceHistoryResponse>;
|
|
1360
1471
|
getTime: () => Promise<string>;
|
|
1361
1472
|
}
|
|
1362
1473
|
|
|
@@ -1388,4 +1499,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1388
1499
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1389
1500
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1390
1501
|
|
|
1391
|
-
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 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 SetReferralCodeParams, type SetReferralParamsRequest, SpotMarketStatus, Status, type StatusResponse, 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 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 };
|
|
1502
|
+
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 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 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 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 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, SpotMarketStatus, Status, type StatusResponse, 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 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
|
@@ -15,7 +15,7 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
15
15
|
|
|
16
16
|
// generated_types/addApiKey.ts
|
|
17
17
|
var ABI = {
|
|
18
|
-
"address": "
|
|
18
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
19
19
|
"name": "add_api_key",
|
|
20
20
|
"friends": [],
|
|
21
21
|
"exposed_functions": [
|
|
@@ -40,7 +40,7 @@ var addApiKey_default = ABI;
|
|
|
40
40
|
|
|
41
41
|
// generated_types/cancelAllPerpOrders.ts
|
|
42
42
|
var ABI2 = {
|
|
43
|
-
"address": "
|
|
43
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
44
44
|
"name": "cancel_all_perp_orders",
|
|
45
45
|
"friends": [],
|
|
46
46
|
"exposed_functions": [
|
|
@@ -63,7 +63,7 @@ var cancelAllPerpOrders_default = ABI2;
|
|
|
63
63
|
|
|
64
64
|
// generated_types/cancelPerpOrders.ts
|
|
65
65
|
var ABI3 = {
|
|
66
|
-
"address": "
|
|
66
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
67
67
|
"name": "cancel_perp_orders",
|
|
68
68
|
"friends": [],
|
|
69
69
|
"exposed_functions": [
|
|
@@ -88,7 +88,7 @@ var cancelPerpOrders_default = ABI3;
|
|
|
88
88
|
|
|
89
89
|
// generated_types/createUser.ts
|
|
90
90
|
var ABI4 = {
|
|
91
|
-
"address": "
|
|
91
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
92
92
|
"name": "create_user",
|
|
93
93
|
"friends": [],
|
|
94
94
|
"exposed_functions": [
|
|
@@ -113,7 +113,7 @@ var createUser_default = ABI4;
|
|
|
113
113
|
|
|
114
114
|
// generated_types/depositToVault.ts
|
|
115
115
|
var ABI5 = {
|
|
116
|
-
"address": "
|
|
116
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
117
117
|
"name": "deposit_to_vault",
|
|
118
118
|
"friends": [],
|
|
119
119
|
"exposed_functions": [
|
|
@@ -138,7 +138,7 @@ var depositToVault_default = ABI5;
|
|
|
138
138
|
|
|
139
139
|
// generated_types/depositToken.ts
|
|
140
140
|
var ABI6 = {
|
|
141
|
-
"address": "
|
|
141
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
142
142
|
"name": "deposit_token",
|
|
143
143
|
"friends": [],
|
|
144
144
|
"exposed_functions": [
|
|
@@ -163,7 +163,7 @@ var depositToken_default = ABI6;
|
|
|
163
163
|
|
|
164
164
|
// generated_types/lendToken.ts
|
|
165
165
|
var ABI7 = {
|
|
166
|
-
"address": "
|
|
166
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
167
167
|
"name": "lend_token",
|
|
168
168
|
"friends": [],
|
|
169
169
|
"exposed_functions": [
|
|
@@ -189,7 +189,7 @@ var lendToken_default = ABI7;
|
|
|
189
189
|
|
|
190
190
|
// generated_types/placePerpLimitOrder.ts
|
|
191
191
|
var ABI8 = {
|
|
192
|
-
"address": "
|
|
192
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
193
193
|
"name": "place_perp_limit_order",
|
|
194
194
|
"friends": [],
|
|
195
195
|
"exposed_functions": [
|
|
@@ -218,7 +218,7 @@ var placePerpLimitOrder_default = ABI8;
|
|
|
218
218
|
|
|
219
219
|
// generated_types/changePerpOrderPrice.ts
|
|
220
220
|
var ABI9 = {
|
|
221
|
-
"address": "
|
|
221
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
222
222
|
"name": "change_perp_order_price",
|
|
223
223
|
"friends": [],
|
|
224
224
|
"exposed_functions": [
|
|
@@ -245,7 +245,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
245
245
|
|
|
246
246
|
// generated_types/placePerpMarketOrder.ts
|
|
247
247
|
var ABI10 = {
|
|
248
|
-
"address": "
|
|
248
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
249
249
|
"name": "place_perp_market_order",
|
|
250
250
|
"friends": [],
|
|
251
251
|
"exposed_functions": [
|
|
@@ -273,7 +273,7 @@ var placePerpMarketOrder_default = ABI10;
|
|
|
273
273
|
|
|
274
274
|
// generated_types/redeemToken.ts
|
|
275
275
|
var ABI11 = {
|
|
276
|
-
"address": "
|
|
276
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
277
277
|
"name": "redeem_token",
|
|
278
278
|
"friends": [],
|
|
279
279
|
"exposed_functions": [
|
|
@@ -299,7 +299,7 @@ var redeemToken_default = ABI11;
|
|
|
299
299
|
|
|
300
300
|
// generated_types/removeApiKey.ts
|
|
301
301
|
var ABI12 = {
|
|
302
|
-
"address": "
|
|
302
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
303
303
|
"name": "remove_api_key",
|
|
304
304
|
"friends": [],
|
|
305
305
|
"exposed_functions": [
|
|
@@ -323,7 +323,7 @@ var removeApiKey_default = ABI12;
|
|
|
323
323
|
|
|
324
324
|
// generated_types/setAliasName.ts
|
|
325
325
|
var ABI13 = {
|
|
326
|
-
"address": "
|
|
326
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
327
327
|
"name": "set_alias_name",
|
|
328
328
|
"friends": [],
|
|
329
329
|
"exposed_functions": [
|
|
@@ -347,7 +347,7 @@ var setAliasName_default = ABI13;
|
|
|
347
347
|
|
|
348
348
|
// generated_types/setAutolend.ts
|
|
349
349
|
var ABI14 = {
|
|
350
|
-
"address": "
|
|
350
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
351
351
|
"name": "set_autolend",
|
|
352
352
|
"friends": [],
|
|
353
353
|
"exposed_functions": [
|
|
@@ -371,7 +371,7 @@ var setAutolend_default = ABI14;
|
|
|
371
371
|
|
|
372
372
|
// generated_types/claimReferralFees.ts
|
|
373
373
|
var ABI15 = {
|
|
374
|
-
"address": "
|
|
374
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
375
375
|
"name": "claim_referral_fees",
|
|
376
376
|
"friends": [],
|
|
377
377
|
"exposed_functions": [
|
|
@@ -395,7 +395,7 @@ var claimReferralFees_default = ABI15;
|
|
|
395
395
|
|
|
396
396
|
// generated_types/transferToUser.ts
|
|
397
397
|
var ABI16 = {
|
|
398
|
-
"address": "
|
|
398
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
399
399
|
"name": "transfer_to_user",
|
|
400
400
|
"friends": [],
|
|
401
401
|
"exposed_functions": [
|
|
@@ -422,7 +422,7 @@ var transferToUser_default = ABI16;
|
|
|
422
422
|
|
|
423
423
|
// generated_types/placeMultiplePerpOrders.ts
|
|
424
424
|
var ABI17 = {
|
|
425
|
-
"address": "
|
|
425
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
426
426
|
"name": "place_multiple_perp_orders",
|
|
427
427
|
"friends": [],
|
|
428
428
|
"exposed_functions": [
|
|
@@ -451,7 +451,7 @@ var placeMultiplePerpOrders_default = ABI17;
|
|
|
451
451
|
|
|
452
452
|
// generated_types/claimKickbackFee.ts
|
|
453
453
|
var ABI18 = {
|
|
454
|
-
"address": "
|
|
454
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
455
455
|
"name": "claim_kickback_fee",
|
|
456
456
|
"friends": [],
|
|
457
457
|
"exposed_functions": [
|
|
@@ -474,7 +474,7 @@ var claimKickbackFee_default = ABI18;
|
|
|
474
474
|
|
|
475
475
|
// generated_types/replaceMultipleOrders.ts
|
|
476
476
|
var ABI19 = {
|
|
477
|
-
"address": "
|
|
477
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
478
478
|
"name": "replace_multiple_orders",
|
|
479
479
|
"friends": [],
|
|
480
480
|
"exposed_functions": [
|
|
@@ -502,7 +502,7 @@ var replaceMultipleOrders_default = ABI19;
|
|
|
502
502
|
|
|
503
503
|
// generated_types/claimDeposit.ts
|
|
504
504
|
var ABI20 = {
|
|
505
|
-
"address": "
|
|
505
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
506
506
|
"name": "claim_deposit",
|
|
507
507
|
"friends": [],
|
|
508
508
|
"exposed_functions": [
|
|
@@ -526,7 +526,7 @@ var claimDeposit_default = ABI20;
|
|
|
526
526
|
|
|
527
527
|
// generated_types/removeApiKeySigner.ts
|
|
528
528
|
var ABI21 = {
|
|
529
|
-
"address": "
|
|
529
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
530
530
|
"name": "remove_api_key_signer",
|
|
531
531
|
"friends": [],
|
|
532
532
|
"exposed_functions": [
|
|
@@ -550,7 +550,7 @@ var removeApiKeySigner_default = ABI21;
|
|
|
550
550
|
|
|
551
551
|
// generated_types/setReferralCode.ts
|
|
552
552
|
var ABI22 = {
|
|
553
|
-
"address": "
|
|
553
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
554
554
|
"name": "set_referral_code",
|
|
555
555
|
"friends": [],
|
|
556
556
|
"exposed_functions": [
|
|
@@ -574,7 +574,7 @@ var setReferralCode_default = ABI22;
|
|
|
574
574
|
|
|
575
575
|
// generated_types/tokenizeUserVaultInvestment.ts
|
|
576
576
|
var ABI23 = {
|
|
577
|
-
"address": "
|
|
577
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
578
578
|
"name": "tokenize_user_vault_investment",
|
|
579
579
|
"friends": [],
|
|
580
580
|
"exposed_functions": [
|
|
@@ -598,7 +598,7 @@ var tokenizeUserVaultInvestment_default = ABI23;
|
|
|
598
598
|
|
|
599
599
|
// generated_types/addCredits.ts
|
|
600
600
|
var ABI24 = {
|
|
601
|
-
"address": "
|
|
601
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
602
602
|
"name": "add_credits",
|
|
603
603
|
"friends": [],
|
|
604
604
|
"exposed_functions": [
|
|
@@ -697,6 +697,10 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
697
697
|
EndpointsV12["GetTokensStats"] = "/v1/get_tokens_stats";
|
|
698
698
|
EndpointsV12["GetTokensAggregatedStats"] = "/v1/get_tokens_aggregated_stats";
|
|
699
699
|
EndpointsV12["CheckReferralCode"] = "/v1/check_referral_code";
|
|
700
|
+
EndpointsV12["GetUserVaultDeposits"] = "/v1/get_user_vault_deposits";
|
|
701
|
+
EndpointsV12["GetUserVaultWithdrawals"] = "/v1/get_user_vault_withdrawals";
|
|
702
|
+
EndpointsV12["GetVaultHistoricalData"] = "/v1/get_vault_historical_data";
|
|
703
|
+
EndpointsV12["GetIndexPriceHistory"] = "/v1/get_index_price_history";
|
|
700
704
|
return EndpointsV12;
|
|
701
705
|
})(EndpointsV1 || {});
|
|
702
706
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -719,7 +723,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
719
723
|
|
|
720
724
|
// generated_types/withdrawFromVault.ts
|
|
721
725
|
var ABI25 = {
|
|
722
|
-
"address": "
|
|
726
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
723
727
|
"name": "withdraw_from_vault",
|
|
724
728
|
"friends": [],
|
|
725
729
|
"exposed_functions": [
|
|
@@ -858,6 +862,10 @@ var getTopicFromMessage = (data) => {
|
|
|
858
862
|
return data.content.userId;
|
|
859
863
|
case "ApiCreditsChange":
|
|
860
864
|
return data.content.userId;
|
|
865
|
+
case "VaultDeposit":
|
|
866
|
+
return data.content.userId;
|
|
867
|
+
case "VaultWithdraw":
|
|
868
|
+
return data.content.userId;
|
|
861
869
|
}
|
|
862
870
|
};
|
|
863
871
|
|
|
@@ -1324,6 +1332,28 @@ var Client = class _Client {
|
|
|
1324
1332
|
const response = await this.sendGetJson("/v1/check_referral_code" /* CheckReferralCode */, request);
|
|
1325
1333
|
return response;
|
|
1326
1334
|
};
|
|
1335
|
+
this.getUserVaultDeposits = async (request) => {
|
|
1336
|
+
const response = await this.sendGetJson("/v1/get_user_vault_deposits" /* GetUserVaultDeposits */, request);
|
|
1337
|
+
return response;
|
|
1338
|
+
};
|
|
1339
|
+
this.getUserVaultWithdraws = async (request) => {
|
|
1340
|
+
const response = await this.sendGetJson("/v1/get_user_vault_withdrawals" /* GetUserVaultWithdrawals */, request);
|
|
1341
|
+
return response;
|
|
1342
|
+
};
|
|
1343
|
+
this.getVaultHistoricalData = async (request) => {
|
|
1344
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1345
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1346
|
+
}
|
|
1347
|
+
const response = await this.sendGetJson("/v1/get_vault_historical_data" /* GetVaultHistoricalData */, request);
|
|
1348
|
+
return response;
|
|
1349
|
+
};
|
|
1350
|
+
this.getHistoricalIndexPrices = async (request) => {
|
|
1351
|
+
if (request.olderTimestampMs && request.newerTimestampMs && request.olderTimestampMs > request.newerTimestampMs) {
|
|
1352
|
+
throw new Error("olderTimestampMs must be lower than newerTimestampMs");
|
|
1353
|
+
}
|
|
1354
|
+
const response = await this.sendGetJson("/v1/get_index_price_history" /* GetIndexPriceHistory */, request);
|
|
1355
|
+
return response;
|
|
1356
|
+
};
|
|
1327
1357
|
// Meta
|
|
1328
1358
|
this.getTime = async () => {
|
|
1329
1359
|
const response = await this.sendGetJson("/time" /* Time */);
|
|
@@ -2051,7 +2081,7 @@ function parseEntryFunctionAbi(args) {
|
|
|
2051
2081
|
|
|
2052
2082
|
// generated_types/faucetEntrypoints.ts
|
|
2053
2083
|
var ABI26 = {
|
|
2054
|
-
"address": "
|
|
2084
|
+
"address": "0x2ad117cb377933bd2db5c21366826f0145ab8704156d8db621c5a02ed4a4a000",
|
|
2055
2085
|
"name": "faucet_entrypoints",
|
|
2056
2086
|
"friends": [],
|
|
2057
2087
|
"exposed_functions": [
|