@typus/typus-sdk 0.2.3 → 0.2.4
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/constants.d.ts +6 -6
- package/lib/constants.js +6 -6
- package/lib/scripts/coveredCall/getClaimAllTx.js +1 -1
- package/lib/scripts/coveredCall/getClaimTx.js +2 -4
- package/lib/scripts/coveredCall/getNewAuctionTx.js +2 -7
- package/lib/scripts/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +5 -10
- package/lib/scripts/coveredCall/getNewCoveredCallVaultTx.js +12 -6
- package/lib/test/testClaim.js +2 -2
- package/lib/test/testNewVault.js +12 -5
- package/lib/test/testSettle.js +18 -13
- package/lib/utils/coveredCall/getClaimAllTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimAllTx.js +1 -2
- package/lib/utils/coveredCall/getClaimTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimTx.js +1 -3
- package/lib/utils/coveredCall/getDeliveryTx.js +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.js +1 -6
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +4 -8
- package/lib/utils/coveredCall/getNewBidTx.js +2 -2
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +12 -6
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ export declare const TOKEN_REGISTRY_BTC = "0xb10e4bf339c2495d793647fa726fd5427ca
|
|
|
3
3
|
export declare const TOKEN_REGISTRY_ETH = "0x59c42da8bb8a3b98a764985af1d9cef7e6e9f87d";
|
|
4
4
|
export declare const TOKEN_REGISTRY_SUI = "0xf4a1954d812748ee08dd4c4c1e21bb136a6c089e";
|
|
5
5
|
export declare const ORACLE_PACKAGE = "0x437d2eb473bd348ad22b37ffb84bd652656026b1";
|
|
6
|
-
export declare const COVERED_CALL_PACKAGE = "
|
|
7
|
-
export declare const COVERED_CALL_REGISTRY = "
|
|
8
|
-
export declare const COVERED_CALL_MANAGER = "
|
|
9
|
-
export declare const USER_SHARE_TABLE = "
|
|
10
|
-
export declare const MAKER_SHARE_TABLE = "
|
|
11
|
-
export declare const DOV_PACKAGE = "
|
|
6
|
+
export declare const COVERED_CALL_PACKAGE = "0x557125ee218ff0f09b74e67110ca11a10b7c3553";
|
|
7
|
+
export declare const COVERED_CALL_REGISTRY = "0xe713352b3e1679825c8bd209a9f2c5c355572eea";
|
|
8
|
+
export declare const COVERED_CALL_MANAGER = "0x1924683a4112a39f2eee9e07a770ed7f7f911ad5";
|
|
9
|
+
export declare const USER_SHARE_TABLE = "0x1987456681ee8ba897a6693d7355931e5d25e17a";
|
|
10
|
+
export declare const MAKER_SHARE_TABLE = "0xcb3e6ad0b3ab79e35899d134dc42bdd3b97ca485";
|
|
11
|
+
export declare const DOV_PACKAGE = "0x1ab7f453176dc6d35fe5e8b6b27a53cb73d1061d";
|
|
12
12
|
export declare const DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
13
13
|
export declare const FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
14
14
|
export declare const TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
package/lib/constants.js
CHANGED
|
@@ -9,13 +9,13 @@ exports.TOKEN_REGISTRY_SUI = "0xf4a1954d812748ee08dd4c4c1e21bb136a6c089e"; //fak
|
|
|
9
9
|
//publish from typus-oracle
|
|
10
10
|
exports.ORACLE_PACKAGE = "0x437d2eb473bd348ad22b37ffb84bd652656026b1";
|
|
11
11
|
//publish from typus-dov/cover_call
|
|
12
|
-
exports.COVERED_CALL_PACKAGE = "
|
|
13
|
-
exports.COVERED_CALL_REGISTRY = "
|
|
14
|
-
exports.COVERED_CALL_MANAGER = "
|
|
15
|
-
exports.USER_SHARE_TABLE = "
|
|
16
|
-
exports.MAKER_SHARE_TABLE = "
|
|
12
|
+
exports.COVERED_CALL_PACKAGE = "0x557125ee218ff0f09b74e67110ca11a10b7c3553";
|
|
13
|
+
exports.COVERED_CALL_REGISTRY = "0xe713352b3e1679825c8bd209a9f2c5c355572eea";
|
|
14
|
+
exports.COVERED_CALL_MANAGER = "0x1924683a4112a39f2eee9e07a770ed7f7f911ad5";
|
|
15
|
+
exports.USER_SHARE_TABLE = "0x1987456681ee8ba897a6693d7355931e5d25e17a";
|
|
16
|
+
exports.MAKER_SHARE_TABLE = "0xcb3e6ad0b3ab79e35899d134dc42bdd3b97ca485";
|
|
17
17
|
//publish from typus-dov/typus-dov
|
|
18
|
-
exports.DOV_PACKAGE = "
|
|
18
|
+
exports.DOV_PACKAGE = "0x1ab7f453176dc6d35fe5e8b6b27a53cb73d1061d";
|
|
19
19
|
exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
20
20
|
exports.FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
21
21
|
exports.TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
|
@@ -46,7 +46,7 @@ var constants_1 = require("../../constants");
|
|
|
46
46
|
console.log("test for getClaimAllTx()");
|
|
47
47
|
index = 0;
|
|
48
48
|
isRolling = true;
|
|
49
|
-
return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index
|
|
49
|
+
return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index)];
|
|
50
50
|
case 1:
|
|
51
51
|
claimAllTx = _a.sent();
|
|
52
52
|
console.log(claimAllTx);
|
|
@@ -39,15 +39,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var getClaimTx_1 = require("../../utils/coveredCall/getClaimTx");
|
|
40
40
|
var constants_1 = require("../../constants");
|
|
41
41
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
var index,
|
|
42
|
+
var index, claimTx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
switch (_a.label) {
|
|
45
45
|
case 0:
|
|
46
46
|
console.log("test for getClaimTx()");
|
|
47
47
|
index = 0;
|
|
48
|
-
|
|
49
|
-
isRolling = true;
|
|
50
|
-
return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, amount, isRolling)];
|
|
48
|
+
return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index)];
|
|
51
49
|
case 1:
|
|
52
50
|
claimTx = _a.sent();
|
|
53
51
|
console.log(claimTx);
|
|
@@ -39,19 +39,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var getNewAuctionTx_1 = require("../../utils/coveredCall/getNewAuctionTx");
|
|
40
40
|
var constants_1 = require("../../constants");
|
|
41
41
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
var typeArgument, vaultIndex,
|
|
42
|
+
var typeArgument, vaultIndex, newAuctionTx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
switch (_a.label) {
|
|
45
45
|
case 0:
|
|
46
46
|
console.log("test for getNewAuctionTx()");
|
|
47
47
|
typeArgument = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
48
48
|
vaultIndex = 1;
|
|
49
|
-
|
|
50
|
-
end = 100;
|
|
51
|
-
decay = 0;
|
|
52
|
-
initialPrice = 1;
|
|
53
|
-
finalPrice = 100;
|
|
54
|
-
return [4 /*yield*/, (0, getNewAuctionTx_1.getNewAuctionTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex, start, end, decay, initialPrice, finalPrice)];
|
|
49
|
+
return [4 /*yield*/, (0, getNewAuctionTx_1.getNewAuctionTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex)];
|
|
55
50
|
case 1:
|
|
56
51
|
newAuctionTx = _a.sent();
|
|
57
52
|
console.log(newAuctionTx);
|
|
@@ -39,21 +39,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var getNewAuctionWithNextCoveredCallVaultTx_1 = require("../../utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx");
|
|
40
40
|
var constants_1 = require("../../constants");
|
|
41
41
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
var index,
|
|
42
|
+
var index, timeOracle, activationTsMs, expirationTsMs, newAuctionWithNextCoveredCallVaultTx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
switch (_a.label) {
|
|
45
45
|
case 0:
|
|
46
46
|
console.log("test for getNewAuctionWithNextCoveredCallVaultTx()");
|
|
47
47
|
index = 1;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
finalPrice = 1;
|
|
53
|
-
expiration = 2000;
|
|
54
|
-
assetName = "BTC";
|
|
55
|
-
strikeOtmPct = 2000;
|
|
56
|
-
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, start, end, decay, initialPrice, finalPrice, expiration, strikeOtmPct)];
|
|
48
|
+
timeOracle = "";
|
|
49
|
+
activationTsMs = 1672992000000;
|
|
50
|
+
expirationTsMs = 1672992000000 + 604800000;
|
|
51
|
+
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, timeOracle, activationTsMs, expirationTsMs)];
|
|
57
52
|
case 1:
|
|
58
53
|
newAuctionWithNextCoveredCallVaultTx = _a.sent();
|
|
59
54
|
console.log(newAuctionWithNextCoveredCallVaultTx);
|
|
@@ -39,19 +39,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var getNewCoveredCallVaultTx_1 = require("../../utils/coveredCall/getNewCoveredCallVaultTx");
|
|
40
40
|
var constants_1 = require("../../constants");
|
|
41
41
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
var
|
|
42
|
+
var tokenDecimal, shareDecimal, timeOracle, period, activationTsMs, expirationTsMs, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance, newCoveredCallVaultTx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
44
44
|
switch (_a.label) {
|
|
45
45
|
case 0:
|
|
46
46
|
console.log("test for getNewCoveredCallVaultTx()");
|
|
47
|
-
expiration = 123;
|
|
48
|
-
strike = 456;
|
|
49
47
|
tokenDecimal = 9;
|
|
50
48
|
shareDecimal = 4;
|
|
51
49
|
timeOracle = "";
|
|
52
|
-
period =
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
period = 1;
|
|
51
|
+
activationTsMs = 1671782400000;
|
|
52
|
+
expirationTsMs = 1671782400000 + 604800000;
|
|
53
|
+
capacity = 1000000000;
|
|
54
|
+
strikeOtmPct = 500;
|
|
55
|
+
decaySpeed = 1;
|
|
56
|
+
initialPrice = 5000;
|
|
57
|
+
finalPrice = 1000;
|
|
58
|
+
auctionDurationInMs = 3600000;
|
|
59
|
+
prevBalance = 0;
|
|
60
|
+
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, constants_1.COVERED_CALL_MANAGER, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance)];
|
|
55
61
|
case 1:
|
|
56
62
|
newCoveredCallVaultTx = _a.sent();
|
|
57
63
|
console.log(newCoveredCallVaultTx);
|
package/lib/test/testClaim.js
CHANGED
|
@@ -61,14 +61,14 @@ 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
|
-
return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex
|
|
64
|
+
return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex)];
|
|
65
65
|
case 2:
|
|
66
66
|
claimTx = _a.sent();
|
|
67
67
|
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
68
68
|
case 3:
|
|
69
69
|
_a.sent();
|
|
70
70
|
console.log("claim successfully");
|
|
71
|
-
return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex
|
|
71
|
+
return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex)];
|
|
72
72
|
case 4:
|
|
73
73
|
claimAllTx = _a.sent();
|
|
74
74
|
return [4 /*yield*/, signer.executeMoveCall(claimAllTx)];
|
package/lib/test/testNewVault.js
CHANGED
|
@@ -72,12 +72,19 @@ var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read
|
|
|
72
72
|
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
73
73
|
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
74
74
|
var token = "0x07f6ef13aa444a793b11675494a8c7fb3b1acab7"; // minted token
|
|
75
|
-
var expiration = 1;
|
|
76
|
-
var strike = 105;
|
|
77
75
|
var tokenDecimal = 9;
|
|
78
76
|
var shareDecimal = 4;
|
|
79
|
-
var
|
|
80
|
-
var
|
|
77
|
+
var timeOracle = "";
|
|
78
|
+
var period = 1;
|
|
79
|
+
var activationTsMs = 1671782400000;
|
|
80
|
+
var expirationTsMs = 1671782400000 + 604800000;
|
|
81
|
+
var capacity = 1000000000;
|
|
82
|
+
var strikeOtmPct = 500;
|
|
83
|
+
var decaySpeed = 1;
|
|
84
|
+
var initialPrice = 5000;
|
|
85
|
+
var finalPrice = 1000;
|
|
86
|
+
var auctionDurationInMs = 3600000;
|
|
87
|
+
var prevBalance = 0;
|
|
81
88
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
89
|
var typeArgument, _a, timeOracle, _, newCoveredCallVaultTx, moveCallTxn;
|
|
83
90
|
return __generator(this, function (_b) {
|
|
@@ -90,7 +97,7 @@ var start = 1671782400000; // 2022/12/23 Friday 08:00:00
|
|
|
90
97
|
return [4 /*yield*/, (0, createTimeOracle_1.createTimeOracle)()];
|
|
91
98
|
case 2:
|
|
92
99
|
_a = __read.apply(void 0, [_b.sent(), 2]), timeOracle = _a[0], _ = _a[1];
|
|
93
|
-
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, tokenDecimal, shareDecimal,
|
|
100
|
+
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, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance)];
|
|
94
101
|
case 3:
|
|
95
102
|
newCoveredCallVaultTx = _b.sent();
|
|
96
103
|
return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
|
package/lib/test/testSettle.js
CHANGED
|
@@ -92,7 +92,7 @@ var expirationTsMs2 = 2000000;
|
|
|
92
92
|
// let timeOracle = '0x2b06a0f8109e394258c288b1d90c8c5a9c3832db';
|
|
93
93
|
// let timeOracleManager = '0xcad2723ff9c95ce423d3614375e2fa73ce9a7c04';
|
|
94
94
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
-
var typeArgument, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, price, ts, tokenDecimal, shareDecimal, period,
|
|
95
|
+
var typeArgument, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, price, ts, tokenDecimal, shareDecimal, period, activationTsMs, expirationTsMs, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance, vaultIndex, depositAmount, startAuctionTsMs, endAuctionTsMs, currentTime, bidSize, sellSize, premiumRoi, exposureRatio;
|
|
96
96
|
return __generator(this, function (_c) {
|
|
97
97
|
switch (_c.label) {
|
|
98
98
|
case 0: return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token)
|
|
@@ -122,11 +122,16 @@ var expirationTsMs2 = 2000000;
|
|
|
122
122
|
tokenDecimal = 9;
|
|
123
123
|
shareDecimal = 4;
|
|
124
124
|
period = 1;
|
|
125
|
-
|
|
126
|
-
;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
activationTsMs = 1671782400000;
|
|
126
|
+
expirationTsMs = 1671782400000 + 604800000;
|
|
127
|
+
capacity = 1000000000;
|
|
128
|
+
strikeOtmPct = 500;
|
|
129
|
+
decaySpeed = 1;
|
|
130
|
+
initialPrice = 5000;
|
|
131
|
+
finalPrice = 1000;
|
|
132
|
+
auctionDurationInMs = 3600000;
|
|
133
|
+
prevBalance = 0;
|
|
134
|
+
return [4 /*yield*/, createNewVault(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance)];
|
|
130
135
|
case 5:
|
|
131
136
|
_c.sent();
|
|
132
137
|
return [4 /*yield*/, getNewestVaultIndex(constants_1.COVERED_CALL_REGISTRY)];
|
|
@@ -152,9 +157,9 @@ var expirationTsMs2 = 2000000;
|
|
|
152
157
|
decaySpeed = 2;
|
|
153
158
|
initialPrice = 500000000;
|
|
154
159
|
finalPrice = 100000000;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
];
|
|
160
|
+
activationTsMs = 1672992000000;
|
|
161
|
+
expirationTsMs = 1672992000000 + 604800000;
|
|
162
|
+
return [4 /*yield*/, createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, timeOracle, activationTsMs, expirationTsMs)];
|
|
158
163
|
case 10:
|
|
159
164
|
_c.sent();
|
|
160
165
|
currentTime = startAuctionTsMs + 300;
|
|
@@ -338,7 +343,7 @@ function updateTimeOracle(timeOracle, managerCap, ts) {
|
|
|
338
343
|
});
|
|
339
344
|
});
|
|
340
345
|
}
|
|
341
|
-
function createNewVault(typeArgument,
|
|
346
|
+
function createNewVault(packageId, registry, typeArgument, managerCap, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance) {
|
|
342
347
|
return __awaiter(this, void 0, void 0, function () {
|
|
343
348
|
var _this = this;
|
|
344
349
|
return __generator(this, function (_a) {
|
|
@@ -348,7 +353,7 @@ function createNewVault(typeArgument, expirationTsMs1, tokenDecimal, shareDecima
|
|
|
348
353
|
switch (_a.label) {
|
|
349
354
|
case 0:
|
|
350
355
|
_a.trys.push([0, 4, , 5]);
|
|
351
|
-
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, tokenDecimal, shareDecimal,
|
|
356
|
+
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, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance)];
|
|
352
357
|
case 1:
|
|
353
358
|
newCoveredCallVaultTx = _a.sent();
|
|
354
359
|
return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
|
|
@@ -463,7 +468,7 @@ function depositToVault(typeArgument, vaultIndex, depositAmount) {
|
|
|
463
468
|
});
|
|
464
469
|
});
|
|
465
470
|
}
|
|
466
|
-
function createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex,
|
|
471
|
+
function createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, timeOracle, activationTsMs, expirationTsMs) {
|
|
467
472
|
return __awaiter(this, void 0, void 0, function () {
|
|
468
473
|
var _this = this;
|
|
469
474
|
return __generator(this, function (_a) {
|
|
@@ -473,7 +478,7 @@ function createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, star
|
|
|
473
478
|
switch (_a.label) {
|
|
474
479
|
case 0:
|
|
475
480
|
_a.trys.push([0, 3, , 4]);
|
|
476
|
-
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex,
|
|
481
|
+
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, timeOracle, activationTsMs, expirationTsMs)];
|
|
477
482
|
case 1:
|
|
478
483
|
txn = _a.sent();
|
|
479
484
|
return [4 /*yield*/, signer.executeMoveCall(txn)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getClaimAllTx(packageId: string, registry: string, typeArgument: string, index: number
|
|
1
|
+
export declare function getClaimAllTx(packageId: string, registry: string, typeArgument: string, index: number): 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.getClaimAllTx = void 0;
|
|
40
|
-
function getClaimAllTx(packageId, registry, typeArgument, index
|
|
40
|
+
function getClaimAllTx(packageId, registry, typeArgument, index) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -49,7 +49,6 @@ function getClaimAllTx(packageId, registry, typeArgument, index, isRolling) {
|
|
|
49
49
|
arguments: [
|
|
50
50
|
registry,
|
|
51
51
|
[index],
|
|
52
|
-
[isRolling],
|
|
53
52
|
],
|
|
54
53
|
gasBudget: 10000,
|
|
55
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getClaimTx(packageId: string, registry: string, typeArgument: string, index: number
|
|
1
|
+
export declare function getClaimTx(packageId: string, registry: string, typeArgument: string, index: number): 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.getClaimTx = void 0;
|
|
40
|
-
function getClaimTx(packageId, registry, typeArgument, index
|
|
40
|
+
function getClaimTx(packageId, registry, typeArgument, index) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -49,8 +49,6 @@ function getClaimTx(packageId, registry, typeArgument, index, amount, isRolling)
|
|
|
49
49
|
arguments: [
|
|
50
50
|
registry,
|
|
51
51
|
index,
|
|
52
|
-
amount,
|
|
53
|
-
isRolling,
|
|
54
52
|
],
|
|
55
53
|
gasBudget: 10000,
|
|
56
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: number
|
|
1
|
+
export declare function getNewAuctionTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: number): 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, managerCap, index
|
|
40
|
+
function getNewAuctionTx(packageId, registry, typeArgument, managerCap, index) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -50,11 +50,6 @@ function getNewAuctionTx(packageId, registry, typeArgument, managerCap, index, s
|
|
|
50
50
|
managerCap,
|
|
51
51
|
registry,
|
|
52
52
|
index,
|
|
53
|
-
start,
|
|
54
|
-
end,
|
|
55
|
-
decay,
|
|
56
|
-
initialPrice,
|
|
57
|
-
finalPrice,
|
|
58
53
|
],
|
|
59
54
|
gasBudget: 1000,
|
|
60
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionWithNextCoveredCallVaultTx(packageId: string, managerCap: string, registry: string, typeArgument: string, index: number,
|
|
1
|
+
export declare function getNewAuctionWithNextCoveredCallVaultTx(packageId: string, managerCap: string, registry: string, typeArgument: string, index: number, timeOracle: string, activationTsMs: number, expirationTsMs: number): 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.getNewAuctionWithNextCoveredCallVaultTx = void 0;
|
|
40
|
-
function getNewAuctionWithNextCoveredCallVaultTx(packageId, managerCap, registry, typeArgument, index,
|
|
40
|
+
function getNewAuctionWithNextCoveredCallVaultTx(packageId, managerCap, registry, typeArgument, index, timeOracle, activationTsMs, expirationTsMs) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -50,13 +50,9 @@ function getNewAuctionWithNextCoveredCallVaultTx(packageId, managerCap, registry
|
|
|
50
50
|
managerCap,
|
|
51
51
|
registry,
|
|
52
52
|
index,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
initialPrice,
|
|
57
|
-
finalPrice,
|
|
58
|
-
expiration,
|
|
59
|
-
strikeOtmPct,
|
|
53
|
+
timeOracle,
|
|
54
|
+
activationTsMs,
|
|
55
|
+
expirationTsMs,
|
|
60
56
|
],
|
|
61
57
|
gasBudget: 10000,
|
|
62
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, tokenDecimal: number, shareDecimal: number,
|
|
1
|
+
export declare function getNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, timeOracle: string, period: number, activationTsMs: number, expirationTsMs: number, tokenDecimal: number, shareDecimal: number, capacity: number, strikeOtmPct: number, decaySpeed: number, initialPrice: number, finalPrice: number, auctionDurationInMs: number, prevBalance: number): 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.getNewCoveredCallVaultTx = void 0;
|
|
40
|
-
function getNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap, tokenDecimal, shareDecimal,
|
|
40
|
+
function getNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
42
|
var tx;
|
|
43
43
|
return __generator(this, function (_a) {
|
|
@@ -49,13 +49,19 @@ function getNewCoveredCallVaultTx(packageId, registry, typeArgument, managerCap,
|
|
|
49
49
|
arguments: [
|
|
50
50
|
managerCap,
|
|
51
51
|
registry,
|
|
52
|
-
tokenDecimal,
|
|
53
|
-
shareDecimal,
|
|
54
52
|
timeOracle,
|
|
55
53
|
period,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
activationTsMs,
|
|
55
|
+
expirationTsMs,
|
|
56
|
+
tokenDecimal,
|
|
57
|
+
shareDecimal,
|
|
58
|
+
capacity,
|
|
59
|
+
strikeOtmPct,
|
|
60
|
+
decaySpeed,
|
|
61
|
+
initialPrice,
|
|
62
|
+
finalPrice,
|
|
63
|
+
auctionDurationInMs,
|
|
64
|
+
prevBalance,
|
|
59
65
|
],
|
|
60
66
|
gasBudget: 10000,
|
|
61
67
|
};
|