@typus/typus-sdk 0.5.4 → 0.5.6
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/lib/scripts/sui.js +4 -4
- package/lib/test/testClaim.js +4 -3
- package/lib/test/testDeposit.js +3 -2
- package/lib/test/testDepositV2.js +4 -2
- package/lib/test/testMint.js +3 -2
- package/lib/test/testNewAuction.js +3 -2
- package/lib/test/testNewVault.js +3 -2
- package/lib/test/testOracle.js +4 -3
- package/lib/test/testSettle.js +10 -9
- package/lib/test/testUnsubscribe.js +3 -2
- package/lib/test/testWithdraw.js +3 -2
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +3 -7
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +3 -7
- package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedDeliveryTx.js +3 -7
- package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedEvolutionTx.js +3 -10
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +3 -9
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +3 -8
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +3 -4
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +3 -7
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +3 -7
- package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedSettleTx.js +3 -8
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +3 -7
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +2 -2
- package/lib/utils/coveredCall/createPriceOracle.js +3 -2
- package/lib/utils/coveredCall/createTimeOracle.js +3 -2
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +2 -2
- package/lib/utils/coveredCall/getClaimAllTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimAllTx.js +2 -2
- package/lib/utils/coveredCall/getClaimTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimTx.js +2 -2
- package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getCloseAuctionTx.js +2 -2
- package/lib/utils/coveredCall/getCloseVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getCloseVaultTx.js +2 -2
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +1 -1
- package/lib/utils/coveredCall/getDeliveryTx.js +2 -2
- package/lib/utils/coveredCall/getDepositTx.d.ts +1 -1
- package/lib/utils/coveredCall/getDepositTx.js +2 -2
- package/lib/utils/coveredCall/getEvolutionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getEvolutionTx.js +2 -2
- package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.js +2 -2
- package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +1 -1
- package/lib/utils/coveredCall/getMakerClaimAllTx.js +2 -2
- package/lib/utils/coveredCall/getMakerClaimTx.d.ts +1 -1
- package/lib/utils/coveredCall/getMakerClaimTx.js +2 -2
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.js +2 -2
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +2 -2
- package/lib/utils/coveredCall/getNewBidTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewBidTx.js +2 -2
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +2 -2
- package/lib/utils/coveredCall/getNewManagerTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewManagerTx.js +2 -2
- package/lib/utils/coveredCall/getRefundTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRefundTx.js +2 -2
- package/lib/utils/coveredCall/getRemoveBidTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveBidTx.js +2 -2
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +2 -2
- package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveManagerTx.js +2 -2
- package/lib/utils/coveredCall/getRollOverTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRollOverTx.js +2 -2
- package/lib/utils/coveredCall/getSettleTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSettleTx.js +2 -2
- package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.js +2 -2
- package/lib/utils/coveredCall/getSubscribeTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSubscribeTx.js +2 -2
- package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.js +2 -2
- package/lib/utils/coveredCall/getUpdateCapacityTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdateCapacityTx.js +2 -2
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +2 -2
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +2 -2
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +2 -2
- package/lib/utils/coveredCall/getWithdrawTx.d.ts +1 -1
- package/lib/utils/coveredCall/getWithdrawTx.js +2 -2
- package/lib/utils/getCreateTokenRegistryTx.d.ts +1 -1
- package/lib/utils/getCreateTokenRegistryTx.js +2 -2
- package/lib/utils/getMintTx.d.ts +1 -1
- package/lib/utils/getMintTx.js +2 -2
- package/lib/utils/getNewOracleTx.d.ts +1 -1
- package/lib/utils/getNewOracleTx.js +2 -2
- package/lib/utils/getNewTimeOracleTx.d.ts +1 -1
- package/lib/utils/getNewTimeOracleTx.js +2 -2
- package/lib/utils/getUpdateOracleTx.d.ts +1 -1
- package/lib/utils/getUpdateOracleTx.js +2 -2
- package/lib/utils/getUpdateTimeOracleTx.d.ts +1 -1
- package/lib/utils/getUpdateTimeOracleTx.js +2 -2
- package/package.json +2 -2
package/lib/scripts/sui.js
CHANGED
|
@@ -82,7 +82,7 @@ function readJsonFile(filePath) {
|
|
|
82
82
|
// console.log("test for transferObject()")
|
|
83
83
|
// const transferTxn = await signer.transferObject({
|
|
84
84
|
// objectId: obj1,
|
|
85
|
-
// gasBudget:
|
|
85
|
+
// gasBudget: gasBudget,
|
|
86
86
|
// recipient: receiver,
|
|
87
87
|
// });
|
|
88
88
|
// console.log('transferTxn', transferTxn);
|
|
@@ -100,7 +100,7 @@ function readJsonFile(filePath) {
|
|
|
100
100
|
// 'An NFT created by the wallet Command Line Tool',
|
|
101
101
|
// 'ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty',
|
|
102
102
|
// ],
|
|
103
|
-
// gasBudget:
|
|
103
|
+
// gasBudget: gasBudget,
|
|
104
104
|
// });
|
|
105
105
|
// console.log('moveCallTxn', moveCallTxn);
|
|
106
106
|
// })();
|
|
@@ -135,7 +135,7 @@ function readJsonFile(filePath) {
|
|
|
135
135
|
// );
|
|
136
136
|
// const publishTxn = await signer.publish({
|
|
137
137
|
// compiledModules: modulesInBytes,
|
|
138
|
-
// gasBudget:
|
|
138
|
+
// gasBudget: gasBudget,
|
|
139
139
|
// });
|
|
140
140
|
// console.log('publishTxn', publishTxn);
|
|
141
141
|
// })();
|
|
@@ -180,7 +180,7 @@ function readJsonFile(filePath) {
|
|
|
180
180
|
// true,
|
|
181
181
|
// coin
|
|
182
182
|
// ],
|
|
183
|
-
// gasBudget:
|
|
183
|
+
// gasBudget: gasBudget,
|
|
184
184
|
// }
|
|
185
185
|
// const moveCallTxn = await signer.executeMoveCall(txn);
|
|
186
186
|
// console.log('moveCallTxn', moveCallTxn);
|
package/lib/test/testClaim.js
CHANGED
|
@@ -48,7 +48,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
48
48
|
after claim,
|
|
49
49
|
*/
|
|
50
50
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
-
var claimAmount, isRolling, token, vaultIndex, typeArgument, claimTx, claimAllTx;
|
|
51
|
+
var claimAmount, isRolling, token, vaultIndex, typeArgument, gasBudget, claimTx, claimAllTx;
|
|
52
52
|
return __generator(this, function (_a) {
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
@@ -61,14 +61,15 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
61
61
|
case 1:
|
|
62
62
|
typeArgument = _a.sent();
|
|
63
63
|
console.log("test for claim, try to claim " + token + " for " + claimAmount + " ...");
|
|
64
|
-
|
|
64
|
+
gasBudget = "100000";
|
|
65
|
+
return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex[0])];
|
|
65
66
|
case 2:
|
|
66
67
|
claimTx = _a.sent();
|
|
67
68
|
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
68
69
|
case 3:
|
|
69
70
|
_a.sent();
|
|
70
71
|
console.log("claim successfully");
|
|
71
|
-
return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex)];
|
|
72
|
+
return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex)];
|
|
72
73
|
case 4:
|
|
73
74
|
claimAllTx = _a.sent();
|
|
74
75
|
return [4 /*yield*/, signer.executeMoveCall(claimAllTx)];
|
package/lib/test/testDeposit.js
CHANGED
|
@@ -48,7 +48,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
48
48
|
and subVault "rolling_sub_vault" will increase
|
|
49
49
|
*/
|
|
50
50
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
-
var depositAmount, isRolling, token, vaultIndex, typeArgument, depositTx;
|
|
51
|
+
var depositAmount, isRolling, token, vaultIndex, typeArgument, gasBudget, depositTx;
|
|
52
52
|
return __generator(this, function (_a) {
|
|
53
53
|
switch (_a.label) {
|
|
54
54
|
case 0:
|
|
@@ -60,7 +60,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
60
60
|
case 1:
|
|
61
61
|
typeArgument = _a.sent();
|
|
62
62
|
console.log("test for deposit, try to deposit " + token + " for " + depositAmount + " ...");
|
|
63
|
-
|
|
63
|
+
gasBudget = "100000";
|
|
64
|
+
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
|
|
64
65
|
case 2:
|
|
65
66
|
depositTx = _a.sent();
|
|
66
67
|
return [4 /*yield*/, signer.executeMoveCall(depositTx)];
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
// })
|
|
33
33
|
// it('Create new vault in registry', async () => {
|
|
34
34
|
// try {
|
|
35
|
-
// let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
|
|
35
|
+
// let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
|
|
36
|
+
// gasBudget: string, SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
|
|
36
37
|
// let moveCallTxn = await signer.executeMoveCall(newSharkFinVaultTx);
|
|
37
38
|
// console.log(moveCallTxn)
|
|
38
39
|
// assert.ok("Create new vault in registry successfully");
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
// //@ts-ignore
|
|
47
48
|
// let numOfVaultBeforeCreateVault = registry.details.data.fields.num_of_vault
|
|
48
49
|
// // console.log("numOfVaultBeforeCreateVault: " + numOfVaultBeforeCreateVault)
|
|
49
|
-
// let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
|
|
50
|
+
// let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
|
|
51
|
+
// gasBudget: string, SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
|
|
50
52
|
// await signer.executeMoveCall(newSharkFinVaultTx);
|
|
51
53
|
// registry = await provider.getObject(SHARKFIN_REGISTRY)
|
|
52
54
|
// //@ts-ignore
|
package/lib/test/testMint.js
CHANGED
|
@@ -44,7 +44,7 @@ var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
|
44
44
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
45
45
|
var mintAmount = 1000500000;
|
|
46
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
-
var tokenRegistry, moduleName, mintTx, moveCallTxn;
|
|
47
|
+
var tokenRegistry, moduleName, gasBudget, mintTx, moveCallTxn;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0:
|
|
@@ -52,7 +52,8 @@ var mintAmount = 1000500000;
|
|
|
52
52
|
return [4 /*yield*/, prepareData(tokenRegistry)];
|
|
53
53
|
case 1:
|
|
54
54
|
moduleName = _a.sent();
|
|
55
|
-
|
|
55
|
+
gasBudget = "100000";
|
|
56
|
+
return [4 /*yield*/, (0, getMintTx_1.getMintTx)(gasBudget, constants_1.TOKEN_PACKAGE, tokenRegistry, moduleName, mintAmount)];
|
|
56
57
|
case 2:
|
|
57
58
|
mintTx = _a.sent();
|
|
58
59
|
return [4 /*yield*/, signer.executeMoveCall(mintTx)];
|
|
@@ -62,7 +62,7 @@ var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); /
|
|
|
62
62
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
63
63
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
64
64
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
-
var token, typeArgument, vaultIndex, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, activationTsMs, expirationTsMs, newAuctionTx, a;
|
|
65
|
+
var token, typeArgument, vaultIndex, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, activationTsMs, expirationTsMs, gasBudget, newAuctionTx, a;
|
|
66
66
|
return __generator(this, function (_c) {
|
|
67
67
|
switch (_c.label) {
|
|
68
68
|
case 0:
|
|
@@ -80,7 +80,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
80
80
|
_b = __read.apply(void 0, [_c.sent(), 2]), timeOracle = _b[0], timeOracleManager = _b[1];
|
|
81
81
|
activationTsMs = 1671992000000;
|
|
82
82
|
expirationTsMs = 1;
|
|
83
|
-
|
|
83
|
+
gasBudget = "100000";
|
|
84
|
+
return [4 /*yield*/, (0, getNewAuctionTx_1.getNewAuctionTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
|
|
84
85
|
case 4:
|
|
85
86
|
newAuctionTx = _c.sent();
|
|
86
87
|
return [4 /*yield*/, signer.executeMoveCall(newAuctionTx)];
|
package/lib/test/testNewVault.js
CHANGED
|
@@ -87,7 +87,7 @@ var auctionDurationInMs = "3600000";
|
|
|
87
87
|
var prevBalance = 0;
|
|
88
88
|
var leverage = "100";
|
|
89
89
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
-
var typeArgument, _a, timeOracle, _, newCoveredCallVaultTx, moveCallTxn;
|
|
90
|
+
var typeArgument, _a, timeOracle, _, gasBudget, newCoveredCallVaultTx, moveCallTxn;
|
|
91
91
|
return __generator(this, function (_b) {
|
|
92
92
|
switch (_b.label) {
|
|
93
93
|
case 0: return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)
|
|
@@ -99,7 +99,8 @@ var leverage = "100";
|
|
|
99
99
|
case 2:
|
|
100
100
|
_a = __read.apply(void 0, [_b.sent(), 2]), timeOracle = _a[0], _ = _a[1];
|
|
101
101
|
console.log(typeArgument, timeOracle);
|
|
102
|
-
|
|
102
|
+
gasBudget = "100000";
|
|
103
|
+
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period, activationTsMs, expirationTsMs.toString(), tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, [], leverage)];
|
|
103
104
|
case 3:
|
|
104
105
|
newCoveredCallVaultTx = _b.sent();
|
|
105
106
|
return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
|
package/lib/test/testOracle.js
CHANGED
|
@@ -44,7 +44,7 @@ var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); /
|
|
|
44
44
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
45
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
46
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
-
var price, unix, decimal, newOracleTx, moveCallTxn, digest, txn, newOracle, managerCap, updateOracleTx, newOracleObj;
|
|
47
|
+
var price, unix, decimal, gasBudget, newOracleTx, moveCallTxn, digest, txn, newOracle, managerCap, updateOracleTx, newOracleObj;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0:
|
|
@@ -52,7 +52,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
52
52
|
unix = 5678;
|
|
53
53
|
decimal = 8;
|
|
54
54
|
console.log("create new oracle...");
|
|
55
|
-
|
|
55
|
+
gasBudget = "100000";
|
|
56
|
+
return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, decimal)];
|
|
56
57
|
case 1:
|
|
57
58
|
newOracleTx = _a.sent();
|
|
58
59
|
return [4 /*yield*/, signer.executeMoveCall(newOracleTx)];
|
|
@@ -71,7 +72,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
71
72
|
managerCap = txn.effects.created[0].reference.objectId;
|
|
72
73
|
}
|
|
73
74
|
console.log("update oracle...");
|
|
74
|
-
return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, newOracle, managerCap, price, unix)];
|
|
75
|
+
return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, newOracle, managerCap, price, unix)];
|
|
75
76
|
case 4:
|
|
76
77
|
updateOracleTx = _a.sent();
|
|
77
78
|
return [4 /*yield*/, signer.executeMoveCall(updateOracleTx)];
|
package/lib/test/testSettle.js
CHANGED
|
@@ -87,6 +87,7 @@ var strike = 2000;
|
|
|
87
87
|
var isRolling = true;
|
|
88
88
|
var expirationTsMs1 = 1000000;
|
|
89
89
|
var expirationTsMs2 = 2000000;
|
|
90
|
+
var gasBudget = "100000";
|
|
90
91
|
// let priceOracle = '0x636b4e02991f13720571d0cbbc8b83d80cd14729';
|
|
91
92
|
// let priceOracleManager = '0xd958057a227cdfd2080f4aeda7a16d6fe7135bcc';
|
|
92
93
|
// let timeOracle = '0x2b06a0f8109e394258c288b1d90c8c5a9c3832db';
|
|
@@ -243,7 +244,7 @@ function updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price,
|
|
|
243
244
|
switch (_a.label) {
|
|
244
245
|
case 0:
|
|
245
246
|
_a.trys.push([0, 3, , 4]);
|
|
246
|
-
return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.ORACLE_PACKAGE, typeArgument, priceOracle, priceOracleManager, price, ts)];
|
|
247
|
+
return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, typeArgument, priceOracle, priceOracleManager, price, ts)];
|
|
247
248
|
case 1:
|
|
248
249
|
updateOracleTx = _a.sent();
|
|
249
250
|
return [4 /*yield*/, signer.executeMoveCall(updateOracleTx)];
|
|
@@ -276,7 +277,7 @@ function updateTimeOracle(timeOracle, managerCap, ts) {
|
|
|
276
277
|
switch (_a.label) {
|
|
277
278
|
case 0:
|
|
278
279
|
_a.trys.push([0, 3, , 4]);
|
|
279
|
-
return [4 /*yield*/, (0, getUpdateTimeOracleTx_1.getUpdateTimeOracleTx)(constants_1.ORACLE_PACKAGE, timeOracle, managerCap, ts)];
|
|
280
|
+
return [4 /*yield*/, (0, getUpdateTimeOracleTx_1.getUpdateTimeOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, timeOracle, managerCap, ts)];
|
|
280
281
|
case 1:
|
|
281
282
|
updateTimeOracleTx = _a.sent();
|
|
282
283
|
return [4 /*yield*/, signer.executeMoveCall(updateTimeOracleTx)];
|
|
@@ -309,7 +310,7 @@ function createNewVault(packageId, registry, typeArgument, managerCap, timeOracl
|
|
|
309
310
|
switch (_a.label) {
|
|
310
311
|
case 0:
|
|
311
312
|
_a.trys.push([0, 4, , 5]);
|
|
312
|
-
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period.toString(), activationTsMs.toString(), expirationTsMs.toString(), tokenDecimal.toString(), shareDecimal.toString(), capacity.toString(), strikeOtmPct.toString(), strikeIncrement.toString(), decaySpeed.toString(), initialPrice.toString(), finalPrice.toString(), auctionDurationInMs.toString(), [], leverage.toString())];
|
|
313
|
+
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period.toString(), activationTsMs.toString(), expirationTsMs.toString(), tokenDecimal.toString(), shareDecimal.toString(), capacity.toString(), strikeOtmPct.toString(), strikeIncrement.toString(), decaySpeed.toString(), initialPrice.toString(), finalPrice.toString(), auctionDurationInMs.toString(), [], leverage.toString())];
|
|
313
314
|
case 1:
|
|
314
315
|
newCoveredCallVaultTx = _a.sent();
|
|
315
316
|
return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
|
|
@@ -401,7 +402,7 @@ function depositToVault(typeArgument, vaultIndex, depositAmount) {
|
|
|
401
402
|
switch (_a.label) {
|
|
402
403
|
case 0:
|
|
403
404
|
_a.trys.push([0, 3, , 4]);
|
|
404
|
-
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), token, depositAmount.toString())];
|
|
405
|
+
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), token, depositAmount.toString())];
|
|
405
406
|
case 1:
|
|
406
407
|
depositTx = _a.sent();
|
|
407
408
|
return [4 /*yield*/, signer.executeMoveCall(depositTx)];
|
|
@@ -434,7 +435,7 @@ function createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, pric
|
|
|
434
435
|
switch (_a.label) {
|
|
435
436
|
case 0:
|
|
436
437
|
_a.trys.push([0, 3, , 4]);
|
|
437
|
-
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs)];
|
|
438
|
+
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs)];
|
|
438
439
|
case 1:
|
|
439
440
|
txn = _a.sent();
|
|
440
441
|
return [4 /*yield*/, signer.executeMoveCall(txn)];
|
|
@@ -466,7 +467,7 @@ function newBid(typeArgument, vaultIndex, size, token, timeOracle) {
|
|
|
466
467
|
switch (_a.label) {
|
|
467
468
|
case 0:
|
|
468
469
|
_a.trys.push([0, 3, , 4]);
|
|
469
|
-
return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), size.toString(), token, timeOracle)];
|
|
470
|
+
return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), size.toString(), token, timeOracle)];
|
|
470
471
|
case 1:
|
|
471
472
|
newBidTx = _a.sent();
|
|
472
473
|
return [4 /*yield*/, signer.executeMoveCall(newBidTx)];
|
|
@@ -498,7 +499,7 @@ function delivery(typeArgument, vaultIndex, sellSize, timeOracle) {
|
|
|
498
499
|
switch (_a.label) {
|
|
499
500
|
case 0:
|
|
500
501
|
_a.trys.push([0, 3, , 4]);
|
|
501
|
-
return [4 /*yield*/, (0, getDeliveryTx_1.getDeliveryTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), timeOracle)];
|
|
502
|
+
return [4 /*yield*/, (0, getDeliveryTx_1.getDeliveryTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), timeOracle)];
|
|
502
503
|
case 1:
|
|
503
504
|
deliveryTx = _a.sent();
|
|
504
505
|
return [4 /*yield*/, signer.executeMoveCall(deliveryTx)];
|
|
@@ -531,7 +532,7 @@ function updatePayoffConfig(typeArgument, vaultIndex, price, premiumRoi, exposur
|
|
|
531
532
|
switch (_a.label) {
|
|
532
533
|
case 0:
|
|
533
534
|
_a.trys.push([0, 3, , 4]);
|
|
534
|
-
return [4 /*yield*/, (0, getUpdatePayoffConfigTx_1.getUpdatePayoffConfigTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), premiumRoi.toString(), exposureRatio.toString())];
|
|
535
|
+
return [4 /*yield*/, (0, getUpdatePayoffConfigTx_1.getUpdatePayoffConfigTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), premiumRoi.toString(), exposureRatio.toString())];
|
|
535
536
|
case 1:
|
|
536
537
|
updatePayoffConfigTx = _a.sent();
|
|
537
538
|
return [4 /*yield*/, signer.executeMoveCall(updatePayoffConfigTx)];
|
|
@@ -564,7 +565,7 @@ function settle(typeArgument, vaultIndex, priceOracle, timeOracle) {
|
|
|
564
565
|
switch (_a.label) {
|
|
565
566
|
case 0:
|
|
566
567
|
_a.trys.push([0, 3, , 4]);
|
|
567
|
-
return [4 /*yield*/, (0, getSettleTx_1.getSettleTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
|
|
568
|
+
return [4 /*yield*/, (0, getSettleTx_1.getSettleTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
|
|
568
569
|
case 1:
|
|
569
570
|
settleTx = _a.sent();
|
|
570
571
|
return [4 /*yield*/, signer.executeMoveCall(settleTx)];
|
|
@@ -44,6 +44,7 @@ var getUnsubscribeTx_1 = require("../utils/coveredCall/getUnsubscribeTx");
|
|
|
44
44
|
var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
45
45
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
46
46
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
47
|
+
var gasBudget = "100000";
|
|
47
48
|
/*
|
|
48
49
|
after unsubscribe, the subvault (is deposited) "balance" in fields will be 0,
|
|
49
50
|
and a regular linked list node will be created if not exist, and the value increase.
|
|
@@ -67,14 +68,14 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
67
68
|
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)];
|
|
68
69
|
case 1:
|
|
69
70
|
typeArgument = _a.sent();
|
|
70
|
-
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
|
|
71
|
+
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
|
|
71
72
|
case 2:
|
|
72
73
|
depositTx = _a.sent();
|
|
73
74
|
return [4 /*yield*/, signer.executeMoveCall(depositTx)];
|
|
74
75
|
case 3:
|
|
75
76
|
_a.sent();
|
|
76
77
|
console.log("deposit " + depositAmount + " to new vault successfully");
|
|
77
|
-
return [4 /*yield*/, (0, getUnsubscribeTx_1.getUnsubscribeTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, share)];
|
|
78
|
+
return [4 /*yield*/, (0, getUnsubscribeTx_1.getUnsubscribeTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, share)];
|
|
78
79
|
case 4:
|
|
79
80
|
unSubscribedTx = _a.sent();
|
|
80
81
|
return [4 /*yield*/, signer.executeMoveCall(unSubscribedTx)];
|
package/lib/test/testWithdraw.js
CHANGED
|
@@ -44,7 +44,7 @@ var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); /
|
|
|
44
44
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
45
45
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
46
46
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
-
var withdrawAmount, isRolling, token, vaultIndex, typeArgument, withdrawTx;
|
|
47
|
+
var withdrawAmount, isRolling, token, vaultIndex, typeArgument, gasBudget, withdrawTx;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0:
|
|
@@ -57,7 +57,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
57
57
|
case 1:
|
|
58
58
|
typeArgument = _a.sent();
|
|
59
59
|
console.log("test for withdraw, try to withdraw " + token + " for " + withdrawAmount + " ...");
|
|
60
|
-
|
|
60
|
+
gasBudget = "100000";
|
|
61
|
+
return [4 /*yield*/, (0, getWithdrawTx_1.getWithdrawTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), withdrawAmount.toString())];
|
|
61
62
|
case 2:
|
|
62
63
|
withdrawTx = _a.sent();
|
|
63
64
|
return [4 /*yield*/, signer.executeMoveCall(withdrawTx)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedAddAuthorizedUserTx(packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedAddAuthorizedUserTx(gasBudget: string, packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedAddAuthorizedUserTx = void 0;
|
|
40
|
-
function getAuthorizedAddAuthorizedUserTx(packageId, registry, managerCap, address) {
|
|
40
|
+
function getAuthorizedAddAuthorizedUserTx(gasBudget, packageId, registry, managerCap, address) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,12 +46,8 @@ function getAuthorizedAddAuthorizedUserTx(packageId, registry, managerCap, addre
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'add_authorized_user',
|
|
48
48
|
typeArguments: [],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
registry,
|
|
52
|
-
address,
|
|
53
|
-
],
|
|
54
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [managerCap, registry, address],
|
|
50
|
+
gasBudget: gasBudget,
|
|
55
51
|
};
|
|
56
52
|
return [2 /*return*/, tx];
|
|
57
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedAddCoveredCallVaultAuthorizedUserTx = void 0;
|
|
40
|
-
function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(packageId, registry, typeArgument, index, address) {
|
|
40
|
+
function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArgument, index, address) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,12 +46,8 @@ function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(packageId, registry, t
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'authorized_add_covered_call_vault_authorized_user',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
index,
|
|
52
|
-
address,
|
|
53
|
-
],
|
|
54
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [registry, index, address],
|
|
50
|
+
gasBudget: gasBudget,
|
|
55
51
|
};
|
|
56
52
|
return [2 /*return*/, tx];
|
|
57
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedDeliveryTx(packageId: string, registry: string, typeArgument: string, index: string, timeOracle: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedDeliveryTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, timeOracle: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedDeliveryTx = void 0;
|
|
40
|
-
function getAuthorizedDeliveryTx(packageId, registry, typeArgument, index, timeOracle) {
|
|
40
|
+
function getAuthorizedDeliveryTx(gasBudget, packageId, registry, typeArgument, index, timeOracle) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,12 +46,8 @@ function getAuthorizedDeliveryTx(packageId, registry, typeArgument, index, timeO
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'authorized_delivery',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
index,
|
|
52
|
-
timeOracle,
|
|
53
|
-
],
|
|
54
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [registry, index, timeOracle],
|
|
50
|
+
gasBudget: gasBudget,
|
|
55
51
|
};
|
|
56
52
|
return [2 /*return*/, tx];
|
|
57
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedEvolutionTx(packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedEvolutionTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedEvolutionTx = void 0;
|
|
40
|
-
function getAuthorizedEvolutionTx(packageId, registry, typeArgument, index, priceOracle, timeOracle, activationTsMs, expirationTsMs) {
|
|
40
|
+
function getAuthorizedEvolutionTx(gasBudget, packageId, registry, typeArgument, index, priceOracle, timeOracle, activationTsMs, expirationTsMs) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,15 +46,8 @@ function getAuthorizedEvolutionTx(packageId, registry, typeArgument, index, pric
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'authorized_evolution',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
index,
|
|
52
|
-
priceOracle,
|
|
53
|
-
timeOracle,
|
|
54
|
-
activationTsMs,
|
|
55
|
-
expirationTsMs,
|
|
56
|
-
],
|
|
57
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [registry, index, priceOracle, timeOracle, activationTsMs, expirationTsMs],
|
|
50
|
+
gasBudget: gasBudget,
|
|
58
51
|
};
|
|
59
52
|
return [2 /*return*/, tx];
|
|
60
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedLastEvolutionTx(packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, expirationTsMs: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedLastEvolutionTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, expirationTsMs: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedLastEvolutionTx = void 0;
|
|
40
|
-
function getAuthorizedLastEvolutionTx(packageId, registry, typeArgument, index, priceOracle, timeOracle, expirationTsMs) {
|
|
40
|
+
function getAuthorizedLastEvolutionTx(gasBudget, packageId, registry, typeArgument, index, priceOracle, timeOracle, expirationTsMs) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,14 +46,8 @@ function getAuthorizedLastEvolutionTx(packageId, registry, typeArgument, index,
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'authorized_last_evolution',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
index,
|
|
52
|
-
priceOracle,
|
|
53
|
-
timeOracle,
|
|
54
|
-
expirationTsMs,
|
|
55
|
-
],
|
|
56
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [registry, index, priceOracle, timeOracle, expirationTsMs],
|
|
50
|
+
gasBudget: gasBudget,
|
|
57
51
|
};
|
|
58
52
|
return [2 /*return*/, tx];
|
|
59
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionTx(packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
1
|
+
export declare function getNewAuctionTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getNewAuctionTx = void 0;
|
|
40
|
-
function getNewAuctionTx(packageId, registry, typeArgument, index, priceOracle, timeOracle) {
|
|
40
|
+
function getNewAuctionTx(gasBudget, packageId, registry, typeArgument, index, priceOracle, timeOracle) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,13 +46,8 @@ function getNewAuctionTx(packageId, registry, typeArgument, index, priceOracle,
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'authorized_new_auction',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
index,
|
|
52
|
-
priceOracle,
|
|
53
|
-
timeOracle,
|
|
54
|
-
],
|
|
55
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [registry, index, priceOracle, timeOracle],
|
|
50
|
+
gasBudget: gasBudget,
|
|
56
51
|
};
|
|
57
52
|
return [2 /*return*/, tx];
|
|
58
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, timeOracle: string, period: string, activationTsMs: string, expirationTsMs: string, tokenDecimal: string, shareDecimal: string, capacity: string, strikeOtmPct: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedNewCoveredCallVaultTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, managerCap: string, timeOracle: string, period: string, activationTsMs: string, expirationTsMs: string, tokenDecimal: string, shareDecimal: string, capacity: string, strikeOtmPct: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedNewCoveredCallVaultTx = void 0;
|
|
40
|
-
function getAuthorizedNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, whitelist, leverage) {
|
|
40
|
+
function getAuthorizedNewCoveredCallVaultTx(gasBudget, packageId, registry, typeArgument, managerCap, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, whitelist, leverage) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -47,7 +47,6 @@ function getAuthorizedNewCoveredCallVaultTx(packageId, registry, typeArgument, m
|
|
|
47
47
|
function: 'authorized_new_covered_call_vault',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
49
|
arguments: [
|
|
50
|
-
managerCap,
|
|
51
50
|
registry,
|
|
52
51
|
timeOracle,
|
|
53
52
|
period,
|
|
@@ -65,7 +64,7 @@ function getAuthorizedNewCoveredCallVaultTx(packageId, registry, typeArgument, m
|
|
|
65
64
|
leverage,
|
|
66
65
|
whitelist,
|
|
67
66
|
],
|
|
68
|
-
gasBudget:
|
|
67
|
+
gasBudget: gasBudget,
|
|
69
68
|
};
|
|
70
69
|
return [2 /*return*/, tx];
|
|
71
70
|
});
|
|
@@ -74,4 +73,4 @@ function getAuthorizedNewCoveredCallVaultTx(packageId, registry, typeArgument, m
|
|
|
74
73
|
exports.getAuthorizedNewCoveredCallVaultTx = getAuthorizedNewCoveredCallVaultTx;
|
|
75
74
|
/*
|
|
76
75
|
sui client call --package 0x1543511bdce9ea3c401c4939126cea518adee965 --module covered_call --function new_covered_call_vault --type-args 0x2::sui::SUI --args 0x8517b2dbaae56eeb84352e4869b289459c68965b 0xb02452d0bbef3cbdc7840ea5bad27bcdd4031675 123 leoAsset 456 --gas-budget 100000
|
|
77
|
-
*/
|
|
76
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedRemoveAuthorizedUserTx(packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedRemoveAuthorizedUserTx(gasBudget: string, packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedRemoveAuthorizedUserTx = void 0;
|
|
40
|
-
function getAuthorizedRemoveAuthorizedUserTx(packageId, registry, managerCap, address) {
|
|
40
|
+
function getAuthorizedRemoveAuthorizedUserTx(gasBudget, packageId, registry, managerCap, address) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,12 +46,8 @@ function getAuthorizedRemoveAuthorizedUserTx(packageId, registry, managerCap, ad
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'remove_authorized_user',
|
|
48
48
|
typeArguments: [],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
registry,
|
|
52
|
-
address,
|
|
53
|
-
],
|
|
54
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [managerCap, registry, address],
|
|
50
|
+
gasBudget: gasBudget,
|
|
55
51
|
};
|
|
56
52
|
return [2 /*return*/, tx];
|
|
57
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx = void 0;
|
|
40
|
-
function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(packageId, registry, typeArgument, index, address) {
|
|
40
|
+
function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArgument, index, address) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -46,12 +46,8 @@ function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(packageId, registry
|
|
|
46
46
|
module: 'covered_call',
|
|
47
47
|
function: 'authorized_remove_covered_call_vault_authorized_user',
|
|
48
48
|
typeArguments: [typeArgument],
|
|
49
|
-
arguments: [
|
|
50
|
-
|
|
51
|
-
index,
|
|
52
|
-
address,
|
|
53
|
-
],
|
|
54
|
-
gasBudget: 100000,
|
|
49
|
+
arguments: [registry, index, address],
|
|
50
|
+
gasBudget: gasBudget,
|
|
55
51
|
};
|
|
56
52
|
return [2 /*return*/, tx];
|
|
57
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedSettleTx(packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
1
|
+
export declare function getAuthorizedSettleTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|