@typus/typus-sdk 1.0.20 → 1.0.22
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 +0 -1
- package/lib/constants.js +5 -3
- package/lib/test/mergeCoins.js +1 -2
- package/lib/test/multiple-collateral/getAuctionMaxSize.js +4 -3
- package/lib/test/{single-collateral/helper/getUserStatus.js → multiple-collateral/getBids.js} +14 -9
- package/lib/test/multiple-collateral/getMaxLossPerUnit.js +4 -3
- package/lib/test/multiple-collateral/getUserShares.js +4 -3
- package/lib/test/single-collateral/authorized/testAuthorizedNewPortfolioVault.js +1 -1
- package/lib/test/single-collateral/authorized/testAuthorizedUpdateUpcomingVaultConfig.js +1 -1
- package/lib/test/single-collateral/authorized/testAuthorizedUpdateWarmupVaultConfig.js +1 -1
- package/lib/test/single-collateral/getAuctionMaxSize.js +4 -3
- package/lib/test/single-collateral/{helper/getAuctionMaxSize.js → getBids.js} +14 -13
- package/lib/test/single-collateral/getMaxLossPerUnit.js +4 -3
- package/lib/test/single-collateral/getUserShares.js +4 -3
- package/lib/test/single-collateral/testMint.js +2 -4
- package/lib/test/single-collateral/testSDK.js +1 -2
- package/lib/test/single-collateral/user/testClaim.js +1 -1
- package/lib/test/single-collateral/user/testCompound.js +1 -1
- package/lib/test/single-collateral/user/testDeposit.js +1 -1
- package/lib/test/single-collateral/user/testHarvest.js +1 -1
- package/lib/test/single-collateral/user/testUnsubscribe.js +1 -1
- package/lib/test/single-collateral/user/testWithdraw.js +1 -1
- package/lib/test/sponsorTransaction.js +1 -1
- package/lib/utils/portfolio/multiple-collateral/authorized-entry.d.ts +102 -0
- package/lib/utils/portfolio/multiple-collateral/authorized-entry.js +295 -0
- package/lib/utils/portfolio/multiple-collateral/manager-entry.d.ts +219 -0
- package/lib/utils/portfolio/multiple-collateral/manager-entry.js +584 -0
- package/lib/utils/portfolio/multiple-collateral/portfolio-vault.js +4 -4
- package/lib/utils/portfolio/multiple-collateral/user-entry.d.ts +84 -0
- package/lib/utils/portfolio/multiple-collateral/user-entry.js +271 -0
- package/lib/utils/portfolio/single-collateral/getLeaderBoard.d.ts +2 -2
- package/lib/utils/portfolio/single-collateral/getLeaderBoard.js +30 -10
- package/lib/utils/portfolio/single-collateral/portfolio-vault.js +3 -3
- package/lib/utils/typus-framework/dutch.d.ts +2 -0
- package/lib/utils/typus-framework/dutch.js +65 -1
- package/lib/utils/typus-framework/vault.d.ts +2 -0
- package/lib/utils/typus-framework/vault.js +4 -0
- package/package.json +3 -3
- package/lib/mnemonic.json +0 -3
- package/lib/scripts/getSubVault.d.ts +0 -0
- package/lib/scripts/getSubVault.js +0 -6
- /package/lib/test/{single-collateral/helper/getAuctionMaxSize.d.ts → multiple-collateral/getBids.d.ts} +0 -0
- /package/lib/test/single-collateral/{helper/getUserStatus.d.ts → getBids.d.ts} +0 -0
|
@@ -0,0 +1,584 @@
|
|
|
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getTerminateAuctionTx = exports.getTerminateVaultTx = exports.getNewAuctionTx = exports.getUpdateActiveVaultConfigTx = exports.getCloseTx = exports.getEvolutionTx = exports.getDeliveryTx = exports.getUpdateUpcomingVaultConfigTx = exports.getUpdateWarmupVaultConfigTx = exports.getUpdateCapacityTx = exports.getNewPortfolioVaultTx = exports.getUpdateRestrictActivationTimePeriodTx = exports.getRemovePortfolioVaultAuthorizedUserTx = exports.getAddPortfolioVaultAuthorizedUserTx = exports.getRemoveAuthorizedUserTx = exports.getAddAuthorizedUserTx = exports.getRemoveManagerTx = exports.getNewManagerTx = void 0;
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
/**
|
|
42
|
+
public(friend) entry fun new_manager(
|
|
43
|
+
_manager_cap: &ManagerCap,
|
|
44
|
+
users: vector<address>,
|
|
45
|
+
ctx: &mut TxContext
|
|
46
|
+
)
|
|
47
|
+
*/
|
|
48
|
+
function getNewManagerTx(gasBudget, packageId, managerCap, users) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var tx;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
tx = new sui_js_1.TransactionBlock();
|
|
53
|
+
tx.moveCall({
|
|
54
|
+
target: "".concat(packageId, "::multiple_collateral::new_manager"),
|
|
55
|
+
arguments: [tx.pure(managerCap), tx.pure(users)],
|
|
56
|
+
});
|
|
57
|
+
tx.setGasBudget(gasBudget);
|
|
58
|
+
return [2 /*return*/, tx];
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
exports.getNewManagerTx = getNewManagerTx;
|
|
63
|
+
/**
|
|
64
|
+
public(friend) entry fun remove_manager(
|
|
65
|
+
_manager_cap: &ManagerCap,
|
|
66
|
+
users: vector<address>,
|
|
67
|
+
ctx: &mut TxContext
|
|
68
|
+
)
|
|
69
|
+
*/
|
|
70
|
+
function getRemoveManagerTx(gasBudget, packageId, managerCap) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var tx;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
tx = new sui_js_1.TransactionBlock();
|
|
75
|
+
tx.moveCall({
|
|
76
|
+
target: "".concat(packageId, "::multiple_collateral::remove_manager"),
|
|
77
|
+
arguments: [tx.pure(managerCap)],
|
|
78
|
+
});
|
|
79
|
+
tx.setGasBudget(gasBudget);
|
|
80
|
+
return [2 /*return*/, tx];
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.getRemoveManagerTx = getRemoveManagerTx;
|
|
85
|
+
/**
|
|
86
|
+
public(friend) entry fun add_authorized_user(
|
|
87
|
+
manager_cap: &ManagerCap,
|
|
88
|
+
registry: &mut Registry,
|
|
89
|
+
users: vector<address>,
|
|
90
|
+
ctx: &TxContext,
|
|
91
|
+
)
|
|
92
|
+
*/
|
|
93
|
+
function getAddAuthorizedUserTx(gasBudget, packageId, managerCap, registry, users) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
+
var tx;
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
tx = new sui_js_1.TransactionBlock();
|
|
98
|
+
tx.moveCall({
|
|
99
|
+
target: "".concat(packageId, "::multiple_collateral::add_authorized_user"),
|
|
100
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(users)],
|
|
101
|
+
});
|
|
102
|
+
tx.setGasBudget(gasBudget);
|
|
103
|
+
return [2 /*return*/, tx];
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
exports.getAddAuthorizedUserTx = getAddAuthorizedUserTx;
|
|
108
|
+
/**
|
|
109
|
+
public(friend) entry fun remove_authorized_user(
|
|
110
|
+
manager_cap: &ManagerCap,
|
|
111
|
+
registry: &mut Registry,
|
|
112
|
+
users: vector<address>,
|
|
113
|
+
ctx: &TxContext,
|
|
114
|
+
)
|
|
115
|
+
*/
|
|
116
|
+
function getRemoveAuthorizedUserTx(gasBudget, packageId, managerCap, registry, users) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var tx;
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
tx = new sui_js_1.TransactionBlock();
|
|
121
|
+
tx.moveCall({
|
|
122
|
+
target: "".concat(packageId, "::multiple_collateral::remove_authorized_user"),
|
|
123
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(users)],
|
|
124
|
+
});
|
|
125
|
+
tx.setGasBudget(gasBudget);
|
|
126
|
+
return [2 /*return*/, tx];
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
exports.getRemoveAuthorizedUserTx = getRemoveAuthorizedUserTx;
|
|
131
|
+
/**
|
|
132
|
+
public(friend) entry fun add_portfolio_vault_authorized_user<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
133
|
+
manager_cap: &ManagerCap,
|
|
134
|
+
registry: &mut Registry,
|
|
135
|
+
index: u64,
|
|
136
|
+
users: vector<address>,
|
|
137
|
+
ctx: &TxContext,
|
|
138
|
+
)
|
|
139
|
+
*/
|
|
140
|
+
function getAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, typeArguments, managerCap, registry, index, users) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
+
var tx;
|
|
143
|
+
return __generator(this, function (_a) {
|
|
144
|
+
tx = new sui_js_1.TransactionBlock();
|
|
145
|
+
tx.moveCall({
|
|
146
|
+
target: "".concat(packageId, "::multiple_collateral::add_portfolio_vault_authorized_user"),
|
|
147
|
+
typeArguments: typeArguments,
|
|
148
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(users)],
|
|
149
|
+
});
|
|
150
|
+
tx.setGasBudget(gasBudget);
|
|
151
|
+
return [2 /*return*/, tx];
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
exports.getAddPortfolioVaultAuthorizedUserTx = getAddPortfolioVaultAuthorizedUserTx;
|
|
156
|
+
/**
|
|
157
|
+
public(friend) entry fun remove_portfolio_vault_authorized_user<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
158
|
+
manager_cap: &ManagerCap,
|
|
159
|
+
registry: &mut Registry,
|
|
160
|
+
index: u64,
|
|
161
|
+
users: vector<address>,
|
|
162
|
+
ctx: &TxContext,
|
|
163
|
+
)
|
|
164
|
+
*/
|
|
165
|
+
function getRemovePortfolioVaultAuthorizedUserTx(gasBudget, packageId, typeArguments, managerCap, registry, index, users) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
+
var tx;
|
|
168
|
+
return __generator(this, function (_a) {
|
|
169
|
+
tx = new sui_js_1.TransactionBlock();
|
|
170
|
+
tx.moveCall({
|
|
171
|
+
target: "".concat(packageId, "::multiple_collateral::remove_portfolio_vault_authorized_user"),
|
|
172
|
+
typeArguments: typeArguments,
|
|
173
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(users)],
|
|
174
|
+
});
|
|
175
|
+
tx.setGasBudget(gasBudget);
|
|
176
|
+
return [2 /*return*/, tx];
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
exports.getRemovePortfolioVaultAuthorizedUserTx = getRemovePortfolioVaultAuthorizedUserTx;
|
|
181
|
+
/**
|
|
182
|
+
public(friend) entry fun update_restrict_activation_time_period(
|
|
183
|
+
_manager_cap: &ManagerCap,
|
|
184
|
+
registry: &mut Registry,
|
|
185
|
+
from_ts_ms: u64,
|
|
186
|
+
to_ts_ms: u64,
|
|
187
|
+
ctx: &TxContext,
|
|
188
|
+
)
|
|
189
|
+
*/
|
|
190
|
+
function getUpdateRestrictActivationTimePeriodTx(gasBudget, packageId, managerCap, registry, from_ts_ms, to_ts_ms) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
192
|
+
var tx;
|
|
193
|
+
return __generator(this, function (_a) {
|
|
194
|
+
tx = new sui_js_1.TransactionBlock();
|
|
195
|
+
tx.moveCall({
|
|
196
|
+
target: "".concat(packageId, "::multiple_collateral::update_restrict_activation_time_period"),
|
|
197
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(from_ts_ms), tx.pure(to_ts_ms)],
|
|
198
|
+
});
|
|
199
|
+
tx.setGasBudget(gasBudget);
|
|
200
|
+
return [2 /*return*/, tx];
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
exports.getUpdateRestrictActivationTimePeriodTx = getUpdateRestrictActivationTimePeriodTx;
|
|
205
|
+
/**
|
|
206
|
+
public(friend) entry fun new_portfolio_vault<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
207
|
+
manager_cap: &ManagerCap,
|
|
208
|
+
registry: &mut Registry,
|
|
209
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
210
|
+
clock: &Clock,
|
|
211
|
+
strategy_name: String,
|
|
212
|
+
period: u8,
|
|
213
|
+
activation_ts_ms: u64,
|
|
214
|
+
expiration_ts_ms: u64,
|
|
215
|
+
o_token_decimal: u64,
|
|
216
|
+
u_token_decimal: u64,
|
|
217
|
+
b_token_decimal: u64,
|
|
218
|
+
capacity: u64,
|
|
219
|
+
call_strike_pct: vector<u64>,
|
|
220
|
+
call_weight: vector<u64>,
|
|
221
|
+
call_is_buyer: vector<bool>,
|
|
222
|
+
put_strike_pct: vector<u64>,
|
|
223
|
+
put_weight: vector<u64>,
|
|
224
|
+
put_is_buyer: vector<bool>,
|
|
225
|
+
strike_increment: u64,
|
|
226
|
+
lot_size: u64,
|
|
227
|
+
decay_speed: u64,
|
|
228
|
+
initial_price: u64,
|
|
229
|
+
final_price: u64,
|
|
230
|
+
auction_duration_in_ms: u64,
|
|
231
|
+
leverage: u64,
|
|
232
|
+
has_next: bool,
|
|
233
|
+
whitelist: vector<address>,
|
|
234
|
+
ctx: &mut TxContext
|
|
235
|
+
)
|
|
236
|
+
*/
|
|
237
|
+
function getNewPortfolioVaultTx(gasBudget, packageId, typeArguments, managerCap, registry, priceOracle, strategy_name, period, activation_ts_ms, expiration_ts_ms, o_token_decimal, u_token_decimal, b_token_decimal, capacity, call_strike_pct, call_weight, call_is_buyer, put_strike_pct, put_weight, put_is_buyer, strike_increment, lot_size, decay_speed, initial_price, final_price, auction_duration_in_ms, leverage, has_next, whitelist) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
239
|
+
var tx;
|
|
240
|
+
return __generator(this, function (_a) {
|
|
241
|
+
tx = new sui_js_1.TransactionBlock();
|
|
242
|
+
tx.moveCall({
|
|
243
|
+
target: "".concat(packageId, "::multiple_collateral::new_portfolio_vault"),
|
|
244
|
+
typeArguments: typeArguments,
|
|
245
|
+
arguments: [
|
|
246
|
+
tx.pure(managerCap),
|
|
247
|
+
tx.pure(registry),
|
|
248
|
+
tx.pure(priceOracle),
|
|
249
|
+
tx.pure("0x6"),
|
|
250
|
+
tx.pure(strategy_name),
|
|
251
|
+
tx.pure(period),
|
|
252
|
+
tx.pure(activation_ts_ms),
|
|
253
|
+
tx.pure(expiration_ts_ms),
|
|
254
|
+
tx.pure(o_token_decimal),
|
|
255
|
+
tx.pure(u_token_decimal),
|
|
256
|
+
tx.pure(b_token_decimal),
|
|
257
|
+
tx.pure(capacity),
|
|
258
|
+
tx.pure(call_strike_pct),
|
|
259
|
+
tx.pure(call_weight),
|
|
260
|
+
tx.pure(call_is_buyer),
|
|
261
|
+
tx.pure(put_strike_pct),
|
|
262
|
+
tx.pure(put_weight),
|
|
263
|
+
tx.pure(put_is_buyer),
|
|
264
|
+
tx.pure(strike_increment),
|
|
265
|
+
tx.pure(lot_size),
|
|
266
|
+
tx.pure(decay_speed),
|
|
267
|
+
tx.pure(initial_price),
|
|
268
|
+
tx.pure(final_price),
|
|
269
|
+
tx.pure(auction_duration_in_ms),
|
|
270
|
+
tx.pure(leverage),
|
|
271
|
+
tx.pure(has_next),
|
|
272
|
+
tx.pure(whitelist),
|
|
273
|
+
],
|
|
274
|
+
});
|
|
275
|
+
tx.setGasBudget(gasBudget);
|
|
276
|
+
return [2 /*return*/, tx];
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
exports.getNewPortfolioVaultTx = getNewPortfolioVaultTx;
|
|
281
|
+
/**
|
|
282
|
+
public(friend) entry fun update_capacity<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
283
|
+
_manager_cap: &ManagerCap,
|
|
284
|
+
registry: &mut Registry,
|
|
285
|
+
index: u64,
|
|
286
|
+
capacity: u64,
|
|
287
|
+
ctx: &TxContext,
|
|
288
|
+
)
|
|
289
|
+
*/
|
|
290
|
+
function getUpdateCapacityTx(gasBudget, packageId, typeArguments, managerCap, registry, index, capacity) {
|
|
291
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
+
var tx;
|
|
293
|
+
return __generator(this, function (_a) {
|
|
294
|
+
tx = new sui_js_1.TransactionBlock();
|
|
295
|
+
tx.moveCall({
|
|
296
|
+
target: "".concat(packageId, "::multiple_collateral::update_capacity"),
|
|
297
|
+
typeArguments: typeArguments,
|
|
298
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(capacity)],
|
|
299
|
+
});
|
|
300
|
+
tx.setGasBudget(gasBudget);
|
|
301
|
+
return [2 /*return*/, tx];
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
exports.getUpdateCapacityTx = getUpdateCapacityTx;
|
|
306
|
+
/**
|
|
307
|
+
public(friend) entry fun update_warmup_vault_config<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
308
|
+
_manager_cap: &ManagerCap,
|
|
309
|
+
registry: &mut Registry,
|
|
310
|
+
index: u64,
|
|
311
|
+
strike_increment: u64,
|
|
312
|
+
decay_speed: u64,
|
|
313
|
+
initial_price: u64,
|
|
314
|
+
final_price: u64,
|
|
315
|
+
auction_duration_in_ms: u64,
|
|
316
|
+
ctx: &TxContext,
|
|
317
|
+
)
|
|
318
|
+
*/
|
|
319
|
+
function getUpdateWarmupVaultConfigTx(gasBudget, packageId, typeArguments, managerCap, registry, index, strike_increment, decay_speed, initial_price, final_price, auction_duration_in_ms) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
321
|
+
var tx;
|
|
322
|
+
return __generator(this, function (_a) {
|
|
323
|
+
tx = new sui_js_1.TransactionBlock();
|
|
324
|
+
tx.moveCall({
|
|
325
|
+
target: "".concat(packageId, "::multiple_collateral::update_warmup_vault_config"),
|
|
326
|
+
typeArguments: typeArguments,
|
|
327
|
+
arguments: [
|
|
328
|
+
tx.pure(managerCap),
|
|
329
|
+
tx.pure(registry),
|
|
330
|
+
tx.pure(index),
|
|
331
|
+
tx.pure(strike_increment),
|
|
332
|
+
tx.pure(decay_speed),
|
|
333
|
+
tx.pure(initial_price),
|
|
334
|
+
tx.pure(final_price),
|
|
335
|
+
tx.pure(auction_duration_in_ms),
|
|
336
|
+
],
|
|
337
|
+
});
|
|
338
|
+
tx.setGasBudget(gasBudget);
|
|
339
|
+
return [2 /*return*/, tx];
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
exports.getUpdateWarmupVaultConfigTx = getUpdateWarmupVaultConfigTx;
|
|
344
|
+
/**
|
|
345
|
+
public(friend) entry fun update_upcoming_vault_config<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
346
|
+
_manager_cap: &ManagerCap,
|
|
347
|
+
registry: &mut Registry,
|
|
348
|
+
index: u64,
|
|
349
|
+
call_strike_pct: vector<u64>,
|
|
350
|
+
call_weight: vector<u64>,
|
|
351
|
+
call_is_buyer: vector<bool>,
|
|
352
|
+
put_strike_pct: vector<u64>,
|
|
353
|
+
put_weight: vector<u64>,
|
|
354
|
+
put_is_buyer: vector<bool>,
|
|
355
|
+
strike_increment: u64,
|
|
356
|
+
decay_speed: u64,
|
|
357
|
+
initial_price: u64,
|
|
358
|
+
final_price: u64,
|
|
359
|
+
auction_duration_in_ms: u64,
|
|
360
|
+
ctx: &TxContext,
|
|
361
|
+
)
|
|
362
|
+
*/
|
|
363
|
+
function getUpdateUpcomingVaultConfigTx(gasBudget, packageId, typeArguments, managerCap, registry, index, call_strike_pct, call_weight, call_is_buyer, put_strike_pct, put_weight, put_is_buyer, strike_increment, decay_speed, initial_price, final_price, auction_duration_in_ms) {
|
|
364
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
365
|
+
var tx;
|
|
366
|
+
return __generator(this, function (_a) {
|
|
367
|
+
tx = new sui_js_1.TransactionBlock();
|
|
368
|
+
tx.moveCall({
|
|
369
|
+
target: "".concat(packageId, "::multiple_collateral::update_upcoming_vault_config"),
|
|
370
|
+
typeArguments: typeArguments,
|
|
371
|
+
arguments: [
|
|
372
|
+
tx.pure(managerCap),
|
|
373
|
+
tx.pure(registry),
|
|
374
|
+
tx.pure(index),
|
|
375
|
+
tx.pure(call_strike_pct),
|
|
376
|
+
tx.pure(call_weight),
|
|
377
|
+
tx.pure(call_is_buyer),
|
|
378
|
+
tx.pure(put_strike_pct),
|
|
379
|
+
tx.pure(put_weight),
|
|
380
|
+
tx.pure(put_is_buyer),
|
|
381
|
+
tx.pure(strike_increment),
|
|
382
|
+
tx.pure(decay_speed),
|
|
383
|
+
tx.pure(initial_price),
|
|
384
|
+
tx.pure(final_price),
|
|
385
|
+
tx.pure(auction_duration_in_ms),
|
|
386
|
+
],
|
|
387
|
+
});
|
|
388
|
+
tx.setGasBudget(gasBudget);
|
|
389
|
+
return [2 /*return*/, tx];
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
exports.getUpdateUpcomingVaultConfigTx = getUpdateUpcomingVaultConfigTx;
|
|
394
|
+
/**
|
|
395
|
+
public(friend) entry fun delivery<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
396
|
+
manager_cap: &ManagerCap,
|
|
397
|
+
registry: &mut Registry,
|
|
398
|
+
index: u64,
|
|
399
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
400
|
+
clock: &Clock,
|
|
401
|
+
ctx: &mut TxContext
|
|
402
|
+
)
|
|
403
|
+
*/
|
|
404
|
+
function getDeliveryTx(gasBudget, packageId, typeArguments, managerCap, registry, index, priceOracle) {
|
|
405
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
406
|
+
var tx;
|
|
407
|
+
return __generator(this, function (_a) {
|
|
408
|
+
tx = new sui_js_1.TransactionBlock();
|
|
409
|
+
tx.moveCall({
|
|
410
|
+
target: "".concat(packageId, "::multiple_collateral::delivery"),
|
|
411
|
+
typeArguments: typeArguments,
|
|
412
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(priceOracle), tx.pure("0x6")],
|
|
413
|
+
});
|
|
414
|
+
tx.setGasBudget(gasBudget);
|
|
415
|
+
return [2 /*return*/, tx];
|
|
416
|
+
});
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
exports.getDeliveryTx = getDeliveryTx;
|
|
420
|
+
/**
|
|
421
|
+
public(friend) entry fun evolution<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
422
|
+
manager_cap: &ManagerCap,
|
|
423
|
+
registry: &mut Registry,
|
|
424
|
+
index: u64,
|
|
425
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
426
|
+
clock: &Clock,
|
|
427
|
+
ctx: &mut TxContext,
|
|
428
|
+
)
|
|
429
|
+
*/
|
|
430
|
+
function getEvolutionTx(gasBudget, packageId, typeArguments, managerCap, registry, index, priceOracle) {
|
|
431
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
432
|
+
var tx;
|
|
433
|
+
return __generator(this, function (_a) {
|
|
434
|
+
tx = new sui_js_1.TransactionBlock();
|
|
435
|
+
tx.moveCall({
|
|
436
|
+
target: "".concat(packageId, "::multiple_collateral::evolution"),
|
|
437
|
+
typeArguments: typeArguments,
|
|
438
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(priceOracle), tx.pure("0x6")],
|
|
439
|
+
});
|
|
440
|
+
tx.setGasBudget(gasBudget);
|
|
441
|
+
return [2 /*return*/, tx];
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
exports.getEvolutionTx = getEvolutionTx;
|
|
446
|
+
/**
|
|
447
|
+
public(friend) entry fun close<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
448
|
+
_manager_cap: &ManagerCap,
|
|
449
|
+
registry: &mut Registry,
|
|
450
|
+
index: u64,
|
|
451
|
+
ctx: &TxContext,
|
|
452
|
+
)
|
|
453
|
+
*/
|
|
454
|
+
function getCloseTx(gasBudget, packageId, typeArguments, managerCap, registry, index) {
|
|
455
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
456
|
+
var tx;
|
|
457
|
+
return __generator(this, function (_a) {
|
|
458
|
+
tx = new sui_js_1.TransactionBlock();
|
|
459
|
+
tx.moveCall({
|
|
460
|
+
target: "".concat(packageId, "::multiple_collateral::evolution"),
|
|
461
|
+
typeArguments: typeArguments,
|
|
462
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index)],
|
|
463
|
+
});
|
|
464
|
+
tx.setGasBudget(gasBudget);
|
|
465
|
+
return [2 /*return*/, tx];
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
exports.getCloseTx = getCloseTx;
|
|
470
|
+
/**
|
|
471
|
+
public(friend) entry fun update_active_vault_config<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
472
|
+
_manager_cap: &ManagerCap,
|
|
473
|
+
registry: &mut Registry,
|
|
474
|
+
index: u64,
|
|
475
|
+
strike_increment: u64,
|
|
476
|
+
decay_speed: u64,
|
|
477
|
+
initial_price: u64,
|
|
478
|
+
final_price: u64,
|
|
479
|
+
auction_duration_in_ms: u64,
|
|
480
|
+
ctx: &TxContext,
|
|
481
|
+
)
|
|
482
|
+
*/
|
|
483
|
+
function getUpdateActiveVaultConfigTx(gasBudget, packageId, typeArguments, managerCap, registry, index, strike_increment, decay_speed, initial_price, final_price, auction_duration_in_ms) {
|
|
484
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
485
|
+
var tx;
|
|
486
|
+
return __generator(this, function (_a) {
|
|
487
|
+
tx = new sui_js_1.TransactionBlock();
|
|
488
|
+
tx.moveCall({
|
|
489
|
+
target: "".concat(packageId, "::multiple_collateral::update_active_vault_config"),
|
|
490
|
+
typeArguments: typeArguments,
|
|
491
|
+
arguments: [
|
|
492
|
+
tx.pure(managerCap),
|
|
493
|
+
tx.pure(registry),
|
|
494
|
+
tx.pure(index),
|
|
495
|
+
tx.pure(strike_increment),
|
|
496
|
+
tx.pure(decay_speed),
|
|
497
|
+
tx.pure(initial_price),
|
|
498
|
+
tx.pure(final_price),
|
|
499
|
+
tx.pure(auction_duration_in_ms),
|
|
500
|
+
],
|
|
501
|
+
});
|
|
502
|
+
tx.setGasBudget(gasBudget);
|
|
503
|
+
return [2 /*return*/, tx];
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
exports.getUpdateActiveVaultConfigTx = getUpdateActiveVaultConfigTx;
|
|
508
|
+
/**
|
|
509
|
+
public(friend) entry fun new_auction<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
510
|
+
manager_cap: &ManagerCap,
|
|
511
|
+
registry: &mut Registry,
|
|
512
|
+
index: u64,
|
|
513
|
+
start_ts_ms: u64,
|
|
514
|
+
price_oracle: &Oracle<O_TOKEN>,
|
|
515
|
+
clock: &Clock,
|
|
516
|
+
ctx: &mut TxContext,
|
|
517
|
+
)
|
|
518
|
+
*/
|
|
519
|
+
function getNewAuctionTx(gasBudget, packageId, typeArguments, managerCap, registry, index, start_ts_ms, price_oracle) {
|
|
520
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
521
|
+
var tx;
|
|
522
|
+
return __generator(this, function (_a) {
|
|
523
|
+
tx = new sui_js_1.TransactionBlock();
|
|
524
|
+
tx.moveCall({
|
|
525
|
+
target: "".concat(packageId, "::multiple_collateral::new_auction"),
|
|
526
|
+
typeArguments: typeArguments,
|
|
527
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure(start_ts_ms), tx.pure(price_oracle), tx.pure("0x6")],
|
|
528
|
+
});
|
|
529
|
+
tx.setGasBudget(gasBudget);
|
|
530
|
+
return [2 /*return*/, tx];
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
exports.getNewAuctionTx = getNewAuctionTx;
|
|
535
|
+
/**
|
|
536
|
+
public(friend) entry fun terminate_vault<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
537
|
+
manager_cap: &ManagerCap,
|
|
538
|
+
registry: &mut Registry,
|
|
539
|
+
index: u64,
|
|
540
|
+
clock: &Clock,
|
|
541
|
+
ctx: &mut TxContext,
|
|
542
|
+
)
|
|
543
|
+
*/
|
|
544
|
+
function getTerminateVaultTx(gasBudget, packageId, typeArguments, managerCap, registry, index) {
|
|
545
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
546
|
+
var tx;
|
|
547
|
+
return __generator(this, function (_a) {
|
|
548
|
+
tx = new sui_js_1.TransactionBlock();
|
|
549
|
+
tx.moveCall({
|
|
550
|
+
target: "".concat(packageId, "::multiple_collateral::terminate_vault"),
|
|
551
|
+
typeArguments: typeArguments,
|
|
552
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure("0x6")],
|
|
553
|
+
});
|
|
554
|
+
tx.setGasBudget(gasBudget);
|
|
555
|
+
return [2 /*return*/, tx];
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
exports.getTerminateVaultTx = getTerminateVaultTx;
|
|
560
|
+
/**
|
|
561
|
+
public(friend) entry fun terminate_auction<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
562
|
+
manager_cap: &ManagerCap,
|
|
563
|
+
registry: &mut Registry,
|
|
564
|
+
index: u64,
|
|
565
|
+
clock: &Clock,
|
|
566
|
+
ctx: &mut TxContext,
|
|
567
|
+
)
|
|
568
|
+
*/
|
|
569
|
+
function getTerminateAuctionTx(gasBudget, packageId, typeArguments, managerCap, registry, index) {
|
|
570
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
571
|
+
var tx;
|
|
572
|
+
return __generator(this, function (_a) {
|
|
573
|
+
tx = new sui_js_1.TransactionBlock();
|
|
574
|
+
tx.moveCall({
|
|
575
|
+
target: "".concat(packageId, "::multiple_collateral::terminate_auction"),
|
|
576
|
+
typeArguments: typeArguments,
|
|
577
|
+
arguments: [tx.pure(managerCap), tx.pure(registry), tx.pure(index), tx.pure("0x6")],
|
|
578
|
+
});
|
|
579
|
+
tx.setGasBudget(gasBudget);
|
|
580
|
+
return [2 /*return*/, tx];
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
exports.getTerminateAuctionTx = getTerminateAuctionTx;
|
|
@@ -41,7 +41,7 @@ var vault_1 = require("../../typus-framework/vault");
|
|
|
41
41
|
var dutch_1 = require("../../typus-framework/dutch");
|
|
42
42
|
function getPortfolioVaults(provider, registry, token_deposit_vault_registry, usd_deposit_vault_registry, bid_vault_registry, index) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
var portfolioVaultIds, portfolioVaults, tokenDepositVaultIds,
|
|
44
|
+
var portfolioVaultIds, portfolioVaults, tokenDepositVaultIds, usdDepositVaultIds, bidVaultIds;
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
47
|
case 0: return [4 /*yield*/, provider.getDynamicFields({ parentId: registry })];
|
|
@@ -239,7 +239,7 @@ function getPortfolioVaults(provider, registry, token_deposit_vault_registry, us
|
|
|
239
239
|
options: { showContent: true },
|
|
240
240
|
})];
|
|
241
241
|
case 4:
|
|
242
|
-
|
|
242
|
+
(_a.sent())
|
|
243
243
|
.filter(function (tokenDepositVault) { return tokenDepositVault.error == undefined; })
|
|
244
244
|
.forEach(function (tokenDepositVault) {
|
|
245
245
|
// @ts-ignore
|
|
@@ -260,7 +260,7 @@ function getPortfolioVaults(provider, registry, token_deposit_vault_registry, us
|
|
|
260
260
|
options: { showContent: true },
|
|
261
261
|
})];
|
|
262
262
|
case 6:
|
|
263
|
-
|
|
263
|
+
(_a.sent())
|
|
264
264
|
.filter(function (usdDepositVault) { return usdDepositVault.error == undefined; })
|
|
265
265
|
.forEach(function (usdDepositVault) {
|
|
266
266
|
// @ts-ignore
|
|
@@ -281,7 +281,7 @@ function getPortfolioVaults(provider, registry, token_deposit_vault_registry, us
|
|
|
281
281
|
options: { showContent: true },
|
|
282
282
|
})];
|
|
283
283
|
case 8:
|
|
284
|
-
|
|
284
|
+
(_a.sent())
|
|
285
285
|
.filter(function (bidVault) { return bidVault.error == undefined; })
|
|
286
286
|
.forEach(function (bidVault) {
|
|
287
287
|
// @ts-ignore
|