@nightlylabs/dex-sdk 0.1.38 → 0.1.40
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 +96 -46
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +96 -46
- 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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
449
449
|
"name": "transfer_to_user",
|
|
450
450
|
"friends": [],
|
|
451
451
|
"exposed_functions": [
|
|
@@ -470,9 +470,37 @@ var ABI16 = {
|
|
|
470
470
|
};
|
|
471
471
|
var transferToUser_default = ABI16;
|
|
472
472
|
|
|
473
|
-
// generated_types/
|
|
473
|
+
// generated_types/withdrawToken.ts
|
|
474
474
|
var ABI17 = {
|
|
475
|
-
"address": "
|
|
475
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
476
|
+
"name": "withdraw_token",
|
|
477
|
+
"friends": [],
|
|
478
|
+
"exposed_functions": [
|
|
479
|
+
{
|
|
480
|
+
"name": "withdraw_token",
|
|
481
|
+
"visibility": "public",
|
|
482
|
+
"is_entry": true,
|
|
483
|
+
"is_view": false,
|
|
484
|
+
"generic_type_params": [],
|
|
485
|
+
"params": [
|
|
486
|
+
"&signer",
|
|
487
|
+
"u64",
|
|
488
|
+
"u64",
|
|
489
|
+
"0x1::object::Object<0x1::fungible_asset::Metadata>",
|
|
490
|
+
"bool",
|
|
491
|
+
"bool",
|
|
492
|
+
"address"
|
|
493
|
+
],
|
|
494
|
+
"return": []
|
|
495
|
+
}
|
|
496
|
+
],
|
|
497
|
+
"structs": []
|
|
498
|
+
};
|
|
499
|
+
var withdrawToken_default = ABI17;
|
|
500
|
+
|
|
501
|
+
// generated_types/placeMultiplePerpOrders.ts
|
|
502
|
+
var ABI18 = {
|
|
503
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
476
504
|
"name": "place_multiple_perp_orders",
|
|
477
505
|
"friends": [],
|
|
478
506
|
"exposed_functions": [
|
|
@@ -497,11 +525,11 @@ var ABI17 = {
|
|
|
497
525
|
],
|
|
498
526
|
"structs": []
|
|
499
527
|
};
|
|
500
|
-
var placeMultiplePerpOrders_default =
|
|
528
|
+
var placeMultiplePerpOrders_default = ABI18;
|
|
501
529
|
|
|
502
530
|
// generated_types/claimKickbackFee.ts
|
|
503
|
-
var
|
|
504
|
-
"address": "
|
|
531
|
+
var ABI19 = {
|
|
532
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
505
533
|
"name": "claim_kickback_fee",
|
|
506
534
|
"friends": [],
|
|
507
535
|
"exposed_functions": [
|
|
@@ -520,11 +548,11 @@ var ABI18 = {
|
|
|
520
548
|
],
|
|
521
549
|
"structs": []
|
|
522
550
|
};
|
|
523
|
-
var claimKickbackFee_default =
|
|
551
|
+
var claimKickbackFee_default = ABI19;
|
|
524
552
|
|
|
525
553
|
// generated_types/replaceMultipleOrders.ts
|
|
526
|
-
var
|
|
527
|
-
"address": "
|
|
554
|
+
var ABI20 = {
|
|
555
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
528
556
|
"name": "replace_multiple_orders",
|
|
529
557
|
"friends": [],
|
|
530
558
|
"exposed_functions": [
|
|
@@ -548,11 +576,11 @@ var ABI19 = {
|
|
|
548
576
|
],
|
|
549
577
|
"structs": []
|
|
550
578
|
};
|
|
551
|
-
var replaceMultipleOrders_default =
|
|
579
|
+
var replaceMultipleOrders_default = ABI20;
|
|
552
580
|
|
|
553
581
|
// generated_types/claimDeposit.ts
|
|
554
|
-
var
|
|
555
|
-
"address": "
|
|
582
|
+
var ABI21 = {
|
|
583
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
556
584
|
"name": "claim_deposit",
|
|
557
585
|
"friends": [],
|
|
558
586
|
"exposed_functions": [
|
|
@@ -572,11 +600,11 @@ var ABI20 = {
|
|
|
572
600
|
],
|
|
573
601
|
"structs": []
|
|
574
602
|
};
|
|
575
|
-
var claimDeposit_default =
|
|
603
|
+
var claimDeposit_default = ABI21;
|
|
576
604
|
|
|
577
605
|
// generated_types/removeApiKeySigner.ts
|
|
578
|
-
var
|
|
579
|
-
"address": "
|
|
606
|
+
var ABI22 = {
|
|
607
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
580
608
|
"name": "remove_api_key_signer",
|
|
581
609
|
"friends": [],
|
|
582
610
|
"exposed_functions": [
|
|
@@ -596,11 +624,11 @@ var ABI21 = {
|
|
|
596
624
|
],
|
|
597
625
|
"structs": []
|
|
598
626
|
};
|
|
599
|
-
var removeApiKeySigner_default =
|
|
627
|
+
var removeApiKeySigner_default = ABI22;
|
|
600
628
|
|
|
601
629
|
// generated_types/setReferralCode.ts
|
|
602
|
-
var
|
|
603
|
-
"address": "
|
|
630
|
+
var ABI23 = {
|
|
631
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
604
632
|
"name": "set_referral_code",
|
|
605
633
|
"friends": [],
|
|
606
634
|
"exposed_functions": [
|
|
@@ -620,11 +648,11 @@ var ABI22 = {
|
|
|
620
648
|
],
|
|
621
649
|
"structs": []
|
|
622
650
|
};
|
|
623
|
-
var setReferralCode_default =
|
|
651
|
+
var setReferralCode_default = ABI23;
|
|
624
652
|
|
|
625
653
|
// generated_types/tokenizeUserVaultInvestment.ts
|
|
626
|
-
var
|
|
627
|
-
"address": "
|
|
654
|
+
var ABI24 = {
|
|
655
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
628
656
|
"name": "tokenize_user_vault_investment",
|
|
629
657
|
"friends": [],
|
|
630
658
|
"exposed_functions": [
|
|
@@ -644,11 +672,11 @@ var ABI23 = {
|
|
|
644
672
|
],
|
|
645
673
|
"structs": []
|
|
646
674
|
};
|
|
647
|
-
var tokenizeUserVaultInvestment_default =
|
|
675
|
+
var tokenizeUserVaultInvestment_default = ABI24;
|
|
648
676
|
|
|
649
677
|
// generated_types/addCredits.ts
|
|
650
|
-
var
|
|
651
|
-
"address": "
|
|
678
|
+
var ABI25 = {
|
|
679
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
652
680
|
"name": "add_credits",
|
|
653
681
|
"friends": [],
|
|
654
682
|
"exposed_functions": [
|
|
@@ -668,7 +696,7 @@ var ABI24 = {
|
|
|
668
696
|
],
|
|
669
697
|
"structs": []
|
|
670
698
|
};
|
|
671
|
-
var addCredits_default =
|
|
699
|
+
var addCredits_default = ABI25;
|
|
672
700
|
|
|
673
701
|
// generated_types/typeshareTypes.ts
|
|
674
702
|
var ChartInterval = /* @__PURE__ */ ((ChartInterval2) => {
|
|
@@ -779,8 +807,8 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
779
807
|
})(UserStatus || {});
|
|
780
808
|
|
|
781
809
|
// generated_types/withdrawFromVault.ts
|
|
782
|
-
var
|
|
783
|
-
"address": "
|
|
810
|
+
var ABI26 = {
|
|
811
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
784
812
|
"name": "withdraw_from_vault",
|
|
785
813
|
"friends": [],
|
|
786
814
|
"exposed_functions": [
|
|
@@ -802,7 +830,7 @@ var ABI25 = {
|
|
|
802
830
|
],
|
|
803
831
|
"structs": []
|
|
804
832
|
};
|
|
805
|
-
var withdrawFromVault_default =
|
|
833
|
+
var withdrawFromVault_default = ABI26;
|
|
806
834
|
|
|
807
835
|
// src/utils.ts
|
|
808
836
|
var import_ts_sdk = require("@aptos-labs/ts-sdk");
|
|
@@ -2057,6 +2085,28 @@ var Client = class _Client {
|
|
|
2057
2085
|
});
|
|
2058
2086
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
2059
2087
|
}
|
|
2088
|
+
async withdrawToken(params) {
|
|
2089
|
+
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
2090
|
+
aptosConfig: this._aptos.config,
|
|
2091
|
+
abi: parseEntryFunctionAbi({
|
|
2092
|
+
moduleAbi: withdrawToken_default,
|
|
2093
|
+
functionName: withdrawToken_default.name,
|
|
2094
|
+
moduleAddress: withdrawToken_default.address,
|
|
2095
|
+
moduleName: withdrawToken_default.name
|
|
2096
|
+
}),
|
|
2097
|
+
function: `${withdrawToken_default.address}::${withdrawToken_default.name}::withdraw_token`,
|
|
2098
|
+
typeArguments: [],
|
|
2099
|
+
functionArguments: [
|
|
2100
|
+
params.userId,
|
|
2101
|
+
params.amount,
|
|
2102
|
+
params.tokenAddress,
|
|
2103
|
+
params.max,
|
|
2104
|
+
params.borrow,
|
|
2105
|
+
params.recipient
|
|
2106
|
+
]
|
|
2107
|
+
});
|
|
2108
|
+
return await this.createAndSubmitTransaction(aptosPayload);
|
|
2109
|
+
}
|
|
2060
2110
|
async replaceMultipleOrders(params) {
|
|
2061
2111
|
const isBids = params.orders.map((order) => order.isBid);
|
|
2062
2112
|
const prices = params.orders.map((order) => order.price);
|
|
@@ -2178,8 +2228,8 @@ function parseEntryFunctionAbi(args) {
|
|
|
2178
2228
|
}
|
|
2179
2229
|
|
|
2180
2230
|
// generated_types/faucetEntrypoints.ts
|
|
2181
|
-
var
|
|
2182
|
-
"address": "
|
|
2231
|
+
var ABI27 = {
|
|
2232
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
2183
2233
|
"name": "faucet_entrypoints",
|
|
2184
2234
|
"friends": [],
|
|
2185
2235
|
"exposed_functions": [
|
|
@@ -2210,7 +2260,7 @@ var ABI26 = {
|
|
|
2210
2260
|
],
|
|
2211
2261
|
"structs": []
|
|
2212
2262
|
};
|
|
2213
|
-
var faucetEntrypoints_default =
|
|
2263
|
+
var faucetEntrypoints_default = ABI27;
|
|
2214
2264
|
|
|
2215
2265
|
// src/testFaucet.ts
|
|
2216
2266
|
var import_ts_sdk3 = require("@aptos-labs/ts-sdk");
|
package/dist/index.d.cts
CHANGED
|
@@ -1309,6 +1309,14 @@ interface TransferToUserParams {
|
|
|
1309
1309
|
borrow: boolean;
|
|
1310
1310
|
recipient: string;
|
|
1311
1311
|
}
|
|
1312
|
+
interface WithdrawTokenParams {
|
|
1313
|
+
userId: string;
|
|
1314
|
+
tokenAddress: Address;
|
|
1315
|
+
amount: string;
|
|
1316
|
+
borrow: boolean;
|
|
1317
|
+
max: boolean;
|
|
1318
|
+
recipient: Address;
|
|
1319
|
+
}
|
|
1312
1320
|
interface IGetChartCandlesInRange {
|
|
1313
1321
|
marketName: string;
|
|
1314
1322
|
interval: ChartInterval;
|
|
@@ -1514,6 +1522,7 @@ declare class Client {
|
|
|
1514
1522
|
claimReferralFees(params: ClaimReferralFeesParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1515
1523
|
claimKickbackFee(params: ClaimKickbackFeeParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1516
1524
|
transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1525
|
+
withdrawToken(params: WithdrawTokenParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1517
1526
|
replaceMultipleOrders(params: ReplaceMultipleOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1518
1527
|
placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1519
1528
|
claimDeposit(params: ClaimDepositParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
@@ -1595,4 +1604,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1595
1604
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1596
1605
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1597
1606
|
|
|
1598
|
-
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 CanceledPerpOrder, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1607
|
+
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 CanceledPerpOrder, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WithdrawTokenParams, 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
|
@@ -1309,6 +1309,14 @@ interface TransferToUserParams {
|
|
|
1309
1309
|
borrow: boolean;
|
|
1310
1310
|
recipient: string;
|
|
1311
1311
|
}
|
|
1312
|
+
interface WithdrawTokenParams {
|
|
1313
|
+
userId: string;
|
|
1314
|
+
tokenAddress: Address;
|
|
1315
|
+
amount: string;
|
|
1316
|
+
borrow: boolean;
|
|
1317
|
+
max: boolean;
|
|
1318
|
+
recipient: Address;
|
|
1319
|
+
}
|
|
1312
1320
|
interface IGetChartCandlesInRange {
|
|
1313
1321
|
marketName: string;
|
|
1314
1322
|
interval: ChartInterval;
|
|
@@ -1514,6 +1522,7 @@ declare class Client {
|
|
|
1514
1522
|
claimReferralFees(params: ClaimReferralFeesParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1515
1523
|
claimKickbackFee(params: ClaimKickbackFeeParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1516
1524
|
transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1525
|
+
withdrawToken(params: WithdrawTokenParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1517
1526
|
replaceMultipleOrders(params: ReplaceMultipleOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1518
1527
|
placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1519
1528
|
claimDeposit(params: ClaimDepositParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
@@ -1595,4 +1604,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1595
1604
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1596
1605
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1597
1606
|
|
|
1598
|
-
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 CanceledPerpOrder, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1607
|
+
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 CanceledPerpOrder, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type GetIndexerStatusResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetServicesStatusResponse, type GetTokenAggregatedStatsRequest, type GetTokenAggregatedStatsResponse, type GetTokenStatsHistoryRequest, type GetTokenStatsHistoryResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserAggregatedVaultStatsRequest, type GetUserAggregatedVaultStatsResponse, type GetUserClaimedKickbackHistoryRequest, type GetUserClaimedKickbackHistoryResponse, type GetUserClaimedReferralKickbackHistoryRequest, type GetUserClaimedReferralKickbackHistoryResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserLiquidationsHistoryRequest, type GetUserLiquidationsHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserTransferHistoryRequest, type GetUserTransferHistoryResponse, type GetUserVaultDepositsRequest, type GetUserVaultDepositsResponse, type GetUserVaultWithdrawsRequest, type GetUserVaultWithdrawsResponse, type GetUserVolumeForReferralRequest, type GetUserVolumeForReferralResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type GetVaultDepositsRequest, type GetVaultDepositsResponse, type GetVaultHistoricalDataRequest, type GetVaultHistoricalDataResponse, type GetVaultWithdrawalsRequest, type GetVaultWithdrawalsResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalLiquidation, type HistoricalReferralStats, type HistoricalTokenStats, type HistoricalTradeStats, type HistoricalUserTransfer, type HistoricalVaultDeposit, type HistoricalVaultWithdraw, type HistoricalWithdraw, type IGetChartCandlesInRange, type IndexPriceHistory, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultDeposit, type VaultHistoricalData, type VaultInvestment, type VaultWithdraw, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WithdrawTokenParams, 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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
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": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
399
399
|
"name": "transfer_to_user",
|
|
400
400
|
"friends": [],
|
|
401
401
|
"exposed_functions": [
|
|
@@ -420,9 +420,37 @@ var ABI16 = {
|
|
|
420
420
|
};
|
|
421
421
|
var transferToUser_default = ABI16;
|
|
422
422
|
|
|
423
|
-
// generated_types/
|
|
423
|
+
// generated_types/withdrawToken.ts
|
|
424
424
|
var ABI17 = {
|
|
425
|
-
"address": "
|
|
425
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
426
|
+
"name": "withdraw_token",
|
|
427
|
+
"friends": [],
|
|
428
|
+
"exposed_functions": [
|
|
429
|
+
{
|
|
430
|
+
"name": "withdraw_token",
|
|
431
|
+
"visibility": "public",
|
|
432
|
+
"is_entry": true,
|
|
433
|
+
"is_view": false,
|
|
434
|
+
"generic_type_params": [],
|
|
435
|
+
"params": [
|
|
436
|
+
"&signer",
|
|
437
|
+
"u64",
|
|
438
|
+
"u64",
|
|
439
|
+
"0x1::object::Object<0x1::fungible_asset::Metadata>",
|
|
440
|
+
"bool",
|
|
441
|
+
"bool",
|
|
442
|
+
"address"
|
|
443
|
+
],
|
|
444
|
+
"return": []
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"structs": []
|
|
448
|
+
};
|
|
449
|
+
var withdrawToken_default = ABI17;
|
|
450
|
+
|
|
451
|
+
// generated_types/placeMultiplePerpOrders.ts
|
|
452
|
+
var ABI18 = {
|
|
453
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
426
454
|
"name": "place_multiple_perp_orders",
|
|
427
455
|
"friends": [],
|
|
428
456
|
"exposed_functions": [
|
|
@@ -447,11 +475,11 @@ var ABI17 = {
|
|
|
447
475
|
],
|
|
448
476
|
"structs": []
|
|
449
477
|
};
|
|
450
|
-
var placeMultiplePerpOrders_default =
|
|
478
|
+
var placeMultiplePerpOrders_default = ABI18;
|
|
451
479
|
|
|
452
480
|
// generated_types/claimKickbackFee.ts
|
|
453
|
-
var
|
|
454
|
-
"address": "
|
|
481
|
+
var ABI19 = {
|
|
482
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
455
483
|
"name": "claim_kickback_fee",
|
|
456
484
|
"friends": [],
|
|
457
485
|
"exposed_functions": [
|
|
@@ -470,11 +498,11 @@ var ABI18 = {
|
|
|
470
498
|
],
|
|
471
499
|
"structs": []
|
|
472
500
|
};
|
|
473
|
-
var claimKickbackFee_default =
|
|
501
|
+
var claimKickbackFee_default = ABI19;
|
|
474
502
|
|
|
475
503
|
// generated_types/replaceMultipleOrders.ts
|
|
476
|
-
var
|
|
477
|
-
"address": "
|
|
504
|
+
var ABI20 = {
|
|
505
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
478
506
|
"name": "replace_multiple_orders",
|
|
479
507
|
"friends": [],
|
|
480
508
|
"exposed_functions": [
|
|
@@ -498,11 +526,11 @@ var ABI19 = {
|
|
|
498
526
|
],
|
|
499
527
|
"structs": []
|
|
500
528
|
};
|
|
501
|
-
var replaceMultipleOrders_default =
|
|
529
|
+
var replaceMultipleOrders_default = ABI20;
|
|
502
530
|
|
|
503
531
|
// generated_types/claimDeposit.ts
|
|
504
|
-
var
|
|
505
|
-
"address": "
|
|
532
|
+
var ABI21 = {
|
|
533
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
506
534
|
"name": "claim_deposit",
|
|
507
535
|
"friends": [],
|
|
508
536
|
"exposed_functions": [
|
|
@@ -522,11 +550,11 @@ var ABI20 = {
|
|
|
522
550
|
],
|
|
523
551
|
"structs": []
|
|
524
552
|
};
|
|
525
|
-
var claimDeposit_default =
|
|
553
|
+
var claimDeposit_default = ABI21;
|
|
526
554
|
|
|
527
555
|
// generated_types/removeApiKeySigner.ts
|
|
528
|
-
var
|
|
529
|
-
"address": "
|
|
556
|
+
var ABI22 = {
|
|
557
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
530
558
|
"name": "remove_api_key_signer",
|
|
531
559
|
"friends": [],
|
|
532
560
|
"exposed_functions": [
|
|
@@ -546,11 +574,11 @@ var ABI21 = {
|
|
|
546
574
|
],
|
|
547
575
|
"structs": []
|
|
548
576
|
};
|
|
549
|
-
var removeApiKeySigner_default =
|
|
577
|
+
var removeApiKeySigner_default = ABI22;
|
|
550
578
|
|
|
551
579
|
// generated_types/setReferralCode.ts
|
|
552
|
-
var
|
|
553
|
-
"address": "
|
|
580
|
+
var ABI23 = {
|
|
581
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
554
582
|
"name": "set_referral_code",
|
|
555
583
|
"friends": [],
|
|
556
584
|
"exposed_functions": [
|
|
@@ -570,11 +598,11 @@ var ABI22 = {
|
|
|
570
598
|
],
|
|
571
599
|
"structs": []
|
|
572
600
|
};
|
|
573
|
-
var setReferralCode_default =
|
|
601
|
+
var setReferralCode_default = ABI23;
|
|
574
602
|
|
|
575
603
|
// generated_types/tokenizeUserVaultInvestment.ts
|
|
576
|
-
var
|
|
577
|
-
"address": "
|
|
604
|
+
var ABI24 = {
|
|
605
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
578
606
|
"name": "tokenize_user_vault_investment",
|
|
579
607
|
"friends": [],
|
|
580
608
|
"exposed_functions": [
|
|
@@ -594,11 +622,11 @@ var ABI23 = {
|
|
|
594
622
|
],
|
|
595
623
|
"structs": []
|
|
596
624
|
};
|
|
597
|
-
var tokenizeUserVaultInvestment_default =
|
|
625
|
+
var tokenizeUserVaultInvestment_default = ABI24;
|
|
598
626
|
|
|
599
627
|
// generated_types/addCredits.ts
|
|
600
|
-
var
|
|
601
|
-
"address": "
|
|
628
|
+
var ABI25 = {
|
|
629
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
602
630
|
"name": "add_credits",
|
|
603
631
|
"friends": [],
|
|
604
632
|
"exposed_functions": [
|
|
@@ -618,7 +646,7 @@ var ABI24 = {
|
|
|
618
646
|
],
|
|
619
647
|
"structs": []
|
|
620
648
|
};
|
|
621
|
-
var addCredits_default =
|
|
649
|
+
var addCredits_default = ABI25;
|
|
622
650
|
|
|
623
651
|
// generated_types/typeshareTypes.ts
|
|
624
652
|
var ChartInterval = /* @__PURE__ */ ((ChartInterval2) => {
|
|
@@ -729,8 +757,8 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
729
757
|
})(UserStatus || {});
|
|
730
758
|
|
|
731
759
|
// generated_types/withdrawFromVault.ts
|
|
732
|
-
var
|
|
733
|
-
"address": "
|
|
760
|
+
var ABI26 = {
|
|
761
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
734
762
|
"name": "withdraw_from_vault",
|
|
735
763
|
"friends": [],
|
|
736
764
|
"exposed_functions": [
|
|
@@ -752,7 +780,7 @@ var ABI25 = {
|
|
|
752
780
|
],
|
|
753
781
|
"structs": []
|
|
754
782
|
};
|
|
755
|
-
var withdrawFromVault_default =
|
|
783
|
+
var withdrawFromVault_default = ABI26;
|
|
756
784
|
|
|
757
785
|
// src/utils.ts
|
|
758
786
|
import { Account } from "@aptos-labs/ts-sdk";
|
|
@@ -2007,6 +2035,28 @@ var Client = class _Client {
|
|
|
2007
2035
|
});
|
|
2008
2036
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
2009
2037
|
}
|
|
2038
|
+
async withdrawToken(params) {
|
|
2039
|
+
const aptosPayload = await generateTransactionPayload({
|
|
2040
|
+
aptosConfig: this._aptos.config,
|
|
2041
|
+
abi: parseEntryFunctionAbi({
|
|
2042
|
+
moduleAbi: withdrawToken_default,
|
|
2043
|
+
functionName: withdrawToken_default.name,
|
|
2044
|
+
moduleAddress: withdrawToken_default.address,
|
|
2045
|
+
moduleName: withdrawToken_default.name
|
|
2046
|
+
}),
|
|
2047
|
+
function: `${withdrawToken_default.address}::${withdrawToken_default.name}::withdraw_token`,
|
|
2048
|
+
typeArguments: [],
|
|
2049
|
+
functionArguments: [
|
|
2050
|
+
params.userId,
|
|
2051
|
+
params.amount,
|
|
2052
|
+
params.tokenAddress,
|
|
2053
|
+
params.max,
|
|
2054
|
+
params.borrow,
|
|
2055
|
+
params.recipient
|
|
2056
|
+
]
|
|
2057
|
+
});
|
|
2058
|
+
return await this.createAndSubmitTransaction(aptosPayload);
|
|
2059
|
+
}
|
|
2010
2060
|
async replaceMultipleOrders(params) {
|
|
2011
2061
|
const isBids = params.orders.map((order) => order.isBid);
|
|
2012
2062
|
const prices = params.orders.map((order) => order.price);
|
|
@@ -2128,8 +2178,8 @@ function parseEntryFunctionAbi(args) {
|
|
|
2128
2178
|
}
|
|
2129
2179
|
|
|
2130
2180
|
// generated_types/faucetEntrypoints.ts
|
|
2131
|
-
var
|
|
2132
|
-
"address": "
|
|
2181
|
+
var ABI27 = {
|
|
2182
|
+
"address": "0x193a6967fd19763b15c6b1c125c4a44d5efe2734714dda734526465df8d5ea69",
|
|
2133
2183
|
"name": "faucet_entrypoints",
|
|
2134
2184
|
"friends": [],
|
|
2135
2185
|
"exposed_functions": [
|
|
@@ -2160,7 +2210,7 @@ var ABI26 = {
|
|
|
2160
2210
|
],
|
|
2161
2211
|
"structs": []
|
|
2162
2212
|
};
|
|
2163
|
-
var faucetEntrypoints_default =
|
|
2213
|
+
var faucetEntrypoints_default = ABI27;
|
|
2164
2214
|
|
|
2165
2215
|
// src/testFaucet.ts
|
|
2166
2216
|
import {
|