StakeProgram.authorizeWithSeed constructor

StakeProgram.authorizeWithSeed({
  1. required StakeAuthorizeWithSeedLayout layout,
  2. required SolAddress stakePubkey,
  3. required SolAddress authorityBase,
  4. SolAddress? custodianPubkey,
})

Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account.

Implementation

factory StakeProgram.authorizeWithSeed(
    {required StakeAuthorizeWithSeedLayout layout,
    required SolAddress stakePubkey,
    required SolAddress authorityBase,
    SolAddress? custodianPubkey}) {
  return StakeProgram(
      layout: layout,
      keys: [
        stakePubkey.toWritable(),
        authorityBase.toSigner(),
        SystemProgramConst.sysvarClockPubkey.toReadOnly(),
        if (custodianPubkey != null) custodianPubkey.toSigner(),
      ],
      programId: StakeProgramConst.programId);
}