VoteProgram.initializeAccount constructor

VoteProgram.initializeAccount({
  1. required VoteProgramInitializeAccountLayout layout,
  2. required SolAddress votePubKey,
  3. required SolAddress nodePubKey,
})

Generate an Initialize instruction.

Implementation

factory VoteProgram.initializeAccount(
    {required VoteProgramInitializeAccountLayout layout,
    required SolAddress votePubKey,
    required SolAddress nodePubKey}) {
  return VoteProgram(
      layout: layout,
      keys: [
        votePubKey.toWritable(),
        SystemProgramConst.sysvarRentPubkey.toReadOnly(),
        SystemProgramConst.sysvarClockPubkey.toReadOnly(),
        nodePubKey.toSigner(),
      ],
      programId: VoteProgramConst.programId);
}