StakePoolProgram.withdrawStake constructor

StakePoolProgram.withdrawStake({
  1. required SolAddress stakePool,
  2. required SolAddress validatorList,
  3. required SolAddress withdrawAuthority,
  4. required SolAddress validatorStake,
  5. required SolAddress destinationStake,
  6. required SolAddress destinationStakeAuthority,
  7. required SolAddress sourceTransferAuthority,
  8. required SolAddress sourcePoolAccount,
  9. required SolAddress managerFeeAccount,
  10. required SolAddress poolMint,
  11. required StakePoolWithdrawStakeLayout layout,
})

Withdraw the token from the pool at the current ratio.

Implementation

factory StakePoolProgram.withdrawStake({
  /// Stake pool
  required SolAddress stakePool,

  /// Validator stake list storage account
  required SolAddress validatorList,

  /// Stake pool withdraw authority
  required SolAddress withdrawAuthority,

  /// Validator or reserve stake account to split
  required SolAddress validatorStake,

  /// Unitialized stake account to receive withdrawal
  required SolAddress destinationStake,

  /// User account to set as a new withdraw authority
  required SolAddress destinationStakeAuthority,

  /// User transfer authority, for pool token account
  required SolAddress sourceTransferAuthority,

  /// User account with pool tokens to burn from
  required SolAddress sourcePoolAccount,

  /// Account to receive pool fee tokens
  required SolAddress managerFeeAccount,

  /// Pool token mint account
  required SolAddress poolMint,
  required StakePoolWithdrawStakeLayout layout,
}) {
  return StakePoolProgram(
      layout: layout,
      keys: [
        stakePool.toWritable(),
        validatorList.toWritable(),
        withdrawAuthority.toReadOnly(),
        validatorStake.toWritable(),
        destinationStake.toWritable(),
        destinationStakeAuthority.toReadOnly(),
        sourceTransferAuthority.toSigner(),
        sourcePoolAccount.toWritable(),
        managerFeeAccount.toWritable(),
        poolMint.toWritable(),
        SystemProgramConst.sysvarClockPubkey.toReadOnly(),
        SPLTokenProgramConst.tokenProgramId.toReadOnly(),
        StakeProgramConst.programId.toReadOnly()
      ],
      programId: StakePoolProgramConst.programId);
}