@triadxyz/poseidons-protocol 0.3.7 → 0.3.9
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/game/index.js
CHANGED
package/dist/game/wheel.d.ts
CHANGED
|
@@ -62,7 +62,8 @@ export default class Wheel {
|
|
|
62
62
|
/**
|
|
63
63
|
* Close a wheel
|
|
64
64
|
* @param id - The id of the wheel
|
|
65
|
+
* @param isActive - The active status of the wheel
|
|
65
66
|
* @returns The transaction signature or versioned transaction
|
|
66
67
|
*/
|
|
67
|
-
closeWheel(id: number): Promise<string | VersionedTransaction>;
|
|
68
|
+
closeWheel(id: number, isActive: boolean): Promise<string | VersionedTransaction>;
|
|
68
69
|
}
|
package/dist/game/wheel.js
CHANGED
|
@@ -107,11 +107,14 @@ class Wheel {
|
|
|
107
107
|
const userPDA = (0, pda_1.getUserPDA)(user);
|
|
108
108
|
const wheelPDA = (0, pda_1.getWheelPDA)(id);
|
|
109
109
|
const ixs = [];
|
|
110
|
+
if (spins > 10) {
|
|
111
|
+
throw new Error('Spins must be less than 10');
|
|
112
|
+
}
|
|
110
113
|
if (newUser) {
|
|
111
114
|
ixs.push(yield this.program.methods
|
|
112
115
|
.createUser(refer)
|
|
113
116
|
.accounts({
|
|
114
|
-
signer:
|
|
117
|
+
signer: user,
|
|
115
118
|
payer: this.rpcOptions.payer
|
|
116
119
|
})
|
|
117
120
|
.instruction());
|
|
@@ -132,14 +135,15 @@ class Wheel {
|
|
|
132
135
|
/**
|
|
133
136
|
* Close a wheel
|
|
134
137
|
* @param id - The id of the wheel
|
|
138
|
+
* @param isActive - The active status of the wheel
|
|
135
139
|
* @returns The transaction signature or versioned transaction
|
|
136
140
|
*/
|
|
137
|
-
closeWheel(id) {
|
|
141
|
+
closeWheel(id, isActive) {
|
|
138
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
143
|
const wheelPDA = (0, pda_1.getWheelPDA)(id);
|
|
140
144
|
const ixs = [
|
|
141
145
|
yield this.program.methods
|
|
142
|
-
.closeWheel()
|
|
146
|
+
.closeWheel(isActive)
|
|
143
147
|
.accounts({
|
|
144
148
|
signer: this.program.provider.publicKey,
|
|
145
149
|
wheel: wheelPDA
|