StakePoolProgram.depositStake constructor
StakePoolProgram.depositStake({
- required SolAddress stakePool,
- required SolAddress validatorList,
- required SolAddress depositAuthority,
- required SolAddress withdrawAuthority,
- required SolAddress depositStake,
- required SolAddress validatorStake,
- required SolAddress reserveStake,
- required SolAddress destinationPoolAccount,
- required SolAddress managerFeeAccount,
- required SolAddress referralPoolAccount,
- required SolAddress poolMint,
Deposit some stake into the pool. The output is a "pool" token representing ownership into the pool. Inputs are converted to the current ratio.
Implementation
factory StakePoolProgram.depositStake({
/// Stake pool
required SolAddress stakePool,
/// Validator stake list storage account
required SolAddress validatorList,
/// Stake pool deposit authority
required SolAddress depositAuthority,
/// Stake pool withdraw authority
required SolAddress withdrawAuthority,
/// Stake account to join the pool (withdraw authority for the
/// stake account should be first set to the stake pool deposit
/// authority)
required SolAddress depositStake,
/// Validator stake account for the stake account to be merged
required SolAddress validatorStake,
/// Reserve stake account, to withdraw rent exempt reserve
required SolAddress reserveStake,
/// User account to receive pool tokens
required SolAddress destinationPoolAccount,
/// Account to receive pool fee tokens
required SolAddress managerFeeAccount,
/// Account to receive a portion of pool fee tokens as referral
/// fees
required SolAddress referralPoolAccount,
/// Pool token mint account
required SolAddress poolMint,
}) {
return StakePoolProgram(
layout: StakePoolDepositStakeLayout(),
keys: [
stakePool.toWritable(),
validatorList.toWritable(),
depositAuthority.toReadOnly(),
withdrawAuthority.toReadOnly(),
depositStake.toWritable(),
validatorStake.toWritable(),
reserveStake.toWritable(),
destinationPoolAccount.toWritable(),
managerFeeAccount.toWritable(),
referralPoolAccount.toWritable(),
poolMint.toWritable(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SystemProgramConst.sysvarStakeHistoryPubkey.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
StakeProgramConst.programId.toReadOnly()
],
programId: StakePoolProgramConst.programId);
}