@typus/typus-sdk 0.4.6 → 0.4.8
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/package.json +3 -3
- package/lib/constants.d.ts +0 -30
- package/lib/constants.js +0 -38
- package/lib/scripts/getSubVault.d.ts +0 -0
- package/lib/scripts/getSubVault.js +0 -6
- package/lib/scripts/sui.d.ts +0 -1
- package/lib/scripts/sui.js +0 -187
- package/lib/test/eventListener.d.ts +0 -5
- package/lib/test/eventListener.js +0 -277
- package/lib/test/getBidData.d.ts +0 -1
- package/lib/test/getBidData.js +0 -53
- package/lib/test/getMakersShares.d.ts +0 -1
- package/lib/test/getMakersShares.js +0 -52
- package/lib/test/getUsersShares.d.ts +0 -1
- package/lib/test/getUsersShares.js +0 -52
- package/lib/test/getVaultData.d.ts +0 -1
- package/lib/test/getVaultData.js +0 -53
- package/lib/test/testClaim.d.ts +0 -1
- package/lib/test/testClaim.js +0 -81
- package/lib/test/testCrypto.d.ts +0 -1
- package/lib/test/testCrypto.js +0 -54
- package/lib/test/testDeposit.d.ts +0 -1
- package/lib/test/testDeposit.js +0 -73
- package/lib/test/testDepositV2.d.ts +0 -0
- package/lib/test/testDepositV2.js +0 -62
- package/lib/test/testMint.d.ts +0 -1
- package/lib/test/testMint.js +0 -136
- package/lib/test/testNewAuction.d.ts +0 -1
- package/lib/test/testNewAuction.js +0 -93
- package/lib/test/testNewVault.d.ts +0 -1
- package/lib/test/testNewVault.js +0 -152
- package/lib/test/testOracle.d.ts +0 -1
- package/lib/test/testOracle.js +0 -93
- package/lib/test/testSettle.d.ts +0 -1
- package/lib/test/testSettle.js +0 -589
- package/lib/test/testSubscribeEvent.d.ts +0 -1
- package/lib/test/testSubscribeEvent.js +0 -97
- package/lib/test/testUnsubscribe.d.ts +0 -1
- package/lib/test/testUnsubscribe.js +0 -87
- package/lib/test/testWithdraw.d.ts +0 -1
- package/lib/test/testWithdraw.js +0 -70
- package/lib/utils/auction/getBid.d.ts +0 -2
- package/lib/utils/auction/getBid.js +0 -79
- package/lib/utils/auction/sealedAuction.d.ts +0 -33
- package/lib/utils/auction/sealedAuction.js +0 -64
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +0 -60
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +0 -60
- package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedDeliveryTx.js +0 -60
- package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedEvolutionTx.js +0 -63
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +0 -62
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +0 -61
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +0 -77
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +0 -60
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +0 -60
- package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedSettleTx.js +0 -61
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -1
- package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +0 -65
- package/lib/utils/coveredCall/createPriceOracle.d.ts +0 -1
- package/lib/utils/coveredCall/createPriceOracle.js +0 -92
- package/lib/utils/coveredCall/createTimeOracle.d.ts +0 -1
- package/lib/utils/coveredCall/createTimeOracle.js +0 -91
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +0 -61
- package/lib/utils/coveredCall/getClaimAllTx.d.ts +0 -1
- package/lib/utils/coveredCall/getClaimAllTx.js +0 -59
- package/lib/utils/coveredCall/getClaimTx.d.ts +0 -1
- package/lib/utils/coveredCall/getClaimTx.js +0 -59
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +0 -1
- package/lib/utils/coveredCall/getDeliveryTx.js +0 -61
- package/lib/utils/coveredCall/getDepositTx.d.ts +0 -1
- package/lib/utils/coveredCall/getDepositTx.js +0 -65
- package/lib/utils/coveredCall/getEvolutionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getEvolutionTx.js +0 -64
- package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getLastEvolutionTx.js +0 -63
- package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +0 -1
- package/lib/utils/coveredCall/getMakerClaimAllTx.js +0 -59
- package/lib/utils/coveredCall/getMakerClaimTx.d.ts +0 -1
- package/lib/utils/coveredCall/getMakerClaimTx.js +0 -59
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewAuctionTx.js +0 -66
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +0 -64
- package/lib/utils/coveredCall/getNewBidTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewBidTx.js +0 -62
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +0 -77
- package/lib/utils/coveredCall/getNewManagerTx.d.ts +0 -1
- package/lib/utils/coveredCall/getNewManagerTx.js +0 -59
- package/lib/utils/coveredCall/getRefundTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRefundTx.js +0 -59
- package/lib/utils/coveredCall/getRemoveBidTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRemoveBidTx.js +0 -60
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +0 -61
- package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRemoveManagerTx.js +0 -58
- package/lib/utils/coveredCall/getRollOverTx.d.ts +0 -1
- package/lib/utils/coveredCall/getRollOverTx.js +0 -60
- package/lib/utils/coveredCall/getSettleTx.d.ts +0 -1
- package/lib/utils/coveredCall/getSettleTx.js +0 -62
- package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +0 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.js +0 -62
- package/lib/utils/coveredCall/getSubscribeTx.d.ts +0 -1
- package/lib/utils/coveredCall/getSubscribeTx.js +0 -60
- package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.js +0 -63
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +0 -66
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +0 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +0 -62
- package/lib/utils/coveredCall/getWithdrawTx.d.ts +0 -1
- package/lib/utils/coveredCall/getWithdrawTx.js +0 -60
- package/lib/utils/fetchData.d.ts +0 -83
- package/lib/utils/fetchData.js +0 -206
- package/lib/utils/getCreateTokenRegistryTx.d.ts +0 -1
- package/lib/utils/getCreateTokenRegistryTx.js +0 -59
- package/lib/utils/getMakersShares.d.ts +0 -7
- package/lib/utils/getMakersShares.js +0 -148
- package/lib/utils/getMintTx.d.ts +0 -1
- package/lib/utils/getMintTx.js +0 -62
- package/lib/utils/getNewOracleTx.d.ts +0 -1
- package/lib/utils/getNewOracleTx.js +0 -59
- package/lib/utils/getNewTimeOracleTx.d.ts +0 -1
- package/lib/utils/getNewTimeOracleTx.js +0 -56
- package/lib/utils/getTypeArgumentFromToken.d.ts +0 -1
- package/lib/utils/getTypeArgumentFromToken.js +0 -71
- package/lib/utils/getUpdateOracleTx.d.ts +0 -1
- package/lib/utils/getUpdateOracleTx.js +0 -64
- package/lib/utils/getUpdateTimeOracleTx.d.ts +0 -1
- package/lib/utils/getUpdateTimeOracleTx.js +0 -60
- package/lib/utils/getUsersShares.d.ts +0 -8
- package/lib/utils/getUsersShares.js +0 -147
- package/lib/utils/getVaultData.d.ts +0 -3
- package/lib/utils/getVaultData.js +0 -262
- package/lib/utils/getVaultIndexInRegistry.d.ts +0 -1
- package/lib/utils/getVaultIndexInRegistry.js +0 -61
- package/lib/utils/isObjAvailable.d.ts +0 -0
- package/lib/utils/isObjAvailable.js +0 -14
- package/lib/utils/loadUsersDepositData.d.ts +0 -8
- package/lib/utils/loadUsersDepositData.js +0 -157
package/lib/test/testSettle.js
DELETED
|
@@ -1,589 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
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
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
-
if (!m) return o;
|
|
41
|
-
var i = m.call(o), r, ar = [], e;
|
|
42
|
-
try {
|
|
43
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
-
}
|
|
45
|
-
catch (error) { e = { error: error }; }
|
|
46
|
-
finally {
|
|
47
|
-
try {
|
|
48
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
-
}
|
|
50
|
-
finally { if (e) throw e.error; }
|
|
51
|
-
}
|
|
52
|
-
return ar;
|
|
53
|
-
};
|
|
54
|
-
var __values = (this && this.__values) || function(o) {
|
|
55
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
56
|
-
if (m) return m.call(o);
|
|
57
|
-
if (o && typeof o.length === "number") return {
|
|
58
|
-
next: function () {
|
|
59
|
-
if (o && i >= o.length) o = void 0;
|
|
60
|
-
return { value: o && o[i++], done: !o };
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
64
|
-
};
|
|
65
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
-
var getUpdateOracleTx_1 = require("../utils/getUpdateOracleTx");
|
|
67
|
-
var getNewCoveredCallVaultTx_1 = require("../utils/coveredCall/getNewCoveredCallVaultTx");
|
|
68
|
-
var getDepositTx_1 = require("../utils/coveredCall/getDepositTx");
|
|
69
|
-
var createTimeOracle_1 = require("../utils/coveredCall/createTimeOracle");
|
|
70
|
-
var constants_1 = require("../constants");
|
|
71
|
-
var sui_js_1 = require("@mysten/sui.js");
|
|
72
|
-
var getTypeArgumentFromToken_1 = require("../utils/getTypeArgumentFromToken");
|
|
73
|
-
var getUpdateTimeOracleTx_1 = require("../utils/getUpdateTimeOracleTx");
|
|
74
|
-
var getNewAuctionWithNextCoveredCallVaultTx_1 = require("../utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx");
|
|
75
|
-
var getNewBidTx_1 = require("../utils/coveredCall/getNewBidTx");
|
|
76
|
-
var getDeliveryTx_1 = require("../utils/coveredCall/getDeliveryTx");
|
|
77
|
-
var getUpdatePayoffConfigTx_1 = require("../utils/coveredCall/getUpdatePayoffConfigTx");
|
|
78
|
-
var getSettleTx_1 = require("../utils/coveredCall/getSettleTx");
|
|
79
|
-
var createPriceOracle_1 = require("../utils/coveredCall/createPriceOracle");
|
|
80
|
-
var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); //for read only operations
|
|
81
|
-
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
82
|
-
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
83
|
-
var token = "0x8f306b0fcbcbdee0b3a5e694c06039dfe8ca7f14"; // minted token
|
|
84
|
-
var tokenB = "0xb1bf91e97ea97712903824f2f9f4a29d629e9fab";
|
|
85
|
-
var decimal = 8;
|
|
86
|
-
var strike = 2000;
|
|
87
|
-
var isRolling = true;
|
|
88
|
-
var expirationTsMs1 = 1000000;
|
|
89
|
-
var expirationTsMs2 = 2000000;
|
|
90
|
-
// let priceOracle = '0x636b4e02991f13720571d0cbbc8b83d80cd14729';
|
|
91
|
-
// let priceOracleManager = '0xd958057a227cdfd2080f4aeda7a16d6fe7135bcc';
|
|
92
|
-
// let timeOracle = '0x2b06a0f8109e394258c288b1d90c8c5a9c3832db';
|
|
93
|
-
// let timeOracleManager = '0xcad2723ff9c95ce423d3614375e2fa73ce9a7c04';
|
|
94
|
-
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
-
var typeArgument, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, price, ts, tokenDecimal, shareDecimal, period, activationTsMs, expirationTsMs, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance, vaultIndex, depositAmount, startAuctionTsMs, endAuctionTsMs, currentTime, bidSize, sellSize, premiumRoi, exposureRatio;
|
|
96
|
-
return __generator(this, function (_c) {
|
|
97
|
-
switch (_c.label) {
|
|
98
|
-
case 0: return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token)
|
|
99
|
-
//create price oracle and time oracle
|
|
100
|
-
];
|
|
101
|
-
case 1:
|
|
102
|
-
typeArgument = _c.sent();
|
|
103
|
-
return [4 /*yield*/, (0, createPriceOracle_1.createPriceOracle)(typeArgument)];
|
|
104
|
-
case 2:
|
|
105
|
-
_a = __read.apply(void 0, [_c.sent(), 2]), priceOracle = _a[0], priceOracleManager = _a[1];
|
|
106
|
-
return [4 /*yield*/, (0, createTimeOracle_1.createTimeOracle)()
|
|
107
|
-
// update price oracle and time oracle
|
|
108
|
-
];
|
|
109
|
-
case 3:
|
|
110
|
-
_b = __read.apply(void 0, [_c.sent()
|
|
111
|
-
// update price oracle and time oracle
|
|
112
|
-
, 2]), timeOracle = _b[0], timeOracleManager = _b[1];
|
|
113
|
-
price = 10000000000;
|
|
114
|
-
ts = 0 //ms
|
|
115
|
-
;
|
|
116
|
-
return [4 /*yield*/, updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price, ts)
|
|
117
|
-
// await updateTimeOracle(timeOracle, timeOracleManager, ts)
|
|
118
|
-
//create new vault
|
|
119
|
-
];
|
|
120
|
-
case 4:
|
|
121
|
-
_c.sent();
|
|
122
|
-
tokenDecimal = 9;
|
|
123
|
-
shareDecimal = 4;
|
|
124
|
-
period = 1;
|
|
125
|
-
activationTsMs = 1671782400000;
|
|
126
|
-
expirationTsMs = 1671782400000 + 604800000;
|
|
127
|
-
capacity = 1000000000;
|
|
128
|
-
strikeOtmPct = 500;
|
|
129
|
-
strikeIncrement = 10000;
|
|
130
|
-
decaySpeed = 1;
|
|
131
|
-
initialPrice = 5000;
|
|
132
|
-
finalPrice = 1000;
|
|
133
|
-
auctionDurationInMs = 3600000;
|
|
134
|
-
prevBalance = 0;
|
|
135
|
-
return [4 /*yield*/, createNewVault(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, prevBalance)];
|
|
136
|
-
case 5:
|
|
137
|
-
_c.sent();
|
|
138
|
-
return [4 /*yield*/, getNewestVaultIndex(constants_1.COVERED_CALL_REGISTRY)];
|
|
139
|
-
case 6:
|
|
140
|
-
vaultIndex = _c.sent();
|
|
141
|
-
depositAmount = 50000000000;
|
|
142
|
-
return [4 /*yield*/, depositToVault(typeArgument, vaultIndex, depositAmount)
|
|
143
|
-
//================================start auction================================
|
|
144
|
-
//update price oracle and time oracle
|
|
145
|
-
];
|
|
146
|
-
case 7:
|
|
147
|
-
_c.sent();
|
|
148
|
-
startAuctionTsMs = expirationTsMs1 - 1000;
|
|
149
|
-
return [4 /*yield*/, updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price, startAuctionTsMs)];
|
|
150
|
-
case 8:
|
|
151
|
-
_c.sent();
|
|
152
|
-
return [4 /*yield*/, updateTimeOracle(timeOracle, timeOracleManager, startAuctionTsMs)
|
|
153
|
-
//new_auction_with_next_covered_call_vault
|
|
154
|
-
];
|
|
155
|
-
case 9:
|
|
156
|
-
_c.sent();
|
|
157
|
-
endAuctionTsMs = startAuctionTsMs + 500;
|
|
158
|
-
decaySpeed = 2;
|
|
159
|
-
initialPrice = 500000000;
|
|
160
|
-
finalPrice = 100000000;
|
|
161
|
-
activationTsMs = 1672992000000;
|
|
162
|
-
expirationTsMs = 1672992000000 + 604800000;
|
|
163
|
-
return [4 /*yield*/, createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs)];
|
|
164
|
-
case 10:
|
|
165
|
-
_c.sent();
|
|
166
|
-
currentTime = startAuctionTsMs + 300;
|
|
167
|
-
return [4 /*yield*/, updateTimeOracle(timeOracle, timeOracleManager, currentTime)
|
|
168
|
-
//new bid
|
|
169
|
-
];
|
|
170
|
-
case 11:
|
|
171
|
-
_c.sent();
|
|
172
|
-
bidSize = 50000000000;
|
|
173
|
-
return [4 /*yield*/, newBid(typeArgument, vaultIndex, bidSize, tokenB, timeOracle)
|
|
174
|
-
// //check some data
|
|
175
|
-
// //TODO
|
|
176
|
-
//update time oracle
|
|
177
|
-
];
|
|
178
|
-
case 12:
|
|
179
|
-
_c.sent();
|
|
180
|
-
// //check some data
|
|
181
|
-
// //TODO
|
|
182
|
-
//update time oracle
|
|
183
|
-
return [4 /*yield*/, updateTimeOracle(timeOracle, timeOracleManager, endAuctionTsMs + 1)
|
|
184
|
-
//delivery
|
|
185
|
-
];
|
|
186
|
-
case 13:
|
|
187
|
-
// //check some data
|
|
188
|
-
// //TODO
|
|
189
|
-
//update time oracle
|
|
190
|
-
_c.sent();
|
|
191
|
-
sellSize = 50000000000;
|
|
192
|
-
return [4 /*yield*/, delivery(typeArgument, vaultIndex, sellSize, timeOracle)
|
|
193
|
-
// //================================end auction================================
|
|
194
|
-
//update price oracle and time oracle
|
|
195
|
-
];
|
|
196
|
-
case 14:
|
|
197
|
-
_c.sent();
|
|
198
|
-
// //================================end auction================================
|
|
199
|
-
//update price oracle and time oracle
|
|
200
|
-
return [4 /*yield*/, updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price, endAuctionTsMs)];
|
|
201
|
-
case 15:
|
|
202
|
-
// //================================end auction================================
|
|
203
|
-
//update price oracle and time oracle
|
|
204
|
-
_c.sent();
|
|
205
|
-
return [4 /*yield*/, updateTimeOracle(timeOracle, timeOracleManager, endAuctionTsMs)
|
|
206
|
-
//update payoff config
|
|
207
|
-
];
|
|
208
|
-
case 16:
|
|
209
|
-
_c.sent();
|
|
210
|
-
premiumRoi = 100000;
|
|
211
|
-
exposureRatio = bidSize * (Math.pow(10, decimal)) / depositAmount;
|
|
212
|
-
return [4 /*yield*/, updatePayoffConfig(typeArgument, vaultIndex, price, premiumRoi, exposureRatio)
|
|
213
|
-
//update price oracle and time oracle
|
|
214
|
-
];
|
|
215
|
-
case 17:
|
|
216
|
-
_c.sent();
|
|
217
|
-
//update price oracle and time oracle
|
|
218
|
-
price = 9800000000;
|
|
219
|
-
return [4 /*yield*/, updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price, expirationTsMs1)];
|
|
220
|
-
case 18:
|
|
221
|
-
_c.sent();
|
|
222
|
-
return [4 /*yield*/, updateTimeOracle(timeOracle, timeOracleManager, expirationTsMs1)
|
|
223
|
-
//settle
|
|
224
|
-
];
|
|
225
|
-
case 19:
|
|
226
|
-
_c.sent();
|
|
227
|
-
//settle
|
|
228
|
-
return [4 /*yield*/, settle(typeArgument, vaultIndex, priceOracle, timeOracle)];
|
|
229
|
-
case 20:
|
|
230
|
-
//settle
|
|
231
|
-
_c.sent();
|
|
232
|
-
return [2 /*return*/];
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
}); })();
|
|
236
|
-
function updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price, ts) {
|
|
237
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
238
|
-
var _this = this;
|
|
239
|
-
return __generator(this, function (_a) {
|
|
240
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
241
|
-
var updateOracleTx, e_1;
|
|
242
|
-
return __generator(this, function (_a) {
|
|
243
|
-
switch (_a.label) {
|
|
244
|
-
case 0:
|
|
245
|
-
_a.trys.push([0, 3, , 4]);
|
|
246
|
-
return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.ORACLE_PACKAGE, typeArgument, priceOracle, priceOracleManager, price, ts)];
|
|
247
|
-
case 1:
|
|
248
|
-
updateOracleTx = _a.sent();
|
|
249
|
-
return [4 /*yield*/, signer.executeMoveCall(updateOracleTx)];
|
|
250
|
-
case 2:
|
|
251
|
-
_a.sent();
|
|
252
|
-
console.log("update price oracle successfully");
|
|
253
|
-
resolve(null);
|
|
254
|
-
return [3 /*break*/, 4];
|
|
255
|
-
case 3:
|
|
256
|
-
e_1 = _a.sent();
|
|
257
|
-
console.error("err in updatePriceOracle");
|
|
258
|
-
reject();
|
|
259
|
-
return [3 /*break*/, 4];
|
|
260
|
-
case 4: return [2 /*return*/];
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
}); }).catch(function (error) {
|
|
264
|
-
console.error(error);
|
|
265
|
-
})];
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
function updateTimeOracle(timeOracle, managerCap, ts) {
|
|
270
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
271
|
-
var _this = this;
|
|
272
|
-
return __generator(this, function (_a) {
|
|
273
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
274
|
-
var updateTimeOracleTx, e_2;
|
|
275
|
-
return __generator(this, function (_a) {
|
|
276
|
-
switch (_a.label) {
|
|
277
|
-
case 0:
|
|
278
|
-
_a.trys.push([0, 3, , 4]);
|
|
279
|
-
return [4 /*yield*/, (0, getUpdateTimeOracleTx_1.getUpdateTimeOracleTx)(constants_1.ORACLE_PACKAGE, timeOracle, managerCap, ts)];
|
|
280
|
-
case 1:
|
|
281
|
-
updateTimeOracleTx = _a.sent();
|
|
282
|
-
return [4 /*yield*/, signer.executeMoveCall(updateTimeOracleTx)];
|
|
283
|
-
case 2:
|
|
284
|
-
_a.sent();
|
|
285
|
-
console.log("update time oracle successfully");
|
|
286
|
-
resolve(null);
|
|
287
|
-
return [3 /*break*/, 4];
|
|
288
|
-
case 3:
|
|
289
|
-
e_2 = _a.sent();
|
|
290
|
-
console.error("err in updateTimeOracle");
|
|
291
|
-
reject();
|
|
292
|
-
return [3 /*break*/, 4];
|
|
293
|
-
case 4: return [2 /*return*/];
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
}); }).catch(function (error) {
|
|
297
|
-
console.error(error);
|
|
298
|
-
})];
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
function createNewVault(packageId, registry, typeArgument, managerCap, timeOracle, period, activationTsMs, expirationTsMs, tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, leverage) {
|
|
303
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
304
|
-
var _this = this;
|
|
305
|
-
return __generator(this, function (_a) {
|
|
306
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
307
|
-
var newCoveredCallVaultTx, moveCallTxn, e_3;
|
|
308
|
-
return __generator(this, function (_a) {
|
|
309
|
-
switch (_a.label) {
|
|
310
|
-
case 0:
|
|
311
|
-
_a.trys.push([0, 4, , 5]);
|
|
312
|
-
return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period.toString(), activationTsMs.toString(), expirationTsMs.toString(), tokenDecimal.toString(), shareDecimal.toString(), capacity.toString(), strikeOtmPct.toString(), strikeIncrement.toString(), decaySpeed.toString(), initialPrice.toString(), finalPrice.toString(), auctionDurationInMs.toString(), [], leverage.toString())];
|
|
313
|
-
case 1:
|
|
314
|
-
newCoveredCallVaultTx = _a.sent();
|
|
315
|
-
return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
|
|
316
|
-
case 2:
|
|
317
|
-
moveCallTxn = _a.sent();
|
|
318
|
-
return [4 /*yield*/, checkData(moveCallTxn)];
|
|
319
|
-
case 3:
|
|
320
|
-
_a.sent();
|
|
321
|
-
console.log("create new vault successfully");
|
|
322
|
-
resolve(null);
|
|
323
|
-
return [3 /*break*/, 5];
|
|
324
|
-
case 4:
|
|
325
|
-
e_3 = _a.sent();
|
|
326
|
-
console.error("err in createNewVault");
|
|
327
|
-
reject();
|
|
328
|
-
return [3 /*break*/, 5];
|
|
329
|
-
case 5: return [2 /*return*/];
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
}); }).catch(function (error) {
|
|
333
|
-
console.error(error);
|
|
334
|
-
})];
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
function checkData(moveCallTxn) {
|
|
339
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
340
|
-
var txn, _a, _b, obj, e_4;
|
|
341
|
-
var e_5, _c;
|
|
342
|
-
return __generator(this, function (_d) {
|
|
343
|
-
switch (_d.label) {
|
|
344
|
-
case 0:
|
|
345
|
-
_d.trys.push([0, 2, , 3]);
|
|
346
|
-
return [4 /*yield*/, provider.getTransactionWithEffects(
|
|
347
|
-
//@ts-ignore
|
|
348
|
-
moveCallTxn.EffectsCert.certificate.transactionDigest)];
|
|
349
|
-
case 1:
|
|
350
|
-
txn = _d.sent();
|
|
351
|
-
try {
|
|
352
|
-
for (_a = __values(txn.effects.created), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
353
|
-
obj = _b.value;
|
|
354
|
-
//@ts-ignore
|
|
355
|
-
if (obj.owner.ObjectOwner == constants_1.COVERED_CALL_REGISTRY)
|
|
356
|
-
console.log("new covered call vault: " + obj.reference.objectId);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
360
|
-
finally {
|
|
361
|
-
try {
|
|
362
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
363
|
-
}
|
|
364
|
-
finally { if (e_5) throw e_5.error; }
|
|
365
|
-
}
|
|
366
|
-
return [3 /*break*/, 3];
|
|
367
|
-
case 2:
|
|
368
|
-
e_4 = _d.sent();
|
|
369
|
-
console.error(e_4);
|
|
370
|
-
return [3 /*break*/, 3];
|
|
371
|
-
case 3: return [2 /*return*/];
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
function getNewestVaultIndex(registry) {
|
|
377
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
378
|
-
var tmp, numOfVault;
|
|
379
|
-
return __generator(this, function (_a) {
|
|
380
|
-
switch (_a.label) {
|
|
381
|
-
case 0: return [4 /*yield*/, provider.getObject(registry)];
|
|
382
|
-
case 1:
|
|
383
|
-
tmp = _a.sent();
|
|
384
|
-
if (tmp.status != "Exists") {
|
|
385
|
-
console.log("obj not exists");
|
|
386
|
-
return [2 /*return*/, -1];
|
|
387
|
-
}
|
|
388
|
-
numOfVault = tmp.details.data.fields.num_of_vault;
|
|
389
|
-
return [2 /*return*/, numOfVault - 1];
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
function depositToVault(typeArgument, vaultIndex, depositAmount) {
|
|
395
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
396
|
-
var _this = this;
|
|
397
|
-
return __generator(this, function (_a) {
|
|
398
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
399
|
-
var depositTx, e_6;
|
|
400
|
-
return __generator(this, function (_a) {
|
|
401
|
-
switch (_a.label) {
|
|
402
|
-
case 0:
|
|
403
|
-
_a.trys.push([0, 3, , 4]);
|
|
404
|
-
return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), token, depositAmount.toString())];
|
|
405
|
-
case 1:
|
|
406
|
-
depositTx = _a.sent();
|
|
407
|
-
return [4 /*yield*/, signer.executeMoveCall(depositTx)];
|
|
408
|
-
case 2:
|
|
409
|
-
_a.sent();
|
|
410
|
-
console.log("deposit to vault successfully");
|
|
411
|
-
resolve(null);
|
|
412
|
-
return [3 /*break*/, 4];
|
|
413
|
-
case 3:
|
|
414
|
-
e_6 = _a.sent();
|
|
415
|
-
console.log(e_6);
|
|
416
|
-
console.error("err in depositToVault");
|
|
417
|
-
return [3 /*break*/, 4];
|
|
418
|
-
case 4: return [2 /*return*/];
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
}); }).catch(function (error) {
|
|
422
|
-
console.error(error);
|
|
423
|
-
})];
|
|
424
|
-
});
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
function createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs) {
|
|
428
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
429
|
-
var _this = this;
|
|
430
|
-
return __generator(this, function (_a) {
|
|
431
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
432
|
-
var txn, e_7;
|
|
433
|
-
return __generator(this, function (_a) {
|
|
434
|
-
switch (_a.label) {
|
|
435
|
-
case 0:
|
|
436
|
-
_a.trys.push([0, 3, , 4]);
|
|
437
|
-
return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs)];
|
|
438
|
-
case 1:
|
|
439
|
-
txn = _a.sent();
|
|
440
|
-
return [4 /*yield*/, signer.executeMoveCall(txn)];
|
|
441
|
-
case 2:
|
|
442
|
-
_a.sent();
|
|
443
|
-
console.log("create new auction with next covered call successfully");
|
|
444
|
-
resolve(null);
|
|
445
|
-
return [3 /*break*/, 4];
|
|
446
|
-
case 3:
|
|
447
|
-
e_7 = _a.sent();
|
|
448
|
-
console.error("err in createNewAuctionWithNextCoveredCallVault");
|
|
449
|
-
return [3 /*break*/, 4];
|
|
450
|
-
case 4: return [2 /*return*/];
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
}); }).catch(function (error) {
|
|
454
|
-
console.error(error);
|
|
455
|
-
})];
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
function newBid(typeArgument, vaultIndex, size, token, timeOracle) {
|
|
460
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
461
|
-
var _this = this;
|
|
462
|
-
return __generator(this, function (_a) {
|
|
463
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
464
|
-
var newBidTx, e_8;
|
|
465
|
-
return __generator(this, function (_a) {
|
|
466
|
-
switch (_a.label) {
|
|
467
|
-
case 0:
|
|
468
|
-
_a.trys.push([0, 3, , 4]);
|
|
469
|
-
return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), size.toString(), token, timeOracle)];
|
|
470
|
-
case 1:
|
|
471
|
-
newBidTx = _a.sent();
|
|
472
|
-
return [4 /*yield*/, signer.executeMoveCall(newBidTx)];
|
|
473
|
-
case 2:
|
|
474
|
-
_a.sent();
|
|
475
|
-
console.log("new bid successfully ");
|
|
476
|
-
resolve(null);
|
|
477
|
-
return [3 /*break*/, 4];
|
|
478
|
-
case 3:
|
|
479
|
-
e_8 = _a.sent();
|
|
480
|
-
console.error(e_8);
|
|
481
|
-
return [3 /*break*/, 4];
|
|
482
|
-
case 4: return [2 /*return*/];
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
}); }).catch(function (error) {
|
|
486
|
-
console.error(error);
|
|
487
|
-
})];
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
function delivery(typeArgument, vaultIndex, sellSize, timeOracle) {
|
|
492
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
493
|
-
var _this = this;
|
|
494
|
-
return __generator(this, function (_a) {
|
|
495
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
496
|
-
var deliveryTx, e_9;
|
|
497
|
-
return __generator(this, function (_a) {
|
|
498
|
-
switch (_a.label) {
|
|
499
|
-
case 0:
|
|
500
|
-
_a.trys.push([0, 3, , 4]);
|
|
501
|
-
return [4 /*yield*/, (0, getDeliveryTx_1.getDeliveryTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), timeOracle)];
|
|
502
|
-
case 1:
|
|
503
|
-
deliveryTx = _a.sent();
|
|
504
|
-
return [4 /*yield*/, signer.executeMoveCall(deliveryTx)];
|
|
505
|
-
case 2:
|
|
506
|
-
_a.sent();
|
|
507
|
-
console.log("delivery successfully");
|
|
508
|
-
resolve(null);
|
|
509
|
-
return [3 /*break*/, 4];
|
|
510
|
-
case 3:
|
|
511
|
-
e_9 = _a.sent();
|
|
512
|
-
console.error("err in delivery");
|
|
513
|
-
reject();
|
|
514
|
-
return [3 /*break*/, 4];
|
|
515
|
-
case 4: return [2 /*return*/];
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
}); }).catch(function (error) {
|
|
519
|
-
console.error(error);
|
|
520
|
-
})];
|
|
521
|
-
});
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
function updatePayoffConfig(typeArgument, vaultIndex, price, premiumRoi, exposureRatio) {
|
|
525
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
526
|
-
var _this = this;
|
|
527
|
-
return __generator(this, function (_a) {
|
|
528
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
529
|
-
var updatePayoffConfigTx, e_10;
|
|
530
|
-
return __generator(this, function (_a) {
|
|
531
|
-
switch (_a.label) {
|
|
532
|
-
case 0:
|
|
533
|
-
_a.trys.push([0, 3, , 4]);
|
|
534
|
-
return [4 /*yield*/, (0, getUpdatePayoffConfigTx_1.getUpdatePayoffConfigTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), premiumRoi.toString(), exposureRatio.toString())];
|
|
535
|
-
case 1:
|
|
536
|
-
updatePayoffConfigTx = _a.sent();
|
|
537
|
-
return [4 /*yield*/, signer.executeMoveCall(updatePayoffConfigTx)];
|
|
538
|
-
case 2:
|
|
539
|
-
_a.sent();
|
|
540
|
-
console.log("update payoff config successfully");
|
|
541
|
-
resolve(null);
|
|
542
|
-
return [3 /*break*/, 4];
|
|
543
|
-
case 3:
|
|
544
|
-
e_10 = _a.sent();
|
|
545
|
-
console.error(e_10);
|
|
546
|
-
reject();
|
|
547
|
-
return [3 /*break*/, 4];
|
|
548
|
-
case 4: return [2 /*return*/];
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
}); }).catch(function (error) {
|
|
552
|
-
console.error(error);
|
|
553
|
-
})];
|
|
554
|
-
});
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
function settle(typeArgument, vaultIndex, priceOracle, timeOracle) {
|
|
558
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
559
|
-
var _this = this;
|
|
560
|
-
return __generator(this, function (_a) {
|
|
561
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
562
|
-
var settleTx, e_11;
|
|
563
|
-
return __generator(this, function (_a) {
|
|
564
|
-
switch (_a.label) {
|
|
565
|
-
case 0:
|
|
566
|
-
_a.trys.push([0, 3, , 4]);
|
|
567
|
-
return [4 /*yield*/, (0, getSettleTx_1.getSettleTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
|
|
568
|
-
case 1:
|
|
569
|
-
settleTx = _a.sent();
|
|
570
|
-
return [4 /*yield*/, signer.executeMoveCall(settleTx)];
|
|
571
|
-
case 2:
|
|
572
|
-
_a.sent();
|
|
573
|
-
console.log("settle successfully");
|
|
574
|
-
resolve(null);
|
|
575
|
-
return [3 /*break*/, 4];
|
|
576
|
-
case 3:
|
|
577
|
-
e_11 = _a.sent();
|
|
578
|
-
console.error(e_11);
|
|
579
|
-
reject();
|
|
580
|
-
return [3 /*break*/, 4];
|
|
581
|
-
case 4: return [2 /*return*/];
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
}); }).catch(function (error) {
|
|
585
|
-
console.error(error);
|
|
586
|
-
})];
|
|
587
|
-
});
|
|
588
|
-
});
|
|
589
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|