@typus/typus-sdk 0.6.0 → 0.6.2
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
CHANGED
|
@@ -10,9 +10,9 @@ export declare const TIME_ORACLE = "0x9472de591c68ee1a8a9771221c391f86feb2c1bb";
|
|
|
10
10
|
export declare const COVERED_CALL_PACKAGE = "0x60923650807ee3ccc53c539920b7b0ccea4b1554";
|
|
11
11
|
export declare const COVERED_CALL_REGISTRY = "0x46d88d85f2f22d7fffda51127fe48b274aedd2f1";
|
|
12
12
|
export declare const COVERED_CALL_MANAGER = "0xa47107c76cc3cbb7fdf19d16ac79f8fd9b9f5e4f";
|
|
13
|
-
export declare const USER_SHARE_TABLE = "
|
|
13
|
+
export declare const USER_SHARE_TABLE = "0xc216df077ee67f081fdb72a95c9729ec2102587f";
|
|
14
14
|
export declare const USER_REFUND_TABLE = "0x0bd398f74aa24022595e7c7ae50bd2f258ca07aa";
|
|
15
|
-
export declare const MAKER_SHARE_TABLE = "
|
|
15
|
+
export declare const MAKER_SHARE_TABLE = "0xe80a202dd890d24e64acc345c1b30acbe63a46f3";
|
|
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
|
@@ -16,9 +16,9 @@ exports.TIME_ORACLE = '0x9472de591c68ee1a8a9771221c391f86feb2c1bb';
|
|
|
16
16
|
exports.COVERED_CALL_PACKAGE = "0x60923650807ee3ccc53c539920b7b0ccea4b1554";
|
|
17
17
|
exports.COVERED_CALL_REGISTRY = "0x46d88d85f2f22d7fffda51127fe48b274aedd2f1";
|
|
18
18
|
exports.COVERED_CALL_MANAGER = "0xa47107c76cc3cbb7fdf19d16ac79f8fd9b9f5e4f";
|
|
19
|
-
exports.USER_SHARE_TABLE = "
|
|
19
|
+
exports.USER_SHARE_TABLE = "0xc216df077ee67f081fdb72a95c9729ec2102587f";
|
|
20
20
|
exports.USER_REFUND_TABLE = "0x0bd398f74aa24022595e7c7ae50bd2f258ca07aa";
|
|
21
|
-
exports.MAKER_SHARE_TABLE = "
|
|
21
|
+
exports.MAKER_SHARE_TABLE = "0xe80a202dd890d24e64acc345c1b30acbe63a46f3";
|
|
22
22
|
//publish from typus-dov/typus-dov
|
|
23
23
|
exports.DOV_PACKAGE = "0x49e71a735dc6bdf7327e6c663d04a3e7f68bafd0";
|
|
24
24
|
exports.TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
@@ -27,12 +27,11 @@ exports.TOKEN_DECIMAL = 9;
|
|
|
27
27
|
exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
28
28
|
exports.FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
29
29
|
exports.TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
|
30
|
-
exports.TOKEN_NAME = ["BTC", "ETH", "SUI", "USDC", "USDT"];
|
|
30
|
+
exports.TOKEN_NAME = ["BTC", "ETH", "SUI", "USDC", "USDT", "APT", "DOGE"];
|
|
31
31
|
exports.TOKEN_NAME_TO_MODULE = {
|
|
32
32
|
"BTC": "btc",
|
|
33
33
|
"ETH": "eth",
|
|
34
34
|
"SUI": "sui",
|
|
35
35
|
"USDC": "usdc",
|
|
36
|
-
// "USDT": "token_usdt",
|
|
37
36
|
};
|
|
38
37
|
exports.TESTNET_RPC_ENDPOINT = "https://fullnode.testnet.sui.io:443";
|
|
@@ -76,7 +76,7 @@ var chatId = process.env.CHAT_ID;
|
|
|
76
76
|
];
|
|
77
77
|
newAuctionType = constants_1.COVERED_CALL_PACKAGE + "::covered_call::NewAuction";
|
|
78
78
|
endAuctionType = constants_1.COVERED_CALL_PACKAGE + "::covered_call::Delivery<" + constants_1.TOKEN_PACKAGE + "::eth::ETH>";
|
|
79
|
-
renewSec =
|
|
79
|
+
renewSec = 30;
|
|
80
80
|
// let vault = await getVaultDataFromRegistry(COVERED_CALL_REGISTRY, provider);
|
|
81
81
|
bidTypes.map(function (bidType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
82
|
return __generator(this, function (_a) {
|
|
@@ -182,9 +182,6 @@ function getBidEventsCranker(type, renewSec, provider) {
|
|
|
182
182
|
period = (bidId.period == "0") ? "Daily " : (bidId.period == "1") ? "Weekly " : (bidId.period == "2") ? "Monthly " : "- ";
|
|
183
183
|
format_1 += period + bidId.bidFormat + " is bid with " + size + " " + bidId.bidFormat.split("-")[0] + "! \n";
|
|
184
184
|
}
|
|
185
|
-
else {
|
|
186
|
-
console.log("can't get bidId in getBidEventsCranker");
|
|
187
|
-
}
|
|
188
185
|
return [2 /*return*/];
|
|
189
186
|
});
|
|
190
187
|
}); });
|
|
@@ -224,6 +221,8 @@ function getNewAuctionEventsCranker(type, renewSec, provider) {
|
|
|
224
221
|
case 1:
|
|
225
222
|
events = _b.sent();
|
|
226
223
|
newRes = events.data;
|
|
224
|
+
console.log("new Res in getNewAuctionEventsCranker:");
|
|
225
|
+
console.log(newRes);
|
|
227
226
|
return [4 /*yield*/, twoObjArrAreSame(newRes, res)];
|
|
228
227
|
case 2:
|
|
229
228
|
if (!!(_b.sent())) return [3 /*break*/, 5];
|
|
@@ -303,6 +302,8 @@ function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
|
303
302
|
case 1:
|
|
304
303
|
events = _b.sent();
|
|
305
304
|
newRes = events.data;
|
|
305
|
+
console.log("new Res in getEndAuctionEventsCranker:");
|
|
306
|
+
console.log(newRes);
|
|
306
307
|
return [4 /*yield*/, twoObjArrAreSame(newRes, res)];
|
|
307
308
|
case 2:
|
|
308
309
|
if (!!(_b.sent())) return [3 /*break*/, 5];
|
|
@@ -313,11 +314,13 @@ function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
|
313
314
|
return [4 /*yield*/, generateBidId(vault_1)];
|
|
314
315
|
case 4:
|
|
315
316
|
newBidIds = _b.sent();
|
|
317
|
+
console.log("new bid ids before filter:");
|
|
316
318
|
console.log(newBidIds);
|
|
317
319
|
//compare newBidIds to bidIds
|
|
318
320
|
newBidIds = newBidIds.filter(function (e) {
|
|
319
321
|
return !bidIds.find(function (tmp) { return tmp.bidFormat == e.bidFormat; });
|
|
320
322
|
});
|
|
323
|
+
// console.log("new bid ids after filter:")
|
|
321
324
|
console.log(newBidIds);
|
|
322
325
|
_loop_2 = function (asset) {
|
|
323
326
|
var targetBids = newBidIds.filter(function (bidId) {
|
|
@@ -44,7 +44,7 @@ var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read
|
|
|
44
44
|
var usersShares;
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
|
-
case 0: return [4 /*yield*/, (0, getUsersShares_1.getUsersShares)(
|
|
47
|
+
case 0: return [4 /*yield*/, (0, getUsersShares_1.getUsersShares)("0xc216df077ee67f081fdb72a95c9729ec2102587f", constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
48
48
|
case 1:
|
|
49
49
|
usersShares = _a.sent();
|
|
50
50
|
console.log(usersShares);
|