SPLTokenSetAuthorityLayout.fromBuffer constructor

SPLTokenSetAuthorityLayout.fromBuffer(
  1. List<int> bytes
)

Constructs an SPLTokenSetAuthorityLayout instance from buffer.

Implementation

factory SPLTokenSetAuthorityLayout.fromBuffer(List<int> bytes) {
  final decode = ProgramLayout.decodeAndValidateStruct(
      layout: _layout,
      bytes: bytes,
      instruction: SPLTokenProgramInstruction.setAuthority.insturction);
  return SPLTokenSetAuthorityLayout(
      authorityType: AuthorityType.fromValue(decode["authorityType"]),
      newAuthority: decode["newAuthority"]);
}