@triadxyz/triad-protocol 0.0.4-beta → 0.0.5-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.
- package/dist/stake.d.ts +1 -1
- package/dist/stake.js +18 -9
- package/dist/test.js +3 -0
- package/package.json +1 -1
package/dist/stake.d.ts
CHANGED
|
@@ -118,5 +118,5 @@ export default class Stake {
|
|
|
118
118
|
* @param nftName - Name of the nft
|
|
119
119
|
*
|
|
120
120
|
*/
|
|
121
|
-
claimStakeRewards({ wallet, mint, week, stakeVault, nftName }: ClaimStakeRewardsArgs, options?: RpcOptions): Promise<
|
|
121
|
+
claimStakeRewards({ wallet, mint, week, stakeVault, nftName }: ClaimStakeRewardsArgs, options?: RpcOptions): Promise<string>;
|
|
122
122
|
}
|
package/dist/stake.js
CHANGED
|
@@ -392,9 +392,9 @@ class Stake {
|
|
|
392
392
|
const NFTRewards = (0, helpers_1.getNFTRewardsAddressSync)(this.program.programId, Stake);
|
|
393
393
|
const FromAta = (0, helpers_1.getATASync)(StakeVault, mint);
|
|
394
394
|
const ToAta = (0, helpers_1.getATASync)(wallet, mint);
|
|
395
|
-
let
|
|
395
|
+
let ixs = [];
|
|
396
396
|
for (let w of week) {
|
|
397
|
-
|
|
397
|
+
ixs.push(yield this.program.methods
|
|
398
398
|
.claimStakeRewards({
|
|
399
399
|
week: w
|
|
400
400
|
})
|
|
@@ -406,16 +406,25 @@ class Stake {
|
|
|
406
406
|
nftRewards: NFTRewards,
|
|
407
407
|
stake: Stake,
|
|
408
408
|
stakeVault: StakeVault
|
|
409
|
-
})
|
|
409
|
+
})
|
|
410
|
+
.instruction());
|
|
410
411
|
}
|
|
411
412
|
if (options === null || options === void 0 ? void 0 : options.microLamports) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
})
|
|
416
|
-
]);
|
|
413
|
+
ixs.push(web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
|
|
414
|
+
microLamports: options.microLamports
|
|
415
|
+
}));
|
|
417
416
|
}
|
|
418
|
-
|
|
417
|
+
const { blockhash } = yield this.provider.connection.getLatestBlockhash();
|
|
418
|
+
const messageV0 = new web3_js_1.TransactionMessage({
|
|
419
|
+
payerKey: wallet,
|
|
420
|
+
recentBlockhash: blockhash,
|
|
421
|
+
instructions: ixs
|
|
422
|
+
}).compileToV0Message();
|
|
423
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
424
|
+
return this.provider.sendAndConfirm(tx, [], {
|
|
425
|
+
skipPreflight: options === null || options === void 0 ? void 0 : options.skipPreflight,
|
|
426
|
+
commitment: 'confirmed'
|
|
427
|
+
});
|
|
419
428
|
});
|
|
420
429
|
}
|
|
421
430
|
}
|
package/dist/test.js
CHANGED
|
@@ -204,3 +204,6 @@ const updateStakeRewards = () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
204
204
|
console.log(`Failed chunks saved to ./src/utils/stake-season-1/stakes/2/failedChunks_${ts}.json`);
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
|
+
triadProtocol.stake
|
|
208
|
+
.getStakeByWallet(new web3_js_1.PublicKey('HTbGREt61NFttBCoANvhT58SrmUAy1sFbtCk7BQqaNYh'), constants_1.STAKE_SEASON_1)
|
|
209
|
+
.then(console.log);
|