fromKindBytes static method

dynamic fromKindBytes(
  1. Uint8List bytes
)

Implementation

static fromKindBytes(Uint8List bytes) {
    final kind = SuiBcs.TransactionKind.parse(bytes);
	final programmableTx = kind["ProgrammableTransaction"];
	if (programmableTx == null) {
		throw ArgumentError('Unable to deserialize from bytes.');
	}

	final serialized = {
			"version": 2,
			"gasData": GasConfig().toJson(),
			"inputs": programmableTx["inputs"],
			"commands": programmableTx["commands"],
    };

	return TransactionBlockDataBuilder.restore(serialized);
}