StakePoolProgram.depositStake constructor

StakePoolProgram.depositStake({
  1. required SolAddress stakePool,
  2. required SolAddress validatorList,
  3. required SolAddress depositAuthority,
  4. required SolAddress withdrawAuthority,
  5. required SolAddress depositStake,
  6. required SolAddress validatorStake,
  7. required SolAddress reserveStake,
  8. required SolAddress destinationPoolAccount,
  9. required SolAddress managerFeeAccount,
  10. required SolAddress referralPoolAccount,
  11. 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: const 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);
}