@typus/typus-perp-sdk 1.0.61-ut-upgrade → 1.0.61-ut-upgrade-b
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/fetch.d.ts +0 -6
- package/dist/src/fetch.js +0 -46
- package/dist/src/index.js +4 -6
- package/dist/src/typus_perp/error/functions.d.ts +0 -2
- package/dist/src/typus_perp/error/functions.js +0 -10
- package/dist/src/typus_perp/lp-pool/functions.d.ts +31 -44
- package/dist/src/typus_perp/lp-pool/functions.js +56 -69
- package/dist/src/typus_perp/lp-pool/structs.d.ts +210 -161
- package/dist/src/typus_perp/lp-pool/structs.js +284 -384
- package/dist/src/typus_perp/trading/functions.d.ts +0 -30
- package/dist/src/typus_perp/trading/functions.js +0 -47
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -9
- package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -20
- package/dist/src/user/tlp.d.ts +9 -16
- package/dist/src/user/tlp.js +61 -121
- package/package.json +1 -1
package/dist/src/fetch.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Markets, SymbolMarket } from "./typus_perp/trading/structs";
|
|
|
2
2
|
import { 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";
|
|
6
5
|
import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
|
|
7
6
|
import { TypusBidReceipt } from "./_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs";
|
|
8
7
|
export declare function getLpPools(config: TypusConfig): Promise<LiquidityPool[]>;
|
|
@@ -30,8 +29,3 @@ export declare function getLiquidationPriceAndPnl(config: TypusConfig, pythClien
|
|
|
30
29
|
positions: Position[];
|
|
31
30
|
user: string;
|
|
32
31
|
}): Promise<(string | number)[][] | undefined>;
|
|
33
|
-
export declare function getAllPositions(config: TypusConfig, input: {
|
|
34
|
-
baseToken: TOKEN;
|
|
35
|
-
slice: string;
|
|
36
|
-
page: string;
|
|
37
|
-
}): Promise<Position[]>;
|
package/dist/src/fetch.js
CHANGED
|
@@ -57,7 +57,6 @@ exports.getUserPositions = getUserPositions;
|
|
|
57
57
|
exports.parseOptionBidReceipts = parseOptionBidReceipts;
|
|
58
58
|
exports.getUserStake = getUserStake;
|
|
59
59
|
exports.getLiquidationPriceAndPnl = getLiquidationPriceAndPnl;
|
|
60
|
-
exports.getAllPositions = getAllPositions;
|
|
61
60
|
var client_1 = require("@mysten/sui/client");
|
|
62
61
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
63
62
|
var bcs_1 = require("@mysten/bcs");
|
|
@@ -494,48 +493,3 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
|
|
|
494
493
|
});
|
|
495
494
|
});
|
|
496
495
|
}
|
|
497
|
-
function getAllPositions(config, input) {
|
|
498
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
499
|
-
var provider, tx, res, raw, withoutMaxPage, reader, userPositionsLen, positions, i, fields, pos;
|
|
500
|
-
var _a, _b, _c, _d;
|
|
501
|
-
return __generator(this, function (_e) {
|
|
502
|
-
switch (_e.label) {
|
|
503
|
-
case 0:
|
|
504
|
-
provider = new client_1.SuiClient({ url: config.rpcEndpoint });
|
|
505
|
-
tx = new transactions_1.Transaction();
|
|
506
|
-
(0, functions_1.getAllPositions)(tx, constants_1.tokenType[_1.NETWORK][input.baseToken], {
|
|
507
|
-
version: _1.PERP_VERSION,
|
|
508
|
-
registry: _1.MARKET,
|
|
509
|
-
marketIndex: BigInt(0),
|
|
510
|
-
slice: BigInt(input.slice),
|
|
511
|
-
page: BigInt(input.page),
|
|
512
|
-
});
|
|
513
|
-
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
514
|
-
sender: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
515
|
-
transactionBlock: tx,
|
|
516
|
-
})];
|
|
517
|
-
case 1:
|
|
518
|
-
res = _e.sent();
|
|
519
|
-
console.log(res);
|
|
520
|
-
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])) {
|
|
521
|
-
return [2 /*return*/, []];
|
|
522
|
-
}
|
|
523
|
-
raw = new Uint8Array(res.results[0].returnValues[0][0]);
|
|
524
|
-
// 1) 至少要有 8 bytes 的 max_page
|
|
525
|
-
if (raw.length < 8)
|
|
526
|
-
return [2 /*return*/, []];
|
|
527
|
-
withoutMaxPage = raw.slice(0, raw.length - 8);
|
|
528
|
-
reader = new bcs_1.BcsReader(withoutMaxPage);
|
|
529
|
-
userPositionsLen = reader.read8() - 1;
|
|
530
|
-
positions = [];
|
|
531
|
-
for (i = 0; i < userPositionsLen; i++) {
|
|
532
|
-
reader.read16();
|
|
533
|
-
fields = structs_3.Position.bcs.read(reader);
|
|
534
|
-
pos = structs_3.Position.fromFields(fields);
|
|
535
|
-
positions.push(pos);
|
|
536
|
-
}
|
|
537
|
-
return [2 /*return*/, positions];
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
}
|
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
|
+
? "0x347b833859a487218737de4a5e6b0fb861d37e653a10f44d420279c984badf9c"
|
|
34
|
+
: "0x15844f80fb085bb8fd7cc688ade6282cd6991209eae78934ca001dced8b1b7de";
|
|
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
|
+
: "0x34ba6bf1893409b1a7494350189e060ee79cc2aba6f0c5e4045af9372d96fe85";
|
|
44
44
|
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
45
45
|
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
46
46
|
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
@@ -81,6 +81,4 @@ exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET"
|
|
|
81
81
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
82
82
|
? "0xdf3ed1599218b2415b2cd7fa06296f7f647676019b2873ec18e55a626c584f1b"
|
|
83
83
|
: "0xafb81680b9ac3d627eb733154c43d34e3ec758cf8e00a55c384df2c8150f7881";
|
|
84
|
-
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
85
|
-
? "0x36056abf9adde86f81667dad680a8ac98868c9fc1cb4d519fd2222d5d4522906"
|
|
86
|
-
: "0xbc3914cd777d009afc05e81cd6d006428ce742569c795b0bac493c1b0ef58559";
|
|
84
|
+
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET" ? "0x36056abf9adde86f81667dad680a8ac98868c9fc1cb4d519fd2222d5d4522906" : "";
|
|
@@ -12,7 +12,6 @@ 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;
|
|
16
15
|
export declare function depositAmountInsufficient(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
17
16
|
export declare function depositTokenMismatched(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
18
17
|
export declare function exceedMaxLeverage(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -66,7 +65,6 @@ export declare function tvlNotYetUpdated(tx: Transaction, published_at?: string)
|
|
|
66
65
|
export declare function unauthorized(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
67
66
|
export declare function unsupportedOrderTypeTag(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
68
67
|
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;
|
|
70
68
|
export declare function userMismatched(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
71
69
|
export declare function wrongCollateralType(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
72
70
|
export declare function zeroPrice(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -13,7 +13,6 @@ exports.bidReceiptNotExpired = bidReceiptNotExpired;
|
|
|
13
13
|
exports.bidReceiptNotItm = bidReceiptNotItm;
|
|
14
14
|
exports.bidTokenMismatched = bidTokenMismatched;
|
|
15
15
|
exports.collateralTokenTypeMismatched = collateralTokenTypeMismatched;
|
|
16
|
-
exports.deactivatingSharesAlreadyExisted = deactivatingSharesAlreadyExisted;
|
|
17
16
|
exports.depositAmountInsufficient = depositAmountInsufficient;
|
|
18
17
|
exports.depositTokenMismatched = depositTokenMismatched;
|
|
19
18
|
exports.exceedMaxLeverage = exceedMaxLeverage;
|
|
@@ -67,7 +66,6 @@ exports.tvlNotYetUpdated = tvlNotYetUpdated;
|
|
|
67
66
|
exports.unauthorized = unauthorized;
|
|
68
67
|
exports.unsupportedOrderTypeTag = unsupportedOrderTypeTag;
|
|
69
68
|
exports.unsupportedProcessStatusCode = unsupportedProcessStatusCode;
|
|
70
|
-
exports.userDeactivatingSharesNotExisted = userDeactivatingSharesNotExisted;
|
|
71
69
|
exports.userMismatched = userMismatched;
|
|
72
70
|
exports.wrongCollateralType = wrongCollateralType;
|
|
73
71
|
exports.zeroPrice = zeroPrice;
|
|
@@ -125,10 +123,6 @@ function collateralTokenTypeMismatched(tx, published_at) {
|
|
|
125
123
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
126
124
|
return tx.moveCall({ target: "".concat(published_at, "::error::collateral_token_type_mismatched"), arguments: [] });
|
|
127
125
|
}
|
|
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
|
-
}
|
|
132
126
|
function depositAmountInsufficient(tx, published_at) {
|
|
133
127
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
134
128
|
return tx.moveCall({ target: "".concat(published_at, "::error::deposit_amount_insufficient"), arguments: [] });
|
|
@@ -341,10 +335,6 @@ function unsupportedProcessStatusCode(tx, published_at) {
|
|
|
341
335
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
342
336
|
return tx.moveCall({ target: "".concat(published_at, "::error::unsupported_process_status_code"), arguments: [] });
|
|
343
337
|
}
|
|
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
|
-
}
|
|
348
338
|
function userMismatched(tx, published_at) {
|
|
349
339
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
350
340
|
return tx.moveCall({ target: "".concat(published_at, "::error::user_mismatched"), arguments: [] });
|
|
@@ -35,16 +35,6 @@ 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;
|
|
48
38
|
export interface CalculateBurnLpArgs {
|
|
49
39
|
registry: TransactionObjectInput;
|
|
50
40
|
index: bigint | TransactionArgument;
|
|
@@ -101,15 +91,6 @@ export interface CheckTvlUpdatedArgs {
|
|
|
101
91
|
clock: TransactionObjectInput;
|
|
102
92
|
}
|
|
103
93
|
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;
|
|
113
94
|
export interface CompleteRemoveLiquidityTokenProcessArgs {
|
|
114
95
|
version: TransactionObjectInput;
|
|
115
96
|
registry: TransactionObjectInput;
|
|
@@ -117,13 +98,14 @@ export interface CompleteRemoveLiquidityTokenProcessArgs {
|
|
|
117
98
|
process: TransactionObjectInput;
|
|
118
99
|
}
|
|
119
100
|
export declare function completeRemoveLiquidityTokenProcess(tx: Transaction, typeArg: string, args: CompleteRemoveLiquidityTokenProcessArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
120
|
-
export interface
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
101
|
+
export interface DepositScallopBasicArgs {
|
|
102
|
+
liquidityPool: TransactionObjectInput;
|
|
103
|
+
scallopVersion: TransactionObjectInput;
|
|
104
|
+
scallopMarket: TransactionObjectInput;
|
|
105
|
+
clock: TransactionObjectInput;
|
|
106
|
+
depositAmount: bigint | TransactionArgument;
|
|
124
107
|
}
|
|
125
|
-
export declare function
|
|
126
|
-
export declare function deprecated(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
108
|
+
export declare function depositScallopBasic(tx: Transaction, typeArg: string, args: DepositScallopBasicArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
127
109
|
export declare function getBorrowRateDecimal(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
128
110
|
export interface GetCumulativeBorrowRateArgs {
|
|
129
111
|
liquidityPool: TransactionObjectInput;
|
|
@@ -191,6 +173,16 @@ export interface GetTokenPoolStateArgs {
|
|
|
191
173
|
export declare function getTokenPoolState(tx: Transaction, args: GetTokenPoolStateArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
192
174
|
export declare function getTvlUsd(tx: Transaction, liquidityPool: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
193
175
|
export declare function init(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
176
|
+
export interface ManagerDepositScallopArgs {
|
|
177
|
+
version: TransactionObjectInput;
|
|
178
|
+
registry: TransactionObjectInput;
|
|
179
|
+
index: bigint | TransactionArgument;
|
|
180
|
+
scallopVersion: TransactionObjectInput;
|
|
181
|
+
scallopMarket: TransactionObjectInput;
|
|
182
|
+
clock: TransactionObjectInput;
|
|
183
|
+
lendingAmount: bigint | TransactionArgument | TransactionArgument | null;
|
|
184
|
+
}
|
|
185
|
+
export declare function managerDepositScallop(tx: Transaction, typeArg: string, args: ManagerDepositScallopArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
194
186
|
export interface ManagerFlashRemoveLiquidityArgs {
|
|
195
187
|
version: TransactionObjectInput;
|
|
196
188
|
registry: TransactionObjectInput;
|
|
@@ -210,14 +202,16 @@ export interface ManagerFlashRepayLiquidityArgs {
|
|
|
210
202
|
clock: TransactionObjectInput;
|
|
211
203
|
}
|
|
212
204
|
export declare function managerFlashRepayLiquidity(tx: Transaction, typeArg: string, args: ManagerFlashRepayLiquidityArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
213
|
-
export interface
|
|
205
|
+
export interface ManagerWithdrawScallopArgs {
|
|
214
206
|
version: TransactionObjectInput;
|
|
215
207
|
registry: TransactionObjectInput;
|
|
216
208
|
index: bigint | TransactionArgument;
|
|
217
|
-
|
|
209
|
+
scallopVersion: TransactionObjectInput;
|
|
210
|
+
scallopMarket: TransactionObjectInput;
|
|
218
211
|
clock: TransactionObjectInput;
|
|
212
|
+
withdrawAmount: bigint | TransactionArgument | TransactionArgument | null;
|
|
219
213
|
}
|
|
220
|
-
export declare function
|
|
214
|
+
export declare function managerWithdrawScallop(tx: Transaction, typeArg: string, args: ManagerWithdrawScallopArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
221
215
|
export interface MintLpArgs {
|
|
222
216
|
version: TransactionObjectInput;
|
|
223
217
|
registry: TransactionObjectInput;
|
|
@@ -232,7 +226,6 @@ export interface NewLiquidityPoolArgs {
|
|
|
232
226
|
version: TransactionObjectInput;
|
|
233
227
|
registry: TransactionObjectInput;
|
|
234
228
|
lpTokenDecimal: bigint | TransactionArgument;
|
|
235
|
-
unlockCountdownTsMs: bigint | TransactionArgument;
|
|
236
229
|
}
|
|
237
230
|
export declare function newLiquidityPool(tx: Transaction, typeArg: string, args: NewLiquidityPoolArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
238
231
|
export interface OracleMatchedArgs {
|
|
@@ -260,14 +253,6 @@ export interface PutReceiptCollateralsArgs {
|
|
|
260
253
|
unsettledBidReceipts: Array<TransactionObjectInput> | TransactionArgument;
|
|
261
254
|
}
|
|
262
255
|
export declare function putReceiptCollaterals(tx: Transaction, args: PutReceiptCollateralsArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
263
|
-
export interface RedeemArgs {
|
|
264
|
-
version: TransactionObjectInput;
|
|
265
|
-
registry: TransactionObjectInput;
|
|
266
|
-
index: bigint | TransactionArgument;
|
|
267
|
-
balance: TransactionObjectInput;
|
|
268
|
-
clock: TransactionObjectInput;
|
|
269
|
-
}
|
|
270
|
-
export declare function redeem(tx: Transaction, typeArg: string, args: RedeemArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
271
256
|
export interface RequestCollateralArgs {
|
|
272
257
|
liquidityPool: TransactionObjectInput;
|
|
273
258
|
collateralAmount: bigint | TransactionArgument;
|
|
@@ -387,13 +372,6 @@ export interface UpdateTvlArgs {
|
|
|
387
372
|
clock: TransactionObjectInput;
|
|
388
373
|
}
|
|
389
374
|
export declare function updateTvl(tx: Transaction, args: UpdateTvlArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
390
|
-
export interface UpdateUnlockCountdownTsMsArgs {
|
|
391
|
-
version: TransactionObjectInput;
|
|
392
|
-
registry: TransactionObjectInput;
|
|
393
|
-
index: bigint | TransactionArgument;
|
|
394
|
-
unlockCountdownTsMs: bigint | TransactionArgument;
|
|
395
|
-
}
|
|
396
|
-
export declare function updateUnlockCountdownTsMs(tx: Transaction, args: UpdateUnlockCountdownTsMsArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
397
375
|
export interface ViewSwapResultArgs {
|
|
398
376
|
version: TransactionObjectInput;
|
|
399
377
|
registry: TransactionObjectInput;
|
|
@@ -404,3 +382,12 @@ export interface ViewSwapResultArgs {
|
|
|
404
382
|
clock: TransactionObjectInput;
|
|
405
383
|
}
|
|
406
384
|
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;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addLiquidityToken = addLiquidityToken;
|
|
4
4
|
exports.burnLp = burnLp;
|
|
5
|
-
exports.burnLp_ = burnLp_;
|
|
6
5
|
exports.calculateBurnLp = calculateBurnLp;
|
|
7
6
|
exports.calculateLpFee = calculateLpFee;
|
|
8
7
|
exports.calculateMintLp = calculateMintLp;
|
|
@@ -11,10 +10,8 @@ exports.checkRemoveLiquidityTokenProcessStatus = checkRemoveLiquidityTokenProces
|
|
|
11
10
|
exports.checkTokenPoolStatus = checkTokenPoolStatus;
|
|
12
11
|
exports.checkTradingOrderSizeValid = checkTradingOrderSizeValid;
|
|
13
12
|
exports.checkTvlUpdated = checkTvlUpdated;
|
|
14
|
-
exports.claim = claim;
|
|
15
13
|
exports.completeRemoveLiquidityTokenProcess = completeRemoveLiquidityTokenProcess;
|
|
16
|
-
exports.
|
|
17
|
-
exports.deprecated = deprecated;
|
|
14
|
+
exports.depositScallopBasic = depositScallopBasic;
|
|
18
15
|
exports.getBorrowRateDecimal = getBorrowRateDecimal;
|
|
19
16
|
exports.getCumulativeBorrowRate = getCumulativeBorrowRate;
|
|
20
17
|
exports.getExpiredReceiptCollateralBcs = getExpiredReceiptCollateralBcs;
|
|
@@ -31,16 +28,16 @@ exports.getTokenPool = getTokenPool;
|
|
|
31
28
|
exports.getTokenPoolState = getTokenPoolState;
|
|
32
29
|
exports.getTvlUsd = getTvlUsd;
|
|
33
30
|
exports.init = init;
|
|
31
|
+
exports.managerDepositScallop = managerDepositScallop;
|
|
34
32
|
exports.managerFlashRemoveLiquidity = managerFlashRemoveLiquidity;
|
|
35
33
|
exports.managerFlashRepayLiquidity = managerFlashRepayLiquidity;
|
|
36
|
-
exports.
|
|
34
|
+
exports.managerWithdrawScallop = managerWithdrawScallop;
|
|
37
35
|
exports.mintLp = mintLp;
|
|
38
36
|
exports.newLiquidityPool = newLiquidityPool;
|
|
39
37
|
exports.oracleMatched = oracleMatched;
|
|
40
38
|
exports.orderFilled = orderFilled;
|
|
41
39
|
exports.putCollateral = putCollateral;
|
|
42
40
|
exports.putReceiptCollaterals = putReceiptCollaterals;
|
|
43
|
-
exports.redeem = redeem;
|
|
44
41
|
exports.requestCollateral = requestCollateral;
|
|
45
42
|
exports.resumePool = resumePool;
|
|
46
43
|
exports.resumeTokenPool = resumeTokenPool;
|
|
@@ -58,8 +55,8 @@ exports.updateRemoveLiquidityTokenProcessToken = updateRemoveLiquidityTokenProce
|
|
|
58
55
|
exports.updateReserveAmount = updateReserveAmount;
|
|
59
56
|
exports.updateSpotConfig = updateSpotConfig;
|
|
60
57
|
exports.updateTvl = updateTvl;
|
|
61
|
-
exports.updateUnlockCountdownTsMs = updateUnlockCountdownTsMs;
|
|
62
58
|
exports.viewSwapResult = viewSwapResult;
|
|
59
|
+
exports.withdrawScallopBasic = withdrawScallopBasic;
|
|
63
60
|
var __1 = require("..");
|
|
64
61
|
var structs_1 = require("../../_dependencies/source/0x1/option/structs");
|
|
65
62
|
var util_1 = require("../../_framework/util");
|
|
@@ -112,22 +109,6 @@ function burnLp(tx, typeArgs, args, published_at) {
|
|
|
112
109
|
],
|
|
113
110
|
});
|
|
114
111
|
}
|
|
115
|
-
function burnLp_(tx, typeArgs, args, published_at) {
|
|
116
|
-
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
117
|
-
return tx.moveCall({
|
|
118
|
-
target: "".concat(published_at, "::lp_pool::burn_lp_"),
|
|
119
|
-
typeArguments: typeArgs,
|
|
120
|
-
arguments: [
|
|
121
|
-
(0, util_1.obj)(tx, args.version),
|
|
122
|
-
(0, util_1.obj)(tx, args.registry),
|
|
123
|
-
(0, util_1.pure)(tx, args.index, "u64"),
|
|
124
|
-
(0, util_1.obj)(tx, args.treasuryCaps),
|
|
125
|
-
(0, util_1.obj)(tx, args.oracle),
|
|
126
|
-
(0, util_1.obj)(tx, args.burnLpBalance),
|
|
127
|
-
(0, util_1.obj)(tx, args.clock),
|
|
128
|
-
],
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
112
|
function calculateBurnLp(tx, args, published_at) {
|
|
132
113
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
133
114
|
return tx.moveCall({
|
|
@@ -211,21 +192,6 @@ function checkTvlUpdated(tx, args, published_at) {
|
|
|
211
192
|
arguments: [(0, util_1.obj)(tx, args.liquidityPool), (0, util_1.obj)(tx, args.clock)],
|
|
212
193
|
});
|
|
213
194
|
}
|
|
214
|
-
function claim(tx, typeArgs, args, published_at) {
|
|
215
|
-
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
216
|
-
return tx.moveCall({
|
|
217
|
-
target: "".concat(published_at, "::lp_pool::claim"),
|
|
218
|
-
typeArguments: typeArgs,
|
|
219
|
-
arguments: [
|
|
220
|
-
(0, util_1.obj)(tx, args.version),
|
|
221
|
-
(0, util_1.obj)(tx, args.registry),
|
|
222
|
-
(0, util_1.pure)(tx, args.index, "u64"),
|
|
223
|
-
(0, util_1.obj)(tx, args.treasuryCaps),
|
|
224
|
-
(0, util_1.obj)(tx, args.oracle),
|
|
225
|
-
(0, util_1.obj)(tx, args.clock),
|
|
226
|
-
],
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
195
|
function completeRemoveLiquidityTokenProcess(tx, typeArg, args, published_at) {
|
|
230
196
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
231
197
|
return tx.moveCall({
|
|
@@ -234,18 +200,20 @@ function completeRemoveLiquidityTokenProcess(tx, typeArg, args, published_at) {
|
|
|
234
200
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.index, "u64"), (0, util_1.obj)(tx, args.process)],
|
|
235
201
|
});
|
|
236
202
|
}
|
|
237
|
-
function
|
|
203
|
+
function depositScallopBasic(tx, typeArg, args, published_at) {
|
|
238
204
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
239
205
|
return tx.moveCall({
|
|
240
|
-
target: "".concat(published_at, "::lp_pool::
|
|
206
|
+
target: "".concat(published_at, "::lp_pool::deposit_scallop_basic"),
|
|
241
207
|
typeArguments: [typeArg],
|
|
242
|
-
arguments: [
|
|
208
|
+
arguments: [
|
|
209
|
+
(0, util_1.obj)(tx, args.liquidityPool),
|
|
210
|
+
(0, util_1.obj)(tx, args.scallopVersion),
|
|
211
|
+
(0, util_1.obj)(tx, args.scallopMarket),
|
|
212
|
+
(0, util_1.obj)(tx, args.clock),
|
|
213
|
+
(0, util_1.pure)(tx, args.depositAmount, "u64"),
|
|
214
|
+
],
|
|
243
215
|
});
|
|
244
216
|
}
|
|
245
|
-
function deprecated(tx, published_at) {
|
|
246
|
-
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
247
|
-
return tx.moveCall({ target: "".concat(published_at, "::lp_pool::deprecated"), arguments: [] });
|
|
248
|
-
}
|
|
249
217
|
function getBorrowRateDecimal(tx, published_at) {
|
|
250
218
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
251
219
|
return tx.moveCall({ target: "".concat(published_at, "::lp_pool::get_borrow_rate_decimal"), arguments: [] });
|
|
@@ -346,6 +314,22 @@ function init(tx, published_at) {
|
|
|
346
314
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
347
315
|
return tx.moveCall({ target: "".concat(published_at, "::lp_pool::init"), arguments: [] });
|
|
348
316
|
}
|
|
317
|
+
function managerDepositScallop(tx, typeArg, args, published_at) {
|
|
318
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
319
|
+
return tx.moveCall({
|
|
320
|
+
target: "".concat(published_at, "::lp_pool::manager_deposit_scallop"),
|
|
321
|
+
typeArguments: [typeArg],
|
|
322
|
+
arguments: [
|
|
323
|
+
(0, util_1.obj)(tx, args.version),
|
|
324
|
+
(0, util_1.obj)(tx, args.registry),
|
|
325
|
+
(0, util_1.pure)(tx, args.index, "u64"),
|
|
326
|
+
(0, util_1.obj)(tx, args.scallopVersion),
|
|
327
|
+
(0, util_1.obj)(tx, args.scallopMarket),
|
|
328
|
+
(0, util_1.obj)(tx, args.clock),
|
|
329
|
+
(0, util_1.pure)(tx, args.lendingAmount, "".concat(structs_1.Option.$typeName, "<u64>")),
|
|
330
|
+
],
|
|
331
|
+
});
|
|
332
|
+
}
|
|
349
333
|
function managerFlashRemoveLiquidity(tx, typeArg, args, published_at) {
|
|
350
334
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
351
335
|
return tx.moveCall({
|
|
@@ -377,12 +361,20 @@ function managerFlashRepayLiquidity(tx, typeArg, args, published_at) {
|
|
|
377
361
|
],
|
|
378
362
|
});
|
|
379
363
|
}
|
|
380
|
-
function
|
|
364
|
+
function managerWithdrawScallop(tx, typeArg, args, published_at) {
|
|
381
365
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
382
366
|
return tx.moveCall({
|
|
383
|
-
target: "".concat(published_at, "::lp_pool::
|
|
367
|
+
target: "".concat(published_at, "::lp_pool::manager_withdraw_scallop"),
|
|
384
368
|
typeArguments: [typeArg],
|
|
385
|
-
arguments: [
|
|
369
|
+
arguments: [
|
|
370
|
+
(0, util_1.obj)(tx, args.version),
|
|
371
|
+
(0, util_1.obj)(tx, args.registry),
|
|
372
|
+
(0, util_1.pure)(tx, args.index, "u64"),
|
|
373
|
+
(0, util_1.obj)(tx, args.scallopVersion),
|
|
374
|
+
(0, util_1.obj)(tx, args.scallopMarket),
|
|
375
|
+
(0, util_1.obj)(tx, args.clock),
|
|
376
|
+
(0, util_1.pure)(tx, args.withdrawAmount, "".concat(structs_1.Option.$typeName, "<u64>")),
|
|
377
|
+
],
|
|
386
378
|
});
|
|
387
379
|
}
|
|
388
380
|
function mintLp(tx, typeArgs, args, published_at) {
|
|
@@ -406,12 +398,7 @@ function newLiquidityPool(tx, typeArg, args, published_at) {
|
|
|
406
398
|
return tx.moveCall({
|
|
407
399
|
target: "".concat(published_at, "::lp_pool::new_liquidity_pool"),
|
|
408
400
|
typeArguments: [typeArg],
|
|
409
|
-
arguments: [
|
|
410
|
-
(0, util_1.obj)(tx, args.version),
|
|
411
|
-
(0, util_1.obj)(tx, args.registry),
|
|
412
|
-
(0, util_1.pure)(tx, args.lpTokenDecimal, "u64"),
|
|
413
|
-
(0, util_1.pure)(tx, args.unlockCountdownTsMs, "u64"),
|
|
414
|
-
],
|
|
401
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.lpTokenDecimal, "u64")],
|
|
415
402
|
});
|
|
416
403
|
}
|
|
417
404
|
function oracleMatched(tx, args, published_at) {
|
|
@@ -454,14 +441,6 @@ function putReceiptCollaterals(tx, args, published_at) {
|
|
|
454
441
|
arguments: [(0, util_1.obj)(tx, args.liquidityPool), (0, util_1.vector)(tx, "".concat(structs_2.UnsettledBidReceipt.$typeName), args.unsettledBidReceipts)],
|
|
455
442
|
});
|
|
456
443
|
}
|
|
457
|
-
function redeem(tx, typeArg, args, published_at) {
|
|
458
|
-
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
459
|
-
return tx.moveCall({
|
|
460
|
-
target: "".concat(published_at, "::lp_pool::redeem"),
|
|
461
|
-
typeArguments: [typeArg],
|
|
462
|
-
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.index, "u64"), (0, util_1.obj)(tx, args.balance), (0, util_1.obj)(tx, args.clock)],
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
444
|
function requestCollateral(tx, typeArg, args, published_at) {
|
|
466
445
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
467
446
|
return tx.moveCall({
|
|
@@ -624,13 +603,6 @@ function updateTvl(tx, args, published_at) {
|
|
|
624
603
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.liquidityPool), (0, util_1.obj)(tx, args.tokenType), (0, util_1.obj)(tx, args.oracle), (0, util_1.obj)(tx, args.clock)],
|
|
625
604
|
});
|
|
626
605
|
}
|
|
627
|
-
function updateUnlockCountdownTsMs(tx, args, published_at) {
|
|
628
|
-
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
629
|
-
return tx.moveCall({
|
|
630
|
-
target: "".concat(published_at, "::lp_pool::update_unlock_countdown_ts_ms"),
|
|
631
|
-
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.index, "u64"), (0, util_1.pure)(tx, args.unlockCountdownTsMs, "u64")],
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
606
|
function viewSwapResult(tx, typeArgs, args, published_at) {
|
|
635
607
|
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
636
608
|
return tx.moveCall({
|
|
@@ -647,3 +619,18 @@ function viewSwapResult(tx, typeArgs, args, published_at) {
|
|
|
647
619
|
],
|
|
648
620
|
});
|
|
649
621
|
}
|
|
622
|
+
function withdrawScallopBasic(tx, typeArg, args, published_at) {
|
|
623
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
624
|
+
return tx.moveCall({
|
|
625
|
+
target: "".concat(published_at, "::lp_pool::withdraw_scallop_basic"),
|
|
626
|
+
typeArguments: [typeArg],
|
|
627
|
+
arguments: [
|
|
628
|
+
(0, util_1.obj)(tx, args.version),
|
|
629
|
+
(0, util_1.obj)(tx, args.liquidityPool),
|
|
630
|
+
(0, util_1.obj)(tx, args.scallopVersion),
|
|
631
|
+
(0, util_1.obj)(tx, args.scallopMarket),
|
|
632
|
+
(0, util_1.obj)(tx, args.clock),
|
|
633
|
+
(0, util_1.pure)(tx, args.withdrawAmount, "u64"),
|
|
634
|
+
],
|
|
635
|
+
});
|
|
636
|
+
}
|