SPLTokenUiAmountToAmountLayout.fromBuffer constructor

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

Constructs an SPLTokenUiAmountToAmountLayout instance from buffer.

Implementation

factory SPLTokenUiAmountToAmountLayout.fromBuffer(List<int> bytes) {
  final length = bytes.length - 1;
  final decode = ProgramLayout.decodeAndValidateStruct(
      layout: _layout(length),
      bytes: bytes,
      instruction: SPLTokenProgramInstruction.uiAmountToAmount.insturction);
  return SPLTokenUiAmountToAmountLayout(
      amount: StringUtils.decode(decode["amount"]));
}