StakeProgram.authorize constructor

StakeProgram.authorize({
  1. required StakeAuthorizeLayout layout,
  2. required SolAddress stakePubkey,
  3. required SolAddress authorizedPubkey,
  4. 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);
}