@typus/typus-sdk 1.4.18 → 1.4.19
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/dist/config-mainnet.json +3 -3
- package/dist/src/auto-bid/token-user-entry.d.ts +9 -0
- package/dist/src/auto-bid/token-user-entry.js +126 -0
- package/dist/src/typus/airdrop/authority-entry.d.ts +14 -2
- package/dist/src/typus/airdrop/authority-entry.js +27 -32
- package/dist/src/typus/airdrop/user-entry.d.ts +2 -5
- package/dist/src/typus/airdrop/user-entry.js +8 -8
- package/dist/src/typus/airdrop/view-function.d.ts +2 -5
- package/dist/src/typus/airdrop/view-function.js +5 -5
- package/dist/src/typus/leaderboard/authority-entry.d.ts +10 -2
- package/dist/src/typus/leaderboard/authority-entry.js +12 -13
- package/dist/src/typus/leaderboard/view-function.d.ts +2 -5
- package/dist/src/typus/leaderboard/view-function.js +6 -6
- package/dist/src/typus/tails-staking/authority-entry.d.ts +12 -55
- package/dist/src/typus/tails-staking/authority-entry.js +73 -97
- package/dist/src/typus/tails-staking/user-entry.d.ts +14 -44
- package/dist/src/typus/tails-staking/user-entry.js +123 -123
- package/dist/src/typus/tails-staking/view-function.d.ts +3 -11
- package/dist/src/typus/tails-staking/view-function.js +10 -10
- package/dist/src/typus/user/view-function.d.ts +2 -5
- package/dist/src/typus/user/view-function.js +5 -5
- package/dist/src/typus-dov-single-v2/authority-entry.d.ts +26 -18
- package/dist/src/typus-dov-single-v2/authority-entry.js +23 -114
- package/dist/src/typus-dov-single-v2/function/bidding.js +4 -5
- package/dist/src/typus-dov-single-v2/token-user-entry.d.ts +11 -84
- package/dist/src/typus-dov-single-v2/token-user-entry.js +191 -316
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +11 -69
- package/dist/src/typus-dov-single-v2/user-entry.js +183 -194
- package/dist/src/typus-dov-single-v2/view-function.d.ts +20 -6
- package/dist/src/typus-dov-single-v2/view-function.js +37 -43
- package/dist/src/typus-perp/user/orderWithBidReceipt.js +1 -5
- package/dist/src/typus-safu/index.d.ts +2 -1
- package/dist/src/typus-safu/index.js +2 -1
- package/dist/src/typus-safu/user-history.d.ts +12 -0
- package/dist/src/typus-safu/user-history.js +312 -0
- package/dist/src/utils/typusConfig.d.ts +1 -0
- package/package.json +1 -1
|
@@ -61,7 +61,6 @@ exports.getLevelUpTx = getLevelUpTx;
|
|
|
61
61
|
exports.getExpUpTx = getExpUpTx;
|
|
62
62
|
exports.getExpUpWithoutStakingTx = getExpUpWithoutStakingTx;
|
|
63
63
|
exports.getCreateKioskAndLockNftTx = getCreateKioskAndLockNftTx;
|
|
64
|
-
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
65
64
|
var constants_1 = require("../../constants");
|
|
66
65
|
var kiosk_1 = require("@mysten/kiosk");
|
|
67
66
|
/**
|
|
@@ -75,48 +74,48 @@ var kiosk_1 = require("@mysten/kiosk");
|
|
|
75
74
|
ctx: &mut TxContext,
|
|
76
75
|
) {
|
|
77
76
|
*/
|
|
78
|
-
function getStakeTailsTx(input) {
|
|
77
|
+
function getStakeTailsTx(config, tx, input) {
|
|
79
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
79
|
var _a, coin, _b, personalKioskCap, borrow;
|
|
81
80
|
return __generator(this, function (_c) {
|
|
82
|
-
_a = __read(
|
|
81
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
|
|
83
82
|
if (input.personalKioskPackageId) {
|
|
84
|
-
_b = __read(
|
|
83
|
+
_b = __read(tx.moveCall({
|
|
85
84
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
86
|
-
arguments: [
|
|
85
|
+
arguments: [tx.object(input.kioskCap)],
|
|
87
86
|
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
88
|
-
|
|
89
|
-
target: "".concat(
|
|
87
|
+
tx.moveCall({
|
|
88
|
+
target: "".concat(config.package.typus, "::tails_staking::stake_tails"),
|
|
90
89
|
typeArguments: [],
|
|
91
90
|
arguments: [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
tx.object(config.version.typus),
|
|
92
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
93
|
+
tx.object(input.kiosk),
|
|
95
94
|
personalKioskCap,
|
|
96
|
-
|
|
95
|
+
tx.pure(input.tails),
|
|
97
96
|
coin,
|
|
98
97
|
],
|
|
99
98
|
});
|
|
100
|
-
|
|
99
|
+
tx.moveCall({
|
|
101
100
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
102
|
-
arguments: [
|
|
101
|
+
arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
|
|
103
102
|
});
|
|
104
103
|
}
|
|
105
104
|
else {
|
|
106
|
-
|
|
107
|
-
target: "".concat(
|
|
105
|
+
tx.moveCall({
|
|
106
|
+
target: "".concat(config.package.typus, "::tails_staking::stake_tails"),
|
|
108
107
|
typeArguments: [],
|
|
109
108
|
arguments: [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
tx.object(config.version.typus),
|
|
110
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
111
|
+
tx.object(input.kiosk),
|
|
112
|
+
tx.object(input.kioskCap),
|
|
113
|
+
tx.pure(input.tails),
|
|
115
114
|
coin,
|
|
116
115
|
],
|
|
117
116
|
});
|
|
118
117
|
}
|
|
119
|
-
return [2 /*return*/,
|
|
118
|
+
return [2 /*return*/, tx];
|
|
120
119
|
});
|
|
121
120
|
});
|
|
122
121
|
}
|
|
@@ -130,45 +129,45 @@ function getStakeTailsTx(input) {
|
|
|
130
129
|
ctx: &TxContext,
|
|
131
130
|
) {
|
|
132
131
|
*/
|
|
133
|
-
function getUnstakeTailsTx(input) {
|
|
132
|
+
function getUnstakeTailsTx(config, tx, input) {
|
|
134
133
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
134
|
var _a, personalKioskCap, borrow;
|
|
136
135
|
return __generator(this, function (_b) {
|
|
137
136
|
if (input.personalKioskPackageId) {
|
|
138
|
-
_a = __read(
|
|
137
|
+
_a = __read(tx.moveCall({
|
|
139
138
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
140
|
-
arguments: [
|
|
139
|
+
arguments: [tx.object(input.kioskCap)],
|
|
141
140
|
}), 2), personalKioskCap = _a[0], borrow = _a[1];
|
|
142
|
-
|
|
143
|
-
target: "".concat(
|
|
141
|
+
tx.moveCall({
|
|
142
|
+
target: "".concat(config.package.typus, "::tails_staking::unstake_tails"),
|
|
144
143
|
typeArguments: [],
|
|
145
144
|
arguments: [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
tx.object(config.version.typus),
|
|
146
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
147
|
+
tx.object(input.kiosk),
|
|
149
148
|
personalKioskCap,
|
|
150
|
-
|
|
149
|
+
tx.pure(input.tails),
|
|
151
150
|
],
|
|
152
151
|
});
|
|
153
|
-
|
|
152
|
+
tx.moveCall({
|
|
154
153
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
155
|
-
arguments: [
|
|
154
|
+
arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
|
|
156
155
|
});
|
|
157
156
|
}
|
|
158
157
|
else {
|
|
159
|
-
|
|
160
|
-
target: "".concat(
|
|
158
|
+
tx.moveCall({
|
|
159
|
+
target: "".concat(config.package.typus, "::tails_staking::unstake_tails"),
|
|
161
160
|
typeArguments: [],
|
|
162
161
|
arguments: [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
tx.object(config.version.typus),
|
|
163
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
164
|
+
tx.object(input.kiosk),
|
|
165
|
+
tx.object(input.kioskCap),
|
|
166
|
+
tx.pure(input.tails),
|
|
168
167
|
],
|
|
169
168
|
});
|
|
170
169
|
}
|
|
171
|
-
return [2 /*return*/,
|
|
170
|
+
return [2 /*return*/, tx];
|
|
172
171
|
});
|
|
173
172
|
});
|
|
174
173
|
}
|
|
@@ -184,50 +183,50 @@ function getUnstakeTailsTx(input) {
|
|
|
184
183
|
ctx: &mut TxContext,
|
|
185
184
|
) {
|
|
186
185
|
*/
|
|
187
|
-
function getTransferTailsTx(input) {
|
|
186
|
+
function getTransferTailsTx(config, tx, input) {
|
|
188
187
|
return __awaiter(this, void 0, void 0, function () {
|
|
189
188
|
var _a, coin, _b, personalKioskCap, borrow;
|
|
190
189
|
return __generator(this, function (_c) {
|
|
191
|
-
_a = __read(
|
|
190
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
|
|
192
191
|
if (input.personalKioskPackageId) {
|
|
193
|
-
_b = __read(
|
|
192
|
+
_b = __read(tx.moveCall({
|
|
194
193
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
195
|
-
arguments: [
|
|
194
|
+
arguments: [tx.object(input.kioskCap)],
|
|
196
195
|
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
197
|
-
|
|
198
|
-
target: "".concat(
|
|
196
|
+
tx.moveCall({
|
|
197
|
+
target: "".concat(config.package.typus, "::tails_staking::transfer_tails"),
|
|
199
198
|
typeArguments: [],
|
|
200
199
|
arguments: [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
tx.object(config.version.typus),
|
|
201
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
202
|
+
tx.object(input.kiosk),
|
|
204
203
|
personalKioskCap,
|
|
205
|
-
|
|
204
|
+
tx.pure(input.tails),
|
|
206
205
|
coin,
|
|
207
|
-
|
|
206
|
+
tx.pure(input.recipient),
|
|
208
207
|
],
|
|
209
208
|
});
|
|
210
|
-
|
|
209
|
+
tx.moveCall({
|
|
211
210
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
212
|
-
arguments: [
|
|
211
|
+
arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
214
|
else {
|
|
216
|
-
|
|
217
|
-
target: "".concat(
|
|
215
|
+
tx.moveCall({
|
|
216
|
+
target: "".concat(config.package.typus, "::tails_staking::transfer_tails"),
|
|
218
217
|
typeArguments: [],
|
|
219
218
|
arguments: [
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
tx.object(config.version.typus),
|
|
220
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
221
|
+
tx.object(input.kiosk),
|
|
222
|
+
tx.object(input.kioskCap),
|
|
223
|
+
tx.pure(input.tails),
|
|
225
224
|
coin,
|
|
226
|
-
|
|
225
|
+
tx.pure(input.recipient),
|
|
227
226
|
],
|
|
228
227
|
});
|
|
229
228
|
}
|
|
230
|
-
return [2 /*return*/,
|
|
229
|
+
return [2 /*return*/, tx];
|
|
231
230
|
});
|
|
232
231
|
});
|
|
233
232
|
}
|
|
@@ -239,16 +238,15 @@ function getTransferTailsTx(input) {
|
|
|
239
238
|
ctx: &TxContext,
|
|
240
239
|
) {
|
|
241
240
|
*/
|
|
242
|
-
function getDailySignUpTx(
|
|
241
|
+
function getDailySignUpTx(config, tx) {
|
|
243
242
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
-
var result;
|
|
245
243
|
return __generator(this, function (_a) {
|
|
246
|
-
|
|
247
|
-
target: "".concat(
|
|
244
|
+
tx.moveCall({
|
|
245
|
+
target: "".concat(config.package.typus, "::tails_staking::daily_sign_up"),
|
|
248
246
|
typeArguments: [],
|
|
249
|
-
arguments: [
|
|
247
|
+
arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.tailsStaking), tx.pure(constants_1.CLOCK)],
|
|
250
248
|
});
|
|
251
|
-
return [2 /*return*/,
|
|
249
|
+
return [2 /*return*/, tx];
|
|
252
250
|
});
|
|
253
251
|
});
|
|
254
252
|
}
|
|
@@ -259,21 +257,21 @@ function getDailySignUpTx(input) {
|
|
|
259
257
|
ctx: &mut TxContext,
|
|
260
258
|
): Balance<TOKEN>
|
|
261
259
|
*/
|
|
262
|
-
function getClaimProfitSharingTx(input) {
|
|
260
|
+
function getClaimProfitSharingTx(config, tx, input) {
|
|
263
261
|
return __awaiter(this, void 0, void 0, function () {
|
|
264
262
|
var result;
|
|
265
263
|
return __generator(this, function (_a) {
|
|
266
|
-
result =
|
|
267
|
-
target: "".concat(
|
|
264
|
+
result = tx.moveCall({
|
|
265
|
+
target: "".concat(config.package.typus, "::tails_staking::claim_profit_sharing"),
|
|
268
266
|
typeArguments: input.typeArguments,
|
|
269
|
-
arguments: [
|
|
267
|
+
arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.tailsStaking)],
|
|
270
268
|
});
|
|
271
|
-
|
|
272
|
-
target: "".concat(
|
|
269
|
+
tx.moveCall({
|
|
270
|
+
target: "".concat(config.package.typus, "::utility::transfer_balance"),
|
|
273
271
|
typeArguments: input.typeArguments,
|
|
274
|
-
arguments: [
|
|
272
|
+
arguments: [tx.object(result[0]), tx.pure(input.user)],
|
|
275
273
|
});
|
|
276
|
-
return [2 /*return*/,
|
|
274
|
+
return [2 /*return*/, tx];
|
|
277
275
|
});
|
|
278
276
|
});
|
|
279
277
|
}
|
|
@@ -285,20 +283,20 @@ function getClaimProfitSharingTx(input) {
|
|
|
285
283
|
raw: bool,
|
|
286
284
|
) {
|
|
287
285
|
*/
|
|
288
|
-
function getLevelUpTx(input) {
|
|
286
|
+
function getLevelUpTx(config, tx, input) {
|
|
289
287
|
return __awaiter(this, void 0, void 0, function () {
|
|
290
288
|
return __generator(this, function (_a) {
|
|
291
|
-
|
|
292
|
-
target: "".concat(
|
|
289
|
+
tx.moveCall({
|
|
290
|
+
target: "".concat(config.package.typus, "::tails_staking::level_up"),
|
|
293
291
|
typeArguments: [],
|
|
294
292
|
arguments: [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
293
|
+
tx.object(config.version.typus),
|
|
294
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
295
|
+
tx.pure(input.tails),
|
|
296
|
+
tx.pure(input.raw),
|
|
299
297
|
],
|
|
300
298
|
});
|
|
301
|
-
return [2 /*return*/,
|
|
299
|
+
return [2 /*return*/, tx];
|
|
302
300
|
});
|
|
303
301
|
});
|
|
304
302
|
}
|
|
@@ -312,21 +310,21 @@ function getLevelUpTx(input) {
|
|
|
312
310
|
ctx: &TxContext,
|
|
313
311
|
) {
|
|
314
312
|
*/
|
|
315
|
-
function getExpUpTx(input) {
|
|
313
|
+
function getExpUpTx(config, tx, input) {
|
|
316
314
|
return __awaiter(this, void 0, void 0, function () {
|
|
317
315
|
return __generator(this, function (_a) {
|
|
318
|
-
|
|
319
|
-
target: "".concat(
|
|
316
|
+
tx.moveCall({
|
|
317
|
+
target: "".concat(config.package.typus, "::tails_staking::exp_up"),
|
|
320
318
|
typeArguments: [],
|
|
321
319
|
arguments: [
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
320
|
+
tx.object(config.version.typus),
|
|
321
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
322
|
+
tx.object(config.registry.typus.user),
|
|
323
|
+
tx.pure(input.tails),
|
|
324
|
+
tx.pure(input.amount),
|
|
327
325
|
],
|
|
328
326
|
});
|
|
329
|
-
return [2 /*return*/,
|
|
327
|
+
return [2 /*return*/, tx];
|
|
330
328
|
});
|
|
331
329
|
});
|
|
332
330
|
}
|
|
@@ -342,61 +340,64 @@ function getExpUpTx(input) {
|
|
|
342
340
|
ctx: &TxContext,
|
|
343
341
|
) {
|
|
344
342
|
*/
|
|
345
|
-
function getExpUpWithoutStakingTx(input) {
|
|
343
|
+
function getExpUpWithoutStakingTx(config, tx, input) {
|
|
346
344
|
return __awaiter(this, void 0, void 0, function () {
|
|
347
345
|
var _a, personalKioskCap, borrow;
|
|
348
346
|
return __generator(this, function (_b) {
|
|
349
347
|
if (input.personalKioskPackageId) {
|
|
350
|
-
_a = __read(
|
|
348
|
+
_a = __read(tx.moveCall({
|
|
351
349
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
352
|
-
arguments: [
|
|
350
|
+
arguments: [tx.object(input.kioskCap)],
|
|
353
351
|
}), 2), personalKioskCap = _a[0], borrow = _a[1];
|
|
354
|
-
|
|
355
|
-
target: "".concat(
|
|
352
|
+
tx.moveCall({
|
|
353
|
+
target: "".concat(config.package.typus, "::tails_staking::exp_up_without_staking"),
|
|
356
354
|
typeArguments: [],
|
|
357
355
|
arguments: [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
356
|
+
tx.object(config.version.typus),
|
|
357
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
358
|
+
tx.object(config.registry.typus.user),
|
|
359
|
+
tx.object(input.kiosk),
|
|
362
360
|
personalKioskCap,
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
tx.pure(input.tails),
|
|
362
|
+
tx.pure(input.amount),
|
|
365
363
|
],
|
|
366
364
|
});
|
|
367
|
-
|
|
365
|
+
tx.moveCall({
|
|
368
366
|
target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
369
|
-
arguments: [
|
|
367
|
+
arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
|
|
370
368
|
});
|
|
371
369
|
}
|
|
372
370
|
else {
|
|
373
|
-
|
|
374
|
-
target: "".concat(
|
|
371
|
+
tx.moveCall({
|
|
372
|
+
target: "".concat(config.package.typus, "::tails_staking::exp_up_without_staking"),
|
|
375
373
|
typeArguments: [],
|
|
376
374
|
arguments: [
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
375
|
+
tx.object(config.version.typus),
|
|
376
|
+
tx.object(config.registry.typus.tailsStaking),
|
|
377
|
+
tx.object(config.registry.typus.user),
|
|
378
|
+
tx.object(input.kiosk),
|
|
379
|
+
tx.object(input.kioskCap),
|
|
380
|
+
tx.pure(input.tails),
|
|
381
|
+
tx.pure(input.amount),
|
|
384
382
|
],
|
|
385
383
|
});
|
|
386
384
|
}
|
|
387
|
-
return [2 /*return*/,
|
|
385
|
+
return [2 /*return*/, tx];
|
|
388
386
|
});
|
|
389
387
|
});
|
|
390
388
|
}
|
|
391
|
-
function getCreateKioskAndLockNftTx(
|
|
389
|
+
function getCreateKioskAndLockNftTx(config, tx, kioskClient, input) {
|
|
392
390
|
return __awaiter(this, void 0, void 0, function () {
|
|
393
|
-
var
|
|
391
|
+
var kioskTx, kiosk, kioskCap;
|
|
394
392
|
return __generator(this, function (_a) {
|
|
395
|
-
tx = new transactions_1.TransactionBlock();
|
|
396
393
|
kioskTx = new kiosk_1.KioskTransaction({ transactionBlock: tx, kioskClient: kioskClient });
|
|
397
394
|
kioskTx.create();
|
|
398
|
-
|
|
399
|
-
|
|
395
|
+
kioskTx.lock({
|
|
396
|
+
itemType: "".concat(config.package.nft, "::typus_nft::Tails"),
|
|
397
|
+
itemId: input.nft_id,
|
|
398
|
+
policy: input.nft_policy,
|
|
399
|
+
item: input.nft_id,
|
|
400
|
+
});
|
|
400
401
|
kiosk = kioskTx.kiosk, kioskCap = kioskTx.kioskCap;
|
|
401
402
|
if (kiosk && kioskCap) {
|
|
402
403
|
tx.moveCall({
|
|
@@ -404,8 +405,7 @@ function getCreateKioskAndLockNftTx(kioskClient, gasBudget, nftPackageId, policy
|
|
|
404
405
|
typeArguments: [kiosk_1.KIOSK_TYPE],
|
|
405
406
|
arguments: [kiosk],
|
|
406
407
|
});
|
|
407
|
-
tx.transferObjects([kioskCap], tx.pure(
|
|
408
|
-
tx.setGasBudget(gasBudget);
|
|
408
|
+
tx.transferObjects([kioskCap], tx.pure(input.user));
|
|
409
409
|
}
|
|
410
410
|
else {
|
|
411
411
|
console.error("Fail to Create Kiosk Tx!!");
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
2
3
|
export interface StakingInfo {
|
|
3
4
|
user: string;
|
|
4
5
|
tails: string[];
|
|
5
6
|
profits: string[];
|
|
6
7
|
u64Padding: string[];
|
|
7
8
|
}
|
|
8
|
-
export declare function getStakingInfo(input: {
|
|
9
|
-
provider: SuiClient;
|
|
10
|
-
typusPackageId: string;
|
|
11
|
-
typusEcosystemVersion: string;
|
|
12
|
-
typusTailsStakingRegistry: string;
|
|
9
|
+
export declare function getStakingInfo(config: TypusConfig, provider: SuiClient, input: {
|
|
13
10
|
user: string;
|
|
14
11
|
}): Promise<StakingInfo>;
|
|
15
|
-
export declare function getLevelCounts(
|
|
16
|
-
provider: SuiClient;
|
|
17
|
-
typusPackageId: string;
|
|
18
|
-
typusEcosystemVersion: string;
|
|
19
|
-
typusTailsStakingRegistry: string;
|
|
20
|
-
}): Promise<number[]>;
|
|
12
|
+
export declare function getLevelCounts(config: TypusConfig, provider: SuiClient): Promise<number[]>;
|
|
@@ -40,8 +40,8 @@ exports.getStakingInfo = getStakingInfo;
|
|
|
40
40
|
exports.getLevelCounts = getLevelCounts;
|
|
41
41
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
42
42
|
var bcs_1 = require("@mysten/bcs");
|
|
43
|
-
var utils_1 = require("
|
|
44
|
-
function getStakingInfo(input) {
|
|
43
|
+
var utils_1 = require("src/utils");
|
|
44
|
+
function getStakingInfo(config, provider, input) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
46
|
var transactionBlock, results, bytes, reader, length;
|
|
47
47
|
return __generator(this, function (_a) {
|
|
@@ -49,15 +49,15 @@ function getStakingInfo(input) {
|
|
|
49
49
|
case 0:
|
|
50
50
|
transactionBlock = new transactions_1.TransactionBlock();
|
|
51
51
|
transactionBlock.moveCall({
|
|
52
|
-
target: "".concat(
|
|
52
|
+
target: "".concat(config.package.typus, "::tails_staking::get_staking_info"),
|
|
53
53
|
typeArguments: [],
|
|
54
54
|
arguments: [
|
|
55
|
-
transactionBlock.pure(
|
|
56
|
-
transactionBlock.pure(
|
|
55
|
+
transactionBlock.pure(config.version.typus),
|
|
56
|
+
transactionBlock.pure(config.registry.typus.tailsStaking),
|
|
57
57
|
transactionBlock.pure(input.user),
|
|
58
58
|
],
|
|
59
59
|
});
|
|
60
|
-
return [4 /*yield*/,
|
|
60
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
61
61
|
sender: "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
62
62
|
transactionBlock: transactionBlock,
|
|
63
63
|
})];
|
|
@@ -93,7 +93,7 @@ function getStakingInfo(input) {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function getLevelCounts(
|
|
96
|
+
function getLevelCounts(config, provider) {
|
|
97
97
|
return __awaiter(this, void 0, void 0, function () {
|
|
98
98
|
var transactionBlock, results, bytes, reader;
|
|
99
99
|
return __generator(this, function (_a) {
|
|
@@ -101,11 +101,11 @@ function getLevelCounts(input) {
|
|
|
101
101
|
case 0:
|
|
102
102
|
transactionBlock = new transactions_1.TransactionBlock();
|
|
103
103
|
transactionBlock.moveCall({
|
|
104
|
-
target: "".concat(
|
|
104
|
+
target: "".concat(config.package.typus, "::tails_staking::get_level_counts"),
|
|
105
105
|
typeArguments: [],
|
|
106
|
-
arguments: [transactionBlock.pure(
|
|
106
|
+
arguments: [transactionBlock.pure(config.version.typus), transactionBlock.pure(config.registry.typus.tailsStaking)],
|
|
107
107
|
});
|
|
108
|
-
return [4 /*yield*/,
|
|
108
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({
|
|
109
109
|
sender: "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
110
110
|
transactionBlock: transactionBlock,
|
|
111
111
|
})];
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
typusPackageId: string;
|
|
5
|
-
typusEcosystemVersion: string;
|
|
6
|
-
typusUserRegistry: string;
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
3
|
+
export declare function getUserMetadata(config: TypusConfig, provider: SuiClient, input: {
|
|
7
4
|
user: string;
|
|
8
5
|
}): Promise<string[]>;
|
|
@@ -40,7 +40,7 @@ exports.getUserMetadata = getUserMetadata;
|
|
|
40
40
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
41
41
|
var bcs_1 = require("@mysten/bcs");
|
|
42
42
|
var SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
43
|
-
function getUserMetadata(input) {
|
|
43
|
+
function getUserMetadata(config, provider, input) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
45
|
var transactionBlock, results, bytes, reader;
|
|
46
46
|
return __generator(this, function (_a) {
|
|
@@ -48,15 +48,15 @@ function getUserMetadata(input) {
|
|
|
48
48
|
case 0:
|
|
49
49
|
transactionBlock = new transactions_1.TransactionBlock();
|
|
50
50
|
transactionBlock.moveCall({
|
|
51
|
-
target: "".concat(
|
|
51
|
+
target: "".concat(config.package.typus, "::user::get_user_metadata"),
|
|
52
52
|
typeArguments: [],
|
|
53
53
|
arguments: [
|
|
54
|
-
transactionBlock.pure(
|
|
55
|
-
transactionBlock.pure(
|
|
54
|
+
transactionBlock.pure(config.version.typus),
|
|
55
|
+
transactionBlock.pure(config.registry.typus.user),
|
|
56
56
|
transactionBlock.pure(input.user),
|
|
57
57
|
],
|
|
58
58
|
});
|
|
59
|
-
return [4 /*yield*/,
|
|
59
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: SENDER, transactionBlock: transactionBlock })];
|
|
60
60
|
case 1:
|
|
61
61
|
results = (_a.sent()).results;
|
|
62
62
|
bytes = results[results.length - 1].returnValues[0][0];
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
-
|
|
3
|
-
public(friend) entry fun otc<D_TOKEN, B_TOKEN>(
|
|
4
|
-
registry: &mut Registry,
|
|
5
|
-
index: u64,
|
|
6
|
-
coins: vector<Coin<B_TOKEN>>,
|
|
7
|
-
delivery_price: u64,
|
|
8
|
-
delivery_size: u64,
|
|
9
|
-
bidder_bid_value: u64,
|
|
10
|
-
bidder_fee_balance_value: u64,
|
|
11
|
-
incentive_bid_value: u64,
|
|
12
|
-
incentive_fee_balance_value: u64,
|
|
13
|
-
depositor_incentive_value: u64,
|
|
14
|
-
clock: &Clock,
|
|
15
|
-
ctx: &mut TxContext,
|
|
16
|
-
)
|
|
17
|
-
*/
|
|
18
|
-
export declare function getOtcTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], deliveryPrice: string, deliverySize: string, bidderBidValue: string, bidderFeeBalanceValue: string, incentiveBidValue: string, incentiveFeeBalanceValue: string, depositorIncentiveValue: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
19
3
|
/**
|
|
20
4
|
public(friend) entry fun update_config(
|
|
21
5
|
registry: &mut Registry,
|
|
@@ -67,4 +51,28 @@ export interface UpdateConfigRequests {
|
|
|
67
51
|
depositIncentiveBpDivisorDecimal?: string;
|
|
68
52
|
};
|
|
69
53
|
}
|
|
70
|
-
export declare function getUpdateConfigTx(
|
|
54
|
+
export declare function getUpdateConfigTx(config: TypusConfig, tx: TransactionBlock, requests: {
|
|
55
|
+
index: string;
|
|
56
|
+
input: {
|
|
57
|
+
oracleId?: string;
|
|
58
|
+
depositLotSize?: string;
|
|
59
|
+
bidLotSize?: string;
|
|
60
|
+
minDepositSize?: string;
|
|
61
|
+
minBidSize?: string;
|
|
62
|
+
maxDepositEntry?: string;
|
|
63
|
+
maxBidEntry?: string;
|
|
64
|
+
depositFeeBp?: string;
|
|
65
|
+
depositFeeShareBp?: string;
|
|
66
|
+
depositSharedFeePool?: string;
|
|
67
|
+
bidFeeBp?: string;
|
|
68
|
+
depositIncentiveBp?: string;
|
|
69
|
+
bidIncentiveBp?: string;
|
|
70
|
+
auctionDelayTsMs?: string;
|
|
71
|
+
auctionDurationTsMs?: string;
|
|
72
|
+
recoupDelayTsMs?: string;
|
|
73
|
+
capacity?: string;
|
|
74
|
+
leverage?: string;
|
|
75
|
+
riskLevel?: string;
|
|
76
|
+
depositIncentiveBpDivisorDecimal?: string;
|
|
77
|
+
};
|
|
78
|
+
}[]): Promise<TransactionBlock>;
|