@triadxyz/poseidons-protocol 0.5.4 → 0.5.6

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.
@@ -3,12 +3,10 @@ import { Program } from '@coral-xyz/anchor';
3
3
  import { PublicKey } from '@solana/web3.js';
4
4
  import { PoseidonsProtocol } from './../types/poseidons_protocol';
5
5
  import { RpcOptions } from './../types';
6
- import Chest from './chest';
7
6
  import Wheel from './wheel';
8
7
  export default class Game {
9
8
  private program;
10
9
  private rpcOptions;
11
- chest: Chest;
12
10
  wheel: Wheel;
13
11
  constructor(program: Program<PoseidonsProtocol>, rpcOptions: RpcOptions);
14
12
  /**
@@ -25,4 +23,9 @@ export default class Game {
25
23
  refer: PublicKey;
26
24
  isUsdc: boolean;
27
25
  }): Promise<string | import("@solana/web3.js").VersionedTransaction>;
26
+ /**
27
+ * Generate a number
28
+ * @returns The transaction signature or versioned transaction
29
+ */
30
+ generateNumber(): Promise<string | import("@solana/web3.js").VersionedTransaction>;
28
31
  }
@@ -13,7 +13,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const anchor_1 = require("@coral-xyz/anchor");
16
- const chest_1 = __importDefault(require("./chest"));
17
16
  const wheel_1 = __importDefault(require("./wheel"));
18
17
  const sendVersionedTransaction_1 = __importDefault(require("../utils/sendVersionedTransaction"));
19
18
  const pda_1 = require("../utils/pda");
@@ -23,7 +22,6 @@ class Game {
23
22
  constructor(program, rpcOptions) {
24
23
  this.program = program;
25
24
  this.rpcOptions = rpcOptions;
26
- this.chest = new chest_1.default(this.program, this.rpcOptions);
27
25
  this.wheel = new wheel_1.default(this.program, this.rpcOptions);
28
26
  }
29
27
  /**
@@ -67,5 +65,22 @@ class Game {
67
65
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions, addressLookupTableAccounts);
68
66
  });
69
67
  }
68
+ /**
69
+ * Generate a number
70
+ * @returns The transaction signature or versioned transaction
71
+ */
72
+ generateNumber() {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const ixs = [
75
+ yield this.program.methods
76
+ .generateNumber()
77
+ .accounts({
78
+ signer: this.program.provider.publicKey
79
+ })
80
+ .instruction()
81
+ ];
82
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
83
+ });
84
+ }
70
85
  }
71
86
  exports.default = Game;
@@ -180,18 +180,18 @@ class Wheel {
180
180
  payer: this.rpcOptions.payer
181
181
  })
182
182
  .instruction());
183
- ixs.push(yield this.program.methods
184
- .addWheelTicket({
185
- tickets: new anchor_1.BN(tickets),
186
- isUsdc
187
- })
188
- .accounts({
189
- signer: this.program.provider.publicKey,
190
- user: (0, pda_1.getUserPDA)(this.program.provider.publicKey),
191
- wheel: (0, pda_1.getWheelPDA)(wheelId)
192
- })
193
- .instruction());
194
183
  }
184
+ ixs.push(yield this.program.methods
185
+ .addWheelTicket({
186
+ tickets: new anchor_1.BN(tickets),
187
+ isUsdc
188
+ })
189
+ .accounts({
190
+ signer: this.program.provider.publicKey,
191
+ user: (0, pda_1.getUserPDA)(this.program.provider.publicKey),
192
+ wheel: (0, pda_1.getWheelPDA)(wheelId)
193
+ })
194
+ .instruction());
195
195
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
196
196
  });
197
197
  }