VoteProgram.withdraw constructor

VoteProgram.withdraw({
  1. required VoteProgramWithdrawLayout layout,
  2. required SolAddress votePubkey,
  3. required SolAddress authorizedWithdrawerPubkey,
  4. required SolAddress toPubkey,
})

Generate a transaction to withdraw from a Vote account.

Implementation

factory VoteProgram.withdraw({
  required VoteProgramWithdrawLayout layout,
  required SolAddress votePubkey,
  required SolAddress authorizedWithdrawerPubkey,
  required SolAddress toPubkey,
}) {
  return VoteProgram(
      layout: layout,
      keys: [
        votePubkey.toWritable(),
        toPubkey.toWritable(),
        authorizedWithdrawerPubkey.toSigner(),
      ],
      programId: VoteProgramConst.programId);
}