@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
|
@@ -27,7 +27,7 @@ exports.getMultiTransferBidReceiptTx = getMultiTransferBidReceiptTx;
|
|
|
27
27
|
exports.getRebateTx = getRebateTx;
|
|
28
28
|
exports.getCompoundWithRedeemTx = getCompoundWithRedeemTx;
|
|
29
29
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
30
|
-
var constants_1 = require("
|
|
30
|
+
var constants_1 = require("src/constants");
|
|
31
31
|
/**
|
|
32
32
|
public fun public_raise_fund<D_TOKEN, B_TOKEN>(
|
|
33
33
|
typus_ecosystem_version: &TypusEcosystemVersion,
|
|
@@ -43,54 +43,54 @@ var constants_1 = require("../constants");
|
|
|
43
43
|
ctx: &mut TxContext,
|
|
44
44
|
): (TypusDepositReceipt, vector<u64>) {
|
|
45
45
|
*/
|
|
46
|
-
function getRaiseFundTx(input) {
|
|
46
|
+
function getRaiseFundTx(config, tx, input) {
|
|
47
47
|
var raiseBalance = input.typeArguments[0] == "0x2::sui::SUI" ||
|
|
48
48
|
input.typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"
|
|
49
|
-
?
|
|
50
|
-
target: "".concat(
|
|
49
|
+
? tx.moveCall({
|
|
50
|
+
target: "".concat(config.package.framework, "::utils::delegate_extract_balance"),
|
|
51
51
|
typeArguments: [input.typeArguments[0]],
|
|
52
52
|
arguments: [
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
tx.pure(input.user),
|
|
54
|
+
tx.makeMoveVec({
|
|
55
55
|
type: "0x2::coin::Coin<".concat(input.typeArguments[0], ">"),
|
|
56
|
-
objects: [
|
|
56
|
+
objects: [tx.splitCoins(tx.gas, [tx.pure(input.raiseAmount)])],
|
|
57
57
|
}),
|
|
58
|
-
|
|
58
|
+
tx.pure(input.raiseAmount),
|
|
59
59
|
],
|
|
60
60
|
})
|
|
61
|
-
:
|
|
62
|
-
target: "".concat(
|
|
61
|
+
: tx.moveCall({
|
|
62
|
+
target: "".concat(config.package.framework, "::utils::delegate_extract_balance"),
|
|
63
63
|
typeArguments: [input.typeArguments[0]],
|
|
64
64
|
arguments: [
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
tx.pure(input.user),
|
|
66
|
+
tx.makeMoveVec({
|
|
67
67
|
type: "0x2::coin::Coin<".concat(input.typeArguments[0], ">"),
|
|
68
|
-
objects: input.raiseCoins.map(function (coin) { return
|
|
68
|
+
objects: input.raiseCoins.map(function (coin) { return tx.object(coin); }),
|
|
69
69
|
}),
|
|
70
|
-
|
|
70
|
+
tx.pure(input.raiseAmount),
|
|
71
71
|
],
|
|
72
72
|
});
|
|
73
|
-
var result =
|
|
74
|
-
target: "".concat(
|
|
73
|
+
var result = tx.moveCall({
|
|
74
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_raise_fund"),
|
|
75
75
|
typeArguments: input.typeArguments,
|
|
76
76
|
arguments: [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
type: "".concat(
|
|
84
|
-
objects: input.receipts.map(function (receipt) { return
|
|
77
|
+
tx.object(config.version.typus),
|
|
78
|
+
tx.object(config.registry.typus.user),
|
|
79
|
+
tx.object(config.registry.typus.leaderboard),
|
|
80
|
+
tx.object(config.registry.dov.dovSingle),
|
|
81
|
+
tx.pure(input.index),
|
|
82
|
+
tx.makeMoveVec({
|
|
83
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusDepositReceipt"),
|
|
84
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
85
85
|
}),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
tx.object(raiseBalance),
|
|
87
|
+
tx.pure(input.raiseFromPremium),
|
|
88
|
+
tx.pure(input.raiseFromInactive),
|
|
89
|
+
tx.object(constants_1.CLOCK),
|
|
90
90
|
],
|
|
91
91
|
});
|
|
92
|
-
|
|
93
|
-
return
|
|
92
|
+
tx.transferObjects([tx.object(result[0])], input.user);
|
|
93
|
+
return tx;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
public fun public_reduce_fund<D_TOKEN, B_TOKEN, I_TOKEN>(
|
|
@@ -109,48 +109,48 @@ function getRaiseFundTx(input) {
|
|
|
109
109
|
ctx: &mut TxContext,
|
|
110
110
|
): (Option<TypusDepositReceipt>, Balance<D_TOKEN>, Balance<B_TOKEN>, Balance<I_TOKEN>, vector<u64>) {
|
|
111
111
|
*/
|
|
112
|
-
function getReduceFundTx(input) {
|
|
113
|
-
var result =
|
|
114
|
-
target: "".concat(
|
|
112
|
+
function getReduceFundTx(config, tx, input) {
|
|
113
|
+
var result = tx.moveCall({
|
|
114
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_reduce_fund"),
|
|
115
115
|
typeArguments: input.typeArguments,
|
|
116
116
|
arguments: [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
type: "".concat(
|
|
124
|
-
objects: input.receipts.map(function (receipt) { return
|
|
117
|
+
tx.object(config.version.typus),
|
|
118
|
+
tx.object(config.registry.typus.user),
|
|
119
|
+
tx.object(config.registry.typus.leaderboard),
|
|
120
|
+
tx.object(config.registry.dov.dovSingle),
|
|
121
|
+
tx.pure(input.index),
|
|
122
|
+
tx.makeMoveVec({
|
|
123
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusDepositReceipt"),
|
|
124
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
125
125
|
}),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
tx.pure(input.reduceFromWarmup),
|
|
127
|
+
tx.pure(input.reduceFromActive),
|
|
128
|
+
tx.pure(input.reduceFromPremium),
|
|
129
|
+
tx.pure(input.reduceFromInactive),
|
|
130
|
+
tx.pure(input.reduceFromIncentive),
|
|
131
|
+
tx.object(constants_1.CLOCK),
|
|
132
132
|
],
|
|
133
133
|
});
|
|
134
|
-
|
|
135
|
-
target: "".concat(
|
|
136
|
-
arguments: [
|
|
134
|
+
tx.moveCall({
|
|
135
|
+
target: "".concat(config.package.framework, "::vault::transfer_deposit_receipt"),
|
|
136
|
+
arguments: [tx.object(result[0]), tx.pure(input.user)],
|
|
137
137
|
});
|
|
138
|
-
|
|
139
|
-
target: "".concat(
|
|
138
|
+
tx.moveCall({
|
|
139
|
+
target: "".concat(config.package.framework, "::utils::transfer_balance"),
|
|
140
140
|
typeArguments: [input.typeArguments[0]],
|
|
141
|
-
arguments: [
|
|
141
|
+
arguments: [tx.object(result[1]), tx.pure(input.user)],
|
|
142
142
|
});
|
|
143
|
-
|
|
144
|
-
target: "".concat(
|
|
143
|
+
tx.moveCall({
|
|
144
|
+
target: "".concat(config.package.framework, "::utils::transfer_balance"),
|
|
145
145
|
typeArguments: [input.typeArguments[1]],
|
|
146
|
-
arguments: [
|
|
146
|
+
arguments: [tx.object(result[2]), tx.pure(input.user)],
|
|
147
147
|
});
|
|
148
|
-
|
|
149
|
-
target: "".concat(
|
|
148
|
+
tx.moveCall({
|
|
149
|
+
target: "".concat(config.package.framework, "::utils::transfer_balance"),
|
|
150
150
|
typeArguments: [input.typeArguments[2]],
|
|
151
|
-
arguments: [
|
|
151
|
+
arguments: [tx.object(result[3]), tx.pure(input.user)],
|
|
152
152
|
});
|
|
153
|
-
return
|
|
153
|
+
return tx;
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
public fun public_refresh_deposit_snapshot<D_TOKEN, B_TOKEN>(
|
|
@@ -164,25 +164,25 @@ function getReduceFundTx(input) {
|
|
|
164
164
|
ctx: &mut TxContext,
|
|
165
165
|
): (TypusDepositReceipt, vector<u64>) {
|
|
166
166
|
*/
|
|
167
|
-
function getRefreshDepositSnapshotTx(input) {
|
|
168
|
-
var result =
|
|
169
|
-
target: "".concat(
|
|
167
|
+
function getRefreshDepositSnapshotTx(config, tx, input) {
|
|
168
|
+
var result = tx.moveCall({
|
|
169
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_refresh_deposit_snapshot"),
|
|
170
170
|
typeArguments: input.typeArguments,
|
|
171
171
|
arguments: [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
type: "".concat(
|
|
179
|
-
objects: input.receipts.map(function (receipt) { return
|
|
172
|
+
tx.object(config.version.typus),
|
|
173
|
+
tx.object(config.registry.typus.user),
|
|
174
|
+
tx.object(config.registry.typus.leaderboard),
|
|
175
|
+
tx.object(config.registry.dov.dovSingle),
|
|
176
|
+
tx.pure(input.index),
|
|
177
|
+
tx.makeMoveVec({
|
|
178
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusDepositReceipt"),
|
|
179
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
180
180
|
}),
|
|
181
|
-
|
|
181
|
+
tx.object(constants_1.CLOCK),
|
|
182
182
|
],
|
|
183
183
|
});
|
|
184
|
-
|
|
185
|
-
return
|
|
184
|
+
tx.transferObjects([tx.object(result[0])], input.user);
|
|
185
|
+
return tx;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
188
|
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN>(
|
|
@@ -194,70 +194,67 @@ function getRefreshDepositSnapshotTx(input) {
|
|
|
194
194
|
ctx: &mut TxContext,
|
|
195
195
|
)
|
|
196
196
|
*/
|
|
197
|
-
function getNewBidTx(input) {
|
|
197
|
+
function getNewBidTx(config, tx, input) {
|
|
198
198
|
if (!input.usingSponsoredGasCoin &&
|
|
199
199
|
(input.typeArguments[1] == "0x2::sui::SUI" ||
|
|
200
200
|
input.typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
201
|
-
var _a = __read(
|
|
202
|
-
var result =
|
|
203
|
-
target: "".concat(
|
|
201
|
+
var _a = __read(tx.splitCoins(tx.gas, [tx.pure(input.premium_required)]), 1), coin = _a[0];
|
|
202
|
+
var result = tx.moveCall({
|
|
203
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_bid"),
|
|
204
204
|
typeArguments: input.typeArguments,
|
|
205
205
|
arguments: [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
tx.object(config.version.typus),
|
|
207
|
+
tx.object(config.registry.typus.user),
|
|
208
|
+
tx.object(input.tgldRegistry),
|
|
209
|
+
tx.object(config.registry.typus.leaderboard),
|
|
210
|
+
tx.object(config.registry.dov.dovSingle),
|
|
211
|
+
tx.pure(input.index),
|
|
212
|
+
tx.makeMoveVec({ objects: [coin] }),
|
|
213
|
+
tx.pure(input.size),
|
|
214
|
+
tx.object(constants_1.CLOCK),
|
|
215
215
|
],
|
|
216
216
|
});
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
target: "".concat(
|
|
217
|
+
tx.transferObjects([tx.object(result[0])], input.user);
|
|
218
|
+
tx.moveCall({
|
|
219
|
+
target: "".concat(config.package.framework, "::utils::transfer_coins"),
|
|
220
220
|
typeArguments: [input.typeArguments[1]],
|
|
221
|
-
arguments: [
|
|
221
|
+
arguments: [tx.makeMoveVec({ objects: [tx.object(result[1])] }), tx.pure(input.user)],
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
else {
|
|
225
|
-
var balance =
|
|
226
|
-
target: "".concat(
|
|
225
|
+
var balance = tx.moveCall({
|
|
226
|
+
target: "".concat(config.package.framework, "::utils::extract_balance"),
|
|
227
227
|
typeArguments: [input.typeArguments[1]],
|
|
228
|
-
arguments: [
|
|
229
|
-
input.tx.makeMoveVec({ objects: input.coins.map(function (coin) { return input.tx.object(coin); }) }),
|
|
230
|
-
input.tx.pure(input.premium_required),
|
|
231
|
-
],
|
|
228
|
+
arguments: [tx.makeMoveVec({ objects: input.coins.map(function (coin) { return tx.object(coin); }) }), tx.pure(input.premium_required)],
|
|
232
229
|
});
|
|
233
|
-
var coin =
|
|
230
|
+
var coin = tx.moveCall({
|
|
234
231
|
target: "0x2::coin::from_balance",
|
|
235
232
|
typeArguments: [input.typeArguments[1]],
|
|
236
|
-
arguments: [
|
|
233
|
+
arguments: [tx.object(balance)],
|
|
237
234
|
});
|
|
238
|
-
var result =
|
|
239
|
-
target: "".concat(
|
|
235
|
+
var result = tx.moveCall({
|
|
236
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_bid"),
|
|
240
237
|
typeArguments: input.typeArguments,
|
|
241
238
|
arguments: [
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
239
|
+
tx.object(config.version.typus),
|
|
240
|
+
tx.object(config.registry.typus.user),
|
|
241
|
+
tx.object(input.tgldRegistry),
|
|
242
|
+
tx.object(config.registry.typus.leaderboard),
|
|
243
|
+
tx.object(config.registry.dov.dovSingle),
|
|
244
|
+
tx.pure(input.index),
|
|
245
|
+
tx.makeMoveVec({ objects: [coin] }),
|
|
246
|
+
tx.pure(input.size),
|
|
247
|
+
tx.pure("0x6"),
|
|
251
248
|
],
|
|
252
249
|
});
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
target: "".concat(
|
|
250
|
+
tx.transferObjects([tx.object(result[0])], input.user);
|
|
251
|
+
tx.moveCall({
|
|
252
|
+
target: "".concat(config.package.framework, "::utils::transfer_coins"),
|
|
256
253
|
typeArguments: [input.typeArguments[1]],
|
|
257
|
-
arguments: [
|
|
254
|
+
arguments: [tx.makeMoveVec({ objects: [tx.object(result[1])] }), tx.pure(input.user)],
|
|
258
255
|
});
|
|
259
256
|
}
|
|
260
|
-
return
|
|
257
|
+
return tx;
|
|
261
258
|
}
|
|
262
259
|
/**
|
|
263
260
|
public(friend) entry fun exercise<D_TOKEN, B_TOKEN>(
|
|
@@ -267,25 +264,25 @@ function getNewBidTx(input) {
|
|
|
267
264
|
ctx: &mut TxContext,
|
|
268
265
|
)
|
|
269
266
|
*/
|
|
270
|
-
function getExerciseTx(input) {
|
|
271
|
-
var result =
|
|
272
|
-
target: "".concat(
|
|
267
|
+
function getExerciseTx(config, tx, input) {
|
|
268
|
+
var result = tx.moveCall({
|
|
269
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::exercise"),
|
|
273
270
|
typeArguments: input.typeArguments,
|
|
274
271
|
arguments: [
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
type: "".concat(
|
|
279
|
-
objects: input.receipts.map(function (receipt) { return
|
|
272
|
+
tx.object(config.registry.dov.dovSingle),
|
|
273
|
+
tx.pure(input.index),
|
|
274
|
+
tx.makeMoveVec({
|
|
275
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt"),
|
|
276
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
280
277
|
}),
|
|
281
278
|
],
|
|
282
279
|
});
|
|
283
|
-
|
|
284
|
-
target: "".concat(
|
|
280
|
+
tx.moveCall({
|
|
281
|
+
target: "".concat(config.package.framework, "::utils::transfer_balance"),
|
|
285
282
|
typeArguments: [input.typeArguments[0]],
|
|
286
|
-
arguments: [
|
|
283
|
+
arguments: [tx.object(result[0]), tx.pure(input.user)],
|
|
287
284
|
});
|
|
288
|
-
return
|
|
285
|
+
return tx;
|
|
289
286
|
}
|
|
290
287
|
/**
|
|
291
288
|
public(friend) entry fun transfer_bid_receipt<D_TOKEN, B_TOKEN>(
|
|
@@ -297,55 +294,55 @@ function getExerciseTx(input) {
|
|
|
297
294
|
ctx: &mut TxContext,
|
|
298
295
|
) {
|
|
299
296
|
*/
|
|
300
|
-
function getTransferBidReceiptTx(input) {
|
|
301
|
-
|
|
302
|
-
target: "".concat(
|
|
297
|
+
function getTransferBidReceiptTx(config, tx, input) {
|
|
298
|
+
tx.moveCall({
|
|
299
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::transfer_bid_receipt"),
|
|
303
300
|
typeArguments: input.typeArguments,
|
|
304
301
|
arguments: [
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
type: "".concat(
|
|
309
|
-
objects: input.receipts.map(function (receipt) { return
|
|
302
|
+
tx.object(config.registry.dov.dovSingle),
|
|
303
|
+
tx.pure(input.index),
|
|
304
|
+
tx.makeMoveVec({
|
|
305
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt"),
|
|
306
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
310
307
|
}),
|
|
311
|
-
|
|
312
|
-
|
|
308
|
+
tx.pure(input.share ? [input.share] : []),
|
|
309
|
+
tx.pure(input.recipient),
|
|
313
310
|
],
|
|
314
311
|
});
|
|
315
|
-
return
|
|
312
|
+
return tx;
|
|
316
313
|
}
|
|
317
|
-
function getSplitBidReceiptTx(input) {
|
|
318
|
-
var result =
|
|
319
|
-
target: "".concat(
|
|
314
|
+
function getSplitBidReceiptTx(config, tx, input) {
|
|
315
|
+
var result = tx.moveCall({
|
|
316
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::simple_split_bid_receipt"),
|
|
320
317
|
typeArguments: [],
|
|
321
318
|
arguments: [
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
type: "".concat(
|
|
326
|
-
objects: input.receipts.map(function (receipt) { return
|
|
319
|
+
tx.object(config.registry.dov.dovSingle),
|
|
320
|
+
tx.pure(input.index),
|
|
321
|
+
tx.makeMoveVec({
|
|
322
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt"),
|
|
323
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
327
324
|
}),
|
|
328
|
-
|
|
325
|
+
tx.pure([input.share]),
|
|
329
326
|
],
|
|
330
327
|
});
|
|
331
|
-
var unwrap0 =
|
|
328
|
+
var unwrap0 = tx.moveCall({
|
|
332
329
|
target: "0x1::option::destroy_some",
|
|
333
|
-
typeArguments: ["".concat(
|
|
334
|
-
arguments: [
|
|
330
|
+
typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
|
|
331
|
+
arguments: [tx.object(result[0])],
|
|
335
332
|
});
|
|
336
|
-
var unwrap1 =
|
|
333
|
+
var unwrap1 = tx.moveCall({
|
|
337
334
|
target: "0x1::option::destroy_some",
|
|
338
|
-
typeArguments: ["".concat(
|
|
339
|
-
arguments: [
|
|
335
|
+
typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
|
|
336
|
+
arguments: [tx.object(result[1])],
|
|
340
337
|
});
|
|
341
|
-
|
|
338
|
+
tx.transferObjects([unwrap1], input.recipient);
|
|
342
339
|
return unwrap0;
|
|
343
340
|
}
|
|
344
|
-
function getMultiTransferBidReceiptTx(input) {
|
|
341
|
+
function getMultiTransferBidReceiptTx(config, input) {
|
|
345
342
|
var tx = new transactions_1.TransactionBlock();
|
|
346
343
|
console.assert(input.shares.length == input.recipients.length, "shares.length != recipients.length");
|
|
347
344
|
var receipts = {
|
|
348
|
-
// type: `${
|
|
345
|
+
// type: `${config.packageOrigin.framework}::vault::TypusBidReceipt`,
|
|
349
346
|
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
350
347
|
};
|
|
351
348
|
var i = 0;
|
|
@@ -353,10 +350,10 @@ function getMultiTransferBidReceiptTx(input) {
|
|
|
353
350
|
var share = input.shares[i];
|
|
354
351
|
var recipient = input.recipients[i];
|
|
355
352
|
var result = tx.moveCall({
|
|
356
|
-
target: "".concat(
|
|
353
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_transfer_bid_receipt"),
|
|
357
354
|
typeArguments: input.typeArguments,
|
|
358
355
|
arguments: [
|
|
359
|
-
tx.object(
|
|
356
|
+
tx.object(config.registry.dov.dovSingle),
|
|
360
357
|
tx.pure(input.index),
|
|
361
358
|
tx.makeMoveVec(receipts),
|
|
362
359
|
tx.pure([share]),
|
|
@@ -365,7 +362,7 @@ function getMultiTransferBidReceiptTx(input) {
|
|
|
365
362
|
});
|
|
366
363
|
var unwrap = tx.moveCall({
|
|
367
364
|
target: "0x1::option::destroy_some",
|
|
368
|
-
typeArguments: ["".concat(
|
|
365
|
+
typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
|
|
369
366
|
arguments: [tx.object(result[0])],
|
|
370
367
|
});
|
|
371
368
|
receipts = { objects: [unwrap] };
|
|
@@ -383,58 +380,50 @@ function getMultiTransferBidReceiptTx(input) {
|
|
|
383
380
|
ctx: &mut TxContext,
|
|
384
381
|
)
|
|
385
382
|
*/
|
|
386
|
-
function getRebateTx(input) {
|
|
387
|
-
var result =
|
|
388
|
-
target: "".concat(
|
|
383
|
+
function getRebateTx(config, tx, input) {
|
|
384
|
+
var result = tx.moveCall({
|
|
385
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::rebate"),
|
|
389
386
|
typeArguments: [input.typeArgument],
|
|
390
|
-
arguments: [
|
|
387
|
+
arguments: [tx.object(config.registry.dov.dovSingle)],
|
|
391
388
|
});
|
|
392
|
-
var balance =
|
|
389
|
+
var balance = tx.moveCall({
|
|
393
390
|
target: "0x1::option::destroy_some",
|
|
394
391
|
typeArguments: ["0x2::balance::Balance<".concat(input.typeArgument, ">")],
|
|
395
|
-
arguments: [
|
|
392
|
+
arguments: [tx.object(result[0])],
|
|
396
393
|
});
|
|
397
|
-
|
|
398
|
-
target: "".concat(
|
|
394
|
+
tx.moveCall({
|
|
395
|
+
target: "".concat(config.package.framework, "::utils::transfer_balance"),
|
|
399
396
|
typeArguments: [input.typeArgument],
|
|
400
|
-
arguments: [
|
|
397
|
+
arguments: [tx.object(balance), tx.pure(input.user)],
|
|
401
398
|
});
|
|
402
|
-
return
|
|
399
|
+
return tx;
|
|
403
400
|
}
|
|
404
|
-
function getCompoundWithRedeemTx(input) {
|
|
405
|
-
var raiseBalance =
|
|
401
|
+
function getCompoundWithRedeemTx(config, tx, input) {
|
|
402
|
+
var raiseBalance = tx.moveCall({
|
|
406
403
|
target: "0x2::balance::zero",
|
|
407
404
|
typeArguments: [input.typeArguments[0]],
|
|
408
405
|
arguments: [],
|
|
409
406
|
});
|
|
410
|
-
var result =
|
|
411
|
-
target: "".concat(
|
|
407
|
+
var result = tx.moveCall({
|
|
408
|
+
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_raise_fund"),
|
|
412
409
|
typeArguments: [input.typeArguments[0], input.typeArguments[1]],
|
|
413
410
|
arguments: [
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
type: "".concat(
|
|
421
|
-
objects: input.receipts.map(function (receipt) { return
|
|
411
|
+
tx.object(config.version.typus),
|
|
412
|
+
tx.object(config.registry.typus.user),
|
|
413
|
+
tx.object(config.registry.typus.leaderboard),
|
|
414
|
+
tx.object(config.registry.dov.dovSingle),
|
|
415
|
+
tx.pure(input.index),
|
|
416
|
+
tx.makeMoveVec({
|
|
417
|
+
type: "".concat(config.packageOrigin.framework, "::vault::TypusDepositReceipt"),
|
|
418
|
+
objects: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
422
419
|
}),
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
420
|
+
tx.object(raiseBalance),
|
|
421
|
+
tx.pure(true),
|
|
422
|
+
tx.pure(false),
|
|
423
|
+
tx.object(constants_1.CLOCK),
|
|
427
424
|
],
|
|
428
425
|
});
|
|
429
|
-
return getReduceFundTx({
|
|
430
|
-
tx: input.tx,
|
|
431
|
-
typusEcosystemVersion: input.typusEcosystemVersion,
|
|
432
|
-
typusUserRegistry: input.typusUserRegistry,
|
|
433
|
-
typusLeaderboardRegistry: input.typusLeaderboardRegistry,
|
|
434
|
-
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
435
|
-
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
436
|
-
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
437
|
-
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
426
|
+
return getReduceFundTx(config, tx, {
|
|
438
427
|
typeArguments: input.typeArguments,
|
|
439
428
|
index: input.index,
|
|
440
429
|
receipts: [result[0]],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
+
import { TypusConfig } from "src/utils";
|
|
2
3
|
export interface Vault {
|
|
3
4
|
id: string;
|
|
4
5
|
info: Info;
|
|
@@ -128,7 +129,9 @@ export interface DepositVault {
|
|
|
128
129
|
u64Padding: string[];
|
|
129
130
|
bcsPadding: string[];
|
|
130
131
|
}
|
|
131
|
-
export declare function getVaults(
|
|
132
|
+
export declare function getVaults(config: TypusConfig, provider: SuiClient, input: {
|
|
133
|
+
indexes: string[];
|
|
134
|
+
}): Promise<{
|
|
132
135
|
[key: string]: Vault;
|
|
133
136
|
}>;
|
|
134
137
|
export interface Auction {
|
|
@@ -149,7 +152,9 @@ export interface Auction {
|
|
|
149
152
|
ableToRemoveBid: boolean;
|
|
150
153
|
bidIndex: string;
|
|
151
154
|
}
|
|
152
|
-
export declare function getAuctions(
|
|
155
|
+
export declare function getAuctions(config: TypusConfig, provider: SuiClient, input: {
|
|
156
|
+
indexes: string[];
|
|
157
|
+
}): Promise<{
|
|
153
158
|
[key: string]: Auction;
|
|
154
159
|
}>;
|
|
155
160
|
export interface AuctionBid {
|
|
@@ -162,7 +167,9 @@ export interface AuctionBid {
|
|
|
162
167
|
feeDiscount: string;
|
|
163
168
|
tsMs: string;
|
|
164
169
|
}
|
|
165
|
-
export declare function getAuctionBids(
|
|
170
|
+
export declare function getAuctionBids(config: TypusConfig, provider: SuiClient, input: {
|
|
171
|
+
index: string;
|
|
172
|
+
}): Promise<AuctionBid[]>;
|
|
166
173
|
export interface DepositSnapshot {
|
|
167
174
|
snapshots: string[];
|
|
168
175
|
totalDeposit: string;
|
|
@@ -183,7 +190,10 @@ export interface RRR {
|
|
|
183
190
|
};
|
|
184
191
|
b: DepositSnapshot;
|
|
185
192
|
}
|
|
186
|
-
export declare function getDepositShares(
|
|
193
|
+
export declare function getDepositShares(config: TypusConfig, provider: SuiClient, input: {
|
|
194
|
+
receipts: string[];
|
|
195
|
+
user: string;
|
|
196
|
+
}): Promise<{
|
|
187
197
|
depositShare: {
|
|
188
198
|
[key: string]: DepositShare;
|
|
189
199
|
};
|
|
@@ -204,9 +214,13 @@ export interface BidShare {
|
|
|
204
214
|
bidVault: BidVault;
|
|
205
215
|
share: string;
|
|
206
216
|
}
|
|
207
|
-
export declare function getMyBids(
|
|
217
|
+
export declare function getMyBids(config: TypusConfig, provider: SuiClient, input: {
|
|
218
|
+
receipts: string[];
|
|
219
|
+
}): Promise<{
|
|
208
220
|
[key: string]: BidShare;
|
|
209
221
|
}>;
|
|
210
|
-
export declare function getRefundShares(
|
|
222
|
+
export declare function getRefundShares(config: TypusConfig, provider: SuiClient, input: {
|
|
223
|
+
typeArguments: string[];
|
|
224
|
+
}): Promise<{
|
|
211
225
|
[key: string]: string;
|
|
212
226
|
}>;
|