@triadxyz/poseidons-protocol 0.3.0 → 0.3.2

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.
@@ -37,10 +37,9 @@ export default class Chest {
37
37
  * @param refer - The refer of the user
38
38
  * @returns The transaction signature or versioned transaction
39
39
  */
40
- placeChestBid({ id, coins, refer }: {
40
+ placeChestBid({ id, coins }: {
41
41
  id: number;
42
42
  coins: number;
43
- refer: PublicKey;
44
43
  }): Promise<string | import("@solana/web3.js").VersionedTransaction>;
45
44
  /**
46
45
  * Add chest winners
@@ -74,7 +74,7 @@ class Chest {
74
74
  * @param refer - The refer of the user
75
75
  * @returns The transaction signature or versioned transaction
76
76
  */
77
- placeChestBid({ id, coins, refer }) {
77
+ placeChestBid({ id, coins }) {
78
78
  return __awaiter(this, void 0, void 0, function* () {
79
79
  const instructions = [
80
80
  yield this.program.methods
@@ -84,7 +84,6 @@ class Chest {
84
84
  })
85
85
  .accounts({
86
86
  signer: this.program.provider.publicKey,
87
- refer: (0, pda_1.getUserPDA)(refer),
88
87
  user: (0, pda_1.getUserPDA)(this.program.provider.publicKey)
89
88
  })
90
89
  .instruction()
@@ -61,4 +61,10 @@ export default class Wheel {
61
61
  transaction: string;
62
62
  prize: number[];
63
63
  }>;
64
+ /**
65
+ * Close a wheel
66
+ * @param id - The id of the wheel
67
+ * @returns The transaction signature or versioned transaction
68
+ */
69
+ closeWheel(id: number): Promise<string | import("@solana/web3.js").VersionedTransaction>;
64
70
  }
@@ -118,7 +118,6 @@ class Wheel {
118
118
  }
119
119
  if (this.program.provider.publicKey.toBase58() !==
120
120
  ((_b = (_a = this.rpcOptions) === null || _a === void 0 ? void 0 : _a.payer) === null || _b === void 0 ? void 0 : _b.toBase58())) {
121
- console.log('sendVersionedTransaction');
122
121
  return (0, sendVersionedTransaction_1.default)(this.program, instructions, this.rpcOptions);
123
122
  }
124
123
  const transaction = (yield (0, sendVersionedTransaction_1.default)(this.program, instructions, this.rpcOptions));
@@ -134,5 +133,23 @@ class Wheel {
134
133
  };
135
134
  });
136
135
  }
136
+ /**
137
+ * Close a wheel
138
+ * @param id - The id of the wheel
139
+ * @returns The transaction signature or versioned transaction
140
+ */
141
+ closeWheel(id) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ const instructions = [
144
+ yield this.program.methods
145
+ .closeWheel(id)
146
+ .accounts({
147
+ signer: this.program.provider.publicKey
148
+ })
149
+ .instruction()
150
+ ];
151
+ return (0, sendVersionedTransaction_1.default)(this.program, instructions, this.rpcOptions);
152
+ });
153
+ }
137
154
  }
138
155
  exports.default = Wheel;
@@ -813,7 +813,20 @@
813
813
  },
814
814
  {
815
815
  "name": "refer",
816
- "writable": true
816
+ "writable": true,
817
+ "pda": {
818
+ "seeds": [
819
+ {
820
+ "kind": "const",
821
+ "value": [117, 115, 101, 114]
822
+ },
823
+ {
824
+ "kind": "account",
825
+ "path": "refer.authority",
826
+ "account": "User"
827
+ }
828
+ ]
829
+ }
817
830
  },
818
831
  {
819
832
  "name": "mint",
@@ -1060,6 +1073,11 @@
1060
1073
  "code": 6008,
1061
1074
  "name": "WheelIsNotActive",
1062
1075
  "msg": "Wheel is not active"
1076
+ },
1077
+ {
1078
+ "code": 6009,
1079
+ "name": "NotAuthorized",
1080
+ "msg": "Not authorized"
1063
1081
  }
1064
1082
  ],
1065
1083
  "types": [
@@ -1047,6 +1047,19 @@ export type PoseidonsProtocol = {
1047
1047
  {
1048
1048
  name: 'refer';
1049
1049
  writable: true;
1050
+ pda: {
1051
+ seeds: [
1052
+ {
1053
+ kind: 'const';
1054
+ value: [117, 115, 101, 114];
1055
+ },
1056
+ {
1057
+ kind: 'account';
1058
+ path: 'refer.authority';
1059
+ account: 'user';
1060
+ }
1061
+ ];
1062
+ };
1050
1063
  },
1051
1064
  {
1052
1065
  name: 'mint';
@@ -1351,6 +1364,11 @@ export type PoseidonsProtocol = {
1351
1364
  code: 6008;
1352
1365
  name: 'wheelIsNotActive';
1353
1366
  msg: 'Wheel is not active';
1367
+ },
1368
+ {
1369
+ code: 6009;
1370
+ name: 'notAuthorized';
1371
+ msg: 'Not authorized';
1354
1372
  }
1355
1373
  ];
1356
1374
  types: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/poseidons-protocol",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",