@triadxyz/triad-protocol 1.0.2-beta → 1.0.3-beta

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.
@@ -63,6 +63,7 @@ const updateBoost = () => __awaiter(void 0, void 0, void 0, function* () {
63
63
  update.push({ name: stake.name, wallet: stake.authority });
64
64
  }
65
65
  }
66
+ console.log(update);
66
67
  const updateBoostResponse = yield triadProtocol.stake.updateBoost({
67
68
  wallet: wallet.publicKey,
68
69
  nfts: update
@@ -146,7 +147,6 @@ const initializeQuestion = () => __awaiter(void 0, void 0, void 0, function* ()
146
147
  console.log(e);
147
148
  }
148
149
  });
149
- initializeQuestion();
150
150
  const resolveQuestion = () => __awaiter(void 0, void 0, void 0, function* () {
151
151
  const response = yield triadProtocol.trade.resolveQuestion(0);
152
152
  console.log(response);
package/dist/stake.d.ts CHANGED
@@ -82,6 +82,22 @@ export default class Stake {
82
82
  *
83
83
  */
84
84
  claimStakeRewards({ wallet, nftName, collections, rank }: ClaimStakeRewardsArgs, options?: RpcOptions): Promise<import("@solana/web3.js").Transaction>;
85
+ /**
86
+ * Claim All Stake Rewards
87
+ * @param wallet - User wallet
88
+ * @param collections - NFT collections
89
+ * @param ranks - Tensor ranks
90
+ *
91
+ */
92
+ claimAllStakeRewards({ wallet, collections, ranks }: {
93
+ wallet: PublicKey;
94
+ collections: number;
95
+ ranks: {
96
+ onchainId: string;
97
+ name: string;
98
+ rarityRankHrtt: number;
99
+ }[];
100
+ }, options?: RpcOptions): Promise<string>;
85
101
  /**
86
102
  * Update Boost
87
103
  * @param wallet - User wallet
package/dist/stake.js CHANGED
@@ -257,6 +257,38 @@ class Stake {
257
257
  return method.transaction();
258
258
  });
259
259
  }
260
+ /**
261
+ * Claim All Stake Rewards
262
+ * @param wallet - User wallet
263
+ * @param collections - NFT collections
264
+ * @param ranks - Tensor ranks
265
+ *
266
+ */
267
+ claimAllStakeRewards({ wallet, collections, ranks }, options) {
268
+ return __awaiter(this, void 0, void 0, function* () {
269
+ const stakes = yield this.getStakes();
270
+ const ixs = [];
271
+ for (const stake of stakes) {
272
+ const rank = (0, getRarityRank_1.default)(ranks, stake.mint, stake.name);
273
+ if (ixs.length >= 10) {
274
+ break;
275
+ }
276
+ const tx = yield this.claimStakeRewards({
277
+ wallet,
278
+ nftName: stake.name,
279
+ collections,
280
+ rank
281
+ });
282
+ ixs.push(...tx.instructions);
283
+ }
284
+ if (options === null || options === void 0 ? void 0 : options.microLamports) {
285
+ ixs.push(web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
286
+ microLamports: options.microLamports
287
+ }));
288
+ }
289
+ return (0, sendVersionedTransaction_1.default)(this.provider, ixs, options);
290
+ });
291
+ }
260
292
  /**
261
293
  * Update Boost
262
294
  * @param wallet - User wallet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.0.2-beta",
3
+ "version": "1.0.3-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",