StakePoolProgram.increaseValidatorStake constructor

StakePoolProgram.increaseValidatorStake({
  1. required SolAddress stakePool,
  2. required SolAddress staker,
  3. required SolAddress withdrawAuthority,
  4. required SolAddress validatorList,
  5. required SolAddress reserveStake,
  6. required SolAddress transientStake,
  7. required SolAddress validatorStake,
  8. required SolAddress validatorVote,
  9. required StakePoolIncreaseValidatorStakeLayout layout,
})

(Staker only) Increase stake on a validator from the reserve account

Internally, this instruction splits reserve stake into a transient stake account and delegate to the appropriate validator. UpdateValidatorListBalance will do the work of merging once it's ready.

Implementation

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

  /// Stake pool staker
  required SolAddress staker,

  /// Stake pool withdraw authority
  required SolAddress withdrawAuthority,

  /// Validator list
  required SolAddress validatorList,

  /// Stake pool reserve stake
  required SolAddress reserveStake,

  /// Transient stake account
  required SolAddress transientStake,

  /// Validator stake account
  required SolAddress validatorStake,

  /// Validator vote account to delegate to
  required SolAddress validatorVote,
  required StakePoolIncreaseValidatorStakeLayout layout,
}) {
  return StakePoolProgram(
      layout: layout,
      keys: [
        stakePool.toReadOnly(),
        staker.toSigner(),
        withdrawAuthority.toReadOnly(),
        validatorList.toWritable(),
        reserveStake.toWritable(),
        transientStake.toWritable(),
        validatorStake.toReadOnly(),
        validatorVote.toReadOnly(),
        SystemProgramConst.sysvarClockPubkey.toReadOnly(),
        SystemProgramConst.sysvarRentPubkey.toReadOnly(),
        SystemProgramConst.sysvarStakeHistoryPubkey.toReadOnly(),
        StakeProgramConst.stakeConfigId.toReadOnly(),
        SystemProgramConst.programId.toReadOnly(),
        StakeProgramConst.programId.toReadOnly()
      ],
      programId: StakePoolProgramConst.programId);
}