@typus/typus-sdk 1.2.93 → 1.2.95

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.
@@ -20,19 +20,26 @@ exports.getWithdrawProfitStrategyTx = exports.getCloseStrategyTx = exports.getUp
20
20
  var transactions_1 = require("@mysten/sui.js/transactions");
21
21
  var constants_1 = require("../../constants");
22
22
  function getRaiseFundTx(input) {
23
- var typusToken = input.tx.moveCall({
24
- target: "".concat(input.typusTokenPackageId, "::").concat(input.typusTokenType.split("::")[1], "::mint"),
25
- arguments: [
26
- input.tx.object(input.typusTokenRegistry),
27
- input.tx.makeMoveVec({ objects: input.raiseCoins }),
28
- input.tx.pure(input.raiseAmount),
29
- ],
30
- });
31
- var typusTokenBalance = input.tx.moveCall({
32
- target: "0x2::coin::into_balance",
33
- typeArguments: [input.typusTokenType],
34
- arguments: [input.tx.object(typusToken)],
35
- });
23
+ var typusTokenBalance = input.raiseCoins.length > 0
24
+ ? input.tx.moveCall({
25
+ target: "0x2::coin::into_balance",
26
+ typeArguments: [input.typusTokenType],
27
+ arguments: [
28
+ input.tx.object(input.tx.moveCall({
29
+ target: "".concat(input.typusTokenPackageId, "::").concat(input.typusTokenType.split("::")[1], "::mint"),
30
+ arguments: [
31
+ input.tx.object(input.typusTokenRegistry),
32
+ input.tx.makeMoveVec({ objects: input.raiseCoins }),
33
+ input.tx.pure(input.raiseAmount),
34
+ ],
35
+ })),
36
+ ],
37
+ })
38
+ : input.tx.moveCall({
39
+ target: "0x2::balance::zero",
40
+ typeArguments: [input.typusTokenType],
41
+ arguments: [],
42
+ });
36
43
  var result = input.tx.moveCall({
37
44
  target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
38
45
  typeArguments: input.typeArguments,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.2.93",
5
+ "version": "1.2.95",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",