StakePoolProgram.depositSol constructor
StakePoolProgram.depositSol({
- required SolAddress stakePool,
- required SolAddress withdrawAuthority,
- required SolAddress reserveStake,
- required SolAddress fundingAccount,
- required SolAddress destinationPoolAccount,
- required SolAddress managerFeeAccount,
- required SolAddress referralPoolAccount,
- required SolAddress poolMint,
- required StakePoolDepositSolLayout layout,
- SolAddress? depositAuthority,
Deposit SOL directly into the pool's reserve account. The output is a "pool" token representing ownership into the pool. Inputs are converted to the current ratio.
Implementation
factory StakePoolProgram.depositSol({
/// Stake pool
required SolAddress stakePool,
/// Stake pool withdraw authority
required SolAddress withdrawAuthority,
/// Reserve stake account, to deposit SOL
required SolAddress reserveStake,
/// Account providing the lamports to be deposited into the pool
required SolAddress fundingAccount,
/// User account to receive pool tokens
required SolAddress destinationPoolAccount,
/// Account to receive fee tokens
required SolAddress managerFeeAccount,
/// Account to receive a portion of fee as referral fees
required SolAddress referralPoolAccount,
/// Pool token mint account
required SolAddress poolMint,
required StakePoolDepositSolLayout layout,
/// Stake pool sol deposit authority.
SolAddress? depositAuthority,
}) {
return StakePoolProgram(
layout: layout,
keys: [
stakePool.toWritable(),
withdrawAuthority.toReadOnly(),
reserveStake.toWritable(),
fundingAccount.toSignerAndWritable(),
destinationPoolAccount.toWritable(),
managerFeeAccount.toWritable(),
referralPoolAccount.toWritable(),
poolMint.toWritable(),
SystemProgramConst.programId.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
if (depositAuthority != null) depositAuthority.toSigner(),
],
programId: StakePoolProgramConst.programId);
}