@ignitionfi/spl-stake-pool 1.1.23 → 1.1.24

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.
@@ -1553,9 +1553,9 @@ class StakePoolInstruction {
1553
1553
  }
1554
1554
  /**
1555
1555
  * Creates a transaction instruction to withdraw WSOL from a stake pool using a session.
1556
+ * Rent for ATA creation (if needed) is paid from the withdrawal amount.
1556
1557
  */
1557
1558
  static withdrawWsolWithSession(params) {
1558
- var _a;
1559
1559
  const type = STAKE_POOL_INSTRUCTION_LAYOUTS.WithdrawWsolWithSession;
1560
1560
  const data = encodeData(type, {
1561
1561
  poolTokensIn: params.poolTokensIn,
@@ -1576,7 +1576,6 @@ class StakePoolInstruction {
1576
1576
  { pubkey: params.tokenProgramId, isSigner: false, isWritable: false },
1577
1577
  { pubkey: params.wsolMint, isSigner: false, isWritable: false },
1578
1578
  { pubkey: params.programSigner, isSigner: false, isWritable: true },
1579
- { pubkey: (_a = params.payer) !== null && _a !== void 0 ? _a : params.userTransferAuthority, isSigner: true, isWritable: true },
1580
1579
  { pubkey: params.userWallet, isSigner: false, isWritable: false },
1581
1580
  { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
1582
1581
  ];
@@ -1597,6 +1596,7 @@ class StakePoolInstruction {
1597
1596
  }
1598
1597
  /**
1599
1598
  * Creates a transaction instruction to withdraw stake from a stake pool using a Fogo session.
1599
+ * The stake account is created as a PDA and rent is paid from the withdrawal amount.
1600
1600
  */
1601
1601
  static withdrawStakeWithSession(params) {
1602
1602
  const type = STAKE_POOL_INSTRUCTION_LAYOUTS.WithdrawStakeWithSession;
@@ -1620,7 +1620,6 @@ class StakePoolInstruction {
1620
1620
  { pubkey: params.tokenProgramId, isSigner: false, isWritable: false },
1621
1621
  { pubkey: StakeProgram.programId, isSigner: false, isWritable: false },
1622
1622
  { pubkey: params.programSigner, isSigner: false, isWritable: false },
1623
- { pubkey: params.payer, isSigner: true, isWritable: true },
1624
1623
  { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
1625
1624
  ];
1626
1625
  return new TransactionInstruction({
@@ -2195,8 +2194,9 @@ async function withdrawSol(connection, stakePoolAddress, tokenOwner, solReceiver
2195
2194
  }
2196
2195
  /**
2197
2196
  * Creates instructions required to withdraw wSOL from a stake pool.
2197
+ * Rent for ATA creation (if needed) is paid from the withdrawal amount.
2198
2198
  */
2199
- async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, minimumLamportsOut = 0, solWithdrawAuthority, payer) {
2199
+ async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, minimumLamportsOut = 0, solWithdrawAuthority) {
2200
2200
  const stakePoolAccount = await getStakePoolAccount(connection, stakePoolAddress);
2201
2201
  const stakePoolProgramId = getStakePoolProgramId(connection.rpcEndpoint);
2202
2202
  const stakePool = stakePoolAccount.account.data;
@@ -2229,7 +2229,6 @@ async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSes
2229
2229
  wsolMint: NATIVE_MINT,
2230
2230
  programSigner,
2231
2231
  userWallet: userPubkey,
2232
- payer,
2233
2232
  poolTokensIn: poolTokens,
2234
2233
  minimumLamportsOut,
2235
2234
  }));
@@ -2264,13 +2263,12 @@ async function findNextUserStakeSeed(connection, programId, userPubkey, startSee
2264
2263
  * Withdraws stake from a stake pool using a Fogo session.
2265
2264
  *
2266
2265
  * The on-chain program creates stake account PDAs, so no pre-creation step is needed.
2267
- * The paymaster payer provides rent for the stake account PDAs.
2266
+ * Rent for the stake account PDAs is paid from the withdrawal amount.
2268
2267
  *
2269
2268
  * @param connection - Solana connection
2270
2269
  * @param stakePoolAddress - The stake pool to withdraw from
2271
2270
  * @param signerOrSession - The session signer public key
2272
2271
  * @param userPubkey - User's wallet (used for PDA derivation and token ownership)
2273
- * @param payer - Payer for stake account rent (paymaster payer in session context)
2274
2272
  * @param amount - Amount of pool tokens to withdraw
2275
2273
  * @param userStakeSeedStart - Starting seed for user stake PDA derivation (default: 0)
2276
2274
  * @param useReserve - Whether to withdraw from reserve (default: false)
@@ -2278,7 +2276,7 @@ async function findNextUserStakeSeed(connection, programId, userPubkey, startSee
2278
2276
  * @param minimumLamportsOut - Minimum lamports to receive (slippage protection)
2279
2277
  * @param validatorComparator - Optional comparator for validator selection
2280
2278
  */
2281
- async function withdrawStakeWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, payer, amount, userStakeSeedStart = 0, useReserve = false, voteAccountAddress, minimumLamportsOut = 0, validatorComparator) {
2279
+ async function withdrawStakeWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, userStakeSeedStart = 0, useReserve = false, voteAccountAddress, minimumLamportsOut = 0, validatorComparator) {
2282
2280
  const stakePoolAccount = await getStakePoolAccount(connection, stakePoolAddress);
2283
2281
  const stakePoolProgramId = getStakePoolProgramId(connection.rpcEndpoint);
2284
2282
  const stakePool = stakePoolAccount.account.data;
@@ -2356,7 +2354,6 @@ async function withdrawStakeWithSession(connection, stakePoolAddress, signerOrSe
2356
2354
  poolMint: stakePool.poolMint,
2357
2355
  tokenProgramId: stakePool.tokenProgramId,
2358
2356
  programSigner,
2359
- payer,
2360
2357
  poolTokensIn: withdrawAccount.poolAmount.toNumber(),
2361
2358
  minimumLamportsOut,
2362
2359
  userStakeSeed,