StakePoolProgram.decreaseAdditionalValidatorStake constructor
StakePoolProgram.decreaseAdditionalValidatorStake({
- required SolAddress stakePool,
- required SolAddress staker,
- required SolAddress withdrawAuthority,
- required SolAddress validatorList,
- required SolAddress validatorStake,
- required SolAddress transientStake,
- required SolAddress reserveStake,
- required SolAddress ephemeralStake,
- required StakePoolDecreaseAdditionalValidatorStakeLayout layout,
(Staker only) Decrease active stake again from a validator, eventually moving it to the reserve
Works regardless if the transient stake account already exists.
Internally, this instruction:
withdraws rent-exempt reserve lamports from the reserve into the ephemeral stake
splits a validator stake account into an ephemeral stake account deactivates the ephemeral account
merges or splits the ephemeral account into the transient stake account delegated to the appropriate validator
Implementation
factory StakePoolProgram.decreaseAdditionalValidatorStake({
/// Stake pool
required SolAddress stakePool,
/// Stake pool staker
required SolAddress staker,
/// Stake pool withdraw authority
required SolAddress withdrawAuthority,
/// Validator list
required SolAddress validatorList,
/// Canonical stake account to split from
required SolAddress validatorStake,
/// Transient stake account
required SolAddress transientStake,
/// Reserve stake account, to fund rent exempt reserve
required SolAddress reserveStake,
/// Uninitialized ephemeral stake account to receive stake
required SolAddress ephemeralStake,
required StakePoolDecreaseAdditionalValidatorStakeLayout layout,
}) {
return StakePoolProgram(
layout: layout,
keys: [
stakePool.toReadOnly(),
staker.toSigner(),
withdrawAuthority.toReadOnly(),
validatorList.toWritable(),
reserveStake.toWritable(),
validatorStake.toWritable(),
ephemeralStake.toWritable(),
transientStake.toWritable(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SystemProgramConst.sysvarStakeHistoryPubkey.toReadOnly(),
SystemProgramConst.programId.toReadOnly(),
StakeProgramConst.programId.toReadOnly()
],
programId: StakePoolProgramConst.programId);
}