@typus/typus-sdk 1.2.86 → 1.2.87
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/utils/nft-staking/user-entry.d.ts +1 -1
- package/lib/utils/nft-staking/user-entry.js +13 -13
- package/lib/utils/typus-dov-single-v2/function/bidding.js +14 -14
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +29 -63
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +106 -226
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +37 -130
- package/lib/utils/typus-dov-single-v2/user-entry.js +57 -352
- package/lib/utils/user/{view-functions.d.ts → view-function.d.ts} +1 -1
- package/lib/utils/user/{view-functions.js → view-function.js} +4 -3
- package/package.json +1 -1
|
@@ -16,416 +16,121 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.getRebateTx = exports.getMultiTransferBidReceiptTx = exports.getTransferBidReceiptTx = exports.getExerciseTx = exports.getNewBidTx = exports.
|
|
19
|
+
exports.getRebateTx = exports.getMultiTransferBidReceiptTx = exports.getTransferBidReceiptTx = exports.getExerciseTx = exports.getNewBidTx = exports.getReduceFundTx = exports.getRaiseFundTx = void 0;
|
|
20
20
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
21
21
|
var constants_1 = require("../../constants");
|
|
22
22
|
/**
|
|
23
|
-
public fun
|
|
23
|
+
public fun public_raise_fund<D_TOKEN, B_TOKEN>(
|
|
24
|
+
typus_ecosystem_version: &TypusEcosystemVersion,
|
|
25
|
+
typus_user_registry: &mut TypusUserRegistry,
|
|
26
|
+
typus_leaderboard_registry: &mut TypusLeaderboardRegistry,
|
|
24
27
|
registry: &mut Registry,
|
|
25
28
|
index: u64,
|
|
26
|
-
coins: vector<Coin<D_TOKEN>>,
|
|
27
|
-
amount: u64,
|
|
28
29
|
receipts: vector<TypusDepositReceipt>,
|
|
30
|
+
raise_balance: Balance<D_TOKEN>,
|
|
31
|
+
raise_from_premium: bool,
|
|
32
|
+
raise_from_inactive: bool,
|
|
29
33
|
clock: &Clock,
|
|
30
34
|
ctx: &mut TxContext,
|
|
31
|
-
)
|
|
32
|
-
*/
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
(input.
|
|
36
|
-
|
|
37
|
-
var _a = __read(input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.amount)]), 1), coin = _a[0];
|
|
38
|
-
var result = input.tx.moveCall({
|
|
39
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
|
|
40
|
-
typeArguments: input.typeArguments,
|
|
41
|
-
arguments: [
|
|
42
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
43
|
-
input.tx.pure(input.index),
|
|
44
|
-
input.tx.makeMoveVec({ objects: [coin] }),
|
|
45
|
-
input.tx.pure(input.amount),
|
|
46
|
-
input.tx.makeMoveVec({
|
|
47
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
48
|
-
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
49
|
-
}),
|
|
50
|
-
input.tx.pure(constants_1.CLOCK),
|
|
51
|
-
],
|
|
52
|
-
});
|
|
53
|
-
input.tx.moveCall({
|
|
54
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_coins"),
|
|
55
|
-
typeArguments: [input.typeArguments[0]],
|
|
56
|
-
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
57
|
-
});
|
|
58
|
-
input.tx.transferObjects([input.tx.object(result[1])], input.user);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
var result = input.tx.moveCall({
|
|
62
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
|
|
63
|
-
typeArguments: input.typeArguments,
|
|
64
|
-
arguments: [
|
|
65
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
66
|
-
input.tx.pure(input.index),
|
|
67
|
-
input.tx.makeMoveVec({ objects: input.coins.map(function (coin) { return input.tx.object(coin); }) }),
|
|
68
|
-
input.tx.pure(input.amount),
|
|
69
|
-
input.tx.makeMoveVec({
|
|
70
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
71
|
-
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
72
|
-
}),
|
|
73
|
-
input.tx.pure(constants_1.CLOCK),
|
|
74
|
-
],
|
|
75
|
-
});
|
|
76
|
-
input.tx.moveCall({
|
|
77
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_coins"),
|
|
78
|
-
typeArguments: [input.typeArguments[0]],
|
|
79
|
-
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
80
|
-
});
|
|
81
|
-
input.tx.transferObjects([input.tx.object(result[1])], input.user);
|
|
82
|
-
}
|
|
83
|
-
return input.tx;
|
|
84
|
-
}
|
|
85
|
-
exports.getDepositTx = getDepositTx;
|
|
86
|
-
/**
|
|
87
|
-
public fun withdraw<D_TOKEN, B_TOKEN>(
|
|
88
|
-
registry: &mut Registry,
|
|
89
|
-
index: u64,
|
|
90
|
-
receipts: vector<TypusDepositReceipt>,
|
|
91
|
-
share: Option<u64>,
|
|
92
|
-
clock: &Clock,
|
|
93
|
-
ctx: &mut TxContext,
|
|
94
|
-
)
|
|
95
|
-
*/
|
|
96
|
-
function getWithdrawTx(input) {
|
|
97
|
-
var result = input.tx.moveCall({
|
|
98
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::withdraw"),
|
|
99
|
-
typeArguments: input.typeArguments,
|
|
35
|
+
): (TypusDepositReceipt, vector<u64>) {
|
|
36
|
+
*/
|
|
37
|
+
function getRaiseFundTx(input) {
|
|
38
|
+
var raiseBalance = input.tx.moveCall({
|
|
39
|
+
target: "".concat(input.typusFrameworkPackageId, "::utils::delegate_extract_balance"),
|
|
40
|
+
typeArguments: [input.typeArguments[0]],
|
|
100
41
|
arguments: [
|
|
101
|
-
input.tx.
|
|
102
|
-
input.tx.pure(input.index),
|
|
42
|
+
input.tx.pure(input.user),
|
|
103
43
|
input.tx.makeMoveVec({
|
|
104
|
-
type: "".concat(input.
|
|
105
|
-
objects: input.
|
|
44
|
+
type: "0x2::coin::Coin<".concat(input.typeArguments[0], ">"),
|
|
45
|
+
objects: input.raiseCoins,
|
|
106
46
|
}),
|
|
107
|
-
input.tx.pure(input.
|
|
108
|
-
input.tx.pure(constants_1.CLOCK),
|
|
47
|
+
input.tx.pure(input.raiseAmount),
|
|
109
48
|
],
|
|
110
49
|
});
|
|
111
|
-
input.tx.moveCall({
|
|
112
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
113
|
-
typeArguments: [input.typeArguments[0]],
|
|
114
|
-
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
115
|
-
});
|
|
116
|
-
input.tx.moveCall({
|
|
117
|
-
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
118
|
-
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
119
|
-
});
|
|
120
|
-
return input.tx;
|
|
121
|
-
}
|
|
122
|
-
exports.getWithdrawTx = getWithdrawTx;
|
|
123
|
-
/**
|
|
124
|
-
public fun unsubscribe<D_TOKEN, B_TOKEN>(
|
|
125
|
-
registry: &mut Registry,
|
|
126
|
-
index: u64,
|
|
127
|
-
receipts: vector<TypusDepositReceipt>,
|
|
128
|
-
share: Option<u64>,
|
|
129
|
-
clock: &Clock,
|
|
130
|
-
ctx: &mut TxContext,
|
|
131
|
-
)
|
|
132
|
-
*/
|
|
133
|
-
function getUnsubscribeTx(input) {
|
|
134
50
|
var result = input.tx.moveCall({
|
|
135
|
-
target: "".concat(input.typusDovSinglePackageId, "::
|
|
51
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
|
|
136
52
|
typeArguments: input.typeArguments,
|
|
137
53
|
arguments: [
|
|
54
|
+
input.tx.object(input.typusEcosystemVersion),
|
|
55
|
+
input.tx.object(input.typusUserRegistry),
|
|
56
|
+
input.tx.object(input.typusLeaderboardRegistry),
|
|
138
57
|
input.tx.object(input.typusDovSingleRegistry),
|
|
139
58
|
input.tx.pure(input.index),
|
|
140
59
|
input.tx.makeMoveVec({
|
|
141
60
|
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
142
61
|
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
143
62
|
}),
|
|
144
|
-
input.tx.
|
|
63
|
+
input.tx.object(raiseBalance),
|
|
64
|
+
input.tx.pure(input.raiseFromPremium),
|
|
65
|
+
input.tx.pure(input.raiseFromInactive),
|
|
145
66
|
input.tx.pure(constants_1.CLOCK),
|
|
146
67
|
],
|
|
147
68
|
});
|
|
148
69
|
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
149
70
|
return input.tx;
|
|
150
71
|
}
|
|
151
|
-
exports.
|
|
72
|
+
exports.getRaiseFundTx = getRaiseFundTx;
|
|
152
73
|
/**
|
|
153
|
-
public fun
|
|
74
|
+
public fun public_reduce_fund<D_TOKEN, B_TOKEN, I_TOKEN>(
|
|
75
|
+
typus_ecosystem_version: &TypusEcosystemVersion,
|
|
76
|
+
typus_user_registry: &mut TypusUserRegistry,
|
|
77
|
+
typus_leaderboard_registry: &mut TypusLeaderboardRegistry,
|
|
154
78
|
registry: &mut Registry,
|
|
155
79
|
index: u64,
|
|
156
80
|
receipts: vector<TypusDepositReceipt>,
|
|
81
|
+
reduce_from_warmup: u64,
|
|
82
|
+
reduce_from_active: u64,
|
|
83
|
+
reduce_from_premium: bool,
|
|
84
|
+
reduce_from_inactive: bool,
|
|
85
|
+
reduce_from_incentive: bool,
|
|
157
86
|
clock: &Clock,
|
|
158
87
|
ctx: &mut TxContext,
|
|
159
|
-
)
|
|
160
|
-
*/
|
|
161
|
-
function
|
|
162
|
-
var result = input.tx.moveCall({
|
|
163
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::compound"),
|
|
164
|
-
typeArguments: input.typeArguments,
|
|
165
|
-
arguments: [
|
|
166
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
167
|
-
input.tx.pure(input.index),
|
|
168
|
-
input.tx.makeMoveVec({
|
|
169
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
170
|
-
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
171
|
-
}),
|
|
172
|
-
input.tx.object(constants_1.CLOCK),
|
|
173
|
-
],
|
|
174
|
-
});
|
|
175
|
-
if (input.incentiveToken) {
|
|
176
|
-
input.typeArguments.push(input.incentiveToken);
|
|
177
|
-
input.tx = getRedeemTx({
|
|
178
|
-
tx: input.tx,
|
|
179
|
-
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
180
|
-
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
181
|
-
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
182
|
-
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
183
|
-
typeArguments: input.typeArguments,
|
|
184
|
-
index: input.index,
|
|
185
|
-
receipts: [input.tx.object(result[0])],
|
|
186
|
-
user: input.user,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
191
|
-
}
|
|
192
|
-
return input.tx;
|
|
193
|
-
}
|
|
194
|
-
exports.getCompoundTx = getCompoundTx;
|
|
195
|
-
/**
|
|
196
|
-
public fun claim<D_TOKEN, B_TOKEN>(
|
|
197
|
-
registry: &mut Registry,
|
|
198
|
-
index: u64,
|
|
199
|
-
receipts: vector<TypusDepositReceipt>,
|
|
200
|
-
ctx: &mut TxContext,
|
|
201
|
-
)
|
|
202
|
-
*/
|
|
203
|
-
function getClaimTx(input) {
|
|
88
|
+
): (Option<TypusDepositReceipt>, Balance<D_TOKEN>, Balance<B_TOKEN>, Balance<I_TOKEN>, vector<u64>) {
|
|
89
|
+
*/
|
|
90
|
+
function getReduceFundTx(input) {
|
|
204
91
|
var result = input.tx.moveCall({
|
|
205
|
-
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::
|
|
92
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_reduce_fund"),
|
|
206
93
|
typeArguments: input.typeArguments,
|
|
207
94
|
arguments: [
|
|
95
|
+
input.tx.object(input.typusEcosystemVersion),
|
|
96
|
+
input.tx.object(input.typusUserRegistry),
|
|
97
|
+
input.tx.object(input.typusLeaderboardRegistry),
|
|
208
98
|
input.tx.object(input.typusDovSingleRegistry),
|
|
209
99
|
input.tx.pure(input.index),
|
|
210
100
|
input.tx.makeMoveVec({
|
|
211
101
|
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
212
102
|
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
213
103
|
}),
|
|
104
|
+
input.tx.pure(input.reduceFromWarmup),
|
|
105
|
+
input.tx.pure(input.reduceFromActive),
|
|
106
|
+
input.tx.pure(input.reduceFromPremium),
|
|
107
|
+
input.tx.pure(input.reduceFromInactive),
|
|
108
|
+
input.tx.pure(input.reduceFromIncentive),
|
|
109
|
+
input.tx.pure(constants_1.CLOCK),
|
|
214
110
|
],
|
|
215
111
|
});
|
|
216
112
|
input.tx.moveCall({
|
|
217
|
-
target: "".concat(input.typusFrameworkPackageId, "::
|
|
218
|
-
typeArguments: [input.typeArguments[0]],
|
|
113
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
219
114
|
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
220
115
|
});
|
|
221
116
|
input.tx.moveCall({
|
|
222
|
-
target: "".concat(input.typusFrameworkPackageId, "::
|
|
117
|
+
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
118
|
+
typeArguments: [input.typeArguments[0]],
|
|
223
119
|
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
224
120
|
});
|
|
225
|
-
return input.tx;
|
|
226
|
-
}
|
|
227
|
-
exports.getClaimTx = getClaimTx;
|
|
228
|
-
/**
|
|
229
|
-
public fun harvest<D_TOKEN, B_TOKEN>(
|
|
230
|
-
registry: &mut Registry,
|
|
231
|
-
index: u64,
|
|
232
|
-
receipts: vector<TypusDepositReceipt>,
|
|
233
|
-
ctx: &mut TxContext,
|
|
234
|
-
)
|
|
235
|
-
*/
|
|
236
|
-
function getHarvestTx(input) {
|
|
237
|
-
var result = input.tx.moveCall({
|
|
238
|
-
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::harvest"),
|
|
239
|
-
typeArguments: input.typeArguments,
|
|
240
|
-
arguments: [
|
|
241
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
242
|
-
input.tx.pure(input.index),
|
|
243
|
-
input.tx.makeMoveVec({
|
|
244
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
245
|
-
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
246
|
-
}),
|
|
247
|
-
],
|
|
248
|
-
});
|
|
249
121
|
input.tx.moveCall({
|
|
250
122
|
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
251
123
|
typeArguments: [input.typeArguments[1]],
|
|
252
|
-
arguments: [input.tx.object(result[
|
|
253
|
-
});
|
|
254
|
-
if (input.incentiveToken) {
|
|
255
|
-
input.typeArguments.push(input.incentiveToken);
|
|
256
|
-
var receipt = input.tx.moveCall({
|
|
257
|
-
target: "0x1::option::destroy_some",
|
|
258
|
-
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
259
|
-
arguments: [input.tx.object(result[1])],
|
|
260
|
-
});
|
|
261
|
-
input.tx = getRedeemTx({
|
|
262
|
-
tx: input.tx,
|
|
263
|
-
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
264
|
-
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
265
|
-
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
266
|
-
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
267
|
-
typeArguments: input.typeArguments,
|
|
268
|
-
index: input.index,
|
|
269
|
-
receipts: [input.tx.object(receipt)],
|
|
270
|
-
user: input.user,
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
input.tx.moveCall({
|
|
275
|
-
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
276
|
-
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
return input.tx;
|
|
280
|
-
}
|
|
281
|
-
exports.getHarvestTx = getHarvestTx;
|
|
282
|
-
/**
|
|
283
|
-
public fun redeem<D_TOKEN, B_TOKEN, I_TOKEN>(
|
|
284
|
-
registry: &mut Registry,
|
|
285
|
-
index: u64,
|
|
286
|
-
receipts: vector<TypusDepositReceipt>,
|
|
287
|
-
ctx: &mut TxContext,
|
|
288
|
-
)
|
|
289
|
-
*/
|
|
290
|
-
function getRedeemTx(input) {
|
|
291
|
-
var result = input.tx.moveCall({
|
|
292
|
-
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::redeem"),
|
|
293
|
-
typeArguments: input.typeArguments,
|
|
294
|
-
arguments: [
|
|
295
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
296
|
-
input.tx.pure(input.index),
|
|
297
|
-
input.tx.makeMoveVec({
|
|
298
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
299
|
-
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
300
|
-
}),
|
|
301
|
-
],
|
|
124
|
+
arguments: [input.tx.object(result[2]), input.tx.pure(input.user)],
|
|
302
125
|
});
|
|
303
126
|
input.tx.moveCall({
|
|
304
127
|
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
305
128
|
typeArguments: [input.typeArguments[2]],
|
|
306
|
-
arguments: [input.tx.object(result[
|
|
307
|
-
});
|
|
308
|
-
input.tx.moveCall({
|
|
309
|
-
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
310
|
-
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
129
|
+
arguments: [input.tx.object(result[3]), input.tx.pure(input.user)],
|
|
311
130
|
});
|
|
312
131
|
return input.tx;
|
|
313
132
|
}
|
|
314
|
-
exports.
|
|
315
|
-
function getWithdrawHarvestClaimTx(input) {
|
|
316
|
-
var result = input.withdraw
|
|
317
|
-
? input.tx.moveCall({
|
|
318
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::withdraw"),
|
|
319
|
-
typeArguments: input.typeArguments,
|
|
320
|
-
arguments: [
|
|
321
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
322
|
-
input.tx.pure(input.index),
|
|
323
|
-
input.tx.makeMoveVec({
|
|
324
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
325
|
-
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
326
|
-
}),
|
|
327
|
-
input.tx.pure([]),
|
|
328
|
-
input.tx.pure(constants_1.CLOCK),
|
|
329
|
-
],
|
|
330
|
-
})
|
|
331
|
-
: undefined;
|
|
332
|
-
if (input.withdraw) {
|
|
333
|
-
input.tx.moveCall({
|
|
334
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
335
|
-
typeArguments: [input.typeArguments[0]],
|
|
336
|
-
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
result = input.harvest
|
|
340
|
-
? input.tx.moveCall({
|
|
341
|
-
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::harvest"),
|
|
342
|
-
typeArguments: input.typeArguments,
|
|
343
|
-
arguments: [
|
|
344
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
345
|
-
input.tx.pure(input.index),
|
|
346
|
-
input.tx.makeMoveVec({
|
|
347
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
348
|
-
objects: result
|
|
349
|
-
? [
|
|
350
|
-
input.tx.object(input.tx.moveCall({
|
|
351
|
-
target: "0x1::option::destroy_some",
|
|
352
|
-
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
353
|
-
arguments: [input.tx.object(result[1])],
|
|
354
|
-
})),
|
|
355
|
-
]
|
|
356
|
-
: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
357
|
-
}),
|
|
358
|
-
],
|
|
359
|
-
})
|
|
360
|
-
: result;
|
|
361
|
-
if (input.harvest) {
|
|
362
|
-
input.tx.moveCall({
|
|
363
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
364
|
-
typeArguments: [input.typeArguments[1]],
|
|
365
|
-
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
result = input.claim
|
|
369
|
-
? input.tx.moveCall({
|
|
370
|
-
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::claim"),
|
|
371
|
-
typeArguments: input.typeArguments,
|
|
372
|
-
arguments: [
|
|
373
|
-
input.tx.object(input.typusDovSingleRegistry),
|
|
374
|
-
input.tx.pure(input.index),
|
|
375
|
-
input.tx.makeMoveVec({
|
|
376
|
-
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
377
|
-
objects: result
|
|
378
|
-
? [
|
|
379
|
-
input.tx.object(input.tx.moveCall({
|
|
380
|
-
target: "0x1::option::destroy_some",
|
|
381
|
-
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
382
|
-
arguments: [input.tx.object(result[1])],
|
|
383
|
-
})),
|
|
384
|
-
]
|
|
385
|
-
: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
386
|
-
}),
|
|
387
|
-
],
|
|
388
|
-
})
|
|
389
|
-
: result;
|
|
390
|
-
if (input.claim) {
|
|
391
|
-
input.tx.moveCall({
|
|
392
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
393
|
-
typeArguments: [input.typeArguments[0]],
|
|
394
|
-
arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
if (input.incentiveToken) {
|
|
398
|
-
input.typeArguments.push(input.incentiveToken);
|
|
399
|
-
var receipts = result
|
|
400
|
-
? [
|
|
401
|
-
input.tx.object(input.tx.moveCall({
|
|
402
|
-
target: "0x1::option::destroy_some",
|
|
403
|
-
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
404
|
-
arguments: [input.tx.object(result[1])],
|
|
405
|
-
})),
|
|
406
|
-
]
|
|
407
|
-
: input.receipts.map(function (receipt) { return input.tx.object(receipt); });
|
|
408
|
-
input.tx = getRedeemTx({
|
|
409
|
-
tx: input.tx,
|
|
410
|
-
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
411
|
-
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
412
|
-
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
413
|
-
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
414
|
-
typeArguments: input.typeArguments,
|
|
415
|
-
index: input.index,
|
|
416
|
-
receipts: receipts,
|
|
417
|
-
user: input.user,
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
input.tx.moveCall({
|
|
422
|
-
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
423
|
-
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
return input.tx;
|
|
427
|
-
}
|
|
428
|
-
exports.getWithdrawHarvestClaimTx = getWithdrawHarvestClaimTx;
|
|
133
|
+
exports.getReduceFundTx = getReduceFundTx;
|
|
429
134
|
/**
|
|
430
135
|
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN>(
|
|
431
136
|
registry: &mut Registry,
|
|
@@ -442,7 +147,7 @@ function getNewBidTx(input) {
|
|
|
442
147
|
input.typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
443
148
|
var _a = __read(input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.premium_required)]), 1), coin = _a[0];
|
|
444
149
|
var result = input.tx.moveCall({
|
|
445
|
-
target: "".concat(input.typusDovSinglePackageId, "::
|
|
150
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_bid"),
|
|
446
151
|
typeArguments: input.typeArguments,
|
|
447
152
|
arguments: [
|
|
448
153
|
input.tx.object(input.typusEcosystemVersion),
|
|
@@ -453,7 +158,7 @@ function getNewBidTx(input) {
|
|
|
453
158
|
input.tx.pure(input.index),
|
|
454
159
|
input.tx.makeMoveVec({ objects: [coin] }),
|
|
455
160
|
input.tx.pure(input.size),
|
|
456
|
-
input.tx.pure(
|
|
161
|
+
input.tx.pure(constants_1.CLOCK),
|
|
457
162
|
],
|
|
458
163
|
});
|
|
459
164
|
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
@@ -478,7 +183,7 @@ function getNewBidTx(input) {
|
|
|
478
183
|
arguments: [input.tx.object(balance)],
|
|
479
184
|
});
|
|
480
185
|
var result = input.tx.moveCall({
|
|
481
|
-
target: "".concat(input.typusDovSinglePackageId, "::
|
|
186
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_bid"),
|
|
482
187
|
typeArguments: input.typeArguments,
|
|
483
188
|
arguments: [
|
|
484
189
|
input.tx.object(input.typusEcosystemVersion),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function getUserMetadata(input: {
|
|
4
4
|
provider: SuiClient;
|
|
5
5
|
typusPackageId: string;
|
|
6
6
|
typusEcosystemVersion: string;
|
|
@@ -36,11 +36,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.getUserMetadata = exports.SENDER = void 0;
|
|
40
40
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
41
41
|
var bcs_1 = require("@mysten/bcs");
|
|
42
42
|
exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
43
|
-
function
|
|
43
|
+
function getUserMetadata(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) {
|
|
@@ -61,6 +61,7 @@ function getAirdrop(input) {
|
|
|
61
61
|
results = (_a.sent()).results;
|
|
62
62
|
bytes = results[results.length - 1].returnValues[0][0];
|
|
63
63
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
64
|
+
reader.readULEB();
|
|
64
65
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
65
66
|
return reader.read64();
|
|
66
67
|
})];
|
|
@@ -68,4 +69,4 @@ function getAirdrop(input) {
|
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
exports.
|
|
72
|
+
exports.getUserMetadata = getUserMetadata;
|