SPLTokenTransferLayout.fromBuffer constructor

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

Constructs an SPLTokenTransferLayout instance from buffer.

Implementation

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