@typus/typus-sdk 0.5.8 → 0.6.0
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 +9 -9
- package/lib/constants.js +9 -9
- package/lib/scripts/sui.js +0 -12
- package/lib/test/eventListener.js +52 -18
- package/lib/test/getBidData.js +1 -2
- package/lib/test/getMakersShares.js +1 -2
- package/lib/test/getUsersShares.js +1 -2
- package/lib/test/getVaultData.js +1 -2
- package/lib/test/testClaim.js +1 -1
- package/lib/test/testDeposit.js +1 -1
- package/lib/test/testDepositV2.js +2 -2
- package/lib/test/testMint.js +1 -1
- package/lib/test/testNewAuction.js +1 -1
- package/lib/test/testNewVault.js +1 -1
- package/lib/test/testOracle.js +1 -1
- package/lib/test/testSettle.js +1 -1
- package/lib/test/testUnsubscribe.js +1 -1
- package/lib/test/testWithdraw.js +1 -1
- package/lib/utils/auction/getBid.js +2 -2
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/createPriceOracle.js +1 -1
- package/lib/utils/coveredCall/createTimeOracle.js +1 -1
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimAllTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimTx.d.ts +1 -1
- package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getCloseVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +1 -1
- package/lib/utils/coveredCall/getDepositTx.d.ts +1 -1
- package/lib/utils/coveredCall/getEvolutionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +1 -1
- package/lib/utils/coveredCall/getMakerClaimTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewBidTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewManagerTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRefundTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveBidTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRollOverTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSettleTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSubscribeTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdateCapacityTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getWithdrawTx.d.ts +1 -1
- package/lib/utils/fetchData.js +6 -6
- package/lib/utils/getCreateTokenRegistryTx.d.ts +1 -1
- package/lib/utils/getMakersShares.js +4 -4
- package/lib/utils/getMintTx.d.ts +1 -1
- package/lib/utils/getNewOracleTx.d.ts +1 -1
- package/lib/utils/getNewTimeOracleTx.d.ts +1 -1
- package/lib/utils/getUpdateOracleTx.d.ts +1 -1
- package/lib/utils/getUpdateTimeOracleTx.d.ts +1 -1
- package/lib/utils/getUsersShares.js +4 -4
- package/lib/utils/getVaultData.js +2 -2
- package/lib/utils/getWhiteListFromRegistry.js +2 -2
- package/package.json +3 -4
package/lib/constants.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare const TOKEN_PACKAGE = "
|
|
1
|
+
export declare const TOKEN_PACKAGE = "0x9b859f4df672118af1cc3395261f11f3e11d5653";
|
|
2
2
|
export declare const TOKEN_REGISTRY_BTC = "0x7325b75b85ee45e78204a9dcf7800a397259eb3d";
|
|
3
3
|
export declare const TOKEN_REGISTRY_ETH = "0x475d3b10d29c03d85dfa707b5479955729216d4d";
|
|
4
4
|
export declare const TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
5
5
|
export declare const TOKEN_REGISTRY_APT = "0xf1a947ebc2643942bf3f2ecbd6b583c0f8dc3baf";
|
|
6
6
|
export declare const TOKEN_REGISTRY_DOGE = "0x4dbe73f8a744008bc20d12aaa0d4fc8f01692358";
|
|
7
7
|
export declare const TOKEN_REGISTRY_USDC = "0x82e0a1473c6c4d4f713a0ac5957e0c7a2278ed1e";
|
|
8
|
-
export declare const ORACLE_PACKAGE = "
|
|
9
|
-
export declare const TIME_ORACLE = "
|
|
10
|
-
export declare const COVERED_CALL_PACKAGE = "
|
|
11
|
-
export declare const COVERED_CALL_REGISTRY = "
|
|
12
|
-
export declare const COVERED_CALL_MANAGER = "
|
|
13
|
-
export declare const USER_SHARE_TABLE = "
|
|
14
|
-
export declare const USER_REFUND_TABLE = "
|
|
15
|
-
export declare const MAKER_SHARE_TABLE = "
|
|
8
|
+
export declare const ORACLE_PACKAGE = "0x8660f4d7e5afe2b58b46ba915393161cbe92787c";
|
|
9
|
+
export declare const TIME_ORACLE = "0x9472de591c68ee1a8a9771221c391f86feb2c1bb";
|
|
10
|
+
export declare const COVERED_CALL_PACKAGE = "0x60923650807ee3ccc53c539920b7b0ccea4b1554";
|
|
11
|
+
export declare const COVERED_CALL_REGISTRY = "0x46d88d85f2f22d7fffda51127fe48b274aedd2f1";
|
|
12
|
+
export declare const COVERED_CALL_MANAGER = "0xa47107c76cc3cbb7fdf19d16ac79f8fd9b9f5e4f";
|
|
13
|
+
export declare const USER_SHARE_TABLE = "0xb88a461c47ec45198fd7de39cd72b7be3dcaad93";
|
|
14
|
+
export declare const USER_REFUND_TABLE = "0x0bd398f74aa24022595e7c7ae50bd2f258ca07aa";
|
|
15
|
+
export declare const MAKER_SHARE_TABLE = "0x9d492e3724f23bad705c8d30ac244ae76006cef1";
|
|
16
16
|
export declare const DOV_PACKAGE = "0x49e71a735dc6bdf7327e6c663d04a3e7f68bafd0";
|
|
17
17
|
export declare const TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
18
18
|
export declare const PRICE_DECIMAL = 8;
|
package/lib/constants.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TESTNET_RPC_ENDPOINT = exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.TEST_MNEMONIC = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.TOKEN_DECIMAL = exports.PRICE_DECIMAL = exports.TEST_MINT_TOKEN = exports.DOV_PACKAGE = exports.MAKER_SHARE_TABLE = exports.USER_REFUND_TABLE = exports.USER_SHARE_TABLE = exports.COVERED_CALL_MANAGER = exports.COVERED_CALL_REGISTRY = exports.COVERED_CALL_PACKAGE = exports.TIME_ORACLE = exports.ORACLE_PACKAGE = exports.TOKEN_REGISTRY_USDC = exports.TOKEN_REGISTRY_DOGE = exports.TOKEN_REGISTRY_APT = exports.TOKEN_REGISTRY_SUI = exports.TOKEN_REGISTRY_ETH = exports.TOKEN_REGISTRY_BTC = exports.TOKEN_PACKAGE = void 0;
|
|
4
4
|
//publish from sui-dev-token
|
|
5
|
-
exports.TOKEN_PACKAGE = "
|
|
5
|
+
exports.TOKEN_PACKAGE = "0x9b859f4df672118af1cc3395261f11f3e11d5653";
|
|
6
6
|
exports.TOKEN_REGISTRY_BTC = "0x7325b75b85ee45e78204a9dcf7800a397259eb3d";
|
|
7
7
|
exports.TOKEN_REGISTRY_ETH = "0x475d3b10d29c03d85dfa707b5479955729216d4d";
|
|
8
8
|
exports.TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
@@ -10,15 +10,15 @@ exports.TOKEN_REGISTRY_APT = "0xf1a947ebc2643942bf3f2ecbd6b583c0f8dc3baf";
|
|
|
10
10
|
exports.TOKEN_REGISTRY_DOGE = "0x4dbe73f8a744008bc20d12aaa0d4fc8f01692358";
|
|
11
11
|
exports.TOKEN_REGISTRY_USDC = "0x82e0a1473c6c4d4f713a0ac5957e0c7a2278ed1e";
|
|
12
12
|
//publish from typus-oracle
|
|
13
|
-
exports.ORACLE_PACKAGE = "
|
|
14
|
-
exports.TIME_ORACLE = '
|
|
13
|
+
exports.ORACLE_PACKAGE = "0x8660f4d7e5afe2b58b46ba915393161cbe92787c";
|
|
14
|
+
exports.TIME_ORACLE = '0x9472de591c68ee1a8a9771221c391f86feb2c1bb';
|
|
15
15
|
//publish from typus-dov/cover_call
|
|
16
|
-
exports.COVERED_CALL_PACKAGE = "
|
|
17
|
-
exports.COVERED_CALL_REGISTRY = "
|
|
18
|
-
exports.COVERED_CALL_MANAGER = "
|
|
19
|
-
exports.USER_SHARE_TABLE = "
|
|
20
|
-
exports.USER_REFUND_TABLE = "
|
|
21
|
-
exports.MAKER_SHARE_TABLE = "
|
|
16
|
+
exports.COVERED_CALL_PACKAGE = "0x60923650807ee3ccc53c539920b7b0ccea4b1554";
|
|
17
|
+
exports.COVERED_CALL_REGISTRY = "0x46d88d85f2f22d7fffda51127fe48b274aedd2f1";
|
|
18
|
+
exports.COVERED_CALL_MANAGER = "0xa47107c76cc3cbb7fdf19d16ac79f8fd9b9f5e4f";
|
|
19
|
+
exports.USER_SHARE_TABLE = "0xb88a461c47ec45198fd7de39cd72b7be3dcaad93";
|
|
20
|
+
exports.USER_REFUND_TABLE = "0x0bd398f74aa24022595e7c7ae50bd2f258ca07aa";
|
|
21
|
+
exports.MAKER_SHARE_TABLE = "0x9d492e3724f23bad705c8d30ac244ae76006cef1";
|
|
22
22
|
//publish from typus-dov/typus-dov
|
|
23
23
|
exports.DOV_PACKAGE = "0x49e71a735dc6bdf7327e6c663d04a3e7f68bafd0";
|
|
24
24
|
exports.TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
package/lib/scripts/sui.js
CHANGED
|
@@ -39,18 +39,6 @@ function readJsonFile(filePath) {
|
|
|
39
39
|
// })();
|
|
40
40
|
// //Success
|
|
41
41
|
// (async () => {
|
|
42
|
-
// console.log("test for getObjectsOwnedByObject()")
|
|
43
|
-
// const objects = await provider.getObjectsOwnedByObject(
|
|
44
|
-
// obj1
|
|
45
|
-
// )
|
|
46
|
-
// console.log(objects)
|
|
47
|
-
// //filter obj by type
|
|
48
|
-
// for (let object of objects) {
|
|
49
|
-
// if (object.type.includes("dynamic_field")) console.log("it's dynamic field object")
|
|
50
|
-
// }
|
|
51
|
-
// })();
|
|
52
|
-
// //Success
|
|
53
|
-
// (async () => {
|
|
54
42
|
// console.log("test for getObject() and getObjectBatch()")
|
|
55
43
|
// const txn = await provider.getObject(
|
|
56
44
|
// obj1
|
|
@@ -142,10 +142,11 @@ function generateBidId(vault) {
|
|
|
142
142
|
}
|
|
143
143
|
function getBidEventsCranker(type, renewSec, provider) {
|
|
144
144
|
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
-
var res;
|
|
145
|
+
var res, isFirstTime;
|
|
146
146
|
var _this = this;
|
|
147
147
|
return __generator(this, function (_a) {
|
|
148
148
|
res = [];
|
|
149
|
+
isFirstTime = true;
|
|
149
150
|
node_cron_1.default.schedule('*/' + renewSec.toString() + ' * * * * *', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
150
151
|
var events, newRes, newBidHappened, newBid, format_1, vault, bidIds_1, telegramText;
|
|
151
152
|
var _this = this;
|
|
@@ -189,7 +190,12 @@ function getBidEventsCranker(type, renewSec, provider) {
|
|
|
189
190
|
}); });
|
|
190
191
|
telegramText = format_1;
|
|
191
192
|
console.log(telegramText);
|
|
192
|
-
|
|
193
|
+
if (!isFirstTime) {
|
|
194
|
+
sendEventToTelegramChannel(telegramText);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
isFirstTime = false;
|
|
198
|
+
}
|
|
193
199
|
res = newRes;
|
|
194
200
|
_a.label = 4;
|
|
195
201
|
case 4: return [2 /*return*/];
|
|
@@ -203,12 +209,14 @@ function getBidEventsCranker(type, renewSec, provider) {
|
|
|
203
209
|
exports.getBidEventsCranker = getBidEventsCranker;
|
|
204
210
|
function getNewAuctionEventsCranker(type, renewSec, provider) {
|
|
205
211
|
return __awaiter(this, void 0, void 0, function () {
|
|
206
|
-
var res;
|
|
212
|
+
var res, bidIds, isFirstTime;
|
|
207
213
|
var _this = this;
|
|
208
214
|
return __generator(this, function (_a) {
|
|
209
215
|
res = [];
|
|
216
|
+
bidIds = [];
|
|
217
|
+
isFirstTime = true;
|
|
210
218
|
node_cron_1.default.schedule('*/' + renewSec.toString() + ' * * * * *', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
211
|
-
var events, newRes, format_2, vault,
|
|
219
|
+
var events, newRes, format_2, vault, newBidIds, _loop_1, TOKEN_NAME_1, TOKEN_NAME_1_1, asset, telegramText;
|
|
212
220
|
var e_1, _a;
|
|
213
221
|
return __generator(this, function (_b) {
|
|
214
222
|
switch (_b.label) {
|
|
@@ -219,22 +227,28 @@ function getNewAuctionEventsCranker(type, renewSec, provider) {
|
|
|
219
227
|
return [4 /*yield*/, twoObjArrAreSame(newRes, res)];
|
|
220
228
|
case 2:
|
|
221
229
|
if (!!(_b.sent())) return [3 /*break*/, 5];
|
|
222
|
-
format_2 = "Typus Auction is live!
|
|
230
|
+
format_2 = "Typus Auction is live! ";
|
|
231
|
+
format_2 += '<a href="https://devnet.typus.finance/auction">Bid now </a>' + "! \n";
|
|
223
232
|
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
224
233
|
case 3:
|
|
225
234
|
vault = _b.sent();
|
|
226
235
|
return [4 /*yield*/, generateBidId(vault)];
|
|
227
236
|
case 4:
|
|
228
|
-
|
|
237
|
+
newBidIds = _b.sent();
|
|
238
|
+
//compare newBidIds to bidIds
|
|
239
|
+
newBidIds = newBidIds.filter(function (e) {
|
|
240
|
+
return !bidIds.find(function (tmp) { return tmp.bidFormat == e.bidFormat; });
|
|
241
|
+
});
|
|
229
242
|
_loop_1 = function (asset) {
|
|
230
|
-
var targetBids =
|
|
243
|
+
var targetBids = newBidIds.filter(function (bidId) {
|
|
231
244
|
return bidId.bidFormat.toString().includes(asset);
|
|
232
245
|
});
|
|
233
246
|
if (targetBids.length) {
|
|
234
|
-
format_2 += asset + " Options \n";
|
|
247
|
+
format_2 += "* " + asset + " Options \n";
|
|
235
248
|
targetBids.map(function (bidId) {
|
|
236
249
|
var period = (bidId.period == "0") ? "Daily " : (bidId.period == "1") ? "Weekly " : (bidId.period == "2") ? "Monthly " : "- ";
|
|
237
250
|
format_2 += "\t" + period + "Covered Call-" + bidId.bidFormat + " \n";
|
|
251
|
+
format_2 += " \n";
|
|
238
252
|
});
|
|
239
253
|
}
|
|
240
254
|
};
|
|
@@ -253,8 +267,14 @@ function getNewAuctionEventsCranker(type, renewSec, provider) {
|
|
|
253
267
|
}
|
|
254
268
|
telegramText = format_2;
|
|
255
269
|
console.log(telegramText);
|
|
256
|
-
|
|
270
|
+
if (!isFirstTime) {
|
|
271
|
+
sendEventToTelegramChannel(telegramText);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
isFirstTime = false;
|
|
275
|
+
}
|
|
257
276
|
res = newRes;
|
|
277
|
+
bidIds = newBidIds;
|
|
258
278
|
_b.label = 5;
|
|
259
279
|
case 5: return [2 /*return*/];
|
|
260
280
|
}
|
|
@@ -267,12 +287,14 @@ function getNewAuctionEventsCranker(type, renewSec, provider) {
|
|
|
267
287
|
exports.getNewAuctionEventsCranker = getNewAuctionEventsCranker;
|
|
268
288
|
function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
269
289
|
return __awaiter(this, void 0, void 0, function () {
|
|
270
|
-
var res;
|
|
290
|
+
var res, bidIds, isFirstTime;
|
|
271
291
|
var _this = this;
|
|
272
292
|
return __generator(this, function (_a) {
|
|
273
293
|
res = [];
|
|
294
|
+
bidIds = [];
|
|
295
|
+
isFirstTime = true;
|
|
274
296
|
node_cron_1.default.schedule('*/' + renewSec.toString() + ' * * * * *', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
275
|
-
var events, newRes, format_3, vault_1,
|
|
297
|
+
var events, newRes, format_3, vault_1, newBidIds, _loop_2, TOKEN_NAME_2, TOKEN_NAME_2_1, asset, telegramText;
|
|
276
298
|
var e_2, _a;
|
|
277
299
|
var _this = this;
|
|
278
300
|
return __generator(this, function (_b) {
|
|
@@ -290,9 +312,15 @@ function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
|
290
312
|
vault_1 = _b.sent();
|
|
291
313
|
return [4 /*yield*/, generateBidId(vault_1)];
|
|
292
314
|
case 4:
|
|
293
|
-
|
|
315
|
+
newBidIds = _b.sent();
|
|
316
|
+
console.log(newBidIds);
|
|
317
|
+
//compare newBidIds to bidIds
|
|
318
|
+
newBidIds = newBidIds.filter(function (e) {
|
|
319
|
+
return !bidIds.find(function (tmp) { return tmp.bidFormat == e.bidFormat; });
|
|
320
|
+
});
|
|
321
|
+
console.log(newBidIds);
|
|
294
322
|
_loop_2 = function (asset) {
|
|
295
|
-
var targetBids =
|
|
323
|
+
var targetBids = newBidIds.filter(function (bidId) {
|
|
296
324
|
return bidId.bidFormat.toString().includes(asset);
|
|
297
325
|
});
|
|
298
326
|
if (targetBids.length) {
|
|
@@ -303,14 +331,14 @@ function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
|
303
331
|
targetVault = vault_1.find(function (e) { return e.vaultIdx == vaultIdx; });
|
|
304
332
|
totalAuctioned = "-";
|
|
305
333
|
clearingPrice = "-";
|
|
306
|
-
if (targetVault === null || targetVault === void 0 ? void 0 : targetVault.deliveryInfo) {
|
|
307
|
-
// console.log(targetVault.deliveryInfo)
|
|
334
|
+
if (JSON.stringify(targetVault === null || targetVault === void 0 ? void 0 : targetVault.deliveryInfo) != '{}') {
|
|
308
335
|
totalAuctioned = (new decimal_js_1.default(targetVault === null || targetVault === void 0 ? void 0 : targetVault.deliveryInfo.deliverySize).div(new decimal_js_1.default(Math.pow(10, constants_1.TOKEN_DECIMAL)))).toFixed(2);
|
|
309
336
|
clearingPrice = (new decimal_js_1.default(targetVault === null || targetVault === void 0 ? void 0 : targetVault.deliveryInfo.deliveryPrice).div(new decimal_js_1.default(Math.pow(10, 5)))).toFixed(4);
|
|
310
337
|
}
|
|
311
338
|
period = (bidId.period == "0") ? "Daily " : (bidId.period == "1") ? "Weekly " : (bidId.period == "2") ? "Monthly " : "- ";
|
|
312
|
-
format_3 += period + "Covered Call-" + bidId.bidFormat + " auction is closed! Total auctioned " + totalAuctioned +
|
|
339
|
+
format_3 += "* " + period + "Covered Call-" + bidId.bidFormat + " auction is closed! Total auctioned " + totalAuctioned +
|
|
313
340
|
" " + asset + " at a clearing price of " + clearingPrice + " " + asset + " \n";
|
|
341
|
+
format_3 += " \n";
|
|
314
342
|
return [2 /*return*/];
|
|
315
343
|
});
|
|
316
344
|
}); });
|
|
@@ -331,8 +359,14 @@ function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
|
331
359
|
}
|
|
332
360
|
telegramText = format_3;
|
|
333
361
|
console.log(telegramText);
|
|
334
|
-
|
|
362
|
+
if (!isFirstTime) {
|
|
363
|
+
sendEventToTelegramChannel(telegramText);
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
isFirstTime = false;
|
|
367
|
+
}
|
|
335
368
|
res = newRes;
|
|
369
|
+
bidIds = newBidIds;
|
|
336
370
|
_b.label = 5;
|
|
337
371
|
case 5: return [2 /*return*/];
|
|
338
372
|
}
|
|
@@ -347,7 +381,7 @@ function sendEventToTelegramChannel(text) {
|
|
|
347
381
|
return __awaiter(this, void 0, void 0, function () {
|
|
348
382
|
var urlString, request;
|
|
349
383
|
return __generator(this, function (_a) {
|
|
350
|
-
urlString = "https://api.telegram.org/bot".concat(apiToken, "/sendMessage?chat_id=").concat(chatId, "&text=").concat(text);
|
|
384
|
+
urlString = "https://api.telegram.org/bot".concat(apiToken, "/sendMessage?chat_id=").concat(chatId, "&text=").concat(text, "&parse_mode=HTML");
|
|
351
385
|
request = new XMLHttpRequest();
|
|
352
386
|
request.open("GET", urlString);
|
|
353
387
|
request.send();
|
package/lib/test/getBidData.js
CHANGED
|
@@ -37,9 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var getBid_1 = require("../utils/auction/getBid");
|
|
40
|
-
var constants_1 = require("../constants");
|
|
41
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
-
var provider = new sui_js_1.JsonRpcProvider(
|
|
41
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read only operations
|
|
43
42
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
43
|
var vault, bid;
|
|
45
44
|
return __generator(this, function (_a) {
|
|
@@ -37,10 +37,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var constants_1 = require("../constants");
|
|
40
|
-
var constants_2 = require("../constants");
|
|
41
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
42
41
|
var getMakersShares_1 = require("../utils/getMakersShares");
|
|
43
|
-
var provider = new sui_js_1.JsonRpcProvider(
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read only operations
|
|
44
43
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
44
|
var makersShares;
|
|
46
45
|
return __generator(this, function (_a) {
|
|
@@ -38,9 +38,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var constants_1 = require("../constants");
|
|
40
40
|
var getUsersShares_1 = require("../utils/getUsersShares");
|
|
41
|
-
var constants_2 = require("../constants");
|
|
42
41
|
var sui_js_1 = require("@mysten/sui.js");
|
|
43
|
-
var provider = new sui_js_1.JsonRpcProvider(
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read only operations
|
|
44
43
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
44
|
var usersShares;
|
|
46
45
|
return __generator(this, function (_a) {
|
package/lib/test/getVaultData.js
CHANGED
|
@@ -39,8 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var constants_1 = require("../constants");
|
|
40
40
|
var getVaultData_1 = require("../utils/getVaultData");
|
|
41
41
|
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
-
var
|
|
43
|
-
var provider = new sui_js_1.JsonRpcProvider(constants_2.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read only operations
|
|
44
43
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
44
|
var res;
|
|
46
45
|
return __generator(this, function (_a) {
|
package/lib/test/testClaim.js
CHANGED
|
@@ -61,7 +61,7 @@ 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
|
-
gasBudget =
|
|
64
|
+
gasBudget = 100000;
|
|
65
65
|
return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex[0])];
|
|
66
66
|
case 2:
|
|
67
67
|
claimTx = _a.sent();
|
package/lib/test/testDeposit.js
CHANGED
|
@@ -60,7 +60,7 @@ 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
|
-
gasBudget =
|
|
63
|
+
gasBudget = 100000;
|
|
64
64
|
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
|
|
65
65
|
case 2:
|
|
66
66
|
depositTx = _a.sent();
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
// it('Create new vault in registry', async () => {
|
|
34
34
|
// try {
|
|
35
35
|
// let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
|
|
36
|
-
// gasBudget:
|
|
36
|
+
// gasBudget: number, SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
|
|
37
37
|
// let moveCallTxn = await signer.executeMoveCall(newSharkFinVaultTx);
|
|
38
38
|
// console.log(moveCallTxn)
|
|
39
39
|
// assert.ok("Create new vault in registry successfully");
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
// let numOfVaultBeforeCreateVault = registry.details.data.fields.num_of_vault
|
|
49
49
|
// // console.log("numOfVaultBeforeCreateVault: " + numOfVaultBeforeCreateVault)
|
|
50
50
|
// let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
|
|
51
|
-
// gasBudget:
|
|
51
|
+
// gasBudget: number, SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
|
|
52
52
|
// await signer.executeMoveCall(newSharkFinVaultTx);
|
|
53
53
|
// registry = await provider.getObject(SHARKFIN_REGISTRY)
|
|
54
54
|
// //@ts-ignore
|
package/lib/test/testMint.js
CHANGED
|
@@ -52,7 +52,7 @@ var mintAmount = 1000500000;
|
|
|
52
52
|
return [4 /*yield*/, prepareData(tokenRegistry)];
|
|
53
53
|
case 1:
|
|
54
54
|
moduleName = _a.sent();
|
|
55
|
-
gasBudget =
|
|
55
|
+
gasBudget = 100000;
|
|
56
56
|
return [4 /*yield*/, (0, getMintTx_1.getMintTx)(gasBudget, constants_1.TOKEN_PACKAGE, tokenRegistry, moduleName, mintAmount)];
|
|
57
57
|
case 2:
|
|
58
58
|
mintTx = _a.sent();
|
|
@@ -80,7 +80,7 @@ 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
|
-
gasBudget =
|
|
83
|
+
gasBudget = 100000;
|
|
84
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)];
|
|
85
85
|
case 4:
|
|
86
86
|
newAuctionTx = _c.sent();
|
package/lib/test/testNewVault.js
CHANGED
|
@@ -99,7 +99,7 @@ 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
|
-
gasBudget =
|
|
102
|
+
gasBudget = 100000;
|
|
103
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)];
|
|
104
104
|
case 3:
|
|
105
105
|
newCoveredCallVaultTx = _b.sent();
|
package/lib/test/testOracle.js
CHANGED
|
@@ -52,7 +52,7 @@ 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
|
-
gasBudget =
|
|
55
|
+
gasBudget = 100000;
|
|
56
56
|
return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, decimal)];
|
|
57
57
|
case 1:
|
|
58
58
|
newOracleTx = _a.sent();
|
package/lib/test/testSettle.js
CHANGED
|
@@ -87,7 +87,7 @@ var strike = 2000;
|
|
|
87
87
|
var isRolling = true;
|
|
88
88
|
var expirationTsMs1 = 1000000;
|
|
89
89
|
var expirationTsMs2 = 2000000;
|
|
90
|
-
var gasBudget =
|
|
90
|
+
var gasBudget = 100000;
|
|
91
91
|
// let priceOracle = '0x636b4e02991f13720571d0cbbc8b83d80cd14729';
|
|
92
92
|
// let priceOracleManager = '0xd958057a227cdfd2080f4aeda7a16d6fe7135bcc';
|
|
93
93
|
// let timeOracle = '0x2b06a0f8109e394258c288b1d90c8c5a9c3832db';
|
|
@@ -44,7 +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 =
|
|
47
|
+
var gasBudget = 100000;
|
|
48
48
|
/*
|
|
49
49
|
after unsubscribe, the subvault (is deposited) "balance" in fields will be 0,
|
|
50
50
|
and a regular linked list node will be created if not exist, and the value increase.
|
package/lib/test/testWithdraw.js
CHANGED
|
@@ -57,7 +57,7 @@ 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
|
-
gasBudget =
|
|
60
|
+
gasBudget = 100000;
|
|
61
61
|
return [4 /*yield*/, (0, getWithdrawTx_1.getWithdrawTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), withdrawAmount.toString())];
|
|
62
62
|
case 2:
|
|
63
63
|
withdrawTx = _a.sent();
|
|
@@ -52,9 +52,9 @@ function getBid(vault, provider) {
|
|
|
52
52
|
return [2 /*return*/, []];
|
|
53
53
|
}
|
|
54
54
|
bidTable = obj.details.data.fields.value.fields.auction.fields.bids.fields.id.id;
|
|
55
|
-
return [4 /*yield*/, provider.
|
|
55
|
+
return [4 /*yield*/, provider.getDynamicFields(bidTable)];
|
|
56
56
|
case 2:
|
|
57
|
-
obj2 = _a.sent();
|
|
57
|
+
obj2 = (_a.sent()).data;
|
|
58
58
|
ids = obj2.map(function (e) { return e.objectId; });
|
|
59
59
|
return [4 /*yield*/, provider.getObjectBatch(ids)];
|
|
60
60
|
case 3:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedAddAuthorizedUserTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedAddAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedDeliveryTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedDeliveryTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedEvolutionTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedLastEvolutionTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedLastEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, expirationTsMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionTx(gasBudget:
|
|
1
|
+
export declare function getNewAuctionTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedNewCoveredCallVaultTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedNewCoveredCallVaultTx(gasBudget: number, 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 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedRemoveAuthorizedUserTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedRemoveAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedSettleTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedSettleTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedUpdateCapacityTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedUpdateCapacityTx(gasBudget: number, packageId: string, typeArgument: string, registry: string, index: string, capacity: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdateNextVaultConfigTx(gasBudget:
|
|
1
|
+
export declare function getUpdateNextVaultConfigTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, strikeOtmPct: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAuthorizedUpdateVaultConfigTx(gasBudget:
|
|
1
|
+
export declare function getAuthorizedUpdateVaultConfigTx(gasBudget: number, packageId: string, typeArgument: string, registry: string, index: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
|
|
@@ -55,7 +55,7 @@ function createPriceOracle(typeArgument) {
|
|
|
55
55
|
case 0:
|
|
56
56
|
_a.trys.push([0, 4, , 5]);
|
|
57
57
|
console.log("create new price oracle...");
|
|
58
|
-
gasBudget =
|
|
58
|
+
gasBudget = 100000;
|
|
59
59
|
return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, typeArgument, decimal)];
|
|
60
60
|
case 1:
|
|
61
61
|
newOracleTx = _a.sent();
|
|
@@ -54,7 +54,7 @@ function createTimeOracle() {
|
|
|
54
54
|
case 0:
|
|
55
55
|
_a.trys.push([0, 4, , 5]);
|
|
56
56
|
console.log("create new time oracle...");
|
|
57
|
-
gasBudget =
|
|
57
|
+
gasBudget = 100000;
|
|
58
58
|
return [4 /*yield*/, (0, getNewTimeOracleTx_1.getNewTimeOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE)];
|
|
59
59
|
case 1:
|
|
60
60
|
newTimeOracleTx = _a.sent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getAddCoveredCallVaultAuthorizedUserTx(gasBudget:
|
|
1
|
+
export declare function getAddCoveredCallVaultAuthorizedUserTx(gasBudget: number, packageId: string, managerCap: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getClaimAllTx(gasBudget:
|
|
1
|
+
export declare function getClaimAllTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string[]): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getClaimTx(gasBudget:
|
|
1
|
+
export declare function getClaimTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getCloseAuctionTx(gasBudget:
|
|
1
|
+
export declare function getCloseAuctionTx(gasBudget: number, packageId: string, managerCap: string, typeArgument: string, registry: string, index: string, time: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getCloseVaultTx(gasBudget:
|
|
1
|
+
export declare function getCloseVaultTx(gasBudget: number, packageId: string, managerCap: string, typeArgument: string, registry: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDeliveryTx(gasBudget:
|
|
1
|
+
export declare function getDeliveryTx(gasBudget: number, packageId: string, managerCap: string, registry: string, typeArgument: string, index: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDepositTx(gasBudget:
|
|
1
|
+
export declare function getDepositTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, vaultIndex: string, coin: string, amount: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEvolutionTx(gasBudget:
|
|
1
|
+
export declare function getEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEvolutionTx(gasBudget:
|
|
1
|
+
export declare function getEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string, expirationTsMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getMakerClaimAllTx(gasBudget:
|
|
1
|
+
export declare function getMakerClaimAllTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getMakerClaimTx(gasBudget:
|
|
1
|
+
export declare function getMakerClaimTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionTx(gasBudget:
|
|
1
|
+
export declare function getNewAuctionTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionWithNextCoveredCallVaultTx(gasBudget:
|
|
1
|
+
export declare function getNewAuctionWithNextCoveredCallVaultTx(gasBudget: number, packageId: string, managerCap: string, registry: string, typeArgument: string, index: number, priceOracle: string, timeOracle: string, activationTsMs: number, expirationTsMs: number): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewBidTx(gasBudget:
|
|
1
|
+
export declare function getNewBidTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, vaultIndex: string, size: string, coin: string, time: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewCoveredCallVaultTx(gasBudget:
|
|
1
|
+
export declare function getNewCoveredCallVaultTx(gasBudget: number, 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 +1 @@
|
|
|
1
|
-
export declare function getNewManagerTx(gasBudget:
|
|
1
|
+
export declare function getNewManagerTx(gasBudget: number, packageId: string, managerCap: string, user: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRefundTx(gasBudget:
|
|
1
|
+
export declare function getRefundTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRemoveBidTx(gasBudget:
|
|
1
|
+
export declare function getRemoveBidTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, bidIndex: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRemoveCoveredCallVaultAuthorizedUserTx(gasBudget:
|
|
1
|
+
export declare function getRemoveCoveredCallVaultAuthorizedUserTx(gasBudget: number, packageId: string, managerCap: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRemoveManagerTx(gasBudget:
|
|
1
|
+
export declare function getRemoveManagerTx(gasBudget: number, packageId: string, managerCap: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRollOverTx(gasBudget:
|
|
1
|
+
export declare function getRollOverTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getSettleTx(gasBudget:
|
|
1
|
+
export declare function getSettleTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getSettleWithRollOverTx(gasBudget:
|
|
1
|
+
export declare function getSettleWithRollOverTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getSubscribeTx(gasBudget:
|
|
1
|
+
export declare function getSubscribeTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, share: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUnsubscribeTx(gasBudget:
|
|
1
|
+
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, index: string, share: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdateCapacityTx(gasBudget:
|
|
1
|
+
export declare function getUpdateCapacityTx(gasBudget: number, packageId: string, managerCap: string, typeArgument: string, registry: string, index: string, capacity: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdateNextVaultConfigTx(gasBudget:
|
|
1
|
+
export declare function getUpdateNextVaultConfigTx(gasBudget: number, packageId: string, managerCap: string, registry: string, typeArgument: string, index: string, strikeOtmPct: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdatePayoffConfigTx(gasBudget:
|
|
1
|
+
export declare function getUpdatePayoffConfigTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, roi: string, exposureRatio: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdateVaultConfigTx(gasBudget:
|
|
1
|
+
export declare function getUpdateVaultConfigTx(gasBudget: number, packageId: string, managerCap: string, typeArgument: string, registry: string, index: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getWithdrawTx(gasBudget:
|
|
1
|
+
export declare function getWithdrawTx(gasBudget: number, packageId: string, registry: string, typeArgument: string, vaultIndex: string, share: string): Promise<any>;
|
package/lib/utils/fetchData.js
CHANGED
|
@@ -60,9 +60,9 @@ function getCoveredCallVaultsFromRegistry(registry) {
|
|
|
60
60
|
switch (_a.label) {
|
|
61
61
|
case 0:
|
|
62
62
|
console.log("registry: " + registry);
|
|
63
|
-
return [4 /*yield*/, provider.
|
|
63
|
+
return [4 /*yield*/, provider.getDynamicFields(registry)];
|
|
64
64
|
case 1:
|
|
65
|
-
coveredCallVaults = _a.sent();
|
|
65
|
+
coveredCallVaults = (_a.sent()).data;
|
|
66
66
|
console.log("under the registry, there are " + coveredCallVaults.length + " covered call vaults");
|
|
67
67
|
return [2 /*return*/, coveredCallVaults];
|
|
68
68
|
}
|
|
@@ -98,9 +98,9 @@ function getSubVaultsFromTable(tableUnderCoveredCallVault) {
|
|
|
98
98
|
var e_1, _a;
|
|
99
99
|
return __generator(this, function (_b) {
|
|
100
100
|
switch (_b.label) {
|
|
101
|
-
case 0: return [4 /*yield*/, provider.
|
|
101
|
+
case 0: return [4 /*yield*/, provider.getDynamicFields(tableUnderCoveredCallVault)];
|
|
102
102
|
case 1:
|
|
103
|
-
subVaults = _b.sent();
|
|
103
|
+
subVaults = (_b.sent()).data;
|
|
104
104
|
console.log("there are " + subVaults.length + " sub vault under table, representing rolling, regular and maker");
|
|
105
105
|
result = {};
|
|
106
106
|
_b.label = 2;
|
|
@@ -173,9 +173,9 @@ function getLinkedListNodesFromTable(table) {
|
|
|
173
173
|
var linkedListNodes;
|
|
174
174
|
return __generator(this, function (_a) {
|
|
175
175
|
switch (_a.label) {
|
|
176
|
-
case 0: return [4 /*yield*/, provider.
|
|
176
|
+
case 0: return [4 /*yield*/, provider.getDynamicFields(table)];
|
|
177
177
|
case 1:
|
|
178
|
-
linkedListNodes = _a.sent();
|
|
178
|
+
linkedListNodes = (_a.sent()).data;
|
|
179
179
|
console.log("there are " + linkedListNodes.length + " linked list nodes in table");
|
|
180
180
|
return [2 /*return*/, linkedListNodes];
|
|
181
181
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getCreateTokenRegistryTx(gasBudget:
|
|
1
|
+
export declare function getCreateTokenRegistryTx(gasBudget: number, packageId: string): Promise<any>;
|
|
@@ -56,9 +56,9 @@ function getSubVaultsData(registry, provider) {
|
|
|
56
56
|
switch (_b.label) {
|
|
57
57
|
case 0:
|
|
58
58
|
subVaultsData = new Map();
|
|
59
|
-
return [4 /*yield*/, provider.
|
|
59
|
+
return [4 /*yield*/, provider.getDynamicFields(registry)];
|
|
60
60
|
case 1:
|
|
61
|
-
coveredCallVaults = _b.sent();
|
|
61
|
+
coveredCallVaults = (_b.sent()).data;
|
|
62
62
|
coveredCallVaultsId = coveredCallVaults.map(function (e) { return e.objectId; });
|
|
63
63
|
return [4 /*yield*/, provider.getObjectBatch(coveredCallVaultsId)];
|
|
64
64
|
case 2:
|
|
@@ -100,9 +100,9 @@ function getMakersShares(makerShareTable, registry, provider) {
|
|
|
100
100
|
case 1:
|
|
101
101
|
subVaultsData = _a.sent() //vault idx to subvault info
|
|
102
102
|
;
|
|
103
|
-
return [4 /*yield*/, provider.
|
|
103
|
+
return [4 /*yield*/, provider.getDynamicFields(makerShareTable)];
|
|
104
104
|
case 2:
|
|
105
|
-
makerShareIds = (_a.sent()).map(function (x) { return x.objectId; });
|
|
105
|
+
makerShareIds = (_a.sent()).data.map(function (x) { return x.objectId; });
|
|
106
106
|
return [4 /*yield*/, provider.getObjectBatch(makerShareIds)];
|
|
107
107
|
case 3:
|
|
108
108
|
makerShares = (_a.sent()).map(function (x) {
|
package/lib/utils/getMintTx.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getMintTx(gasBudget:
|
|
1
|
+
export declare function getMintTx(gasBudget: number, packageId: string, registry: string, moduleName: string, amount: number): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewOracleTx(gasBudget:
|
|
1
|
+
export declare function getNewOracleTx(gasBudget: number, packageId: string, typeArgument: string, decimal: number): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewTimeOracleTx(gasBudget:
|
|
1
|
+
export declare function getNewTimeOracleTx(gasBudget: number, packageId: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdateOracleTx(gasBudget:
|
|
1
|
+
export declare function getUpdateOracleTx(gasBudget: number, packageId: string, typeArgument: string, oracle: string, managerCap: string, price: number, unix: number): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdateTimeOracleTx(gasBudget:
|
|
1
|
+
export declare function getUpdateTimeOracleTx(gasBudget: number, packageId: string, oracle: string, managerCap: string, ts: number): Promise<any>;
|
|
@@ -60,9 +60,9 @@ function getSubVaultsData(registry, provider) {
|
|
|
60
60
|
switch (_b.label) {
|
|
61
61
|
case 0:
|
|
62
62
|
subVaultsData = new Map();
|
|
63
|
-
return [4 /*yield*/, provider.
|
|
63
|
+
return [4 /*yield*/, provider.getDynamicFields(registry)];
|
|
64
64
|
case 1:
|
|
65
|
-
coveredCallVaults = _b.sent();
|
|
65
|
+
coveredCallVaults = (_b.sent()).data;
|
|
66
66
|
coveredCallVaultsId = coveredCallVaults.map(function (e) { return e.objectId; });
|
|
67
67
|
return [4 /*yield*/, provider.getObjectBatch(coveredCallVaultsId)];
|
|
68
68
|
case 2:
|
|
@@ -106,9 +106,9 @@ function getUsersShares(userShareTable, registry, provider) {
|
|
|
106
106
|
case 1:
|
|
107
107
|
subVaultsData = _a.sent() //vault idx to subvault info
|
|
108
108
|
;
|
|
109
|
-
return [4 /*yield*/, provider.
|
|
109
|
+
return [4 /*yield*/, provider.getDynamicFields(userShareTable)];
|
|
110
110
|
case 2:
|
|
111
|
-
userShareIds = (_a.sent()).map(function (x) { return x.objectId; });
|
|
111
|
+
userShareIds = (_a.sent()).data.map(function (x) { return x.objectId; });
|
|
112
112
|
return [4 /*yield*/, provider.getObjectBatch(userShareIds)];
|
|
113
113
|
case 3:
|
|
114
114
|
userShares = (_a.sent()).map(function (x) {
|
|
@@ -58,9 +58,9 @@ function getVaultDataFromRegistry(registry, provider) {
|
|
|
58
58
|
switch (_b.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
console.log("registry: " + registry);
|
|
61
|
-
return [4 /*yield*/, provider.
|
|
61
|
+
return [4 /*yield*/, provider.getDynamicFields(registry)];
|
|
62
62
|
case 1:
|
|
63
|
-
coveredCallVaults = _b.sent();
|
|
63
|
+
coveredCallVaults = (_b.sent()).data;
|
|
64
64
|
coveredCallVaultsId = coveredCallVaults.map(function (e) { return e.objectId; });
|
|
65
65
|
return [4 /*yield*/, provider.getObjectBatch(coveredCallVaultsId)];
|
|
66
66
|
case 2:
|
|
@@ -52,9 +52,9 @@ function getWhiteListFromRegistry(registry, provider) {
|
|
|
52
52
|
case 1:
|
|
53
53
|
tmp = _a.sent();
|
|
54
54
|
whiteListsTable = tmp.details.data.fields.authority.fields.whitelist.fields.nodes.fields.id.id;
|
|
55
|
-
return [4 /*yield*/, provider.
|
|
55
|
+
return [4 /*yield*/, provider.getDynamicFields(whiteListsTable)];
|
|
56
56
|
case 2:
|
|
57
|
-
whiteListsNodes = _a.sent();
|
|
57
|
+
whiteListsNodes = (_a.sent()).data;
|
|
58
58
|
whiteListsTableId = whiteListsNodes.map(function (e) { return e.objectId; });
|
|
59
59
|
return [4 /*yield*/, provider.getObjectBatch(whiteListsTableId)
|
|
60
60
|
//@ts-ignore
|
package/package.json
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
"name": "@typus/typus-sdk",
|
|
3
3
|
"author": "Typus",
|
|
4
4
|
"description": "typus sdk",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.6.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@mysten/
|
|
8
|
-
"@mysten/sui.js": "^0.26.1",
|
|
7
|
+
"@mysten/sui.js": "^0.27.0",
|
|
9
8
|
"@types/node": "^17.0.0",
|
|
10
9
|
"bignumber.js": "^9.1.1",
|
|
11
10
|
"bs58": "^4.0.1",
|
|
@@ -81,4 +80,4 @@
|
|
|
81
80
|
"url": "https://github.com/Typus-Lab/typus-sdk/issues"
|
|
82
81
|
},
|
|
83
82
|
"homepage": "https://github.com/Typus-Lab/typus-sdk#readme"
|
|
84
|
-
}
|
|
83
|
+
}
|