@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.
- package/dist/src/dice/user-entry.js +16 -39
- package/package.json +1 -1
|
@@ -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,
|
|
141
|
-
return __generator(this, function (
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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: [],
|