@typus/typus-sdk 1.5.8-split-coins → 1.5.8-split-coins-b

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.
@@ -137,8 +137,8 @@ function playGuessTx(config, tx, input) {
137
137
  }
138
138
  function newGamePlayGuessTx(config, tx, input) {
139
139
  return __awaiter(this, void 0, void 0, function () {
140
- var registry, _a, coin;
141
- return __generator(this, function (_b) {
140
+ var registry, coin;
141
+ return __generator(this, function (_a) {
142
142
  registry = "";
143
143
  switch (input.module) {
144
144
  case "tails_exp":
@@ -150,43 +150,20 @@ function newGamePlayGuessTx(config, tx, input) {
150
150
  default:
151
151
  break;
152
152
  }
153
- if (input.typeArguments[0] == "0x2::sui::SUI" ||
154
- input.typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
155
- _a = __read(tx.splitCoins(tx.gas, [tx.pure.u64(input.amount)]), 1), coin = _a[0];
156
- tx.moveCall({
157
- target: "".concat(config.package.dice, "::").concat(input.module, "::new_game"),
158
- typeArguments: input.typeArguments,
159
- arguments: input.module == "combo_dice"
160
- ? [
161
- tx.object(config.registry.dice.comboDice),
162
- tx.object(config.registry.dice.tailsExp),
163
- tx.pure.u64(input.index),
164
- tx.makeMoveVec({ elements: [coin] }),
165
- tx.pure.u64(input.amount),
166
- ]
167
- : [tx.object(registry), tx.pure.u64(input.index), tx.makeMoveVec({ elements: [coin] }), tx.pure.u64(input.amount)],
168
- });
169
- }
170
- else {
171
- tx.moveCall({
172
- target: "".concat(config.package.dice, "::").concat(input.module, "::new_game"),
173
- typeArguments: input.typeArguments,
174
- arguments: input.module == "combo_dice"
175
- ? [
176
- tx.object(config.registry.dice.comboDice),
177
- tx.object(config.registry.dice.tailsExp),
178
- tx.pure.u64(input.index),
179
- tx.makeMoveVec({ elements: input.coins.map(function (id) { return tx.object(id); }) }),
180
- tx.pure.u64(input.amount),
181
- ]
182
- : [
183
- tx.object(registry),
184
- tx.pure.u64(input.index),
185
- tx.makeMoveVec({ elements: input.coins.map(function (id) { return tx.object(id); }) }),
186
- tx.pure.u64(input.amount),
187
- ],
188
- });
189
- }
153
+ coin = (0, utils_1.splitCoins)(tx, input.typeArguments[0], input.coins, input.amount);
154
+ tx.moveCall({
155
+ target: "".concat(config.package.dice, "::").concat(input.module, "::new_game"),
156
+ typeArguments: input.typeArguments,
157
+ arguments: input.module == "combo_dice"
158
+ ? [
159
+ tx.object(config.registry.dice.comboDice),
160
+ tx.object(config.registry.dice.tailsExp),
161
+ tx.pure.u64(input.index),
162
+ tx.makeMoveVec({ elements: [coin] }),
163
+ tx.pure.u64(input.amount),
164
+ ]
165
+ : [tx.object(registry), tx.pure.u64(input.index), tx.makeMoveVec({ elements: [coin] }), tx.pure.u64(input.amount)],
166
+ });
190
167
  // tx.moveCall({
191
168
  // target: `${config.package.dice}::${input.module}::play_guess`,
192
169
  // 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.5.8-split-coins",
5
+ "version": "1.5.8-split-coins-b",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.9.34",