I want to validate Transactions to make sure they are actual Cardano txs with correct length, format etc.
I see that Transaction object in emurgo serialization library has an 'is_valid()' method that I guess returns if tx is valid or not.
The point is that I have the txHash (random example: 5ea96bdc7ab5e13c68838482eedf7b97382310f450bade5589bf500fed894ed7).
I am trying to convert from the txHash to the Transaction object, but library returns an error:
"Deserialization failed in Transaction because: Invalid cbor: not the right type, expected Array' byte received
Bytes'"
This is what i am trying:
var txBytes = Buffer.from(txHash, 'hex');
const tx = WASM.Transaction.from_bytes(
txBytes
);
isValid = tx.is_valid();
Any idea how can i get Transaction object from a txHash?
Thanks