validateRawTx method

Future<ValidateRawTxResponse?> validateRawTx(
  1. List<int> txBytes
)

Validate a raw transaction Returns null for valid transactions, or an error message for invalid ones

Implementation

Future<ValidateRawTxResponse?> validateRawTx(List<int> txBytes) async {
  if (txBytes.isEmpty) {
    throw ValidationException('Transaction bytes cannot be empty');
  }

  try {
    await _proxy.post('/validate-tx', txBytes);
    return null; // Valid transaction
  } on ChronikException catch (e) {
    return ValidateRawTxResponse(error: e.message);
  }
}