@nightlylabs/dex-sdk 0.1.61 → 0.1.62
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 +39 -81
- package/dist/index.d.cts +38 -12
- package/dist/index.d.ts +38 -12
- package/dist/index.js +39 -81
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ var import_uuid = require("uuid");
|
|
|
66
66
|
|
|
67
67
|
// generated_types/addApiKey.ts
|
|
68
68
|
var ABI = {
|
|
69
|
-
"address": "
|
|
69
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
70
70
|
"name": "add_api_key",
|
|
71
71
|
"friends": [],
|
|
72
72
|
"exposed_functions": [
|
|
@@ -91,7 +91,7 @@ var addApiKey_default = ABI;
|
|
|
91
91
|
|
|
92
92
|
// generated_types/cancelAllPerpOrders.ts
|
|
93
93
|
var ABI2 = {
|
|
94
|
-
"address": "
|
|
94
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
95
95
|
"name": "cancel_all_perp_orders",
|
|
96
96
|
"friends": [],
|
|
97
97
|
"exposed_functions": [
|
|
@@ -114,7 +114,7 @@ var cancelAllPerpOrders_default = ABI2;
|
|
|
114
114
|
|
|
115
115
|
// generated_types/cancelPerpOrders.ts
|
|
116
116
|
var ABI3 = {
|
|
117
|
-
"address": "
|
|
117
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
118
118
|
"name": "cancel_perp_orders",
|
|
119
119
|
"friends": [],
|
|
120
120
|
"exposed_functions": [
|
|
@@ -139,7 +139,7 @@ var cancelPerpOrders_default = ABI3;
|
|
|
139
139
|
|
|
140
140
|
// generated_types/createUser.ts
|
|
141
141
|
var ABI4 = {
|
|
142
|
-
"address": "
|
|
142
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
143
143
|
"name": "create_user",
|
|
144
144
|
"friends": [],
|
|
145
145
|
"exposed_functions": [
|
|
@@ -164,7 +164,7 @@ var createUser_default = ABI4;
|
|
|
164
164
|
|
|
165
165
|
// generated_types/depositToVault.ts
|
|
166
166
|
var ABI5 = {
|
|
167
|
-
"address": "
|
|
167
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
168
168
|
"name": "deposit_to_vault",
|
|
169
169
|
"friends": [],
|
|
170
170
|
"exposed_functions": [
|
|
@@ -189,7 +189,7 @@ var depositToVault_default = ABI5;
|
|
|
189
189
|
|
|
190
190
|
// generated_types/depositToken.ts
|
|
191
191
|
var ABI6 = {
|
|
192
|
-
"address": "
|
|
192
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
193
193
|
"name": "deposit_token",
|
|
194
194
|
"friends": [],
|
|
195
195
|
"exposed_functions": [
|
|
@@ -214,7 +214,7 @@ var depositToken_default = ABI6;
|
|
|
214
214
|
|
|
215
215
|
// generated_types/lendToken.ts
|
|
216
216
|
var ABI7 = {
|
|
217
|
-
"address": "
|
|
217
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
218
218
|
"name": "lend_token",
|
|
219
219
|
"friends": [],
|
|
220
220
|
"exposed_functions": [
|
|
@@ -240,7 +240,7 @@ var lendToken_default = ABI7;
|
|
|
240
240
|
|
|
241
241
|
// generated_types/placePerpLimitOrder.ts
|
|
242
242
|
var ABI8 = {
|
|
243
|
-
"address": "
|
|
243
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
244
244
|
"name": "place_perp_limit_order",
|
|
245
245
|
"friends": [],
|
|
246
246
|
"exposed_functions": [
|
|
@@ -269,7 +269,7 @@ var placePerpLimitOrder_default = ABI8;
|
|
|
269
269
|
|
|
270
270
|
// generated_types/changePerpOrderPrice.ts
|
|
271
271
|
var ABI9 = {
|
|
272
|
-
"address": "
|
|
272
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
273
273
|
"name": "change_perp_order_price",
|
|
274
274
|
"friends": [],
|
|
275
275
|
"exposed_functions": [
|
|
@@ -297,7 +297,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
297
297
|
|
|
298
298
|
// generated_types/placePerpMarketOrder.ts
|
|
299
299
|
var ABI10 = {
|
|
300
|
-
"address": "
|
|
300
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
301
301
|
"name": "place_perp_market_order",
|
|
302
302
|
"friends": [],
|
|
303
303
|
"exposed_functions": [
|
|
@@ -325,7 +325,7 @@ var placePerpMarketOrder_default = ABI10;
|
|
|
325
325
|
|
|
326
326
|
// generated_types/redeemToken.ts
|
|
327
327
|
var ABI11 = {
|
|
328
|
-
"address": "
|
|
328
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
329
329
|
"name": "redeem_token",
|
|
330
330
|
"friends": [],
|
|
331
331
|
"exposed_functions": [
|
|
@@ -351,7 +351,7 @@ var redeemToken_default = ABI11;
|
|
|
351
351
|
|
|
352
352
|
// generated_types/removeApiKey.ts
|
|
353
353
|
var ABI12 = {
|
|
354
|
-
"address": "
|
|
354
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
355
355
|
"name": "remove_api_key",
|
|
356
356
|
"friends": [],
|
|
357
357
|
"exposed_functions": [
|
|
@@ -375,7 +375,7 @@ var removeApiKey_default = ABI12;
|
|
|
375
375
|
|
|
376
376
|
// generated_types/setAliasName.ts
|
|
377
377
|
var ABI13 = {
|
|
378
|
-
"address": "
|
|
378
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
379
379
|
"name": "set_alias_name",
|
|
380
380
|
"friends": [],
|
|
381
381
|
"exposed_functions": [
|
|
@@ -399,7 +399,7 @@ var setAliasName_default = ABI13;
|
|
|
399
399
|
|
|
400
400
|
// generated_types/setAutolend.ts
|
|
401
401
|
var ABI14 = {
|
|
402
|
-
"address": "
|
|
402
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
403
403
|
"name": "set_autolend",
|
|
404
404
|
"friends": [],
|
|
405
405
|
"exposed_functions": [
|
|
@@ -423,7 +423,7 @@ var setAutolend_default = ABI14;
|
|
|
423
423
|
|
|
424
424
|
// generated_types/claimReferralFees.ts
|
|
425
425
|
var ABI15 = {
|
|
426
|
-
"address": "
|
|
426
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
427
427
|
"name": "claim_referral_fees",
|
|
428
428
|
"friends": [],
|
|
429
429
|
"exposed_functions": [
|
|
@@ -447,7 +447,7 @@ var claimReferralFees_default = ABI15;
|
|
|
447
447
|
|
|
448
448
|
// generated_types/transferToUser.ts
|
|
449
449
|
var ABI16 = {
|
|
450
|
-
"address": "
|
|
450
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
451
451
|
"name": "transfer_to_user",
|
|
452
452
|
"friends": [],
|
|
453
453
|
"exposed_functions": [
|
|
@@ -475,7 +475,7 @@ var transferToUser_default = ABI16;
|
|
|
475
475
|
|
|
476
476
|
// generated_types/withdrawToken.ts
|
|
477
477
|
var ABI17 = {
|
|
478
|
-
"address": "
|
|
478
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
479
479
|
"name": "withdraw_token",
|
|
480
480
|
"friends": [],
|
|
481
481
|
"exposed_functions": [
|
|
@@ -503,7 +503,7 @@ var withdrawToken_default = ABI17;
|
|
|
503
503
|
|
|
504
504
|
// generated_types/placeMultiplePerpOrders.ts
|
|
505
505
|
var ABI18 = {
|
|
506
|
-
"address": "
|
|
506
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
507
507
|
"name": "place_multiple_perp_orders",
|
|
508
508
|
"friends": [],
|
|
509
509
|
"exposed_functions": [
|
|
@@ -532,7 +532,7 @@ var placeMultiplePerpOrders_default = ABI18;
|
|
|
532
532
|
|
|
533
533
|
// generated_types/claimKickbackFee.ts
|
|
534
534
|
var ABI19 = {
|
|
535
|
-
"address": "
|
|
535
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
536
536
|
"name": "claim_kickback_fee",
|
|
537
537
|
"friends": [],
|
|
538
538
|
"exposed_functions": [
|
|
@@ -555,7 +555,7 @@ var claimKickbackFee_default = ABI19;
|
|
|
555
555
|
|
|
556
556
|
// generated_types/replaceMultipleOrders.ts
|
|
557
557
|
var ABI20 = {
|
|
558
|
-
"address": "
|
|
558
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
559
559
|
"name": "replace_multiple_orders",
|
|
560
560
|
"friends": [],
|
|
561
561
|
"exposed_functions": [
|
|
@@ -583,7 +583,7 @@ var replaceMultipleOrders_default = ABI20;
|
|
|
583
583
|
|
|
584
584
|
// generated_types/claimDeposit.ts
|
|
585
585
|
var ABI21 = {
|
|
586
|
-
"address": "
|
|
586
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
587
587
|
"name": "claim_deposit",
|
|
588
588
|
"friends": [],
|
|
589
589
|
"exposed_functions": [
|
|
@@ -607,7 +607,7 @@ var claimDeposit_default = ABI21;
|
|
|
607
607
|
|
|
608
608
|
// generated_types/removeApiKeySigner.ts
|
|
609
609
|
var ABI22 = {
|
|
610
|
-
"address": "
|
|
610
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
611
611
|
"name": "remove_api_key_signer",
|
|
612
612
|
"friends": [],
|
|
613
613
|
"exposed_functions": [
|
|
@@ -631,7 +631,7 @@ var removeApiKeySigner_default = ABI22;
|
|
|
631
631
|
|
|
632
632
|
// generated_types/setReferralCode.ts
|
|
633
633
|
var ABI23 = {
|
|
634
|
-
"address": "
|
|
634
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
635
635
|
"name": "set_referral_code",
|
|
636
636
|
"friends": [],
|
|
637
637
|
"exposed_functions": [
|
|
@@ -655,7 +655,7 @@ var setReferralCode_default = ABI23;
|
|
|
655
655
|
|
|
656
656
|
// generated_types/tokenizeUserVaultInvestment.ts
|
|
657
657
|
var ABI24 = {
|
|
658
|
-
"address": "
|
|
658
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
659
659
|
"name": "tokenize_user_vault_investment",
|
|
660
660
|
"friends": [],
|
|
661
661
|
"exposed_functions": [
|
|
@@ -679,7 +679,7 @@ var tokenizeUserVaultInvestment_default = ABI24;
|
|
|
679
679
|
|
|
680
680
|
// generated_types/addCredits.ts
|
|
681
681
|
var ABI25 = {
|
|
682
|
-
"address": "
|
|
682
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
683
683
|
"name": "add_credits",
|
|
684
684
|
"friends": [],
|
|
685
685
|
"exposed_functions": [
|
|
@@ -701,38 +701,6 @@ var ABI25 = {
|
|
|
701
701
|
};
|
|
702
702
|
var addCredits_default = ABI25;
|
|
703
703
|
|
|
704
|
-
// generated_types/openBoxes.ts
|
|
705
|
-
var ABI26 = {
|
|
706
|
-
"address": "0xaadb16682f0afe2f149ae1ec5e1522e9f6ad693610e5bc19c833fc807f6b2388",
|
|
707
|
-
"name": "open_boxes",
|
|
708
|
-
"friends": [],
|
|
709
|
-
"exposed_functions": [
|
|
710
|
-
{
|
|
711
|
-
"name": "open_boxes_with_rewards",
|
|
712
|
-
"visibility": "public",
|
|
713
|
-
"is_entry": true,
|
|
714
|
-
"is_view": false,
|
|
715
|
-
"generic_type_params": [],
|
|
716
|
-
"params": [
|
|
717
|
-
"&signer",
|
|
718
|
-
"&signer",
|
|
719
|
-
"u64",
|
|
720
|
-
"u64",
|
|
721
|
-
"u64",
|
|
722
|
-
"u64",
|
|
723
|
-
"vector<address>",
|
|
724
|
-
"vector<u64>",
|
|
725
|
-
"vector<u64>",
|
|
726
|
-
"vector<0x1::string::String>",
|
|
727
|
-
"vector<0x1::string::String>"
|
|
728
|
-
],
|
|
729
|
-
"return": []
|
|
730
|
-
}
|
|
731
|
-
],
|
|
732
|
-
"structs": []
|
|
733
|
-
};
|
|
734
|
-
var openBoxes_default = ABI26;
|
|
735
|
-
|
|
736
704
|
// generated_types/typeshareTypes.ts
|
|
737
705
|
var BoxRewardTier = /* @__PURE__ */ ((BoxRewardTier2) => {
|
|
738
706
|
BoxRewardTier2["Common"] = "Common";
|
|
@@ -830,6 +798,7 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
830
798
|
EndpointsV12["GetVaultDeposits"] = "/v1/get_vault_deposits";
|
|
831
799
|
EndpointsV12["GetUserVolumeForReferral"] = "/v1/get_required_volume_for_referral";
|
|
832
800
|
EndpointsV12["GetUserRewardsValue"] = "/v1/get_user_rewards_value";
|
|
801
|
+
EndpointsV12["OpenBoxes"] = "/v1/open_boxes";
|
|
833
802
|
return EndpointsV12;
|
|
834
803
|
})(EndpointsV1 || {});
|
|
835
804
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -851,8 +820,8 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
851
820
|
})(UserStatus || {});
|
|
852
821
|
|
|
853
822
|
// generated_types/withdrawFromVault.ts
|
|
854
|
-
var
|
|
855
|
-
"address": "
|
|
823
|
+
var ABI26 = {
|
|
824
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
856
825
|
"name": "withdraw_from_vault",
|
|
857
826
|
"friends": [],
|
|
858
827
|
"exposed_functions": [
|
|
@@ -874,7 +843,7 @@ var ABI27 = {
|
|
|
874
843
|
],
|
|
875
844
|
"structs": []
|
|
876
845
|
};
|
|
877
|
-
var withdrawFromVault_default =
|
|
846
|
+
var withdrawFromVault_default = ABI26;
|
|
878
847
|
|
|
879
848
|
// src/utils.ts
|
|
880
849
|
var import_ts_sdk = require("@aptos-labs/ts-sdk");
|
|
@@ -1897,24 +1866,6 @@ var Client = class _Client {
|
|
|
1897
1866
|
functionArguments: [params.userId, params.amount]
|
|
1898
1867
|
});
|
|
1899
1868
|
}
|
|
1900
|
-
async openBoxesPayload(params) {
|
|
1901
|
-
return await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
1902
|
-
aptosConfig: this._aptos.config,
|
|
1903
|
-
abi: parseEntryFunctionAbi({
|
|
1904
|
-
moduleAbi: openBoxes_default,
|
|
1905
|
-
functionName: openBoxes_default.name,
|
|
1906
|
-
moduleAddress: openBoxes_default.address,
|
|
1907
|
-
moduleName: openBoxes_default.name
|
|
1908
|
-
}),
|
|
1909
|
-
function: `${openBoxes_default.address}::${openBoxes_default.name}::open_boxes`,
|
|
1910
|
-
typeArguments: [],
|
|
1911
|
-
functionArguments: [params.userId, params.boxId, params.amount]
|
|
1912
|
-
});
|
|
1913
|
-
}
|
|
1914
|
-
async openBoxes(params) {
|
|
1915
|
-
const aptosPayload = await this.openBoxesPayload(params);
|
|
1916
|
-
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1917
|
-
}
|
|
1918
1869
|
// Helper function to submit sponsored transaction
|
|
1919
1870
|
async createAndSubmitTransaction(aptosPayload) {
|
|
1920
1871
|
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
@@ -1937,6 +1888,13 @@ var Client = class _Client {
|
|
|
1937
1888
|
});
|
|
1938
1889
|
return await this.submitSponsoredTransaction(tx, signature);
|
|
1939
1890
|
}
|
|
1891
|
+
createOpenBoxesMessage(boxId, amount, userId, apiKey) {
|
|
1892
|
+
return `[Neony Exchange]: Open box, id:${boxId}, amount:${amount}, user_id:${userId}, api_key:${apiKey}`;
|
|
1893
|
+
}
|
|
1894
|
+
async openBoxes(params) {
|
|
1895
|
+
const response = await this.sendPostJson(params, "/v1/open_boxes" /* OpenBoxes */);
|
|
1896
|
+
return response;
|
|
1897
|
+
}
|
|
1940
1898
|
async removeApiKey(params) {
|
|
1941
1899
|
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
1942
1900
|
aptosConfig: this._aptos.config,
|
|
@@ -2349,8 +2307,8 @@ function parseEntryFunctionAbi(args) {
|
|
|
2349
2307
|
}
|
|
2350
2308
|
|
|
2351
2309
|
// generated_types/faucetEntrypoints.ts
|
|
2352
|
-
var
|
|
2353
|
-
"address": "
|
|
2310
|
+
var ABI27 = {
|
|
2311
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
2354
2312
|
"name": "faucet_entrypoints",
|
|
2355
2313
|
"friends": [],
|
|
2356
2314
|
"exposed_functions": [
|
|
@@ -2381,7 +2339,7 @@ var ABI28 = {
|
|
|
2381
2339
|
],
|
|
2382
2340
|
"structs": []
|
|
2383
2341
|
};
|
|
2384
|
-
var faucetEntrypoints_default =
|
|
2342
|
+
var faucetEntrypoints_default = ABI27;
|
|
2385
2343
|
|
|
2386
2344
|
// src/testFaucet.ts
|
|
2387
2345
|
var import_ts_sdk3 = require("@aptos-labs/ts-sdk");
|
package/dist/index.d.cts
CHANGED
|
@@ -78,21 +78,29 @@ declare enum BoxRewardTier {
|
|
|
78
78
|
Legendary = "Legendary",
|
|
79
79
|
Mystic = "Mystic"
|
|
80
80
|
}
|
|
81
|
-
interface BoxReward {
|
|
82
|
-
tier: string;
|
|
83
|
-
usdcAmount?: string;
|
|
84
|
-
pointsAmount?: string;
|
|
85
|
-
badgeType?: BoxRewardTier;
|
|
86
|
-
}
|
|
87
81
|
interface BoxOpeningEvent {
|
|
88
82
|
txHash: string;
|
|
89
83
|
userId: string;
|
|
90
84
|
boxId: string;
|
|
91
85
|
rewards: BoxReward[];
|
|
92
|
-
|
|
86
|
+
totalToken: string;
|
|
93
87
|
totalPoints: string;
|
|
88
|
+
pointsCost: string;
|
|
94
89
|
timestamp: string;
|
|
95
90
|
}
|
|
91
|
+
interface BoxReward {
|
|
92
|
+
tier: string;
|
|
93
|
+
usdcAmount?: string;
|
|
94
|
+
pointsAmount?: string;
|
|
95
|
+
badgeType?: BoxRewardTier;
|
|
96
|
+
}
|
|
97
|
+
interface BoxReward {
|
|
98
|
+
tier: string;
|
|
99
|
+
tokenAddress?: string;
|
|
100
|
+
tokenAmount?: string;
|
|
101
|
+
pointsAmount?: string;
|
|
102
|
+
badgeType?: BoxRewardTier;
|
|
103
|
+
}
|
|
96
104
|
interface CanceledPerpOrders {
|
|
97
105
|
market: string;
|
|
98
106
|
userId: string;
|
|
@@ -599,6 +607,7 @@ interface User {
|
|
|
599
607
|
referral: Referral;
|
|
600
608
|
vault?: Vault;
|
|
601
609
|
credits: string;
|
|
610
|
+
badges: Record<string, number>;
|
|
602
611
|
}
|
|
603
612
|
interface GetUserDataResponse {
|
|
604
613
|
userData: User;
|
|
@@ -866,6 +875,20 @@ interface MarketStatusChange {
|
|
|
866
875
|
market: string;
|
|
867
876
|
status: PerpetualMarketStatus;
|
|
868
877
|
}
|
|
878
|
+
interface OpenBoxesRequest {
|
|
879
|
+
userId: string;
|
|
880
|
+
boxId: string;
|
|
881
|
+
amount: string;
|
|
882
|
+
apiKey: string;
|
|
883
|
+
signature: string;
|
|
884
|
+
}
|
|
885
|
+
interface OpenBoxesResponse {
|
|
886
|
+
txHash: string;
|
|
887
|
+
rewards: BoxReward[];
|
|
888
|
+
totalToken: string;
|
|
889
|
+
totalPoints: string;
|
|
890
|
+
pointsDeducted: string;
|
|
891
|
+
}
|
|
869
892
|
interface OracleUpdate {
|
|
870
893
|
name: string;
|
|
871
894
|
price: string;
|
|
@@ -1075,7 +1098,8 @@ declare enum EndpointsV1 {
|
|
|
1075
1098
|
GetVaultWithdrawals = "/v1/get_vault_withdrawals",
|
|
1076
1099
|
GetVaultDeposits = "/v1/get_vault_deposits",
|
|
1077
1100
|
GetUserVolumeForReferral = "/v1/get_required_volume_for_referral",
|
|
1078
|
-
GetUserRewardsValue = "/v1/get_user_rewards_value"
|
|
1101
|
+
GetUserRewardsValue = "/v1/get_user_rewards_value",
|
|
1102
|
+
OpenBoxes = "/v1/open_boxes"
|
|
1079
1103
|
}
|
|
1080
1104
|
declare enum SpotMarketStatus {
|
|
1081
1105
|
Halted = "halted",
|
|
@@ -1444,10 +1468,12 @@ interface TokenizeUserVaultInvestmentParams {
|
|
|
1444
1468
|
userId: string;
|
|
1445
1469
|
vaultId: string;
|
|
1446
1470
|
}
|
|
1447
|
-
interface
|
|
1471
|
+
interface OpenBoxesSignRequest {
|
|
1448
1472
|
userId: string;
|
|
1449
1473
|
boxId: string;
|
|
1450
1474
|
amount: string;
|
|
1475
|
+
apiKey: string;
|
|
1476
|
+
signature: string;
|
|
1451
1477
|
}
|
|
1452
1478
|
type WsOracleUpdates = Extract<WsMessage, {
|
|
1453
1479
|
type: 'OracleUpdates';
|
|
@@ -1601,11 +1627,11 @@ declare class Client {
|
|
|
1601
1627
|
depositTokenPayload(params: DepositTokenParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1602
1628
|
removeApiKeySigner(params: RemoveApiKeySignerParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1603
1629
|
addApiCredits(params: AddApiCreditsParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1604
|
-
openBoxesPayload(params: OpenBoxesParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1605
|
-
openBoxes(params: OpenBoxesParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1606
1630
|
submitSponsoredTransaction: (tx: SimpleTransaction, signature: AccountAuthenticator) => Promise<SubmitSponsoredTransactionResponse>;
|
|
1607
1631
|
submitSponsoredMultiAgentTransaction: (tx: MultiAgentTransaction, signature: AccountAuthenticator, secondarySignersAuthenticators: AccountAuthenticator[]) => Promise<SubmitSponsoredTransactionResponse>;
|
|
1608
1632
|
createAndSubmitTransaction(aptosPayload: any): Promise<SubmitSponsoredTransactionResponse>;
|
|
1633
|
+
createOpenBoxesMessage(boxId: string, amount: string, userId: string, apiKey: string): string;
|
|
1634
|
+
openBoxes(params: OpenBoxesRequest): Promise<OpenBoxesResponse>;
|
|
1609
1635
|
removeApiKey(params: RemoveApiKeyParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1610
1636
|
setAliasName(params: SetAliasNameParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1611
1637
|
placePerpLimitOrder(params: PlacePerpOrderParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
@@ -1704,4 +1730,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1704
1730
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1705
1731
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1706
1732
|
|
|
1707
|
-
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 BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type 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 GetUserRewardsValueRequest, type GetUserRewardsValueResponse, 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 Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type
|
|
1733
|
+
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 BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type 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 GetUserRewardsValueRequest, type GetUserRewardsValueResponse, 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 Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, type UserRewardsValue, 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 WsBoxOpeningUpdate, type WsCommand, type WsFill, type WsLiquidationUpdate, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -78,21 +78,29 @@ declare enum BoxRewardTier {
|
|
|
78
78
|
Legendary = "Legendary",
|
|
79
79
|
Mystic = "Mystic"
|
|
80
80
|
}
|
|
81
|
-
interface BoxReward {
|
|
82
|
-
tier: string;
|
|
83
|
-
usdcAmount?: string;
|
|
84
|
-
pointsAmount?: string;
|
|
85
|
-
badgeType?: BoxRewardTier;
|
|
86
|
-
}
|
|
87
81
|
interface BoxOpeningEvent {
|
|
88
82
|
txHash: string;
|
|
89
83
|
userId: string;
|
|
90
84
|
boxId: string;
|
|
91
85
|
rewards: BoxReward[];
|
|
92
|
-
|
|
86
|
+
totalToken: string;
|
|
93
87
|
totalPoints: string;
|
|
88
|
+
pointsCost: string;
|
|
94
89
|
timestamp: string;
|
|
95
90
|
}
|
|
91
|
+
interface BoxReward {
|
|
92
|
+
tier: string;
|
|
93
|
+
usdcAmount?: string;
|
|
94
|
+
pointsAmount?: string;
|
|
95
|
+
badgeType?: BoxRewardTier;
|
|
96
|
+
}
|
|
97
|
+
interface BoxReward {
|
|
98
|
+
tier: string;
|
|
99
|
+
tokenAddress?: string;
|
|
100
|
+
tokenAmount?: string;
|
|
101
|
+
pointsAmount?: string;
|
|
102
|
+
badgeType?: BoxRewardTier;
|
|
103
|
+
}
|
|
96
104
|
interface CanceledPerpOrders {
|
|
97
105
|
market: string;
|
|
98
106
|
userId: string;
|
|
@@ -599,6 +607,7 @@ interface User {
|
|
|
599
607
|
referral: Referral;
|
|
600
608
|
vault?: Vault;
|
|
601
609
|
credits: string;
|
|
610
|
+
badges: Record<string, number>;
|
|
602
611
|
}
|
|
603
612
|
interface GetUserDataResponse {
|
|
604
613
|
userData: User;
|
|
@@ -866,6 +875,20 @@ interface MarketStatusChange {
|
|
|
866
875
|
market: string;
|
|
867
876
|
status: PerpetualMarketStatus;
|
|
868
877
|
}
|
|
878
|
+
interface OpenBoxesRequest {
|
|
879
|
+
userId: string;
|
|
880
|
+
boxId: string;
|
|
881
|
+
amount: string;
|
|
882
|
+
apiKey: string;
|
|
883
|
+
signature: string;
|
|
884
|
+
}
|
|
885
|
+
interface OpenBoxesResponse {
|
|
886
|
+
txHash: string;
|
|
887
|
+
rewards: BoxReward[];
|
|
888
|
+
totalToken: string;
|
|
889
|
+
totalPoints: string;
|
|
890
|
+
pointsDeducted: string;
|
|
891
|
+
}
|
|
869
892
|
interface OracleUpdate {
|
|
870
893
|
name: string;
|
|
871
894
|
price: string;
|
|
@@ -1075,7 +1098,8 @@ declare enum EndpointsV1 {
|
|
|
1075
1098
|
GetVaultWithdrawals = "/v1/get_vault_withdrawals",
|
|
1076
1099
|
GetVaultDeposits = "/v1/get_vault_deposits",
|
|
1077
1100
|
GetUserVolumeForReferral = "/v1/get_required_volume_for_referral",
|
|
1078
|
-
GetUserRewardsValue = "/v1/get_user_rewards_value"
|
|
1101
|
+
GetUserRewardsValue = "/v1/get_user_rewards_value",
|
|
1102
|
+
OpenBoxes = "/v1/open_boxes"
|
|
1079
1103
|
}
|
|
1080
1104
|
declare enum SpotMarketStatus {
|
|
1081
1105
|
Halted = "halted",
|
|
@@ -1444,10 +1468,12 @@ interface TokenizeUserVaultInvestmentParams {
|
|
|
1444
1468
|
userId: string;
|
|
1445
1469
|
vaultId: string;
|
|
1446
1470
|
}
|
|
1447
|
-
interface
|
|
1471
|
+
interface OpenBoxesSignRequest {
|
|
1448
1472
|
userId: string;
|
|
1449
1473
|
boxId: string;
|
|
1450
1474
|
amount: string;
|
|
1475
|
+
apiKey: string;
|
|
1476
|
+
signature: string;
|
|
1451
1477
|
}
|
|
1452
1478
|
type WsOracleUpdates = Extract<WsMessage, {
|
|
1453
1479
|
type: 'OracleUpdates';
|
|
@@ -1601,11 +1627,11 @@ declare class Client {
|
|
|
1601
1627
|
depositTokenPayload(params: DepositTokenParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1602
1628
|
removeApiKeySigner(params: RemoveApiKeySignerParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1603
1629
|
addApiCredits(params: AddApiCreditsParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1604
|
-
openBoxesPayload(params: OpenBoxesParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
|
|
1605
|
-
openBoxes(params: OpenBoxesParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1606
1630
|
submitSponsoredTransaction: (tx: SimpleTransaction, signature: AccountAuthenticator) => Promise<SubmitSponsoredTransactionResponse>;
|
|
1607
1631
|
submitSponsoredMultiAgentTransaction: (tx: MultiAgentTransaction, signature: AccountAuthenticator, secondarySignersAuthenticators: AccountAuthenticator[]) => Promise<SubmitSponsoredTransactionResponse>;
|
|
1608
1632
|
createAndSubmitTransaction(aptosPayload: any): Promise<SubmitSponsoredTransactionResponse>;
|
|
1633
|
+
createOpenBoxesMessage(boxId: string, amount: string, userId: string, apiKey: string): string;
|
|
1634
|
+
openBoxes(params: OpenBoxesRequest): Promise<OpenBoxesResponse>;
|
|
1609
1635
|
removeApiKey(params: RemoveApiKeyParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1610
1636
|
setAliasName(params: SetAliasNameParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1611
1637
|
placePerpLimitOrder(params: PlacePerpOrderParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
@@ -1704,4 +1730,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1704
1730
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1705
1731
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1706
1732
|
|
|
1707
|
-
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 BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type 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 GetUserRewardsValueRequest, type GetUserRewardsValueResponse, 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 Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type
|
|
1733
|
+
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 BoxOpeningEvent, type BoxReward, BoxRewardTier, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type CheckReferralCodeRequest, type CheckReferralCodeResponse, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, type ClaimedKickback, type ClaimedReferralKickback, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeData, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingAggregatedStatsRequest, type GetBorrowLendingAggregatedStatsResponse, type GetBorrowLendingDataResponse, type GetBorrowLendingHistoricalDataRequest, type GetBorrowLendingHistoricalDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetIndexPriceHistoryRequest, type GetIndexPriceHistoryResponse, type 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 GetUserRewardsValueRequest, type GetUserRewardsValueResponse, 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 Liquidation, type MarginStep, type MarketStatusChange, Network, type NodeStatus, type OpenBoxesRequest, type OpenBoxesResponse, type OpenBoxesSignRequest, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, type PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RemoveApiKeySignerParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, type SetReferralCodeParams, type SetReferralParamsRequest, type SetReferralParamsResponse, SpotMarketStatus, Status, type StatusResponse, type SubServiceStatus, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenAggregatedStats, type TokenConfigEntry, type TokenizeUserVaultInvestmentParams, type Topic, type Trade, TradeRole, type TradesUpdate, TransferAction, type TransferToUserParams, type TxParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserAggregatedVaultStats, type UserPortfolioValue, type UserRewardsValue, 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 WsBoxOpeningUpdate, type WsCommand, type WsFill, type WsLiquidationUpdate, 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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
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": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
222
222
|
"name": "change_perp_order_price",
|
|
223
223
|
"friends": [],
|
|
224
224
|
"exposed_functions": [
|
|
@@ -246,7 +246,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
246
246
|
|
|
247
247
|
// generated_types/placePerpMarketOrder.ts
|
|
248
248
|
var ABI10 = {
|
|
249
|
-
"address": "
|
|
249
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
250
250
|
"name": "place_perp_market_order",
|
|
251
251
|
"friends": [],
|
|
252
252
|
"exposed_functions": [
|
|
@@ -274,7 +274,7 @@ var placePerpMarketOrder_default = ABI10;
|
|
|
274
274
|
|
|
275
275
|
// generated_types/redeemToken.ts
|
|
276
276
|
var ABI11 = {
|
|
277
|
-
"address": "
|
|
277
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
278
278
|
"name": "redeem_token",
|
|
279
279
|
"friends": [],
|
|
280
280
|
"exposed_functions": [
|
|
@@ -300,7 +300,7 @@ var redeemToken_default = ABI11;
|
|
|
300
300
|
|
|
301
301
|
// generated_types/removeApiKey.ts
|
|
302
302
|
var ABI12 = {
|
|
303
|
-
"address": "
|
|
303
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
304
304
|
"name": "remove_api_key",
|
|
305
305
|
"friends": [],
|
|
306
306
|
"exposed_functions": [
|
|
@@ -324,7 +324,7 @@ var removeApiKey_default = ABI12;
|
|
|
324
324
|
|
|
325
325
|
// generated_types/setAliasName.ts
|
|
326
326
|
var ABI13 = {
|
|
327
|
-
"address": "
|
|
327
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
328
328
|
"name": "set_alias_name",
|
|
329
329
|
"friends": [],
|
|
330
330
|
"exposed_functions": [
|
|
@@ -348,7 +348,7 @@ var setAliasName_default = ABI13;
|
|
|
348
348
|
|
|
349
349
|
// generated_types/setAutolend.ts
|
|
350
350
|
var ABI14 = {
|
|
351
|
-
"address": "
|
|
351
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
352
352
|
"name": "set_autolend",
|
|
353
353
|
"friends": [],
|
|
354
354
|
"exposed_functions": [
|
|
@@ -372,7 +372,7 @@ var setAutolend_default = ABI14;
|
|
|
372
372
|
|
|
373
373
|
// generated_types/claimReferralFees.ts
|
|
374
374
|
var ABI15 = {
|
|
375
|
-
"address": "
|
|
375
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
376
376
|
"name": "claim_referral_fees",
|
|
377
377
|
"friends": [],
|
|
378
378
|
"exposed_functions": [
|
|
@@ -396,7 +396,7 @@ var claimReferralFees_default = ABI15;
|
|
|
396
396
|
|
|
397
397
|
// generated_types/transferToUser.ts
|
|
398
398
|
var ABI16 = {
|
|
399
|
-
"address": "
|
|
399
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
400
400
|
"name": "transfer_to_user",
|
|
401
401
|
"friends": [],
|
|
402
402
|
"exposed_functions": [
|
|
@@ -424,7 +424,7 @@ var transferToUser_default = ABI16;
|
|
|
424
424
|
|
|
425
425
|
// generated_types/withdrawToken.ts
|
|
426
426
|
var ABI17 = {
|
|
427
|
-
"address": "
|
|
427
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
428
428
|
"name": "withdraw_token",
|
|
429
429
|
"friends": [],
|
|
430
430
|
"exposed_functions": [
|
|
@@ -452,7 +452,7 @@ var withdrawToken_default = ABI17;
|
|
|
452
452
|
|
|
453
453
|
// generated_types/placeMultiplePerpOrders.ts
|
|
454
454
|
var ABI18 = {
|
|
455
|
-
"address": "
|
|
455
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
456
456
|
"name": "place_multiple_perp_orders",
|
|
457
457
|
"friends": [],
|
|
458
458
|
"exposed_functions": [
|
|
@@ -481,7 +481,7 @@ var placeMultiplePerpOrders_default = ABI18;
|
|
|
481
481
|
|
|
482
482
|
// generated_types/claimKickbackFee.ts
|
|
483
483
|
var ABI19 = {
|
|
484
|
-
"address": "
|
|
484
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
485
485
|
"name": "claim_kickback_fee",
|
|
486
486
|
"friends": [],
|
|
487
487
|
"exposed_functions": [
|
|
@@ -504,7 +504,7 @@ var claimKickbackFee_default = ABI19;
|
|
|
504
504
|
|
|
505
505
|
// generated_types/replaceMultipleOrders.ts
|
|
506
506
|
var ABI20 = {
|
|
507
|
-
"address": "
|
|
507
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
508
508
|
"name": "replace_multiple_orders",
|
|
509
509
|
"friends": [],
|
|
510
510
|
"exposed_functions": [
|
|
@@ -532,7 +532,7 @@ var replaceMultipleOrders_default = ABI20;
|
|
|
532
532
|
|
|
533
533
|
// generated_types/claimDeposit.ts
|
|
534
534
|
var ABI21 = {
|
|
535
|
-
"address": "
|
|
535
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
536
536
|
"name": "claim_deposit",
|
|
537
537
|
"friends": [],
|
|
538
538
|
"exposed_functions": [
|
|
@@ -556,7 +556,7 @@ var claimDeposit_default = ABI21;
|
|
|
556
556
|
|
|
557
557
|
// generated_types/removeApiKeySigner.ts
|
|
558
558
|
var ABI22 = {
|
|
559
|
-
"address": "
|
|
559
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
560
560
|
"name": "remove_api_key_signer",
|
|
561
561
|
"friends": [],
|
|
562
562
|
"exposed_functions": [
|
|
@@ -580,7 +580,7 @@ var removeApiKeySigner_default = ABI22;
|
|
|
580
580
|
|
|
581
581
|
// generated_types/setReferralCode.ts
|
|
582
582
|
var ABI23 = {
|
|
583
|
-
"address": "
|
|
583
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
584
584
|
"name": "set_referral_code",
|
|
585
585
|
"friends": [],
|
|
586
586
|
"exposed_functions": [
|
|
@@ -604,7 +604,7 @@ var setReferralCode_default = ABI23;
|
|
|
604
604
|
|
|
605
605
|
// generated_types/tokenizeUserVaultInvestment.ts
|
|
606
606
|
var ABI24 = {
|
|
607
|
-
"address": "
|
|
607
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
608
608
|
"name": "tokenize_user_vault_investment",
|
|
609
609
|
"friends": [],
|
|
610
610
|
"exposed_functions": [
|
|
@@ -628,7 +628,7 @@ var tokenizeUserVaultInvestment_default = ABI24;
|
|
|
628
628
|
|
|
629
629
|
// generated_types/addCredits.ts
|
|
630
630
|
var ABI25 = {
|
|
631
|
-
"address": "
|
|
631
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
632
632
|
"name": "add_credits",
|
|
633
633
|
"friends": [],
|
|
634
634
|
"exposed_functions": [
|
|
@@ -650,38 +650,6 @@ var ABI25 = {
|
|
|
650
650
|
};
|
|
651
651
|
var addCredits_default = ABI25;
|
|
652
652
|
|
|
653
|
-
// generated_types/openBoxes.ts
|
|
654
|
-
var ABI26 = {
|
|
655
|
-
"address": "0xaadb16682f0afe2f149ae1ec5e1522e9f6ad693610e5bc19c833fc807f6b2388",
|
|
656
|
-
"name": "open_boxes",
|
|
657
|
-
"friends": [],
|
|
658
|
-
"exposed_functions": [
|
|
659
|
-
{
|
|
660
|
-
"name": "open_boxes_with_rewards",
|
|
661
|
-
"visibility": "public",
|
|
662
|
-
"is_entry": true,
|
|
663
|
-
"is_view": false,
|
|
664
|
-
"generic_type_params": [],
|
|
665
|
-
"params": [
|
|
666
|
-
"&signer",
|
|
667
|
-
"&signer",
|
|
668
|
-
"u64",
|
|
669
|
-
"u64",
|
|
670
|
-
"u64",
|
|
671
|
-
"u64",
|
|
672
|
-
"vector<address>",
|
|
673
|
-
"vector<u64>",
|
|
674
|
-
"vector<u64>",
|
|
675
|
-
"vector<0x1::string::String>",
|
|
676
|
-
"vector<0x1::string::String>"
|
|
677
|
-
],
|
|
678
|
-
"return": []
|
|
679
|
-
}
|
|
680
|
-
],
|
|
681
|
-
"structs": []
|
|
682
|
-
};
|
|
683
|
-
var openBoxes_default = ABI26;
|
|
684
|
-
|
|
685
653
|
// generated_types/typeshareTypes.ts
|
|
686
654
|
var BoxRewardTier = /* @__PURE__ */ ((BoxRewardTier2) => {
|
|
687
655
|
BoxRewardTier2["Common"] = "Common";
|
|
@@ -779,6 +747,7 @@ var EndpointsV1 = /* @__PURE__ */ ((EndpointsV12) => {
|
|
|
779
747
|
EndpointsV12["GetVaultDeposits"] = "/v1/get_vault_deposits";
|
|
780
748
|
EndpointsV12["GetUserVolumeForReferral"] = "/v1/get_required_volume_for_referral";
|
|
781
749
|
EndpointsV12["GetUserRewardsValue"] = "/v1/get_user_rewards_value";
|
|
750
|
+
EndpointsV12["OpenBoxes"] = "/v1/open_boxes";
|
|
782
751
|
return EndpointsV12;
|
|
783
752
|
})(EndpointsV1 || {});
|
|
784
753
|
var SpotMarketStatus = /* @__PURE__ */ ((SpotMarketStatus2) => {
|
|
@@ -800,8 +769,8 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
800
769
|
})(UserStatus || {});
|
|
801
770
|
|
|
802
771
|
// generated_types/withdrawFromVault.ts
|
|
803
|
-
var
|
|
804
|
-
"address": "
|
|
772
|
+
var ABI26 = {
|
|
773
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
805
774
|
"name": "withdraw_from_vault",
|
|
806
775
|
"friends": [],
|
|
807
776
|
"exposed_functions": [
|
|
@@ -823,7 +792,7 @@ var ABI27 = {
|
|
|
823
792
|
],
|
|
824
793
|
"structs": []
|
|
825
794
|
};
|
|
826
|
-
var withdrawFromVault_default =
|
|
795
|
+
var withdrawFromVault_default = ABI26;
|
|
827
796
|
|
|
828
797
|
// src/utils.ts
|
|
829
798
|
import { Account } from "@aptos-labs/ts-sdk";
|
|
@@ -1846,24 +1815,6 @@ var Client = class _Client {
|
|
|
1846
1815
|
functionArguments: [params.userId, params.amount]
|
|
1847
1816
|
});
|
|
1848
1817
|
}
|
|
1849
|
-
async openBoxesPayload(params) {
|
|
1850
|
-
return await generateTransactionPayload({
|
|
1851
|
-
aptosConfig: this._aptos.config,
|
|
1852
|
-
abi: parseEntryFunctionAbi({
|
|
1853
|
-
moduleAbi: openBoxes_default,
|
|
1854
|
-
functionName: openBoxes_default.name,
|
|
1855
|
-
moduleAddress: openBoxes_default.address,
|
|
1856
|
-
moduleName: openBoxes_default.name
|
|
1857
|
-
}),
|
|
1858
|
-
function: `${openBoxes_default.address}::${openBoxes_default.name}::open_boxes`,
|
|
1859
|
-
typeArguments: [],
|
|
1860
|
-
functionArguments: [params.userId, params.boxId, params.amount]
|
|
1861
|
-
});
|
|
1862
|
-
}
|
|
1863
|
-
async openBoxes(params) {
|
|
1864
|
-
const aptosPayload = await this.openBoxesPayload(params);
|
|
1865
|
-
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1866
|
-
}
|
|
1867
1818
|
// Helper function to submit sponsored transaction
|
|
1868
1819
|
async createAndSubmitTransaction(aptosPayload) {
|
|
1869
1820
|
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
@@ -1886,6 +1837,13 @@ var Client = class _Client {
|
|
|
1886
1837
|
});
|
|
1887
1838
|
return await this.submitSponsoredTransaction(tx, signature);
|
|
1888
1839
|
}
|
|
1840
|
+
createOpenBoxesMessage(boxId, amount, userId, apiKey) {
|
|
1841
|
+
return `[Neony Exchange]: Open box, id:${boxId}, amount:${amount}, user_id:${userId}, api_key:${apiKey}`;
|
|
1842
|
+
}
|
|
1843
|
+
async openBoxes(params) {
|
|
1844
|
+
const response = await this.sendPostJson(params, "/v1/open_boxes" /* OpenBoxes */);
|
|
1845
|
+
return response;
|
|
1846
|
+
}
|
|
1889
1847
|
async removeApiKey(params) {
|
|
1890
1848
|
const aptosPayload = await generateTransactionPayload({
|
|
1891
1849
|
aptosConfig: this._aptos.config,
|
|
@@ -2298,8 +2256,8 @@ function parseEntryFunctionAbi(args) {
|
|
|
2298
2256
|
}
|
|
2299
2257
|
|
|
2300
2258
|
// generated_types/faucetEntrypoints.ts
|
|
2301
|
-
var
|
|
2302
|
-
"address": "
|
|
2259
|
+
var ABI27 = {
|
|
2260
|
+
"address": "0x5ac27b84467d20cc038ae6d34fd1aee8a2947d16602b7fc18012a3a00bb12e5d",
|
|
2303
2261
|
"name": "faucet_entrypoints",
|
|
2304
2262
|
"friends": [],
|
|
2305
2263
|
"exposed_functions": [
|
|
@@ -2330,7 +2288,7 @@ var ABI28 = {
|
|
|
2330
2288
|
],
|
|
2331
2289
|
"structs": []
|
|
2332
2290
|
};
|
|
2333
|
-
var faucetEntrypoints_default =
|
|
2291
|
+
var faucetEntrypoints_default = ABI27;
|
|
2334
2292
|
|
|
2335
2293
|
// src/testFaucet.ts
|
|
2336
2294
|
import {
|