StakeProgram.withdraw constructor
StakeProgram.withdraw({
- required StakeWithdrawLayout layout,
- required SolAddress stakePubkey,
- required SolAddress authorizedPubkey,
- required SolAddress toPubkey,
- SolAddress? custodianPubkey,
Generate a Transaction that withdraws deactivated Stake tokens.
Implementation
factory StakeProgram.withdraw(
{required StakeWithdrawLayout layout,
required SolAddress stakePubkey,
required SolAddress authorizedPubkey,
required SolAddress toPubkey,
SolAddress? custodianPubkey}) {
return StakeProgram(
layout: layout,
keys: [
stakePubkey.toWritable(),
toPubkey.toWritable(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SystemProgramConst.sysvarStakeHistoryPubkey.toReadOnly(),
authorizedPubkey.toSigner(),
if (custodianPubkey != null) custodianPubkey.toSigner(),
],
programId: StakeProgramConst.programId);
}