@typus/typus-sdk 0.5.1 → 0.5.3
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 +26 -26
- package/lib/test/eventListener.d.ts +4 -4
- package/lib/test/eventListener.js +132 -68
- package/lib/test/getBidData.js +5 -2
- package/lib/test/getMakersShares.js +5 -2
- package/lib/test/getUsersShares.js +5 -2
- package/lib/test/getVaultData.js +5 -2
- package/lib/test/testClaim.js +2 -2
- package/lib/test/testCrypto.js +1 -1
- package/lib/test/testDeposit.js +2 -2
- package/lib/test/testMint.js +1 -1
- package/lib/test/testNewAuction.js +2 -2
- package/lib/test/testNewVault.js +2 -2
- package/lib/test/testOracle.js +1 -1
- package/lib/test/testSettle.js +2 -2
- package/lib/test/testSubscribeEvent.js +1 -1
- package/lib/test/testUnsubscribe.js +2 -2
- package/lib/test/testWithdraw.js +2 -2
- package/lib/utils/auction/getBid.d.ts +2 -1
- package/lib/utils/auction/getBid.js +3 -4
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedDeliveryTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedEvolutionTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedSettleTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +1 -1
- package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +1 -1
- package/lib/utils/coveredCall/createPriceOracle.js +1 -1
- package/lib/utils/coveredCall/createTimeOracle.js +1 -1
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/coveredCall/getClaimAllTx.js +1 -1
- package/lib/utils/coveredCall/getClaimTx.js +1 -1
- package/lib/utils/coveredCall/getCloseAuctionTx.js +1 -1
- package/lib/utils/coveredCall/getCloseVaultTx.js +1 -1
- package/lib/utils/coveredCall/getDeliveryTx.js +1 -1
- package/lib/utils/coveredCall/getDepositTx.js +1 -1
- package/lib/utils/coveredCall/getEvolutionTx.js +1 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.js +1 -1
- package/lib/utils/coveredCall/getMakerClaimAllTx.js +1 -1
- package/lib/utils/coveredCall/getMakerClaimTx.js +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.js +1 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +1 -1
- package/lib/utils/coveredCall/getNewBidTx.js +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +1 -1
- package/lib/utils/coveredCall/getNewManagerTx.js +1 -1
- package/lib/utils/coveredCall/getRefundTx.js +1 -1
- package/lib/utils/coveredCall/getRemoveBidTx.js +1 -1
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +1 -1
- package/lib/utils/coveredCall/getRemoveManagerTx.js +1 -1
- package/lib/utils/coveredCall/getRollOverTx.js +1 -1
- package/lib/utils/coveredCall/getSettleTx.js +1 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.js +1 -1
- package/lib/utils/coveredCall/getSubscribeTx.js +1 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.js +1 -1
- package/lib/utils/coveredCall/getUpdateCapacityTx.js +1 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +1 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +1 -1
- package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +1 -1
- package/lib/utils/coveredCall/getWithdrawTx.js +1 -1
- package/lib/utils/fetchData.d.ts +1 -0
- package/lib/utils/fetchData.js +1 -1
- package/lib/utils/getCreateTokenRegistryTx.js +1 -1
- package/lib/utils/getMakersShares.d.ts +2 -1
- package/lib/utils/getMakersShares.js +4 -7
- package/lib/utils/getMintTx.js +1 -1
- package/lib/utils/getNewOracleTx.js +1 -1
- package/lib/utils/getNewTimeOracleTx.js +1 -1
- package/lib/utils/getTypeArgumentFromToken.d.ts +2 -1
- package/lib/utils/getTypeArgumentFromToken.js +3 -5
- package/lib/utils/getUpdateOracleTx.js +1 -1
- package/lib/utils/getUpdateTimeOracleTx.js +1 -1
- package/lib/utils/getUsersShares.d.ts +3 -2
- package/lib/utils/getUsersShares.js +12 -11
- package/lib/utils/getVaultData.d.ts +2 -1
- package/lib/utils/getVaultData.js +8 -7
- package/lib/utils/getVaultIndexInRegistry.js +1 -1
- package/lib/utils/loadUsersDepositData.js +28 -31
- package/package.json +4 -3
package/lib/constants.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare const TOKEN_PACKAGE = "
|
|
1
|
+
export declare const TOKEN_PACKAGE = "0xcb6f5de70c65b988556b93988a58a57919584e56";
|
|
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 = "0xddfa73b1bf15da6f72da9346a16051b7b90db1a6";
|
|
9
|
+
export declare const TIME_ORACLE = "0xb4a661b1493812476558de89af2092245b2d893f";
|
|
10
|
+
export declare const COVERED_CALL_PACKAGE = "0xdeb0b9cdc1f0da4196382a40bae55f6087c55626";
|
|
11
|
+
export declare const COVERED_CALL_REGISTRY = "0x01212ccf4f2011efb2c0be14ed538960def8e104";
|
|
12
|
+
export declare const COVERED_CALL_MANAGER = "0xb058fa60c70f6844d952b5f9115101bfb3cd59e6";
|
|
13
|
+
export declare const USER_SHARE_TABLE = "0xd2c1ddb7e80dc6fe494ca4d2fcc32700eb37e098";
|
|
14
|
+
export declare const USER_REFUND_TABLE = "0xc5683c6c8485b5ded986298dd4d15069a020b143";
|
|
15
|
+
export declare const MAKER_SHARE_TABLE = "0x27387549841398c0792fd8472657df030294c3f0";
|
|
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,37 +2,37 @@
|
|
|
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 =
|
|
6
|
-
exports.TOKEN_REGISTRY_BTC =
|
|
7
|
-
exports.TOKEN_REGISTRY_ETH =
|
|
8
|
-
exports.TOKEN_REGISTRY_SUI =
|
|
9
|
-
exports.TOKEN_REGISTRY_APT =
|
|
10
|
-
exports.TOKEN_REGISTRY_DOGE =
|
|
11
|
-
exports.TOKEN_REGISTRY_USDC =
|
|
5
|
+
exports.TOKEN_PACKAGE = "0xcb6f5de70c65b988556b93988a58a57919584e56";
|
|
6
|
+
exports.TOKEN_REGISTRY_BTC = "0x7325b75b85ee45e78204a9dcf7800a397259eb3d";
|
|
7
|
+
exports.TOKEN_REGISTRY_ETH = "0x475d3b10d29c03d85dfa707b5479955729216d4d";
|
|
8
|
+
exports.TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
9
|
+
exports.TOKEN_REGISTRY_APT = "0xf1a947ebc2643942bf3f2ecbd6b583c0f8dc3baf";
|
|
10
|
+
exports.TOKEN_REGISTRY_DOGE = "0x4dbe73f8a744008bc20d12aaa0d4fc8f01692358";
|
|
11
|
+
exports.TOKEN_REGISTRY_USDC = "0x82e0a1473c6c4d4f713a0ac5957e0c7a2278ed1e";
|
|
12
12
|
//publish from typus-oracle
|
|
13
|
-
exports.ORACLE_PACKAGE =
|
|
14
|
-
exports.TIME_ORACLE = '
|
|
13
|
+
exports.ORACLE_PACKAGE = "0xddfa73b1bf15da6f72da9346a16051b7b90db1a6";
|
|
14
|
+
exports.TIME_ORACLE = '0xb4a661b1493812476558de89af2092245b2d893f';
|
|
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 = "0xdeb0b9cdc1f0da4196382a40bae55f6087c55626";
|
|
17
|
+
exports.COVERED_CALL_REGISTRY = "0x01212ccf4f2011efb2c0be14ed538960def8e104";
|
|
18
|
+
exports.COVERED_CALL_MANAGER = "0xb058fa60c70f6844d952b5f9115101bfb3cd59e6";
|
|
19
|
+
exports.USER_SHARE_TABLE = "0xd2c1ddb7e80dc6fe494ca4d2fcc32700eb37e098";
|
|
20
|
+
exports.USER_REFUND_TABLE = "0xc5683c6c8485b5ded986298dd4d15069a020b143";
|
|
21
|
+
exports.MAKER_SHARE_TABLE = "0x27387549841398c0792fd8472657df030294c3f0";
|
|
22
22
|
//publish from typus-dov/typus-dov
|
|
23
|
-
exports.DOV_PACKAGE =
|
|
24
|
-
exports.TEST_MINT_TOKEN =
|
|
23
|
+
exports.DOV_PACKAGE = "0x49e71a735dc6bdf7327e6c663d04a3e7f68bafd0";
|
|
24
|
+
exports.TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
25
25
|
exports.PRICE_DECIMAL = 8;
|
|
26
26
|
exports.TOKEN_DECIMAL = 9;
|
|
27
|
-
exports.DEFAULT_TYPE_ARGUMENT =
|
|
28
|
-
exports.FAKE_TOKEN_TYPE_ARGUMENT =
|
|
29
|
-
exports.TEST_MNEMONIC =
|
|
30
|
-
exports.TOKEN_NAME = [
|
|
27
|
+
exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
28
|
+
exports.FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
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"];
|
|
31
31
|
exports.TOKEN_NAME_TO_MODULE = {
|
|
32
|
-
BTC:
|
|
33
|
-
ETH:
|
|
34
|
-
SUI:
|
|
35
|
-
USDC:
|
|
32
|
+
"BTC": "btc",
|
|
33
|
+
"ETH": "eth",
|
|
34
|
+
"SUI": "sui",
|
|
35
|
+
"USDC": "usdc",
|
|
36
36
|
// "USDT": "token_usdt",
|
|
37
37
|
};
|
|
38
|
-
exports.TESTNET_RPC_ENDPOINT =
|
|
38
|
+
exports.TESTNET_RPC_ENDPOINT = "https://fullnode.testnet.sui.io:443";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getBidEventsCranker(type: string, renewSec: number,
|
|
3
|
-
export declare function getNewAuctionEventsCranker(type: string, renewSec: number,
|
|
4
|
-
export declare function getEndAuctionEventsCranker(type: string, renewSec: number,
|
|
1
|
+
import { JsonRpcProvider } from '@mysten/sui.js';
|
|
2
|
+
export declare function getBidEventsCranker(type: string, renewSec: number, provider: JsonRpcProvider): Promise<void>;
|
|
3
|
+
export declare function getNewAuctionEventsCranker(type: string, renewSec: number, provider: JsonRpcProvider): Promise<void>;
|
|
4
|
+
export declare function getEndAuctionEventsCranker(type: string, renewSec: number, provider: JsonRpcProvider): Promise<void>;
|
|
5
5
|
export declare function sendEventToTelegramChannel(text: any): Promise<void>;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -35,6 +35,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
38
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
51
|
};
|
|
@@ -46,14 +57,15 @@ var getVaultData_1 = require("../utils/getVaultData");
|
|
|
46
57
|
var node_cron_1 = __importDefault(require("node-cron"));
|
|
47
58
|
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
|
|
48
59
|
var moment_1 = __importDefault(require("moment"));
|
|
49
|
-
var
|
|
60
|
+
var decimal_js_1 = __importDefault(require("decimal.js"));
|
|
61
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read only operations
|
|
50
62
|
var apiToken = process.env.API_TOKEN;
|
|
51
63
|
var chatId = process.env.CHAT_ID;
|
|
52
64
|
/*
|
|
53
65
|
「https://api.telegram.org/botTOKEN/getUpdates」,change TOKEN to token from botFather
|
|
54
66
|
*/
|
|
55
67
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var bidTypes, newAuctionType, endAuctionType, renewSec
|
|
68
|
+
var bidTypes, newAuctionType, endAuctionType, renewSec;
|
|
57
69
|
return __generator(this, function (_a) {
|
|
58
70
|
switch (_a.label) {
|
|
59
71
|
case 0:
|
|
@@ -63,26 +75,24 @@ var chatId = process.env.CHAT_ID;
|
|
|
63
75
|
constants_1.COVERED_CALL_PACKAGE + "::covered_call::NewBid<" + constants_1.TOKEN_PACKAGE + "::sui::SUI>",
|
|
64
76
|
];
|
|
65
77
|
newAuctionType = constants_1.COVERED_CALL_PACKAGE + "::covered_call::NewAuction";
|
|
66
|
-
endAuctionType = constants_1.
|
|
78
|
+
endAuctionType = constants_1.COVERED_CALL_PACKAGE + "::covered_call::Delivery<" + constants_1.TOKEN_PACKAGE + "::eth::ETH>";
|
|
67
79
|
renewSec = 10;
|
|
68
|
-
|
|
69
|
-
case 1:
|
|
70
|
-
vault = _a.sent();
|
|
80
|
+
// let vault = await getVaultDataFromRegistry(COVERED_CALL_REGISTRY, provider);
|
|
71
81
|
bidTypes.map(function (bidType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
72
82
|
return __generator(this, function (_a) {
|
|
73
83
|
switch (_a.label) {
|
|
74
|
-
case 0: return [4 /*yield*/, getBidEventsCranker(bidType, renewSec,
|
|
84
|
+
case 0: return [4 /*yield*/, getBidEventsCranker(bidType, renewSec, provider)]; //new_bid
|
|
75
85
|
case 1:
|
|
76
86
|
_a.sent(); //new_bid
|
|
77
87
|
return [2 /*return*/];
|
|
78
88
|
}
|
|
79
89
|
});
|
|
80
90
|
}); });
|
|
81
|
-
return [4 /*yield*/, getNewAuctionEventsCranker(newAuctionType, renewSec,
|
|
82
|
-
case
|
|
91
|
+
return [4 /*yield*/, getNewAuctionEventsCranker(newAuctionType, renewSec, provider)]; //evolution
|
|
92
|
+
case 1:
|
|
83
93
|
_a.sent(); //evolution
|
|
84
|
-
return [4 /*yield*/, getEndAuctionEventsCranker(endAuctionType, renewSec,
|
|
85
|
-
case
|
|
94
|
+
return [4 /*yield*/, getEndAuctionEventsCranker(endAuctionType, renewSec, provider)];
|
|
95
|
+
case 2:
|
|
86
96
|
_a.sent();
|
|
87
97
|
return [2 /*return*/];
|
|
88
98
|
}
|
|
@@ -116,9 +126,13 @@ function generateBidId(vault) {
|
|
|
116
126
|
.unix(Number(time) / 1000)
|
|
117
127
|
.format("DDMMMYY");
|
|
118
128
|
var bidId = "".concat(v.asset, "-").concat(expiration, "-").concat(v.config.payoffConfig.strike, "-C");
|
|
129
|
+
var period = (v.config.period);
|
|
130
|
+
var vaultIdx = v.vaultIdx;
|
|
119
131
|
var obj = {
|
|
120
132
|
bidFormat: bidId,
|
|
121
|
-
bidTime: Number(time)
|
|
133
|
+
bidTime: Number(time),
|
|
134
|
+
period: period,
|
|
135
|
+
vaultIdx: vaultIdx,
|
|
122
136
|
};
|
|
123
137
|
return obj;
|
|
124
138
|
});
|
|
@@ -126,14 +140,14 @@ function generateBidId(vault) {
|
|
|
126
140
|
});
|
|
127
141
|
});
|
|
128
142
|
}
|
|
129
|
-
function getBidEventsCranker(type, renewSec,
|
|
143
|
+
function getBidEventsCranker(type, renewSec, provider) {
|
|
130
144
|
return __awaiter(this, void 0, void 0, function () {
|
|
131
145
|
var res;
|
|
132
146
|
var _this = this;
|
|
133
147
|
return __generator(this, function (_a) {
|
|
134
148
|
res = [];
|
|
135
149
|
node_cron_1.default.schedule('*/' + renewSec.toString() + ' * * * * *', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
136
|
-
var events, newRes, newBid, format_1, bidIds_1, telegramText;
|
|
150
|
+
var events, newRes, newBidHappened, newBid, format_1, vault, bidIds_1, telegramText;
|
|
137
151
|
var _this = this;
|
|
138
152
|
return __generator(this, function (_a) {
|
|
139
153
|
switch (_a.label) {
|
|
@@ -141,9 +155,8 @@ function getBidEventsCranker(type, renewSec, vault) {
|
|
|
141
155
|
case 1:
|
|
142
156
|
events = _a.sent();
|
|
143
157
|
newRes = events.data;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
console.log("there are " + (newRes.length - res.length).toString() + " new bids");
|
|
158
|
+
newBidHappened = newRes.length != res.length;
|
|
159
|
+
if (!newBidHappened) return [3 /*break*/, 4];
|
|
147
160
|
newBid = newRes.filter(function (_a) {
|
|
148
161
|
var id1 = _a.timestamp;
|
|
149
162
|
return !res.some(function (_a) {
|
|
@@ -151,29 +164,22 @@ function getBidEventsCranker(type, renewSec, vault) {
|
|
|
151
164
|
return id2 === id1;
|
|
152
165
|
});
|
|
153
166
|
});
|
|
154
|
-
console.log("new bid amount: " + newBid.length);
|
|
155
167
|
format_1 = "";
|
|
156
|
-
return [4 /*yield*/,
|
|
168
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
157
169
|
case 2:
|
|
170
|
+
vault = _a.sent();
|
|
171
|
+
return [4 /*yield*/, generateBidId(vault)];
|
|
172
|
+
case 3:
|
|
158
173
|
bidIds_1 = _a.sent();
|
|
159
|
-
// [
|
|
160
|
-
// 'ETH-18Jan23-1750-C',
|
|
161
|
-
// 'BTC-18Jan23-21800-C',
|
|
162
|
-
// 'ETH-17Jan23-1750-C',
|
|
163
|
-
// 'SUI-18Jan23-9-C'
|
|
164
|
-
// ]
|
|
165
|
-
// console.log(bidIds)
|
|
166
174
|
newBid.map(function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
167
|
-
var bidId, size;
|
|
175
|
+
var newBidVaultIdx, bidId, size, period;
|
|
168
176
|
return __generator(this, function (_a) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var asset = bidId.bidFormat.split("-")[0];
|
|
172
|
-
return e.event.moveEvent.type.includes(bidId.bidFormat.split("-")[0]);
|
|
173
|
-
});
|
|
177
|
+
newBidVaultIdx = e.event.moveEvent.fields.index;
|
|
178
|
+
bidId = bidIds_1.find(function (bidId) { return bidId.vaultIdx == newBidVaultIdx; });
|
|
174
179
|
if (bidId) {
|
|
175
180
|
size = (Number(e.event.moveEvent.fields.size) / (Math.pow(10, constants_1.TOKEN_DECIMAL))).toString();
|
|
176
|
-
|
|
181
|
+
period = (bidId.period == "0") ? "Daily " : (bidId.period == "1") ? "Weekly " : (bidId.period == "2") ? "Monthly " : "- ";
|
|
182
|
+
format_1 += period + bidId.bidFormat + " is bid with " + size + " " + bidId.bidFormat.split("-")[0] + "! \n";
|
|
177
183
|
}
|
|
178
184
|
else {
|
|
179
185
|
console.log("can't get bidId in getBidEventsCranker");
|
|
@@ -185,8 +191,8 @@ function getBidEventsCranker(type, renewSec, vault) {
|
|
|
185
191
|
console.log(telegramText);
|
|
186
192
|
sendEventToTelegramChannel(telegramText);
|
|
187
193
|
res = newRes;
|
|
188
|
-
_a.label =
|
|
189
|
-
case
|
|
194
|
+
_a.label = 4;
|
|
195
|
+
case 4: return [2 /*return*/];
|
|
190
196
|
}
|
|
191
197
|
});
|
|
192
198
|
}); });
|
|
@@ -195,40 +201,62 @@ function getBidEventsCranker(type, renewSec, vault) {
|
|
|
195
201
|
});
|
|
196
202
|
}
|
|
197
203
|
exports.getBidEventsCranker = getBidEventsCranker;
|
|
198
|
-
function getNewAuctionEventsCranker(type, renewSec,
|
|
204
|
+
function getNewAuctionEventsCranker(type, renewSec, provider) {
|
|
199
205
|
return __awaiter(this, void 0, void 0, function () {
|
|
200
206
|
var res;
|
|
201
207
|
var _this = this;
|
|
202
208
|
return __generator(this, function (_a) {
|
|
203
209
|
res = [];
|
|
204
210
|
node_cron_1.default.schedule('*/' + renewSec.toString() + ' * * * * *', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
205
|
-
var events, newRes, format_2, bidIds, telegramText;
|
|
206
|
-
var
|
|
207
|
-
return __generator(this, function (
|
|
208
|
-
switch (
|
|
211
|
+
var events, newRes, format_2, vault, bidIds, _loop_1, TOKEN_NAME_1, TOKEN_NAME_1_1, asset, telegramText;
|
|
212
|
+
var e_1, _a;
|
|
213
|
+
return __generator(this, function (_b) {
|
|
214
|
+
switch (_b.label) {
|
|
209
215
|
case 0: return [4 /*yield*/, provider.getEvents({ MoveEvent: type }, null, null)];
|
|
210
216
|
case 1:
|
|
211
|
-
events =
|
|
217
|
+
events = _b.sent();
|
|
212
218
|
newRes = events.data;
|
|
213
219
|
return [4 /*yield*/, twoObjArrAreSame(newRes, res)];
|
|
214
220
|
case 2:
|
|
215
|
-
if (!!(
|
|
216
|
-
format_2 = "";
|
|
217
|
-
return [4 /*yield*/,
|
|
221
|
+
if (!!(_b.sent())) return [3 /*break*/, 5];
|
|
222
|
+
format_2 = "Typus Auction is live! Bid now! \n";
|
|
223
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
218
224
|
case 3:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
vault = _b.sent();
|
|
226
|
+
return [4 /*yield*/, generateBidId(vault)];
|
|
227
|
+
case 4:
|
|
228
|
+
bidIds = _b.sent();
|
|
229
|
+
_loop_1 = function (asset) {
|
|
230
|
+
var targetBids = bidIds.filter(function (bidId) {
|
|
231
|
+
return bidId.bidFormat.toString().includes(asset);
|
|
224
232
|
});
|
|
225
|
-
|
|
233
|
+
if (targetBids.length) {
|
|
234
|
+
format_2 += asset + " Options \n";
|
|
235
|
+
targetBids.map(function (bidId) {
|
|
236
|
+
var period = (bidId.period == "0") ? "Daily " : (bidId.period == "1") ? "Weekly " : (bidId.period == "2") ? "Monthly " : "- ";
|
|
237
|
+
format_2 += "\t" + period + "Covered Call-" + bidId.bidFormat + " \n";
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
try {
|
|
242
|
+
for (TOKEN_NAME_1 = __values(constants_1.TOKEN_NAME), TOKEN_NAME_1_1 = TOKEN_NAME_1.next(); !TOKEN_NAME_1_1.done; TOKEN_NAME_1_1 = TOKEN_NAME_1.next()) {
|
|
243
|
+
asset = TOKEN_NAME_1_1.value;
|
|
244
|
+
_loop_1(asset);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
248
|
+
finally {
|
|
249
|
+
try {
|
|
250
|
+
if (TOKEN_NAME_1_1 && !TOKEN_NAME_1_1.done && (_a = TOKEN_NAME_1.return)) _a.call(TOKEN_NAME_1);
|
|
251
|
+
}
|
|
252
|
+
finally { if (e_1) throw e_1.error; }
|
|
253
|
+
}
|
|
226
254
|
telegramText = format_2;
|
|
227
255
|
console.log(telegramText);
|
|
228
256
|
sendEventToTelegramChannel(telegramText);
|
|
229
257
|
res = newRes;
|
|
230
|
-
|
|
231
|
-
case
|
|
258
|
+
_b.label = 5;
|
|
259
|
+
case 5: return [2 /*return*/];
|
|
232
260
|
}
|
|
233
261
|
});
|
|
234
262
|
}); });
|
|
@@ -237,40 +265,76 @@ function getNewAuctionEventsCranker(type, renewSec, vault) {
|
|
|
237
265
|
});
|
|
238
266
|
}
|
|
239
267
|
exports.getNewAuctionEventsCranker = getNewAuctionEventsCranker;
|
|
240
|
-
function getEndAuctionEventsCranker(type, renewSec,
|
|
268
|
+
function getEndAuctionEventsCranker(type, renewSec, provider) {
|
|
241
269
|
return __awaiter(this, void 0, void 0, function () {
|
|
242
270
|
var res;
|
|
243
271
|
var _this = this;
|
|
244
272
|
return __generator(this, function (_a) {
|
|
245
273
|
res = [];
|
|
246
274
|
node_cron_1.default.schedule('*/' + renewSec.toString() + ' * * * * *', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
247
|
-
var events, newRes, format_3, bidIds, telegramText;
|
|
275
|
+
var events, newRes, format_3, vault_1, bidIds, _loop_2, TOKEN_NAME_2, TOKEN_NAME_2_1, asset, telegramText;
|
|
276
|
+
var e_2, _a;
|
|
248
277
|
var _this = this;
|
|
249
|
-
return __generator(this, function (
|
|
250
|
-
switch (
|
|
278
|
+
return __generator(this, function (_b) {
|
|
279
|
+
switch (_b.label) {
|
|
251
280
|
case 0: return [4 /*yield*/, provider.getEvents({ MoveEvent: type }, null, null)];
|
|
252
281
|
case 1:
|
|
253
|
-
events =
|
|
282
|
+
events = _b.sent();
|
|
254
283
|
newRes = events.data;
|
|
255
284
|
return [4 /*yield*/, twoObjArrAreSame(newRes, res)];
|
|
256
285
|
case 2:
|
|
257
|
-
if (!!(
|
|
286
|
+
if (!!(_b.sent())) return [3 /*break*/, 5];
|
|
258
287
|
format_3 = "";
|
|
259
|
-
return [4 /*yield*/,
|
|
288
|
+
return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
260
289
|
case 3:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
290
|
+
vault_1 = _b.sent();
|
|
291
|
+
return [4 /*yield*/, generateBidId(vault_1)];
|
|
292
|
+
case 4:
|
|
293
|
+
bidIds = _b.sent();
|
|
294
|
+
_loop_2 = function (asset) {
|
|
295
|
+
var targetBids = bidIds.filter(function (bidId) {
|
|
296
|
+
return bidId.bidFormat.toString().includes(asset);
|
|
266
297
|
});
|
|
267
|
-
|
|
298
|
+
if (targetBids.length) {
|
|
299
|
+
targetBids.map(function (bidId) { return __awaiter(_this, void 0, void 0, function () {
|
|
300
|
+
var vaultIdx, targetVault, totalAuctioned, clearingPrice, period;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
vaultIdx = bidId.vaultIdx;
|
|
303
|
+
targetVault = vault_1.find(function (e) { return e.vaultIdx == vaultIdx; });
|
|
304
|
+
totalAuctioned = "-";
|
|
305
|
+
clearingPrice = "-";
|
|
306
|
+
if (targetVault === null || targetVault === void 0 ? void 0 : targetVault.deliveryInfo) {
|
|
307
|
+
// console.log(targetVault.deliveryInfo)
|
|
308
|
+
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
|
+
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
|
+
}
|
|
311
|
+
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 +
|
|
313
|
+
" " + asset + " at a clearing price of " + clearingPrice + " " + asset + " \n";
|
|
314
|
+
return [2 /*return*/];
|
|
315
|
+
});
|
|
316
|
+
}); });
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
try {
|
|
320
|
+
for (TOKEN_NAME_2 = __values(constants_1.TOKEN_NAME), TOKEN_NAME_2_1 = TOKEN_NAME_2.next(); !TOKEN_NAME_2_1.done; TOKEN_NAME_2_1 = TOKEN_NAME_2.next()) {
|
|
321
|
+
asset = TOKEN_NAME_2_1.value;
|
|
322
|
+
_loop_2(asset);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
326
|
+
finally {
|
|
327
|
+
try {
|
|
328
|
+
if (TOKEN_NAME_2_1 && !TOKEN_NAME_2_1.done && (_a = TOKEN_NAME_2.return)) _a.call(TOKEN_NAME_2);
|
|
329
|
+
}
|
|
330
|
+
finally { if (e_2) throw e_2.error; }
|
|
331
|
+
}
|
|
268
332
|
telegramText = format_3;
|
|
269
333
|
console.log(telegramText);
|
|
270
334
|
sendEventToTelegramChannel(telegramText);
|
|
271
335
|
res = newRes;
|
|
272
|
-
|
|
273
|
-
case
|
|
336
|
+
_b.label = 5;
|
|
337
|
+
case 5: return [2 /*return*/];
|
|
274
338
|
}
|
|
275
339
|
});
|
|
276
340
|
}); });
|
package/lib/test/getBidData.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -37,13 +37,16 @@ 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
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
40
43
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
44
|
var vault, bid;
|
|
42
45
|
return __generator(this, function (_a) {
|
|
43
46
|
switch (_a.label) {
|
|
44
47
|
case 0:
|
|
45
48
|
vault = "0x1e5807f118c2fc7e0f74eeb439b34f448532a900";
|
|
46
|
-
return [4 /*yield*/, (0, getBid_1.getBid)(vault)];
|
|
49
|
+
return [4 /*yield*/, (0, getBid_1.getBid)(vault, provider)];
|
|
47
50
|
case 1:
|
|
48
51
|
bid = _a.sent();
|
|
49
52
|
console.log(bid);
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -37,12 +37,15 @@ 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
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
40
42
|
var getMakersShares_1 = require("../utils/getMakersShares");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(constants_2.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
41
44
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
45
|
var makersShares;
|
|
43
46
|
return __generator(this, function (_a) {
|
|
44
47
|
switch (_a.label) {
|
|
45
|
-
case 0: return [4 /*yield*/, (0, getMakersShares_1.getMakersShares)(constants_1.MAKER_SHARE_TABLE, constants_1.COVERED_CALL_REGISTRY)];
|
|
48
|
+
case 0: return [4 /*yield*/, (0, getMakersShares_1.getMakersShares)(constants_1.MAKER_SHARE_TABLE, constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
46
49
|
case 1:
|
|
47
50
|
makersShares = _a.sent();
|
|
48
51
|
console.log(makersShares);
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -38,11 +38,14 @@ 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
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(constants_2.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
41
44
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
45
|
var usersShares;
|
|
43
46
|
return __generator(this, function (_a) {
|
|
44
47
|
switch (_a.label) {
|
|
45
|
-
case 0: return [4 /*yield*/, (0, getUsersShares_1.getUsersShares)(constants_1.USER_SHARE_TABLE, constants_1.COVERED_CALL_REGISTRY)];
|
|
48
|
+
case 0: return [4 /*yield*/, (0, getUsersShares_1.getUsersShares)(constants_1.USER_SHARE_TABLE, constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
46
49
|
case 1:
|
|
47
50
|
usersShares = _a.sent();
|
|
48
51
|
console.log(usersShares);
|
package/lib/test/getVaultData.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -38,11 +38,14 @@ 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 getVaultData_1 = require("../utils/getVaultData");
|
|
41
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
+
var constants_2 = require("../constants");
|
|
43
|
+
var provider = new sui_js_1.JsonRpcProvider(constants_2.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
41
44
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
45
|
var res;
|
|
43
46
|
return __generator(this, function (_a) {
|
|
44
47
|
switch (_a.label) {
|
|
45
|
-
case 0: return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.COVERED_CALL_REGISTRY)];
|
|
48
|
+
case 0: return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.COVERED_CALL_REGISTRY, provider)];
|
|
46
49
|
case 1:
|
|
47
50
|
res = _a.sent();
|
|
48
51
|
console.log("vault: ");
|
package/lib/test/testClaim.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -57,7 +57,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
57
57
|
token = "0x8f306b0fcbcbdee0b3a5e694c06039dfe8ca7f14" // minted token
|
|
58
58
|
;
|
|
59
59
|
vaultIndex = ["59"];
|
|
60
|
-
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token)];
|
|
60
|
+
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)];
|
|
61
61
|
case 1:
|
|
62
62
|
typeArgument = _a.sent();
|
|
63
63
|
console.log("test for claim, try to claim " + token + " for " + claimAmount + " ...");
|
package/lib/test/testCrypto.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/lib/test/testDeposit.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -56,7 +56,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
|
56
56
|
isRolling = true;
|
|
57
57
|
token = constants_1.TEST_MINT_TOKEN;
|
|
58
58
|
vaultIndex = "0";
|
|
59
|
-
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token)];
|
|
59
|
+
return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)];
|
|
60
60
|
case 1:
|
|
61
61
|
typeArgument = _a.sent();
|
|
62
62
|
console.log("test for deposit, try to deposit " + token + " for " + depositAmount + " ...");
|
package/lib/test/testMint.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|