@nightlylabs/dex-sdk 0.0.79 → 0.0.81
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 +73 -31
- package/dist/index.d.cts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +73 -31
- package/package.json +2 -2
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
449
449
|
"name": "transfer_to_user",
|
|
450
450
|
"friends": [],
|
|
451
451
|
"exposed_functions": [
|
|
@@ -472,7 +472,7 @@ var transferToUser_default = ABI16;
|
|
|
472
472
|
|
|
473
473
|
// generated_types/placeMultiplePerpOrders.ts
|
|
474
474
|
var ABI17 = {
|
|
475
|
-
"address": "
|
|
475
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
476
476
|
"name": "place_multiple_perp_orders",
|
|
477
477
|
"friends": [],
|
|
478
478
|
"exposed_functions": [
|
|
@@ -501,7 +501,7 @@ var placeMultiplePerpOrders_default = ABI17;
|
|
|
501
501
|
|
|
502
502
|
// generated_types/claimKickbackFee.ts
|
|
503
503
|
var ABI18 = {
|
|
504
|
-
"address": "
|
|
504
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
505
505
|
"name": "claim_kickback_fee",
|
|
506
506
|
"friends": [],
|
|
507
507
|
"exposed_functions": [
|
|
@@ -524,7 +524,7 @@ var claimKickbackFee_default = ABI18;
|
|
|
524
524
|
|
|
525
525
|
// generated_types/replaceMultipleOrders.ts
|
|
526
526
|
var ABI19 = {
|
|
527
|
-
"address": "
|
|
527
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
528
528
|
"name": "replace_multiple_orders",
|
|
529
529
|
"friends": [],
|
|
530
530
|
"exposed_functions": [
|
|
@@ -550,12 +550,37 @@ var ABI19 = {
|
|
|
550
550
|
};
|
|
551
551
|
var replaceMultipleOrders_default = ABI19;
|
|
552
552
|
|
|
553
|
+
// generated_types/claimDeposit.ts
|
|
554
|
+
var ABI20 = {
|
|
555
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
556
|
+
"name": "claim_deposit",
|
|
557
|
+
"friends": [],
|
|
558
|
+
"exposed_functions": [
|
|
559
|
+
{
|
|
560
|
+
"name": "claim_deposit",
|
|
561
|
+
"visibility": "public",
|
|
562
|
+
"is_entry": true,
|
|
563
|
+
"is_view": false,
|
|
564
|
+
"generic_type_params": [],
|
|
565
|
+
"params": [
|
|
566
|
+
"&signer",
|
|
567
|
+
"u64",
|
|
568
|
+
"0x1::object::Object<0x1::fungible_asset::Metadata>"
|
|
569
|
+
],
|
|
570
|
+
"return": []
|
|
571
|
+
}
|
|
572
|
+
],
|
|
573
|
+
"structs": []
|
|
574
|
+
};
|
|
575
|
+
var claimDeposit_default = ABI20;
|
|
576
|
+
|
|
553
577
|
// generated_types/typeshareTypes.ts
|
|
554
578
|
var PerpetualMarketStatus = /* @__PURE__ */ ((PerpetualMarketStatus2) => {
|
|
555
579
|
PerpetualMarketStatus2["Halted"] = "halted";
|
|
556
580
|
PerpetualMarketStatus2["ReduceOnly"] = "reduceOnly";
|
|
557
581
|
PerpetualMarketStatus2["PostOnly"] = "postOnly";
|
|
558
582
|
PerpetualMarketStatus2["Live"] = "live";
|
|
583
|
+
PerpetualMarketStatus2["Settled"] = "settled";
|
|
559
584
|
return PerpetualMarketStatus2;
|
|
560
585
|
})(PerpetualMarketStatus || {});
|
|
561
586
|
var ChartInterval = /* @__PURE__ */ ((ChartInterval2) => {
|
|
@@ -634,8 +659,8 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
634
659
|
})(UserStatus || {});
|
|
635
660
|
|
|
636
661
|
// generated_types/withdrawFromVault.ts
|
|
637
|
-
var
|
|
638
|
-
"address": "
|
|
662
|
+
var ABI21 = {
|
|
663
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
639
664
|
"name": "withdraw_from_vault",
|
|
640
665
|
"friends": [],
|
|
641
666
|
"exposed_functions": [
|
|
@@ -657,7 +682,7 @@ var ABI20 = {
|
|
|
657
682
|
],
|
|
658
683
|
"structs": []
|
|
659
684
|
};
|
|
660
|
-
var withdrawFromVault_default =
|
|
685
|
+
var withdrawFromVault_default = ABI21;
|
|
661
686
|
|
|
662
687
|
// src/utils.ts
|
|
663
688
|
var import_ts_sdk = require("@aptos-labs/ts-sdk");
|
|
@@ -722,6 +747,8 @@ var getTopicFromMessage = (data) => {
|
|
|
722
747
|
return data.type;
|
|
723
748
|
case "OrderbookUpdate":
|
|
724
749
|
return data.content.market;
|
|
750
|
+
case "MarketStatusChange":
|
|
751
|
+
return data.content.market;
|
|
725
752
|
case "TradesUpdate":
|
|
726
753
|
return data.content.market;
|
|
727
754
|
case "BalanceChange":
|
|
@@ -1759,6 +1786,21 @@ var Client = class _Client {
|
|
|
1759
1786
|
});
|
|
1760
1787
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1761
1788
|
}
|
|
1789
|
+
async claimDeposit(params) {
|
|
1790
|
+
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
1791
|
+
aptosConfig: this._aptos.config,
|
|
1792
|
+
abi: parseEntryFunctionAbi({
|
|
1793
|
+
moduleAbi: claimDeposit_default,
|
|
1794
|
+
functionName: claimDeposit_default.name,
|
|
1795
|
+
moduleAddress: claimDeposit_default.address,
|
|
1796
|
+
moduleName: claimDeposit_default.name
|
|
1797
|
+
}),
|
|
1798
|
+
function: `${claimDeposit_default.address}::${claimDeposit_default.name}::claim_deposit`,
|
|
1799
|
+
typeArguments: [],
|
|
1800
|
+
functionArguments: [params.userId, params.tokenAddress]
|
|
1801
|
+
});
|
|
1802
|
+
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1803
|
+
}
|
|
1762
1804
|
};
|
|
1763
1805
|
var client_default = Client;
|
|
1764
1806
|
function parseEntryFunctionAbi(args) {
|
|
@@ -1790,8 +1832,8 @@ function parseEntryFunctionAbi(args) {
|
|
|
1790
1832
|
var import_surf2 = require("@thalalabs/surf");
|
|
1791
1833
|
|
|
1792
1834
|
// generated_types/faucetEntrypoints.ts
|
|
1793
|
-
var
|
|
1794
|
-
"address": "
|
|
1835
|
+
var ABI22 = {
|
|
1836
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
1795
1837
|
"name": "faucet_entrypoints",
|
|
1796
1838
|
"friends": [],
|
|
1797
1839
|
"exposed_functions": [
|
|
@@ -1822,11 +1864,11 @@ var ABI21 = {
|
|
|
1822
1864
|
],
|
|
1823
1865
|
"structs": []
|
|
1824
1866
|
};
|
|
1825
|
-
var faucetEntrypoints_default =
|
|
1867
|
+
var faucetEntrypoints_default = ABI22;
|
|
1826
1868
|
|
|
1827
1869
|
// generated_types/testFaucet.ts
|
|
1828
|
-
var
|
|
1829
|
-
"address": "
|
|
1870
|
+
var ABI23 = {
|
|
1871
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
1830
1872
|
"name": "test_faucet",
|
|
1831
1873
|
"friends": [],
|
|
1832
1874
|
"exposed_functions": [
|
|
@@ -1863,7 +1905,7 @@ var ABI22 = {
|
|
|
1863
1905
|
],
|
|
1864
1906
|
"return": [
|
|
1865
1907
|
"0x1::object::ConstructorRef",
|
|
1866
|
-
"0x1::object::Object<
|
|
1908
|
+
"0x1::object::Object<0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f::test_faucet::Token>"
|
|
1867
1909
|
]
|
|
1868
1910
|
},
|
|
1869
1911
|
{
|
|
@@ -2014,7 +2056,7 @@ var ABI22 = {
|
|
|
2014
2056
|
"0x1::object::Object<0x1::fungible_asset::Metadata>"
|
|
2015
2057
|
],
|
|
2016
2058
|
"return": [
|
|
2017
|
-
"
|
|
2059
|
+
"0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f::test_faucet::FaucetToken"
|
|
2018
2060
|
]
|
|
2019
2061
|
}
|
|
2020
2062
|
],
|
|
@@ -2046,7 +2088,7 @@ var ABI22 = {
|
|
|
2046
2088
|
"fields": [
|
|
2047
2089
|
{
|
|
2048
2090
|
"name": "tokens",
|
|
2049
|
-
"type": "0x1::smart_table::SmartTable<vector<u8>,
|
|
2091
|
+
"type": "0x1::smart_table::SmartTable<vector<u8>, 0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f::test_faucet::FaucetToken>"
|
|
2050
2092
|
}
|
|
2051
2093
|
]
|
|
2052
2094
|
},
|
|
@@ -2071,7 +2113,7 @@ var ABI22 = {
|
|
|
2071
2113
|
}
|
|
2072
2114
|
]
|
|
2073
2115
|
};
|
|
2074
|
-
var testFaucet_default =
|
|
2116
|
+
var testFaucet_default = ABI23;
|
|
2075
2117
|
|
|
2076
2118
|
// src/testFaucet.ts
|
|
2077
2119
|
var TestFaucet = class _TestFaucet extends client_default {
|
package/dist/index.d.cts
CHANGED
|
@@ -111,7 +111,8 @@ declare enum PerpetualMarketStatus {
|
|
|
111
111
|
Halted = "halted",
|
|
112
112
|
ReduceOnly = "reduceOnly",
|
|
113
113
|
PostOnly = "postOnly",
|
|
114
|
-
Live = "live"
|
|
114
|
+
Live = "live",
|
|
115
|
+
Settled = "settled"
|
|
115
116
|
}
|
|
116
117
|
interface FundingRate {
|
|
117
118
|
enabled: boolean;
|
|
@@ -383,7 +384,6 @@ interface User {
|
|
|
383
384
|
}
|
|
384
385
|
interface GetUserDataResponse {
|
|
385
386
|
userData: User;
|
|
386
|
-
perpOrdersCount: string;
|
|
387
387
|
}
|
|
388
388
|
interface GetUserDepositsRequest {
|
|
389
389
|
userId: string;
|
|
@@ -463,6 +463,7 @@ interface HistoricalTradeStats {
|
|
|
463
463
|
tradeVolumePerp: string;
|
|
464
464
|
tradeCountSpot: string;
|
|
465
465
|
tradeCountPerp: string;
|
|
466
|
+
paidFee: string;
|
|
466
467
|
timestampOpen: string;
|
|
467
468
|
timestampClose: string;
|
|
468
469
|
}
|
|
@@ -497,6 +498,10 @@ interface Lend {
|
|
|
497
498
|
tokenAmount: string;
|
|
498
499
|
sharesReceived: string;
|
|
499
500
|
}
|
|
501
|
+
interface MarketStatusChange {
|
|
502
|
+
market: string;
|
|
503
|
+
status: PerpetualMarketStatus;
|
|
504
|
+
}
|
|
500
505
|
interface OracleUpdate {
|
|
501
506
|
name: string;
|
|
502
507
|
price: string;
|
|
@@ -813,6 +818,9 @@ type WsMessage = {
|
|
|
813
818
|
} | {
|
|
814
819
|
type: "ReferralUpdate";
|
|
815
820
|
content: ReferralUpdate;
|
|
821
|
+
} | {
|
|
822
|
+
type: "MarketStatusChange";
|
|
823
|
+
content: MarketStatusChange;
|
|
816
824
|
};
|
|
817
825
|
|
|
818
826
|
type Address = `0x${string}`;
|
|
@@ -938,6 +946,10 @@ interface ReplaceMultipleOrdersParams {
|
|
|
938
946
|
market: string;
|
|
939
947
|
orders: PerpOrderDataForMarket[];
|
|
940
948
|
}
|
|
949
|
+
interface ClaimDepositParams {
|
|
950
|
+
userId: string;
|
|
951
|
+
tokenAddress: Address;
|
|
952
|
+
}
|
|
941
953
|
type WsOracleUpdates = Extract<WsMessage, {
|
|
942
954
|
type: 'OracleUpdates';
|
|
943
955
|
}>;
|
|
@@ -945,7 +957,7 @@ type WsUserUpdates = Extract<WsMessage, {
|
|
|
945
957
|
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate';
|
|
946
958
|
}>;
|
|
947
959
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
948
|
-
type: 'OrderbookUpdate' | 'TradesUpdate';
|
|
960
|
+
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
949
961
|
}>;
|
|
950
962
|
type WsBorrowLendUpdate = Extract<WsMessage, {
|
|
951
963
|
type: 'BorrowLendUpdate';
|
|
@@ -1090,6 +1102,7 @@ declare class Client {
|
|
|
1090
1102
|
transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1091
1103
|
ReplaceMultipleOrders(params: ReplaceMultipleOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1092
1104
|
placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1105
|
+
claimDeposit(params: ClaimDepositParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1093
1106
|
sendGetJson: (endpoint: string, message?: {
|
|
1094
1107
|
[key: string]: any;
|
|
1095
1108
|
}) => Promise<any>;
|
|
@@ -1147,4 +1160,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1147
1160
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1148
1161
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1149
1162
|
|
|
1150
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1163
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -111,7 +111,8 @@ declare enum PerpetualMarketStatus {
|
|
|
111
111
|
Halted = "halted",
|
|
112
112
|
ReduceOnly = "reduceOnly",
|
|
113
113
|
PostOnly = "postOnly",
|
|
114
|
-
Live = "live"
|
|
114
|
+
Live = "live",
|
|
115
|
+
Settled = "settled"
|
|
115
116
|
}
|
|
116
117
|
interface FundingRate {
|
|
117
118
|
enabled: boolean;
|
|
@@ -383,7 +384,6 @@ interface User {
|
|
|
383
384
|
}
|
|
384
385
|
interface GetUserDataResponse {
|
|
385
386
|
userData: User;
|
|
386
|
-
perpOrdersCount: string;
|
|
387
387
|
}
|
|
388
388
|
interface GetUserDepositsRequest {
|
|
389
389
|
userId: string;
|
|
@@ -463,6 +463,7 @@ interface HistoricalTradeStats {
|
|
|
463
463
|
tradeVolumePerp: string;
|
|
464
464
|
tradeCountSpot: string;
|
|
465
465
|
tradeCountPerp: string;
|
|
466
|
+
paidFee: string;
|
|
466
467
|
timestampOpen: string;
|
|
467
468
|
timestampClose: string;
|
|
468
469
|
}
|
|
@@ -497,6 +498,10 @@ interface Lend {
|
|
|
497
498
|
tokenAmount: string;
|
|
498
499
|
sharesReceived: string;
|
|
499
500
|
}
|
|
501
|
+
interface MarketStatusChange {
|
|
502
|
+
market: string;
|
|
503
|
+
status: PerpetualMarketStatus;
|
|
504
|
+
}
|
|
500
505
|
interface OracleUpdate {
|
|
501
506
|
name: string;
|
|
502
507
|
price: string;
|
|
@@ -813,6 +818,9 @@ type WsMessage = {
|
|
|
813
818
|
} | {
|
|
814
819
|
type: "ReferralUpdate";
|
|
815
820
|
content: ReferralUpdate;
|
|
821
|
+
} | {
|
|
822
|
+
type: "MarketStatusChange";
|
|
823
|
+
content: MarketStatusChange;
|
|
816
824
|
};
|
|
817
825
|
|
|
818
826
|
type Address = `0x${string}`;
|
|
@@ -938,6 +946,10 @@ interface ReplaceMultipleOrdersParams {
|
|
|
938
946
|
market: string;
|
|
939
947
|
orders: PerpOrderDataForMarket[];
|
|
940
948
|
}
|
|
949
|
+
interface ClaimDepositParams {
|
|
950
|
+
userId: string;
|
|
951
|
+
tokenAddress: Address;
|
|
952
|
+
}
|
|
941
953
|
type WsOracleUpdates = Extract<WsMessage, {
|
|
942
954
|
type: 'OracleUpdates';
|
|
943
955
|
}>;
|
|
@@ -945,7 +957,7 @@ type WsUserUpdates = Extract<WsMessage, {
|
|
|
945
957
|
type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'ClaimUserKickbackFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate';
|
|
946
958
|
}>;
|
|
947
959
|
type WsPerpMarketUpdates = Extract<WsMessage, {
|
|
948
|
-
type: 'OrderbookUpdate' | 'TradesUpdate';
|
|
960
|
+
type: 'OrderbookUpdate' | 'TradesUpdate' | 'MarketStatusChange';
|
|
949
961
|
}>;
|
|
950
962
|
type WsBorrowLendUpdate = Extract<WsMessage, {
|
|
951
963
|
type: 'BorrowLendUpdate';
|
|
@@ -1090,6 +1102,7 @@ declare class Client {
|
|
|
1090
1102
|
transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1091
1103
|
ReplaceMultipleOrders(params: ReplaceMultipleOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1092
1104
|
placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1105
|
+
claimDeposit(params: ClaimDepositParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
1093
1106
|
sendGetJson: (endpoint: string, message?: {
|
|
1094
1107
|
[key: string]: any;
|
|
1095
1108
|
}) => Promise<any>;
|
|
@@ -1147,4 +1160,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
1147
1160
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
1148
1161
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
1149
1162
|
|
|
1150
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
1163
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimDepositParams, type ClaimKickbackFeeParams, type ClaimReferralFee, type ClaimReferralFeesParams, type ClaimUserKickbackFee, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, type MarketStatusChange, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpOrderDataForMarket, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type ReplaceMultipleOrdersParams, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
16
16
|
|
|
17
17
|
// generated_types/addApiKey.ts
|
|
18
18
|
var ABI = {
|
|
19
|
-
"address": "
|
|
19
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
20
20
|
"name": "add_api_key",
|
|
21
21
|
"friends": [],
|
|
22
22
|
"exposed_functions": [
|
|
@@ -41,7 +41,7 @@ var addApiKey_default = ABI;
|
|
|
41
41
|
|
|
42
42
|
// generated_types/cancelAllPerpOrders.ts
|
|
43
43
|
var ABI2 = {
|
|
44
|
-
"address": "
|
|
44
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
45
45
|
"name": "cancel_all_perp_orders",
|
|
46
46
|
"friends": [],
|
|
47
47
|
"exposed_functions": [
|
|
@@ -64,7 +64,7 @@ var cancelAllPerpOrders_default = ABI2;
|
|
|
64
64
|
|
|
65
65
|
// generated_types/cancelPerpOrders.ts
|
|
66
66
|
var ABI3 = {
|
|
67
|
-
"address": "
|
|
67
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
68
68
|
"name": "cancel_perp_orders",
|
|
69
69
|
"friends": [],
|
|
70
70
|
"exposed_functions": [
|
|
@@ -89,7 +89,7 @@ var cancelPerpOrders_default = ABI3;
|
|
|
89
89
|
|
|
90
90
|
// generated_types/createUser.ts
|
|
91
91
|
var ABI4 = {
|
|
92
|
-
"address": "
|
|
92
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
93
93
|
"name": "create_user",
|
|
94
94
|
"friends": [],
|
|
95
95
|
"exposed_functions": [
|
|
@@ -114,7 +114,7 @@ var createUser_default = ABI4;
|
|
|
114
114
|
|
|
115
115
|
// generated_types/depositToVault.ts
|
|
116
116
|
var ABI5 = {
|
|
117
|
-
"address": "
|
|
117
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
118
118
|
"name": "deposit_to_vault",
|
|
119
119
|
"friends": [],
|
|
120
120
|
"exposed_functions": [
|
|
@@ -139,7 +139,7 @@ var depositToVault_default = ABI5;
|
|
|
139
139
|
|
|
140
140
|
// generated_types/depositToken.ts
|
|
141
141
|
var ABI6 = {
|
|
142
|
-
"address": "
|
|
142
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
143
143
|
"name": "deposit_token",
|
|
144
144
|
"friends": [],
|
|
145
145
|
"exposed_functions": [
|
|
@@ -164,7 +164,7 @@ var depositToken_default = ABI6;
|
|
|
164
164
|
|
|
165
165
|
// generated_types/lendToken.ts
|
|
166
166
|
var ABI7 = {
|
|
167
|
-
"address": "
|
|
167
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
168
168
|
"name": "lend_token",
|
|
169
169
|
"friends": [],
|
|
170
170
|
"exposed_functions": [
|
|
@@ -190,7 +190,7 @@ var lendToken_default = ABI7;
|
|
|
190
190
|
|
|
191
191
|
// generated_types/placePerpLimitOrder.ts
|
|
192
192
|
var ABI8 = {
|
|
193
|
-
"address": "
|
|
193
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
194
194
|
"name": "place_perp_limit_order",
|
|
195
195
|
"friends": [],
|
|
196
196
|
"exposed_functions": [
|
|
@@ -219,7 +219,7 @@ var placePerpLimitOrder_default = ABI8;
|
|
|
219
219
|
|
|
220
220
|
// generated_types/changePerpOrderPrice.ts
|
|
221
221
|
var ABI9 = {
|
|
222
|
-
"address": "
|
|
222
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
223
223
|
"name": "change_perp_order_price",
|
|
224
224
|
"friends": [],
|
|
225
225
|
"exposed_functions": [
|
|
@@ -246,7 +246,7 @@ var changePerpOrderPrice_default = ABI9;
|
|
|
246
246
|
|
|
247
247
|
// generated_types/placePerpMarketOrder.ts
|
|
248
248
|
var ABI10 = {
|
|
249
|
-
"address": "
|
|
249
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
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": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
400
400
|
"name": "transfer_to_user",
|
|
401
401
|
"friends": [],
|
|
402
402
|
"exposed_functions": [
|
|
@@ -423,7 +423,7 @@ var transferToUser_default = ABI16;
|
|
|
423
423
|
|
|
424
424
|
// generated_types/placeMultiplePerpOrders.ts
|
|
425
425
|
var ABI17 = {
|
|
426
|
-
"address": "
|
|
426
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
427
427
|
"name": "place_multiple_perp_orders",
|
|
428
428
|
"friends": [],
|
|
429
429
|
"exposed_functions": [
|
|
@@ -452,7 +452,7 @@ var placeMultiplePerpOrders_default = ABI17;
|
|
|
452
452
|
|
|
453
453
|
// generated_types/claimKickbackFee.ts
|
|
454
454
|
var ABI18 = {
|
|
455
|
-
"address": "
|
|
455
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
456
456
|
"name": "claim_kickback_fee",
|
|
457
457
|
"friends": [],
|
|
458
458
|
"exposed_functions": [
|
|
@@ -475,7 +475,7 @@ var claimKickbackFee_default = ABI18;
|
|
|
475
475
|
|
|
476
476
|
// generated_types/replaceMultipleOrders.ts
|
|
477
477
|
var ABI19 = {
|
|
478
|
-
"address": "
|
|
478
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
479
479
|
"name": "replace_multiple_orders",
|
|
480
480
|
"friends": [],
|
|
481
481
|
"exposed_functions": [
|
|
@@ -501,12 +501,37 @@ var ABI19 = {
|
|
|
501
501
|
};
|
|
502
502
|
var replaceMultipleOrders_default = ABI19;
|
|
503
503
|
|
|
504
|
+
// generated_types/claimDeposit.ts
|
|
505
|
+
var ABI20 = {
|
|
506
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
507
|
+
"name": "claim_deposit",
|
|
508
|
+
"friends": [],
|
|
509
|
+
"exposed_functions": [
|
|
510
|
+
{
|
|
511
|
+
"name": "claim_deposit",
|
|
512
|
+
"visibility": "public",
|
|
513
|
+
"is_entry": true,
|
|
514
|
+
"is_view": false,
|
|
515
|
+
"generic_type_params": [],
|
|
516
|
+
"params": [
|
|
517
|
+
"&signer",
|
|
518
|
+
"u64",
|
|
519
|
+
"0x1::object::Object<0x1::fungible_asset::Metadata>"
|
|
520
|
+
],
|
|
521
|
+
"return": []
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
"structs": []
|
|
525
|
+
};
|
|
526
|
+
var claimDeposit_default = ABI20;
|
|
527
|
+
|
|
504
528
|
// generated_types/typeshareTypes.ts
|
|
505
529
|
var PerpetualMarketStatus = /* @__PURE__ */ ((PerpetualMarketStatus2) => {
|
|
506
530
|
PerpetualMarketStatus2["Halted"] = "halted";
|
|
507
531
|
PerpetualMarketStatus2["ReduceOnly"] = "reduceOnly";
|
|
508
532
|
PerpetualMarketStatus2["PostOnly"] = "postOnly";
|
|
509
533
|
PerpetualMarketStatus2["Live"] = "live";
|
|
534
|
+
PerpetualMarketStatus2["Settled"] = "settled";
|
|
510
535
|
return PerpetualMarketStatus2;
|
|
511
536
|
})(PerpetualMarketStatus || {});
|
|
512
537
|
var ChartInterval = /* @__PURE__ */ ((ChartInterval2) => {
|
|
@@ -585,8 +610,8 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
585
610
|
})(UserStatus || {});
|
|
586
611
|
|
|
587
612
|
// generated_types/withdrawFromVault.ts
|
|
588
|
-
var
|
|
589
|
-
"address": "
|
|
613
|
+
var ABI21 = {
|
|
614
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
590
615
|
"name": "withdraw_from_vault",
|
|
591
616
|
"friends": [],
|
|
592
617
|
"exposed_functions": [
|
|
@@ -608,7 +633,7 @@ var ABI20 = {
|
|
|
608
633
|
],
|
|
609
634
|
"structs": []
|
|
610
635
|
};
|
|
611
|
-
var withdrawFromVault_default =
|
|
636
|
+
var withdrawFromVault_default = ABI21;
|
|
612
637
|
|
|
613
638
|
// src/utils.ts
|
|
614
639
|
import { Account } from "@aptos-labs/ts-sdk";
|
|
@@ -673,6 +698,8 @@ var getTopicFromMessage = (data) => {
|
|
|
673
698
|
return data.type;
|
|
674
699
|
case "OrderbookUpdate":
|
|
675
700
|
return data.content.market;
|
|
701
|
+
case "MarketStatusChange":
|
|
702
|
+
return data.content.market;
|
|
676
703
|
case "TradesUpdate":
|
|
677
704
|
return data.content.market;
|
|
678
705
|
case "BalanceChange":
|
|
@@ -1710,6 +1737,21 @@ var Client = class _Client {
|
|
|
1710
1737
|
});
|
|
1711
1738
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1712
1739
|
}
|
|
1740
|
+
async claimDeposit(params) {
|
|
1741
|
+
const aptosPayload = await generateTransactionPayload({
|
|
1742
|
+
aptosConfig: this._aptos.config,
|
|
1743
|
+
abi: parseEntryFunctionAbi({
|
|
1744
|
+
moduleAbi: claimDeposit_default,
|
|
1745
|
+
functionName: claimDeposit_default.name,
|
|
1746
|
+
moduleAddress: claimDeposit_default.address,
|
|
1747
|
+
moduleName: claimDeposit_default.name
|
|
1748
|
+
}),
|
|
1749
|
+
function: `${claimDeposit_default.address}::${claimDeposit_default.name}::claim_deposit`,
|
|
1750
|
+
typeArguments: [],
|
|
1751
|
+
functionArguments: [params.userId, params.tokenAddress]
|
|
1752
|
+
});
|
|
1753
|
+
return await this.createAndSubmitTransaction(aptosPayload);
|
|
1754
|
+
}
|
|
1713
1755
|
};
|
|
1714
1756
|
var client_default = Client;
|
|
1715
1757
|
function parseEntryFunctionAbi(args) {
|
|
@@ -1741,8 +1783,8 @@ function parseEntryFunctionAbi(args) {
|
|
|
1741
1783
|
import { createEntryPayload } from "@thalalabs/surf";
|
|
1742
1784
|
|
|
1743
1785
|
// generated_types/faucetEntrypoints.ts
|
|
1744
|
-
var
|
|
1745
|
-
"address": "
|
|
1786
|
+
var ABI22 = {
|
|
1787
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
1746
1788
|
"name": "faucet_entrypoints",
|
|
1747
1789
|
"friends": [],
|
|
1748
1790
|
"exposed_functions": [
|
|
@@ -1773,11 +1815,11 @@ var ABI21 = {
|
|
|
1773
1815
|
],
|
|
1774
1816
|
"structs": []
|
|
1775
1817
|
};
|
|
1776
|
-
var faucetEntrypoints_default =
|
|
1818
|
+
var faucetEntrypoints_default = ABI22;
|
|
1777
1819
|
|
|
1778
1820
|
// generated_types/testFaucet.ts
|
|
1779
|
-
var
|
|
1780
|
-
"address": "
|
|
1821
|
+
var ABI23 = {
|
|
1822
|
+
"address": "0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f",
|
|
1781
1823
|
"name": "test_faucet",
|
|
1782
1824
|
"friends": [],
|
|
1783
1825
|
"exposed_functions": [
|
|
@@ -1814,7 +1856,7 @@ var ABI22 = {
|
|
|
1814
1856
|
],
|
|
1815
1857
|
"return": [
|
|
1816
1858
|
"0x1::object::ConstructorRef",
|
|
1817
|
-
"0x1::object::Object<
|
|
1859
|
+
"0x1::object::Object<0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f::test_faucet::Token>"
|
|
1818
1860
|
]
|
|
1819
1861
|
},
|
|
1820
1862
|
{
|
|
@@ -1965,7 +2007,7 @@ var ABI22 = {
|
|
|
1965
2007
|
"0x1::object::Object<0x1::fungible_asset::Metadata>"
|
|
1966
2008
|
],
|
|
1967
2009
|
"return": [
|
|
1968
|
-
"
|
|
2010
|
+
"0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f::test_faucet::FaucetToken"
|
|
1969
2011
|
]
|
|
1970
2012
|
}
|
|
1971
2013
|
],
|
|
@@ -1997,7 +2039,7 @@ var ABI22 = {
|
|
|
1997
2039
|
"fields": [
|
|
1998
2040
|
{
|
|
1999
2041
|
"name": "tokens",
|
|
2000
|
-
"type": "0x1::smart_table::SmartTable<vector<u8>,
|
|
2042
|
+
"type": "0x1::smart_table::SmartTable<vector<u8>, 0xbf412ce2f8510e1b67bfb2a89e2a6488899c2375eb2ee16c48c2dfb4c2882d3f::test_faucet::FaucetToken>"
|
|
2001
2043
|
}
|
|
2002
2044
|
]
|
|
2003
2045
|
},
|
|
@@ -2022,7 +2064,7 @@ var ABI22 = {
|
|
|
2022
2064
|
}
|
|
2023
2065
|
]
|
|
2024
2066
|
};
|
|
2025
|
-
var testFaucet_default =
|
|
2067
|
+
var testFaucet_default = ABI23;
|
|
2026
2068
|
|
|
2027
2069
|
// src/testFaucet.ts
|
|
2028
2070
|
var TestFaucet = class _TestFaucet extends client_default {
|