VoteProgramAuthorizeWithSeedLayout.fromBuffer constructor

VoteProgramAuthorizeWithSeedLayout.fromBuffer(
  1. List<int> data
)

Implementation

factory VoteProgramAuthorizeWithSeedLayout.fromBuffer(List<int> data) {
  final decode = ProgramLayout.decodeAndValidateStruct(
      layout: _layout,
      bytes: data,
      instruction: VoteProgramInstruction.authorizeWithSeed.insturction);
  final voteData =
      Map<String, dynamic>.from(decode["voteAuthorizeWithSeedArgs"]);
  return VoteProgramAuthorizeWithSeedLayout(
      newAuthorized: voteData["newAuthorized"],
      currentAuthorityDerivedKeyOwnerPubkey:
          voteData["currentAuthorityDerivedKeyOwnerPubkey"],
      currentAuthorityDerivedKeySeed:
          voteData["currentAuthorityDerivedKeySeed"],
      voteAuthorizationType: voteData["voteAuthorizationType"]);
}