@streamflow/staking 12.3.0 → 12.4.0
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/cjs/index.cjs +8 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +8 -5
- package/dist/esm/index.d.ts +8 -5
- package/dist/esm/index.js +8 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -7908,15 +7908,16 @@ var SolanaStakingClient = class {
|
|
|
7908
7908
|
}
|
|
7909
7909
|
async prepareStakeInstructions({ nonce, amount, duration, stakePool, stakePoolMint, tokenProgramId = splToken.TOKEN_PROGRAM_ID }, extParams) {
|
|
7910
7910
|
const { stakePoolProgram } = this.programs;
|
|
7911
|
-
const
|
|
7912
|
-
common.invariant(
|
|
7911
|
+
const invoker = extParams.invoker.publicKey;
|
|
7912
|
+
common.invariant(invoker, "Undefined invoker publicKey");
|
|
7913
|
+
const staker = extParams.authority ?? invoker;
|
|
7913
7914
|
const poolMintAccountKey = splToken.getAssociatedTokenAddressSync(common.pk(stakePoolMint), staker, true, common.pk(tokenProgramId));
|
|
7914
7915
|
const instruction = await stakePoolProgram.methods.stake(nonce, amount, duration).accounts({
|
|
7915
7916
|
stakePool,
|
|
7916
7917
|
tokenProgram: tokenProgramId,
|
|
7917
7918
|
from: poolMintAccountKey,
|
|
7918
7919
|
authority: staker,
|
|
7919
|
-
payer:
|
|
7920
|
+
payer: invoker
|
|
7920
7921
|
}).instruction();
|
|
7921
7922
|
return { ixs: [instruction] };
|
|
7922
7923
|
}
|
|
@@ -8187,10 +8188,11 @@ var SolanaStakingClient = class {
|
|
|
8187
8188
|
async prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType = "fixed" }, extParams) {
|
|
8188
8189
|
const rewardPoolProgram = this.getRewardProgram(rewardPoolType);
|
|
8189
8190
|
const { stakePoolProgram } = this.programs;
|
|
8190
|
-
const
|
|
8191
|
-
common.invariant(
|
|
8191
|
+
const invoker = extParams.invoker.publicKey;
|
|
8192
|
+
common.invariant(invoker, "Undefined invoker publicKey");
|
|
8193
|
+
const staker = extParams.authority ?? invoker;
|
|
8192
8194
|
const instruction = await rewardPoolProgram.methods.createEntry().accounts({
|
|
8193
|
-
payer:
|
|
8195
|
+
payer: invoker,
|
|
8194
8196
|
authority: staker,
|
|
8195
8197
|
stakeEntry: deriveStakeEntryPDA(stakePoolProgram.programId, common.pk(stakePool), staker, depositNonce),
|
|
8196
8198
|
rewardPool: deriveRewardPoolPDA(rewardPoolProgram.programId, common.pk(stakePool), common.pk(rewardMint), rewardPoolNonce)
|