SPLTokenApproveLayout.fromBuffer constructor

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

Constructs an SPLTokenApproveLayout instance from buffer.

Implementation

factory SPLTokenApproveLayout.fromBuffer(List<int> bytes) {
  final decode = ProgramLayout.decodeAndValidateStruct(
      layout: _layout,
      bytes: bytes,
      instruction: SPLTokenProgramInstruction.approve.insturction);
  return SPLTokenApproveLayout(amount: decode["amount"]);
}