@typus/typus-perp-sdk 1.0.66 → 1.0.68
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/src/api/sentio.d.ts +13 -2
- package/dist/src/api/sentio.js +69 -18
- package/dist/src/fetch.d.ts +4 -3
- package/dist/src/fetch.js +30 -36
- package/dist/src/index.js +16 -8
- package/dist/src/typus_perp/error/functions.d.ts +2 -0
- package/dist/src/typus_perp/error/functions.js +10 -0
- package/dist/src/typus_perp/lp-pool/functions.d.ts +60 -27
- package/dist/src/typus_perp/lp-pool/functions.js +92 -52
- package/dist/src/typus_perp/lp-pool/structs.d.ts +161 -210
- package/dist/src/typus_perp/lp-pool/structs.js +384 -284
- package/dist/src/typus_perp/trading/functions.d.ts +6 -0
- package/dist/src/typus_perp/trading/functions.js +9 -0
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +9 -0
- package/dist/src/typus_stake_pool/stake-pool/functions.js +20 -0
- package/dist/src/user/tlp.d.ts +23 -9
- package/dist/src/user/tlp.js +148 -61
- package/package.json +2 -2
package/dist/src/api/sentio.d.ts
CHANGED
|
@@ -13,7 +13,18 @@ export interface Volume {
|
|
|
13
13
|
timestamp: string;
|
|
14
14
|
value: number;
|
|
15
15
|
}
|
|
16
|
-
export declare function getTlpFeeFromSentio(): Promise<number>;
|
|
17
|
-
export declare function getTotalVolumeFromSentio(fromTimestamp: number, toTimestamp
|
|
16
|
+
export declare function getTlpFeeFromSentio(fromTimestamp: number, toTimestamp?: number): Promise<number>;
|
|
17
|
+
export declare function getTotalVolumeFromSentio(fromTimestamp: number, toTimestamp?: number): Promise<number>;
|
|
18
18
|
/** Returns Accumulated Users */
|
|
19
19
|
export declare function getAccumulatedUser(): Promise<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Inputs:
|
|
22
|
+
* fromTimestamp: number, toTimestamp?: number
|
|
23
|
+
*
|
|
24
|
+
* Returns
|
|
25
|
+
* { timestamp: string, value: number }[]
|
|
26
|
+
*/
|
|
27
|
+
export declare function getTlpPriceFromSentio(fromTimestamp: number, toTimestamp?: number): Promise<{
|
|
28
|
+
timestamp: string;
|
|
29
|
+
value: number;
|
|
30
|
+
}[]>;
|
package/dist/src/api/sentio.js
CHANGED
|
@@ -41,6 +41,7 @@ exports.getTradingVolumeFromSentio = getTradingVolumeFromSentio;
|
|
|
41
41
|
exports.getTlpFeeFromSentio = getTlpFeeFromSentio;
|
|
42
42
|
exports.getTotalVolumeFromSentio = getTotalVolumeFromSentio;
|
|
43
43
|
exports.getAccumulatedUser = getAccumulatedUser;
|
|
44
|
+
exports.getTlpPriceFromSentio = getTlpPriceFromSentio;
|
|
44
45
|
var src_1 = require("../../src");
|
|
45
46
|
var headers = {
|
|
46
47
|
"api-key": "ffJa6FwxeJNrQP8NZ5doEMXqdSA7XM6mT",
|
|
@@ -99,9 +100,7 @@ function getTradingVolumeFromSentio(fromTimestamp, interval, toTimestamp) {
|
|
|
99
100
|
return __generator(this, function (_a) {
|
|
100
101
|
switch (_a.label) {
|
|
101
102
|
case 0:
|
|
102
|
-
apiUrl =
|
|
103
|
-
? "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query"
|
|
104
|
-
: "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
103
|
+
apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query";
|
|
105
104
|
requestData = {
|
|
106
105
|
timeRange: {
|
|
107
106
|
start: "".concat(fromTimestamp),
|
|
@@ -171,19 +170,17 @@ function getTradingVolumeFromSentio(fromTimestamp, interval, toTimestamp) {
|
|
|
171
170
|
});
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
|
-
function getTlpFeeFromSentio() {
|
|
173
|
+
function getTlpFeeFromSentio(fromTimestamp, toTimestamp) {
|
|
175
174
|
return __awaiter(this, void 0, void 0, function () {
|
|
176
175
|
var apiUrl, requestData, jsonData, response, data, first, last, fee;
|
|
177
176
|
return __generator(this, function (_a) {
|
|
178
177
|
switch (_a.label) {
|
|
179
178
|
case 0:
|
|
180
|
-
apiUrl =
|
|
181
|
-
? "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query"
|
|
182
|
-
: "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
179
|
+
apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query";
|
|
183
180
|
requestData = {
|
|
184
181
|
timeRange: {
|
|
185
|
-
start: "
|
|
186
|
-
end: "now",
|
|
182
|
+
start: "".concat(fromTimestamp),
|
|
183
|
+
end: "".concat(toTimestamp !== null && toTimestamp !== void 0 ? toTimestamp : "now"),
|
|
187
184
|
step: 3600,
|
|
188
185
|
},
|
|
189
186
|
limit: 20,
|
|
@@ -233,13 +230,11 @@ function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
|
|
|
233
230
|
return __generator(this, function (_a) {
|
|
234
231
|
switch (_a.label) {
|
|
235
232
|
case 0:
|
|
236
|
-
apiUrl =
|
|
237
|
-
? "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query"
|
|
238
|
-
: "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
233
|
+
apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query";
|
|
239
234
|
requestData = {
|
|
240
235
|
timeRange: {
|
|
241
236
|
start: "".concat(fromTimestamp),
|
|
242
|
-
end: "".concat(toTimestamp),
|
|
237
|
+
end: "".concat(toTimestamp !== null && toTimestamp !== void 0 ? toTimestamp : "now"),
|
|
243
238
|
step: 3600,
|
|
244
239
|
},
|
|
245
240
|
limit: 1,
|
|
@@ -289,9 +284,7 @@ function getAccumulatedUser() {
|
|
|
289
284
|
return __generator(this, function (_a) {
|
|
290
285
|
switch (_a.label) {
|
|
291
286
|
case 0:
|
|
292
|
-
apiUrl =
|
|
293
|
-
? "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query"
|
|
294
|
-
: "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
287
|
+
apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query";
|
|
295
288
|
requestData = {
|
|
296
289
|
timeRange: {
|
|
297
290
|
start: "now-1h",
|
|
@@ -346,8 +339,66 @@ function getAccumulatedUser() {
|
|
|
346
339
|
});
|
|
347
340
|
});
|
|
348
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Inputs:
|
|
344
|
+
* fromTimestamp: number, toTimestamp?: number
|
|
345
|
+
*
|
|
346
|
+
* Returns
|
|
347
|
+
* { timestamp: string, value: number }[]
|
|
348
|
+
*/
|
|
349
|
+
function getTlpPriceFromSentio(fromTimestamp, toTimestamp) {
|
|
350
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
351
|
+
var apiUrl, requestData, jsonData, response, data, samples;
|
|
352
|
+
return __generator(this, function (_a) {
|
|
353
|
+
switch (_a.label) {
|
|
354
|
+
case 0:
|
|
355
|
+
apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp_mainnet/query";
|
|
356
|
+
requestData = {
|
|
357
|
+
timeRange: {
|
|
358
|
+
start: "".concat(fromTimestamp),
|
|
359
|
+
end: "".concat(toTimestamp !== null && toTimestamp !== void 0 ? toTimestamp : "now"),
|
|
360
|
+
step: 3600,
|
|
361
|
+
},
|
|
362
|
+
limit: 30 * 24,
|
|
363
|
+
queries: [
|
|
364
|
+
{
|
|
365
|
+
metricsQuery: {
|
|
366
|
+
query: "tlp_price",
|
|
367
|
+
alias: "",
|
|
368
|
+
id: "a",
|
|
369
|
+
labelSelector: {},
|
|
370
|
+
aggregate: null,
|
|
371
|
+
functions: [],
|
|
372
|
+
color: "",
|
|
373
|
+
disabled: false,
|
|
374
|
+
},
|
|
375
|
+
dataSource: "METRICS",
|
|
376
|
+
sourceName: "",
|
|
377
|
+
},
|
|
378
|
+
],
|
|
379
|
+
formulas: [],
|
|
380
|
+
};
|
|
381
|
+
jsonData = JSON.stringify(requestData);
|
|
382
|
+
return [4 /*yield*/, fetch(apiUrl, {
|
|
383
|
+
method: "POST",
|
|
384
|
+
headers: headers,
|
|
385
|
+
body: jsonData,
|
|
386
|
+
})];
|
|
387
|
+
case 1:
|
|
388
|
+
response = _a.sent();
|
|
389
|
+
return [4 /*yield*/, response.json()];
|
|
390
|
+
case 2:
|
|
391
|
+
data = _a.sent();
|
|
392
|
+
samples = data.results[0].matrix.samples;
|
|
393
|
+
// console.log(samples[0].values);
|
|
394
|
+
return [2 /*return*/, samples];
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
}
|
|
349
399
|
// getVolumeFromSentio();
|
|
350
|
-
// getTlpFeeFromSentio();
|
|
351
400
|
// getAccumulatedUser();
|
|
352
401
|
// getTradingVolumeFromSentio(1747008000, 1, 1747011600);
|
|
353
|
-
// getTotalVolumeFromSentio(
|
|
402
|
+
// getTotalVolumeFromSentio(1748995200);
|
|
403
|
+
// getTlpPriceFromSentio(1748995200);
|
|
404
|
+
// getTlpFeeFromSentio(1748995200);
|
package/dist/src/fetch.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Markets, SymbolMarket } from "./typus_perp/trading/structs";
|
|
2
|
-
import { LiquidityPool } from "./typus_perp/lp-pool/structs";
|
|
2
|
+
import { DeactivatingShares, LiquidityPool } from "./typus_perp/lp-pool/structs";
|
|
3
3
|
import { TradingOrder, Position } from "./typus_perp/position/structs";
|
|
4
4
|
import { LpUserShare, StakePool } from "./typus_stake_pool/stake-pool/structs";
|
|
5
5
|
import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
|
|
6
6
|
import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
|
|
7
|
+
import { TLP_TOKEN } from ".";
|
|
7
8
|
import { TypusBidReceipt } from "./_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs";
|
|
8
9
|
export declare function getLpPools(config: TypusConfig): Promise<LiquidityPool[]>;
|
|
9
10
|
export declare function getLpPool(config: TypusConfig, objectId?: string): Promise<LiquidityPool>;
|
|
@@ -20,9 +21,9 @@ export declare function getUserOrders(config: TypusConfig, user: string): Promis
|
|
|
20
21
|
export declare function getUserPositions(config: TypusConfig, user: string): Promise<Position[]>;
|
|
21
22
|
export declare function parseOptionBidReceipts(positions: Position[]): (TypusBidReceipt | null)[];
|
|
22
23
|
/**
|
|
23
|
-
* @returns [lpShare, incentives]
|
|
24
|
+
* @returns [[lpShare, incentives][], deactivatingShares[]]
|
|
24
25
|
*/
|
|
25
|
-
export declare function getUserStake(config: TypusConfig, user: string): Promise<[LpUserShare, string[]][]>;
|
|
26
|
+
export declare function getUserStake(config: TypusConfig, user: string): Promise<[[LpUserShare, string[]][], DeactivatingShares<typeof TLP_TOKEN>[]]>;
|
|
26
27
|
/**
|
|
27
28
|
* @returns [liquidationPrice, pnl(in USD)]
|
|
28
29
|
*/
|
package/dist/src/fetch.js
CHANGED
|
@@ -74,6 +74,7 @@ var utils_1 = require("@typus/typus-sdk/dist/src/utils");
|
|
|
74
74
|
var _1 = require(".");
|
|
75
75
|
var structs_5 = require("./_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs");
|
|
76
76
|
var typus_perp_1 = require("./typus_perp");
|
|
77
|
+
var functions_3 = require("./typus_perp/lp-pool/functions");
|
|
77
78
|
function getLpPools(config) {
|
|
78
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
80
|
var provider, dynamicFields, lpPools, _a, _b, field, lpPool, e_1_1;
|
|
@@ -349,11 +350,11 @@ function parseOptionBidReceipts(positions) {
|
|
|
349
350
|
});
|
|
350
351
|
}
|
|
351
352
|
/**
|
|
352
|
-
* @returns [lpShare, incentives]
|
|
353
|
+
* @returns [[lpShare, incentives][], deactivatingShares[]]
|
|
353
354
|
*/
|
|
354
355
|
function getUserStake(config, user) {
|
|
355
356
|
return __awaiter(this, void 0, void 0, function () {
|
|
356
|
-
var provider, tx, res, returnValues, reader, lpShares_1;
|
|
357
|
+
var provider, tx, res, returnValues, reader, lpShares_1, returnValues, reader, deactivatingShares_1;
|
|
357
358
|
return __generator(this, function (_a) {
|
|
358
359
|
switch (_a.label) {
|
|
359
360
|
case 0:
|
|
@@ -370,6 +371,11 @@ function getUserStake(config, user) {
|
|
|
370
371
|
index: BigInt(0),
|
|
371
372
|
user: user,
|
|
372
373
|
});
|
|
374
|
+
(0, functions_3.getUserDeactivatingShares)(tx, _1.TLP_TOKEN, {
|
|
375
|
+
registry: _1.LP_POOL,
|
|
376
|
+
index: BigInt(0),
|
|
377
|
+
user: user,
|
|
378
|
+
});
|
|
373
379
|
return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: user, transactionBlock: tx })];
|
|
374
380
|
case 1:
|
|
375
381
|
res = _a.sent();
|
|
@@ -388,14 +394,20 @@ function getUserStake(config, user) {
|
|
|
388
394
|
});
|
|
389
395
|
lpShares_1.push([lpShare, incentives]);
|
|
390
396
|
});
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
397
|
+
returnValues = res.results[2].returnValues[0][0];
|
|
398
|
+
reader = new bcs_1.BcsReader(new Uint8Array(returnValues));
|
|
399
|
+
deactivatingShares_1 = [];
|
|
400
|
+
reader.readVec(function (reader) {
|
|
401
|
+
var length = reader.readULEB();
|
|
402
|
+
var lpShare = structs_2.DeactivatingShares.bcs.read(reader);
|
|
403
|
+
// @ts-ignore
|
|
404
|
+
deactivatingShares_1.push(lpShare);
|
|
405
|
+
});
|
|
406
|
+
// console.log(deactivatingShares);
|
|
407
|
+
return [2 /*return*/, [lpShares_1, deactivatingShares_1]];
|
|
396
408
|
}
|
|
397
409
|
else {
|
|
398
|
-
return [2 /*return*/, []];
|
|
410
|
+
return [2 /*return*/, [[], []]];
|
|
399
411
|
}
|
|
400
412
|
return [2 /*return*/];
|
|
401
413
|
}
|
|
@@ -536,7 +548,7 @@ function getPositionCount(config, input) {
|
|
|
536
548
|
}
|
|
537
549
|
function getAllPositions(config, input) {
|
|
538
550
|
return __awaiter(this, void 0, void 0, function () {
|
|
539
|
-
var provider, tx, res, raw, withoutMaxPage,
|
|
551
|
+
var provider, tx, res, raw, withoutMaxPage, reader, userPositionsLen, positions, i, fields, pos;
|
|
540
552
|
var _a, _b, _c, _d;
|
|
541
553
|
return __generator(this, function (_e) {
|
|
542
554
|
switch (_e.label) {
|
|
@@ -560,38 +572,20 @@ function getAllPositions(config, input) {
|
|
|
560
572
|
return [2 /*return*/, []];
|
|
561
573
|
}
|
|
562
574
|
raw = new Uint8Array(res.results[0].returnValues[0][0]);
|
|
563
|
-
console.debug("Raw data length:", raw.length);
|
|
564
575
|
// 1) 至少要有 8 bytes 的 max_page
|
|
565
576
|
if (raw.length < 8)
|
|
566
577
|
return [2 /*return*/, []];
|
|
567
578
|
withoutMaxPage = raw.slice(0, raw.length - 8);
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
positions = [];
|
|
577
|
-
for (i = 0; i < userPositionsLen; i++) {
|
|
578
|
-
try {
|
|
579
|
-
bytes = reader.readBytes(reader.readULEB());
|
|
580
|
-
pos = structs_3.Position.fromBcs(Uint8Array.from(Array.from(bytes)));
|
|
581
|
-
positions.push(pos);
|
|
582
|
-
}
|
|
583
|
-
catch (e) {
|
|
584
|
-
console.error("Error parsing position ".concat(i, ":"), e);
|
|
585
|
-
break;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
return [2 /*return*/, positions];
|
|
589
|
-
}
|
|
590
|
-
catch (e) {
|
|
591
|
-
console.error("Error parsing positions:", e);
|
|
592
|
-
return [2 /*return*/, []];
|
|
579
|
+
reader = new bcs_1.BcsReader(withoutMaxPage);
|
|
580
|
+
userPositionsLen = reader.read8() - 1;
|
|
581
|
+
positions = [];
|
|
582
|
+
for (i = 0; i < userPositionsLen; i++) {
|
|
583
|
+
reader.read16();
|
|
584
|
+
fields = structs_3.Position.bcs.read(reader);
|
|
585
|
+
pos = structs_3.Position.fromFields(fields);
|
|
586
|
+
positions.push(pos);
|
|
593
587
|
}
|
|
594
|
-
return [2 /*return
|
|
588
|
+
return [2 /*return*/, positions];
|
|
595
589
|
}
|
|
596
590
|
});
|
|
597
591
|
});
|
package/dist/src/index.js
CHANGED
|
@@ -23,15 +23,20 @@ __exportStar(require("./user"), exports);
|
|
|
23
23
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
24
24
|
// import .env file if exists
|
|
25
25
|
dotenv_1.default.config();
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// default MAINNET
|
|
27
|
+
exports.NETWORK = process.env.NEXT_PUBLIC_CLUSTER == "testnet" ? "TESTNET" : "MAINNET";
|
|
28
|
+
// console.log(`Load .env NEXT_PUBLIC_CLUSTER: ${process.env.NEXT_PUBLIC_CLUSTER}`);
|
|
28
29
|
console.log("Initializing Typus Perp SDK for ".concat(exports.NETWORK));
|
|
30
|
+
/** Register the MVR plugin globally */
|
|
31
|
+
var transactions_1 = require("@mysten/sui/transactions");
|
|
32
|
+
var mvrPlugin = exports.NETWORK == "MAINNET" ? "https://mainnet.mvr.mystenlabs.com" : "https://testnet.mvr.mystenlabs.com";
|
|
33
|
+
var plugin = (0, transactions_1.namedPackagesPlugin)({ url: mvrPlugin });
|
|
34
|
+
/** Register the MVR plugin globally (once) for our PTB construction */
|
|
35
|
+
transactions_1.Transaction.registerGlobalSerializationPlugin("namedPackagesPlugin", plugin);
|
|
29
36
|
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
30
37
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
31
38
|
: "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
|
|
32
|
-
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
33
|
-
? "0xb7e4416296bb3629547b5a0ab24dec17851760eca393c58fb62edbab71c76fa2"
|
|
34
|
-
: "0x15844f80fb085bb8fd7cc688ade6282cd6991209eae78934ca001dced8b1b7de";
|
|
39
|
+
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0xaf238f806cef5e86018f9b7243f46b960af84d32a90edb551cb81437b00c1927" : "@typus/perp";
|
|
35
40
|
exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
36
41
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
37
42
|
: "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
|
|
@@ -39,8 +44,8 @@ exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
|
39
44
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
40
45
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
41
46
|
exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
42
|
-
? "
|
|
43
|
-
: "
|
|
47
|
+
? "0xf980a07d67e379e8d2fa4cfcb24a765df0fc2c09b70be12ff681dcfd6b2b56ac"
|
|
48
|
+
: "0xf8fa4a303118328de2fb53f49a043fa5bf58b84f372db0d1e7cf7b1f1a47d10e";
|
|
44
49
|
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
45
50
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
46
51
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
@@ -58,6 +63,7 @@ exports.LIQUIDITY_POOL_0 = exports.NETWORK == "MAINNET"
|
|
|
58
63
|
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
59
64
|
? "0xc969d946a2b6b917a83b5fb71765793c4a52149e50d2c8cf5c01d7421fc7cd73"
|
|
60
65
|
: "0xed48f046dc88c49eb01d59669e29eb3006173b66445facb88de277bec2913687";
|
|
66
|
+
// MARKET_0 = 0x442cc2c27cadaf287a5f4413967b4dacc6532bc9063875efbc7b178e5add3e4e
|
|
61
67
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
62
68
|
? "0xa12c282a068328833ec4a9109fc77803ec1f523f8da1bb0f82bac8450335f0c9"
|
|
63
69
|
: "0x80f739d013b365055540346d3b081b19369d6ba83d1ed6291be7a066e0a3c25f";
|
|
@@ -81,4 +87,6 @@ exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET"
|
|
|
81
87
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
82
88
|
? "0xdf3ed1599218b2415b2cd7fa06296f7f647676019b2873ec18e55a626c584f1b"
|
|
83
89
|
: "0xafb81680b9ac3d627eb733154c43d34e3ec758cf8e00a55c384df2c8150f7881";
|
|
84
|
-
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
90
|
+
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
91
|
+
? "0x36056abf9adde86f81667dad680a8ac98868c9fc1cb4d519fd2222d5d4522906"
|
|
92
|
+
: "0xbc3914cd777d009afc05e81cd6d006428ce742569c795b0bac493c1b0ef58559";
|
|
@@ -12,6 +12,7 @@ export declare function bidReceiptNotExpired(tx: Transaction, published_at?: str
|
|
|
12
12
|
export declare function bidReceiptNotItm(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
13
13
|
export declare function bidTokenMismatched(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
14
14
|
export declare function collateralTokenTypeMismatched(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
15
|
+
export declare function deactivatingSharesAlreadyExisted(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
15
16
|
export declare function depositAmountInsufficient(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
16
17
|
export declare function depositTokenMismatched(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
17
18
|
export declare function exceedMaxLeverage(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -65,6 +66,7 @@ export declare function tvlNotYetUpdated(tx: Transaction, published_at?: string)
|
|
|
65
66
|
export declare function unauthorized(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
66
67
|
export declare function unsupportedOrderTypeTag(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
67
68
|
export declare function unsupportedProcessStatusCode(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
69
|
+
export declare function userDeactivatingSharesNotExisted(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
68
70
|
export declare function userMismatched(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
69
71
|
export declare function wrongCollateralType(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
70
72
|
export declare function zeroPrice(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -13,6 +13,7 @@ exports.bidReceiptNotExpired = bidReceiptNotExpired;
|
|
|
13
13
|
exports.bidReceiptNotItm = bidReceiptNotItm;
|
|
14
14
|
exports.bidTokenMismatched = bidTokenMismatched;
|
|
15
15
|
exports.collateralTokenTypeMismatched = collateralTokenTypeMismatched;
|
|
16
|
+
exports.deactivatingSharesAlreadyExisted = deactivatingSharesAlreadyExisted;
|
|
16
17
|
exports.depositAmountInsufficient = depositAmountInsufficient;
|
|
17
18
|
exports.depositTokenMismatched = depositTokenMismatched;
|
|
18
19
|
exports.exceedMaxLeverage = exceedMaxLeverage;
|
|
@@ -66,6 +67,7 @@ exports.tvlNotYetUpdated = tvlNotYetUpdated;
|
|
|
66
67
|
exports.unauthorized = unauthorized;
|
|
67
68
|
exports.unsupportedOrderTypeTag = unsupportedOrderTypeTag;
|
|
68
69
|
exports.unsupportedProcessStatusCode = unsupportedProcessStatusCode;
|
|
70
|
+
exports.userDeactivatingSharesNotExisted = userDeactivatingSharesNotExisted;
|
|
69
71
|
exports.userMismatched = userMismatched;
|
|
70
72
|
exports.wrongCollateralType = wrongCollateralType;
|
|
71
73
|
exports.zeroPrice = zeroPrice;
|
|
@@ -123,6 +125,10 @@ function collateralTokenTypeMismatched(tx, published_at) {
|
|
|
123
125
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
124
126
|
return tx.moveCall({ target: "".concat(published_at, "::error::collateral_token_type_mismatched"), arguments: [] });
|
|
125
127
|
}
|
|
128
|
+
function deactivatingSharesAlreadyExisted(tx, published_at) {
|
|
129
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
130
|
+
return tx.moveCall({ target: "".concat(published_at, "::error::deactivating_shares_already_existed"), arguments: [] });
|
|
131
|
+
}
|
|
126
132
|
function depositAmountInsufficient(tx, published_at) {
|
|
127
133
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
128
134
|
return tx.moveCall({ target: "".concat(published_at, "::error::deposit_amount_insufficient"), arguments: [] });
|
|
@@ -335,6 +341,10 @@ function unsupportedProcessStatusCode(tx, published_at) {
|
|
|
335
341
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
336
342
|
return tx.moveCall({ target: "".concat(published_at, "::error::unsupported_process_status_code"), arguments: [] });
|
|
337
343
|
}
|
|
344
|
+
function userDeactivatingSharesNotExisted(tx, published_at) {
|
|
345
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
346
|
+
return tx.moveCall({ target: "".concat(published_at, "::error::user_deactivating_shares_not_existed"), arguments: [] });
|
|
347
|
+
}
|
|
338
348
|
function userMismatched(tx, published_at) {
|
|
339
349
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
340
350
|
return tx.moveCall({ target: "".concat(published_at, "::error::user_mismatched"), arguments: [] });
|
|
@@ -35,6 +35,16 @@ export interface BurnLpArgs {
|
|
|
35
35
|
clock: TransactionObjectInput;
|
|
36
36
|
}
|
|
37
37
|
export declare function burnLp(tx: Transaction, typeArgs: [string, string], args: BurnLpArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
38
|
+
export interface BurnLp_Args {
|
|
39
|
+
version: TransactionObjectInput;
|
|
40
|
+
registry: TransactionObjectInput;
|
|
41
|
+
index: bigint | TransactionArgument;
|
|
42
|
+
treasuryCaps: TransactionObjectInput;
|
|
43
|
+
oracle: TransactionObjectInput;
|
|
44
|
+
burnLpBalance: TransactionObjectInput;
|
|
45
|
+
clock: TransactionObjectInput;
|
|
46
|
+
}
|
|
47
|
+
export declare function burnLp_(tx: Transaction, typeArgs: [string, string], args: BurnLp_Args, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
38
48
|
export interface CalculateBurnLpArgs {
|
|
39
49
|
registry: TransactionObjectInput;
|
|
40
50
|
index: bigint | TransactionArgument;
|
|
@@ -91,6 +101,15 @@ export interface CheckTvlUpdatedArgs {
|
|
|
91
101
|
clock: TransactionObjectInput;
|
|
92
102
|
}
|
|
93
103
|
export declare function checkTvlUpdated(tx: Transaction, args: CheckTvlUpdatedArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
104
|
+
export interface ClaimArgs {
|
|
105
|
+
version: TransactionObjectInput;
|
|
106
|
+
registry: TransactionObjectInput;
|
|
107
|
+
index: bigint | TransactionArgument;
|
|
108
|
+
treasuryCaps: TransactionObjectInput;
|
|
109
|
+
oracle: TransactionObjectInput;
|
|
110
|
+
clock: TransactionObjectInput;
|
|
111
|
+
}
|
|
112
|
+
export declare function claim(tx: Transaction, typeArgs: [string, string], args: ClaimArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
94
113
|
export interface CompleteRemoveLiquidityTokenProcessArgs {
|
|
95
114
|
version: TransactionObjectInput;
|
|
96
115
|
registry: TransactionObjectInput;
|
|
@@ -98,14 +117,13 @@ export interface CompleteRemoveLiquidityTokenProcessArgs {
|
|
|
98
117
|
process: TransactionObjectInput;
|
|
99
118
|
}
|
|
100
119
|
export declare function completeRemoveLiquidityTokenProcess(tx: Transaction, typeArg: string, args: CompleteRemoveLiquidityTokenProcessArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
101
|
-
export interface
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
clock: TransactionObjectInput;
|
|
106
|
-
depositAmount: bigint | TransactionArgument;
|
|
120
|
+
export interface CreateDeactivatingSharesArgs {
|
|
121
|
+
version: TransactionObjectInput;
|
|
122
|
+
registry: TransactionObjectInput;
|
|
123
|
+
index: bigint | TransactionArgument;
|
|
107
124
|
}
|
|
108
|
-
export declare function
|
|
125
|
+
export declare function createDeactivatingShares(tx: Transaction, typeArg: string, args: CreateDeactivatingSharesArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
126
|
+
export declare function deprecated(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
109
127
|
export declare function getBorrowRateDecimal(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
110
128
|
export interface GetCumulativeBorrowRateArgs {
|
|
111
129
|
liquidityPool: TransactionObjectInput;
|
|
@@ -172,17 +190,27 @@ export interface GetTokenPoolStateArgs {
|
|
|
172
190
|
}
|
|
173
191
|
export declare function getTokenPoolState(tx: Transaction, args: GetTokenPoolStateArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
174
192
|
export declare function getTvlUsd(tx: Transaction, liquidityPool: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
193
|
+
export interface GetUserDeactivatingSharesArgs {
|
|
194
|
+
registry: TransactionObjectInput;
|
|
195
|
+
index: bigint | TransactionArgument;
|
|
196
|
+
user: string | TransactionArgument;
|
|
197
|
+
}
|
|
198
|
+
export declare function getUserDeactivatingShares(tx: Transaction, typeArg: string, args: GetUserDeactivatingSharesArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
175
199
|
export declare function init(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
176
|
-
export interface
|
|
200
|
+
export interface ManagerEmergencyDepositArgs {
|
|
177
201
|
version: TransactionObjectInput;
|
|
178
202
|
registry: TransactionObjectInput;
|
|
179
203
|
index: bigint | TransactionArgument;
|
|
180
|
-
|
|
181
|
-
scallopMarket: TransactionObjectInput;
|
|
182
|
-
clock: TransactionObjectInput;
|
|
183
|
-
lendingAmount: bigint | TransactionArgument | TransactionArgument | null;
|
|
204
|
+
coin: TransactionObjectInput;
|
|
184
205
|
}
|
|
185
|
-
export declare function
|
|
206
|
+
export declare function managerEmergencyDeposit(tx: Transaction, typeArgs: [string, string], args: ManagerEmergencyDepositArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
207
|
+
export interface ManagerEmergencyWithdrawArgs {
|
|
208
|
+
version: TransactionObjectInput;
|
|
209
|
+
registry: TransactionObjectInput;
|
|
210
|
+
index: bigint | TransactionArgument;
|
|
211
|
+
receipt: TransactionObjectInput;
|
|
212
|
+
}
|
|
213
|
+
export declare function managerEmergencyWithdraw(tx: Transaction, typeArgs: [string, string], args: ManagerEmergencyWithdrawArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
186
214
|
export interface ManagerFlashRemoveLiquidityArgs {
|
|
187
215
|
version: TransactionObjectInput;
|
|
188
216
|
registry: TransactionObjectInput;
|
|
@@ -202,16 +230,14 @@ export interface ManagerFlashRepayLiquidityArgs {
|
|
|
202
230
|
clock: TransactionObjectInput;
|
|
203
231
|
}
|
|
204
232
|
export declare function managerFlashRepayLiquidity(tx: Transaction, typeArg: string, args: ManagerFlashRepayLiquidityArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
205
|
-
export interface
|
|
233
|
+
export interface ManagerHotfixBurnLpArgs {
|
|
206
234
|
version: TransactionObjectInput;
|
|
207
235
|
registry: TransactionObjectInput;
|
|
208
236
|
index: bigint | TransactionArgument;
|
|
209
|
-
|
|
210
|
-
scallopMarket: TransactionObjectInput;
|
|
237
|
+
oracle: TransactionObjectInput;
|
|
211
238
|
clock: TransactionObjectInput;
|
|
212
|
-
withdrawAmount: bigint | TransactionArgument | TransactionArgument | null;
|
|
213
239
|
}
|
|
214
|
-
export declare function
|
|
240
|
+
export declare function managerHotfixBurnLp(tx: Transaction, typeArg: string, args: ManagerHotfixBurnLpArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
215
241
|
export interface MintLpArgs {
|
|
216
242
|
version: TransactionObjectInput;
|
|
217
243
|
registry: TransactionObjectInput;
|
|
@@ -226,6 +252,7 @@ export interface NewLiquidityPoolArgs {
|
|
|
226
252
|
version: TransactionObjectInput;
|
|
227
253
|
registry: TransactionObjectInput;
|
|
228
254
|
lpTokenDecimal: bigint | TransactionArgument;
|
|
255
|
+
unlockCountdownTsMs: bigint | TransactionArgument;
|
|
229
256
|
}
|
|
230
257
|
export declare function newLiquidityPool(tx: Transaction, typeArg: string, args: NewLiquidityPoolArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
231
258
|
export interface OracleMatchedArgs {
|
|
@@ -253,6 +280,14 @@ export interface PutReceiptCollateralsArgs {
|
|
|
253
280
|
unsettledBidReceipts: Array<TransactionObjectInput> | TransactionArgument;
|
|
254
281
|
}
|
|
255
282
|
export declare function putReceiptCollaterals(tx: Transaction, args: PutReceiptCollateralsArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
283
|
+
export interface RedeemArgs {
|
|
284
|
+
version: TransactionObjectInput;
|
|
285
|
+
registry: TransactionObjectInput;
|
|
286
|
+
index: bigint | TransactionArgument;
|
|
287
|
+
balance: TransactionObjectInput;
|
|
288
|
+
clock: TransactionObjectInput;
|
|
289
|
+
}
|
|
290
|
+
export declare function redeem(tx: Transaction, typeArg: string, args: RedeemArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
256
291
|
export interface RequestCollateralArgs {
|
|
257
292
|
liquidityPool: TransactionObjectInput;
|
|
258
293
|
collateralAmount: bigint | TransactionArgument;
|
|
@@ -372,6 +407,13 @@ export interface UpdateTvlArgs {
|
|
|
372
407
|
clock: TransactionObjectInput;
|
|
373
408
|
}
|
|
374
409
|
export declare function updateTvl(tx: Transaction, args: UpdateTvlArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
410
|
+
export interface UpdateUnlockCountdownTsMsArgs {
|
|
411
|
+
version: TransactionObjectInput;
|
|
412
|
+
registry: TransactionObjectInput;
|
|
413
|
+
index: bigint | TransactionArgument;
|
|
414
|
+
unlockCountdownTsMs: bigint | TransactionArgument;
|
|
415
|
+
}
|
|
416
|
+
export declare function updateUnlockCountdownTsMs(tx: Transaction, args: UpdateUnlockCountdownTsMsArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
375
417
|
export interface ViewSwapResultArgs {
|
|
376
418
|
version: TransactionObjectInput;
|
|
377
419
|
registry: TransactionObjectInput;
|
|
@@ -382,12 +424,3 @@ export interface ViewSwapResultArgs {
|
|
|
382
424
|
clock: TransactionObjectInput;
|
|
383
425
|
}
|
|
384
426
|
export declare function viewSwapResult(tx: Transaction, typeArgs: [string, string], args: ViewSwapResultArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
385
|
-
export interface WithdrawScallopBasicArgs {
|
|
386
|
-
version: TransactionObjectInput;
|
|
387
|
-
liquidityPool: TransactionObjectInput;
|
|
388
|
-
scallopVersion: TransactionObjectInput;
|
|
389
|
-
scallopMarket: TransactionObjectInput;
|
|
390
|
-
clock: TransactionObjectInput;
|
|
391
|
-
withdrawAmount: bigint | TransactionArgument;
|
|
392
|
-
}
|
|
393
|
-
export declare function withdrawScallopBasic(tx: Transaction, typeArg: string, args: WithdrawScallopBasicArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|