SPLTokenSwapWithdrawLayout.fromBuffer constructor

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

Constructs a SPLTokenSwapWithdrawLayout instance from the given byte array.

Implementation

factory SPLTokenSwapWithdrawLayout.fromBuffer(List<int> bytes) {
  final decode = ProgramLayout.decodeAndValidateStruct(
    layout: _layout,
    bytes: bytes,
    instruction: SPLTokenSwapProgramInstruction.withdrawToken.insturction,
  );

  return SPLTokenSwapWithdrawLayout(
    poolTokenAmount: decode["poolTokenAmount"],
    minimumTokenA: decode["minimumTokenA"],
    minimumTokenB: decode["minimumTokenB"],
  );
}