@typus/typus-perp-sdk 1.0.60 → 1.0.61-upgrade-zero-col
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/_framework/util.d.ts +1 -1
- package/dist/src/fetch.d.ts +16 -3
- package/dist/src/fetch.js +139 -8
- package/dist/src/index.js +7 -4
- 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 +30 -0
- package/dist/src/typus_perp/trading/functions.js +47 -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
|
@@ -24,7 +24,7 @@ export declare function obj(tx: Transaction, arg: TransactionObjectInput): {
|
|
|
24
24
|
} | ((tx: Transaction) => Exclude<import("valibot").InferInput<typeof import("@mysten/sui/transactions").Argument>, {
|
|
25
25
|
Input: unknown;
|
|
26
26
|
type?: "pure";
|
|
27
|
-
}>)
|
|
27
|
+
}>) | import("@mysten/sui/dist/cjs/transactions/Transaction").AsyncTransactionThunk<import("@mysten/sui/dist/cjs/transactions/Transaction").TransactionResultArgument>;
|
|
28
28
|
export declare function pure(tx: Transaction, arg: PureArg, type: string): TransactionArgument;
|
|
29
29
|
export declare function option(tx: Transaction, type: string, arg: GenericArg | null): TransactionArgument;
|
|
30
30
|
export declare function generic(tx: Transaction, type: string, arg: GenericArg): TransactionArgument;
|
package/dist/src/fetch.d.ts
CHANGED
|
@@ -1,8 +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
|
+
import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
|
|
5
6
|
import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
|
|
7
|
+
import { TLP_TOKEN } from ".";
|
|
6
8
|
import { TypusBidReceipt } from "./_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs";
|
|
7
9
|
export declare function getLpPools(config: TypusConfig): Promise<LiquidityPool[]>;
|
|
8
10
|
export declare function getLpPool(config: TypusConfig, objectId?: string): Promise<LiquidityPool>;
|
|
@@ -19,9 +21,9 @@ export declare function getUserOrders(config: TypusConfig, user: string): Promis
|
|
|
19
21
|
export declare function getUserPositions(config: TypusConfig, user: string): Promise<Position[]>;
|
|
20
22
|
export declare function parseOptionBidReceipts(positions: Position[]): (TypusBidReceipt | null)[];
|
|
21
23
|
/**
|
|
22
|
-
* @returns [lpShare, incentives]
|
|
24
|
+
* @returns [[lpShare, incentives][], deactivatingShares[]]
|
|
23
25
|
*/
|
|
24
|
-
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>[]]>;
|
|
25
27
|
/**
|
|
26
28
|
* @returns [liquidationPrice, pnl(in USD)]
|
|
27
29
|
*/
|
|
@@ -29,3 +31,14 @@ export declare function getLiquidationPriceAndPnl(config: TypusConfig, pythClien
|
|
|
29
31
|
positions: Position[];
|
|
30
32
|
user: string;
|
|
31
33
|
}): Promise<(string | number)[][] | undefined>;
|
|
34
|
+
export declare function getPositionCount(config: TypusConfig, input: {
|
|
35
|
+
baseToken: TOKEN;
|
|
36
|
+
}): Promise<number>;
|
|
37
|
+
export declare function getAllPositions(config: TypusConfig, input: {
|
|
38
|
+
baseToken: TOKEN;
|
|
39
|
+
slice: string;
|
|
40
|
+
page: string;
|
|
41
|
+
}): Promise<Position[]>;
|
|
42
|
+
export declare function getAllPositionsWithTradingSymbol(config: TypusConfig, input: {
|
|
43
|
+
baseToken: TOKEN;
|
|
44
|
+
}): Promise<Position[]>;
|
package/dist/src/fetch.js
CHANGED
|
@@ -57,6 +57,9 @@ exports.getUserPositions = getUserPositions;
|
|
|
57
57
|
exports.parseOptionBidReceipts = parseOptionBidReceipts;
|
|
58
58
|
exports.getUserStake = getUserStake;
|
|
59
59
|
exports.getLiquidationPriceAndPnl = getLiquidationPriceAndPnl;
|
|
60
|
+
exports.getPositionCount = getPositionCount;
|
|
61
|
+
exports.getAllPositions = getAllPositions;
|
|
62
|
+
exports.getAllPositionsWithTradingSymbol = getAllPositionsWithTradingSymbol;
|
|
60
63
|
var client_1 = require("@mysten/sui/client");
|
|
61
64
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
62
65
|
var bcs_1 = require("@mysten/bcs");
|
|
@@ -71,6 +74,7 @@ var utils_1 = require("@typus/typus-sdk/dist/src/utils");
|
|
|
71
74
|
var _1 = require(".");
|
|
72
75
|
var structs_5 = require("./_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs");
|
|
73
76
|
var typus_perp_1 = require("./typus_perp");
|
|
77
|
+
var functions_3 = require("./typus_perp/lp-pool/functions");
|
|
74
78
|
function getLpPools(config) {
|
|
75
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
76
80
|
var provider, dynamicFields, lpPools, _a, _b, field, lpPool, e_1_1;
|
|
@@ -346,11 +350,11 @@ function parseOptionBidReceipts(positions) {
|
|
|
346
350
|
});
|
|
347
351
|
}
|
|
348
352
|
/**
|
|
349
|
-
* @returns [lpShare, incentives]
|
|
353
|
+
* @returns [[lpShare, incentives][], deactivatingShares[]]
|
|
350
354
|
*/
|
|
351
355
|
function getUserStake(config, user) {
|
|
352
356
|
return __awaiter(this, void 0, void 0, function () {
|
|
353
|
-
var provider, tx, res, returnValues, reader, lpShares_1;
|
|
357
|
+
var provider, tx, res, returnValues, reader, lpShares_1, returnValues, reader, deactivatingShares_1;
|
|
354
358
|
return __generator(this, function (_a) {
|
|
355
359
|
switch (_a.label) {
|
|
356
360
|
case 0:
|
|
@@ -367,6 +371,11 @@ function getUserStake(config, user) {
|
|
|
367
371
|
index: BigInt(0),
|
|
368
372
|
user: user,
|
|
369
373
|
});
|
|
374
|
+
(0, functions_3.getUserDeactivatingShares)(tx, _1.TLP_TOKEN, {
|
|
375
|
+
registry: _1.LP_POOL,
|
|
376
|
+
index: BigInt(0),
|
|
377
|
+
user: user,
|
|
378
|
+
});
|
|
370
379
|
return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: user, transactionBlock: tx })];
|
|
371
380
|
case 1:
|
|
372
381
|
res = _a.sent();
|
|
@@ -387,14 +396,20 @@ function getUserStake(config, user) {
|
|
|
387
396
|
});
|
|
388
397
|
lpShares_1.push([lpShare, incentives]);
|
|
389
398
|
});
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
399
|
+
returnValues = res.results[2].returnValues[0][0];
|
|
400
|
+
reader = new bcs_1.BcsReader(new Uint8Array(returnValues));
|
|
401
|
+
deactivatingShares_1 = [];
|
|
402
|
+
reader.readVec(function (reader) {
|
|
403
|
+
var length = reader.readULEB();
|
|
404
|
+
var lpShare = structs_2.DeactivatingShares.bcs.read(reader);
|
|
405
|
+
// @ts-ignore
|
|
406
|
+
deactivatingShares_1.push(lpShare);
|
|
407
|
+
});
|
|
408
|
+
// console.log(deactivatingShares);
|
|
409
|
+
return [2 /*return*/, [lpShares_1, deactivatingShares_1]];
|
|
395
410
|
}
|
|
396
411
|
else {
|
|
397
|
-
return [2 /*return*/, []];
|
|
412
|
+
return [2 /*return*/, [[], []]];
|
|
398
413
|
}
|
|
399
414
|
return [2 /*return*/];
|
|
400
415
|
}
|
|
@@ -493,3 +508,119 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
|
|
|
493
508
|
});
|
|
494
509
|
});
|
|
495
510
|
}
|
|
511
|
+
function getPositionCount(config, input) {
|
|
512
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
513
|
+
var provider, tx, res, raw, maxPageBytes, view, maxPage;
|
|
514
|
+
var _a, _b, _c, _d;
|
|
515
|
+
return __generator(this, function (_e) {
|
|
516
|
+
switch (_e.label) {
|
|
517
|
+
case 0:
|
|
518
|
+
provider = new client_1.SuiClient({ url: config.rpcEndpoint });
|
|
519
|
+
tx = new transactions_1.Transaction();
|
|
520
|
+
// Rust 實作是呼叫 get_all_positions(slice = 1, page = 1) 然後取最後 8 bytes。
|
|
521
|
+
// 這裡直接複用相同邏輯,只需要 max_page。
|
|
522
|
+
(0, functions_1.getAllPositions)(tx, constants_1.tokenType[_1.NETWORK][input.baseToken], {
|
|
523
|
+
version: _1.PERP_VERSION,
|
|
524
|
+
registry: _1.MARKET,
|
|
525
|
+
marketIndex: BigInt(0),
|
|
526
|
+
slice: BigInt(1),
|
|
527
|
+
page: BigInt(1),
|
|
528
|
+
});
|
|
529
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
530
|
+
sender: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
531
|
+
transactionBlock: tx,
|
|
532
|
+
})];
|
|
533
|
+
case 1:
|
|
534
|
+
res = _e.sent();
|
|
535
|
+
// 沒有資料時,回傳 0
|
|
536
|
+
if (!((_d = (_c = (_b = (_a = res.results) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.returnValues) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d[0])) {
|
|
537
|
+
return [2 /*return*/, 0];
|
|
538
|
+
}
|
|
539
|
+
raw = new Uint8Array(res.results[0].returnValues[0][0]);
|
|
540
|
+
// 至少要含 8 bytes 的 max_page;不足代表無 Position
|
|
541
|
+
if (raw.length < 8)
|
|
542
|
+
return [2 /*return*/, 0];
|
|
543
|
+
maxPageBytes = raw.slice(raw.length - 8);
|
|
544
|
+
view = new DataView(maxPageBytes.buffer, maxPageBytes.byteOffset, 8);
|
|
545
|
+
maxPage = Number(view.getBigUint64(0, true));
|
|
546
|
+
return [2 /*return*/, maxPage];
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
function getAllPositions(config, input) {
|
|
552
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
553
|
+
var provider, tx, res, raw, withoutMaxPage, reader, userPositionsLen, positions, i, fields, pos;
|
|
554
|
+
var _a, _b, _c, _d;
|
|
555
|
+
return __generator(this, function (_e) {
|
|
556
|
+
switch (_e.label) {
|
|
557
|
+
case 0:
|
|
558
|
+
provider = new client_1.SuiClient({ url: config.rpcEndpoint });
|
|
559
|
+
tx = new transactions_1.Transaction();
|
|
560
|
+
(0, functions_1.getAllPositions)(tx, constants_1.tokenType[_1.NETWORK][input.baseToken], {
|
|
561
|
+
version: _1.PERP_VERSION,
|
|
562
|
+
registry: _1.MARKET,
|
|
563
|
+
marketIndex: BigInt(0),
|
|
564
|
+
slice: BigInt(input.slice),
|
|
565
|
+
page: BigInt(input.page),
|
|
566
|
+
});
|
|
567
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
568
|
+
sender: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
569
|
+
transactionBlock: tx,
|
|
570
|
+
})];
|
|
571
|
+
case 1:
|
|
572
|
+
res = _e.sent();
|
|
573
|
+
console.log(res);
|
|
574
|
+
if (!((_d = (_c = (_b = (_a = res.results) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.returnValues) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d[0])) {
|
|
575
|
+
return [2 /*return*/, []];
|
|
576
|
+
}
|
|
577
|
+
raw = new Uint8Array(res.results[0].returnValues[0][0]);
|
|
578
|
+
// 1) 至少要有 8 bytes 的 max_page
|
|
579
|
+
if (raw.length < 8)
|
|
580
|
+
return [2 /*return*/, []];
|
|
581
|
+
withoutMaxPage = raw.slice(0, raw.length - 8);
|
|
582
|
+
reader = new bcs_1.BcsReader(withoutMaxPage);
|
|
583
|
+
userPositionsLen = reader.read8() - 1;
|
|
584
|
+
positions = [];
|
|
585
|
+
for (i = 0; i < userPositionsLen; i++) {
|
|
586
|
+
reader.read16();
|
|
587
|
+
fields = structs_3.Position.bcs.read(reader);
|
|
588
|
+
pos = structs_3.Position.fromFields(fields);
|
|
589
|
+
positions.push(pos);
|
|
590
|
+
}
|
|
591
|
+
return [2 /*return*/, positions];
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
function getAllPositionsWithTradingSymbol(config, input) {
|
|
597
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
598
|
+
var total, slice, pages, pagePromises, page, results;
|
|
599
|
+
return __generator(this, function (_a) {
|
|
600
|
+
switch (_a.label) {
|
|
601
|
+
case 0: return [4 /*yield*/, getPositionCount(config, { baseToken: input.baseToken })];
|
|
602
|
+
case 1:
|
|
603
|
+
total = _a.sent();
|
|
604
|
+
// 2) 若無倉位直接回傳 []
|
|
605
|
+
if (total === 0) {
|
|
606
|
+
return [2 /*return*/, []];
|
|
607
|
+
}
|
|
608
|
+
slice = Math.min(total, 100);
|
|
609
|
+
pages = Math.ceil(total / slice);
|
|
610
|
+
pagePromises = [];
|
|
611
|
+
for (page = 1; page <= pages; page++) {
|
|
612
|
+
pagePromises.push(getAllPositions(config, {
|
|
613
|
+
baseToken: input.baseToken,
|
|
614
|
+
slice: slice.toString(),
|
|
615
|
+
page: page.toString(),
|
|
616
|
+
}));
|
|
617
|
+
}
|
|
618
|
+
return [4 /*yield*/, Promise.all(pagePromises)];
|
|
619
|
+
case 2:
|
|
620
|
+
results = _a.sent();
|
|
621
|
+
// 5) 扁平化後回傳
|
|
622
|
+
return [2 /*return*/, results.flat()];
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
}
|
package/dist/src/index.js
CHANGED
|
@@ -30,8 +30,8 @@ exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
|
30
30
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
31
31
|
: "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
|
|
32
32
|
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
33
|
-
? "
|
|
34
|
-
: "
|
|
33
|
+
? "0xb7e4416296bb3629547b5a0ab24dec17851760eca393c58fb62edbab71c76fa2"
|
|
34
|
+
: "0x9c3b77c0e3259ec2695826d9e1bd80b33d2c68fb555e206ff4372d6ed81c6303";
|
|
35
35
|
exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
36
36
|
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
37
37
|
: "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
|
|
@@ -40,7 +40,7 @@ exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
|
40
40
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
41
41
|
exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
42
42
|
? "0xd9965c09d5ad7d69306b7c550b3b135d94b34f98c3adc379a7333fff2f05808b"
|
|
43
|
-
: "
|
|
43
|
+
: "0xf8fa4a303118328de2fb53f49a043fa5bf58b84f372db0d1e7cf7b1f1a47d10e";
|
|
44
44
|
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
45
45
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
46
46
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
@@ -58,6 +58,7 @@ exports.LIQUIDITY_POOL_0 = exports.NETWORK == "MAINNET"
|
|
|
58
58
|
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
59
59
|
? "0xc969d946a2b6b917a83b5fb71765793c4a52149e50d2c8cf5c01d7421fc7cd73"
|
|
60
60
|
: "0xed48f046dc88c49eb01d59669e29eb3006173b66445facb88de277bec2913687";
|
|
61
|
+
// MARKET_0 = 0x442cc2c27cadaf287a5f4413967b4dacc6532bc9063875efbc7b178e5add3e4e
|
|
61
62
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
62
63
|
? "0xa12c282a068328833ec4a9109fc77803ec1f523f8da1bb0f82bac8450335f0c9"
|
|
63
64
|
: "0x80f739d013b365055540346d3b081b19369d6ba83d1ed6291be7a066e0a3c25f";
|
|
@@ -81,4 +82,6 @@ exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET"
|
|
|
81
82
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
82
83
|
? "0xdf3ed1599218b2415b2cd7fa06296f7f647676019b2873ec18e55a626c584f1b"
|
|
83
84
|
: "0xafb81680b9ac3d627eb733154c43d34e3ec758cf8e00a55c384df2c8150f7881";
|
|
84
|
-
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
85
|
+
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
86
|
+
? "0x36056abf9adde86f81667dad680a8ac98868c9fc1cb4d519fd2222d5d4522906"
|
|
87
|
+
: "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;
|