VoteProgram.authorize constructor

VoteProgram.authorize({
  1. required VoteProgramAuthorizeLayout layout,
  2. required SolAddress votePubkey,
  3. required SolAddress authorizedPubkey,
})

Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account.

Implementation

factory VoteProgram.authorize(
    {required VoteProgramAuthorizeLayout layout,
    required SolAddress votePubkey,
    required SolAddress authorizedPubkey}) {
  return VoteProgram(
      layout: layout,
      keys: [
        votePubkey.toWritable(),
        SystemProgramConst.sysvarClockPubkey.toReadOnly(),
        authorizedPubkey.toSigner(),
      ],
      programId: VoteProgramConst.programId);
}