@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.
@@ -38,7 +38,7 @@ class Game {
38
38
  ixs.push(yield this.program.methods
39
39
  .createUser(refer)
40
40
  .accounts({
41
- signer: this.program.provider.publicKey,
41
+ signer: user,
42
42
  payer: this.rpcOptions.payer
43
43
  })
44
44
  .instruction());
@@ -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
  }
@@ -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: this.program.provider.publicKey,
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
@@ -560,7 +560,12 @@
560
560
  "address": "11111111111111111111111111111111"
561
561
  }
562
562
  ],
563
- "args": []
563
+ "args": [
564
+ {
565
+ "name": "is_active",
566
+ "type": "bool"
567
+ }
568
+ ]
564
569
  },
565
570
  {
566
571
  "name": "create_chest",
@@ -735,7 +735,12 @@ export type PoseidonsProtocol = {
735
735
  address: '11111111111111111111111111111111';
736
736
  }
737
737
  ];
738
- args: [];
738
+ args: [
739
+ {
740
+ name: 'isActive';
741
+ type: 'bool';
742
+ }
743
+ ];
739
744
  },
740
745
  {
741
746
  name: 'createChest';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/poseidons-protocol",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",