@typus/typus-sdk 1.4.17 → 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.
Files changed (37) hide show
  1. package/dist/config-mainnet.json +3 -3
  2. package/dist/src/auto-bid/token-user-entry.d.ts +9 -0
  3. package/dist/src/auto-bid/token-user-entry.js +126 -0
  4. package/dist/src/typus/airdrop/authority-entry.d.ts +14 -2
  5. package/dist/src/typus/airdrop/authority-entry.js +27 -32
  6. package/dist/src/typus/airdrop/user-entry.d.ts +2 -5
  7. package/dist/src/typus/airdrop/user-entry.js +8 -8
  8. package/dist/src/typus/airdrop/view-function.d.ts +2 -5
  9. package/dist/src/typus/airdrop/view-function.js +5 -5
  10. package/dist/src/typus/leaderboard/authority-entry.d.ts +10 -2
  11. package/dist/src/typus/leaderboard/authority-entry.js +12 -13
  12. package/dist/src/typus/leaderboard/view-function.d.ts +2 -5
  13. package/dist/src/typus/leaderboard/view-function.js +6 -6
  14. package/dist/src/typus/tails-staking/authority-entry.d.ts +12 -55
  15. package/dist/src/typus/tails-staking/authority-entry.js +73 -97
  16. package/dist/src/typus/tails-staking/user-entry.d.ts +14 -44
  17. package/dist/src/typus/tails-staking/user-entry.js +123 -123
  18. package/dist/src/typus/tails-staking/view-function.d.ts +3 -11
  19. package/dist/src/typus/tails-staking/view-function.js +10 -10
  20. package/dist/src/typus/user/view-function.d.ts +2 -5
  21. package/dist/src/typus/user/view-function.js +5 -5
  22. package/dist/src/typus-dov-single-v2/authority-entry.d.ts +26 -18
  23. package/dist/src/typus-dov-single-v2/authority-entry.js +23 -114
  24. package/dist/src/typus-dov-single-v2/function/bidding.js +4 -5
  25. package/dist/src/typus-dov-single-v2/token-user-entry.d.ts +11 -84
  26. package/dist/src/typus-dov-single-v2/token-user-entry.js +191 -316
  27. package/dist/src/typus-dov-single-v2/user-entry.d.ts +11 -69
  28. package/dist/src/typus-dov-single-v2/user-entry.js +183 -194
  29. package/dist/src/typus-dov-single-v2/view-function.d.ts +20 -6
  30. package/dist/src/typus-dov-single-v2/view-function.js +37 -43
  31. package/dist/src/typus-perp/user/orderWithBidReceipt.js +1 -5
  32. package/dist/src/typus-safu/index.d.ts +2 -1
  33. package/dist/src/typus-safu/index.js +2 -1
  34. package/dist/src/typus-safu/user-history.d.ts +12 -0
  35. package/dist/src/typus-safu/user-history.js +312 -0
  36. package/dist/src/utils/typusConfig.d.ts +1 -0
  37. 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("../constants");
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
- ? input.tx.moveCall({
50
- target: "".concat(input.typusFrameworkPackageId, "::utils::delegate_extract_balance"),
49
+ ? tx.moveCall({
50
+ target: "".concat(config.package.framework, "::utils::delegate_extract_balance"),
51
51
  typeArguments: [input.typeArguments[0]],
52
52
  arguments: [
53
- input.tx.pure(input.user),
54
- input.tx.makeMoveVec({
53
+ tx.pure(input.user),
54
+ tx.makeMoveVec({
55
55
  type: "0x2::coin::Coin<".concat(input.typeArguments[0], ">"),
56
- objects: [input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.raiseAmount)])],
56
+ objects: [tx.splitCoins(tx.gas, [tx.pure(input.raiseAmount)])],
57
57
  }),
58
- input.tx.pure(input.raiseAmount),
58
+ tx.pure(input.raiseAmount),
59
59
  ],
60
60
  })
61
- : input.tx.moveCall({
62
- target: "".concat(input.typusFrameworkPackageId, "::utils::delegate_extract_balance"),
61
+ : tx.moveCall({
62
+ target: "".concat(config.package.framework, "::utils::delegate_extract_balance"),
63
63
  typeArguments: [input.typeArguments[0]],
64
64
  arguments: [
65
- input.tx.pure(input.user),
66
- input.tx.makeMoveVec({
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 input.tx.object(coin); }),
68
+ objects: input.raiseCoins.map(function (coin) { return tx.object(coin); }),
69
69
  }),
70
- input.tx.pure(input.raiseAmount),
70
+ tx.pure(input.raiseAmount),
71
71
  ],
72
72
  });
73
- var result = input.tx.moveCall({
74
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
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
- input.tx.object(input.typusEcosystemVersion),
78
- input.tx.object(input.typusUserRegistry),
79
- input.tx.object(input.typusLeaderboardRegistry),
80
- input.tx.object(input.typusDovSingleRegistry),
81
- input.tx.pure(input.index),
82
- input.tx.makeMoveVec({
83
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
84
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.object(raiseBalance),
87
- input.tx.pure(input.raiseFromPremium),
88
- input.tx.pure(input.raiseFromInactive),
89
- input.tx.object(constants_1.CLOCK),
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
- input.tx.transferObjects([input.tx.object(result[0])], input.user);
93
- return input.tx;
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 = input.tx.moveCall({
114
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_reduce_fund"),
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
- input.tx.object(input.typusEcosystemVersion),
118
- input.tx.object(input.typusUserRegistry),
119
- input.tx.object(input.typusLeaderboardRegistry),
120
- input.tx.object(input.typusDovSingleRegistry),
121
- input.tx.pure(input.index),
122
- input.tx.makeMoveVec({
123
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
124
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.pure(input.reduceFromWarmup),
127
- input.tx.pure(input.reduceFromActive),
128
- input.tx.pure(input.reduceFromPremium),
129
- input.tx.pure(input.reduceFromInactive),
130
- input.tx.pure(input.reduceFromIncentive),
131
- input.tx.object(constants_1.CLOCK),
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
- input.tx.moveCall({
135
- target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
136
- arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
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
- input.tx.moveCall({
139
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
138
+ tx.moveCall({
139
+ target: "".concat(config.package.framework, "::utils::transfer_balance"),
140
140
  typeArguments: [input.typeArguments[0]],
141
- arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
141
+ arguments: [tx.object(result[1]), tx.pure(input.user)],
142
142
  });
143
- input.tx.moveCall({
144
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
143
+ tx.moveCall({
144
+ target: "".concat(config.package.framework, "::utils::transfer_balance"),
145
145
  typeArguments: [input.typeArguments[1]],
146
- arguments: [input.tx.object(result[2]), input.tx.pure(input.user)],
146
+ arguments: [tx.object(result[2]), tx.pure(input.user)],
147
147
  });
148
- input.tx.moveCall({
149
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
148
+ tx.moveCall({
149
+ target: "".concat(config.package.framework, "::utils::transfer_balance"),
150
150
  typeArguments: [input.typeArguments[2]],
151
- arguments: [input.tx.object(result[3]), input.tx.pure(input.user)],
151
+ arguments: [tx.object(result[3]), tx.pure(input.user)],
152
152
  });
153
- return input.tx;
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 = input.tx.moveCall({
169
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_refresh_deposit_snapshot"),
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
- input.tx.object(input.typusEcosystemVersion),
173
- input.tx.object(input.typusUserRegistry),
174
- input.tx.object(input.typusLeaderboardRegistry),
175
- input.tx.object(input.typusDovSingleRegistry),
176
- input.tx.pure(input.index),
177
- input.tx.makeMoveVec({
178
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
179
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.object(constants_1.CLOCK),
181
+ tx.object(constants_1.CLOCK),
182
182
  ],
183
183
  });
184
- input.tx.transferObjects([input.tx.object(result[0])], input.user);
185
- return input.tx;
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(input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.premium_required)]), 1), coin = _a[0];
202
- var result = input.tx.moveCall({
203
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_bid"),
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
- input.tx.object(input.typusEcosystemVersion),
207
- input.tx.object(input.typusUserRegistry),
208
- input.tx.object(input.tgldRegistry),
209
- input.tx.object(input.typusLeaderboardRegistry),
210
- input.tx.object(input.typusDovSingleRegistry),
211
- input.tx.pure(input.index),
212
- input.tx.makeMoveVec({ objects: [coin] }),
213
- input.tx.pure(input.size),
214
- input.tx.object(constants_1.CLOCK),
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
- input.tx.transferObjects([input.tx.object(result[0])], input.user);
218
- input.tx.moveCall({
219
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_coins"),
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: [input.tx.makeMoveVec({ objects: [input.tx.object(result[1])] }), input.tx.pure(input.user)],
221
+ arguments: [tx.makeMoveVec({ objects: [tx.object(result[1])] }), tx.pure(input.user)],
222
222
  });
223
223
  }
224
224
  else {
225
- var balance = input.tx.moveCall({
226
- target: "".concat(input.typusFrameworkPackageId, "::utils::extract_balance"),
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 = input.tx.moveCall({
230
+ var coin = tx.moveCall({
234
231
  target: "0x2::coin::from_balance",
235
232
  typeArguments: [input.typeArguments[1]],
236
- arguments: [input.tx.object(balance)],
233
+ arguments: [tx.object(balance)],
237
234
  });
238
- var result = input.tx.moveCall({
239
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_bid"),
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
- input.tx.object(input.typusEcosystemVersion),
243
- input.tx.object(input.typusUserRegistry),
244
- input.tx.object(input.tgldRegistry),
245
- input.tx.object(input.typusLeaderboardRegistry),
246
- input.tx.object(input.typusDovSingleRegistry),
247
- input.tx.pure(input.index),
248
- input.tx.makeMoveVec({ objects: [coin] }),
249
- input.tx.pure(input.size),
250
- input.tx.pure("0x6"),
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
- input.tx.transferObjects([input.tx.object(result[0])], input.user);
254
- input.tx.moveCall({
255
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_coins"),
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: [input.tx.makeMoveVec({ objects: [input.tx.object(result[1])] }), input.tx.pure(input.user)],
254
+ arguments: [tx.makeMoveVec({ objects: [tx.object(result[1])] }), tx.pure(input.user)],
258
255
  });
259
256
  }
260
- return input.tx;
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 = input.tx.moveCall({
272
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::exercise"),
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
- input.tx.object(input.typusDovSingleRegistry),
276
- input.tx.pure(input.index),
277
- input.tx.makeMoveVec({
278
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
279
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.moveCall({
284
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
280
+ tx.moveCall({
281
+ target: "".concat(config.package.framework, "::utils::transfer_balance"),
285
282
  typeArguments: [input.typeArguments[0]],
286
- arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
283
+ arguments: [tx.object(result[0]), tx.pure(input.user)],
287
284
  });
288
- return input.tx;
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
- input.tx.moveCall({
302
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::transfer_bid_receipt"),
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
- input.tx.object(input.typusDovSingleRegistry),
306
- input.tx.pure(input.index),
307
- input.tx.makeMoveVec({
308
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
309
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.pure(input.share ? [input.share] : []),
312
- input.tx.pure(input.recipient),
308
+ tx.pure(input.share ? [input.share] : []),
309
+ tx.pure(input.recipient),
313
310
  ],
314
311
  });
315
- return input.tx;
312
+ return tx;
316
313
  }
317
- function getSplitBidReceiptTx(input) {
318
- var result = input.tx.moveCall({
319
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::simple_split_bid_receipt"),
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
- input.tx.object(input.typusDovSingleRegistry),
323
- input.tx.pure(input.index),
324
- input.tx.makeMoveVec({
325
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
326
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.pure([input.share]),
325
+ tx.pure([input.share]),
329
326
  ],
330
327
  });
331
- var unwrap0 = input.tx.moveCall({
328
+ var unwrap0 = tx.moveCall({
332
329
  target: "0x1::option::destroy_some",
333
- typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt")],
334
- arguments: [input.tx.object(result[0])],
330
+ typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
331
+ arguments: [tx.object(result[0])],
335
332
  });
336
- var unwrap1 = input.tx.moveCall({
333
+ var unwrap1 = tx.moveCall({
337
334
  target: "0x1::option::destroy_some",
338
- typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt")],
339
- arguments: [input.tx.object(result[1])],
335
+ typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
336
+ arguments: [tx.object(result[1])],
340
337
  });
341
- input.tx.transferObjects([unwrap1], input.recipient);
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: `${input.typusFrameworkOriginPackageId}::vault::TypusBidReceipt`,
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(input.typusDovSinglePackageId, "::tds_user_entry::public_transfer_bid_receipt"),
353
+ target: "".concat(config.package.dovSingle, "::tds_user_entry::public_transfer_bid_receipt"),
357
354
  typeArguments: input.typeArguments,
358
355
  arguments: [
359
- tx.object(input.typusDovSingleRegistry),
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(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt")],
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 = input.tx.moveCall({
388
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::rebate"),
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: [input.tx.object(input.typusDovSingleRegistry)],
387
+ arguments: [tx.object(config.registry.dov.dovSingle)],
391
388
  });
392
- var balance = input.tx.moveCall({
389
+ var balance = tx.moveCall({
393
390
  target: "0x1::option::destroy_some",
394
391
  typeArguments: ["0x2::balance::Balance<".concat(input.typeArgument, ">")],
395
- arguments: [input.tx.object(result[0])],
392
+ arguments: [tx.object(result[0])],
396
393
  });
397
- input.tx.moveCall({
398
- target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
394
+ tx.moveCall({
395
+ target: "".concat(config.package.framework, "::utils::transfer_balance"),
399
396
  typeArguments: [input.typeArgument],
400
- arguments: [input.tx.object(balance), input.tx.pure(input.user)],
397
+ arguments: [tx.object(balance), tx.pure(input.user)],
401
398
  });
402
- return input.tx;
399
+ return tx;
403
400
  }
404
- function getCompoundWithRedeemTx(input) {
405
- var raiseBalance = input.tx.moveCall({
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 = input.tx.moveCall({
411
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
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
- input.tx.object(input.typusEcosystemVersion),
415
- input.tx.object(input.typusUserRegistry),
416
- input.tx.object(input.typusLeaderboardRegistry),
417
- input.tx.object(input.typusDovSingleRegistry),
418
- input.tx.pure(input.index),
419
- input.tx.makeMoveVec({
420
- type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
421
- objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
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
- input.tx.object(raiseBalance),
424
- input.tx.pure(true),
425
- input.tx.pure(false),
426
- input.tx.object(constants_1.CLOCK),
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(provider: SuiClient, packageId: string, registry: string, indexes: string[], sender?: string): Promise<{
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(provider: SuiClient, packageId: string, registry: string, indexes: string[], sender?: string): Promise<{
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(provider: SuiClient, packageId: string, registry: string, index: string, sender?: string): Promise<AuctionBid[]>;
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(provider: SuiClient, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[], user: string, sender?: string): Promise<{
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(provider: SuiClient, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[], sender?: string): Promise<{
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(provider: SuiClient, packageId: string, registry: string, typeArguments: string[], sender?: string): Promise<{
222
+ export declare function getRefundShares(config: TypusConfig, provider: SuiClient, input: {
223
+ typeArguments: string[];
224
+ }): Promise<{
211
225
  [key: string]: string;
212
226
  }>;