StakeProgram.authorize constructor
StakeProgram.authorize({
- required StakeAuthorizeLayout layout,
- required SolAddress stakePubkey,
- required SolAddress authorizedPubkey,
- SolAddress? custodianPubkey,
Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account.
Implementation
factory StakeProgram.authorize(
{required StakeAuthorizeLayout layout,
required SolAddress stakePubkey,
required SolAddress authorizedPubkey,
SolAddress? custodianPubkey}) {
return StakeProgram(
layout: layout,
keys: [
stakePubkey.toWritable(),
SystemProgramConst.sysvarClockPubkey.toWritable(),
authorizedPubkey.toSigner(),
if (custodianPubkey != null) custodianPubkey.toSigner(),
],
programId: StakeProgramConst.programId);
}