Open drunkirishcoder opened 10 months ago
raw_data_hex
is the hex format of transaction.raw_data
and it does't include information of txID
and signature
.
As raw_data
and raw_data_hex
appear together, you can get what you want through raw_data
property.
Isn't txID
just sha256
of the raw data bytes? also raw_data_hex
can contain signatures as well if I'm not mistaken, because this endpoint exists.
anyway, without going into details, I have an use case where I have the raw_data_hex
but not raw_data
, and would be nice if TronWeb can deserialize it.
Yes, txID
is just sha256
of the raw data bytes. And raw_data_hex
only contains the infomation of raw_data
. When you get a transaction after deserializing the raw_data_hex
, you must sign the transaction again to get signature.
The raw_data
interface is as following:
message raw {
bytes ref_block_bytes = 1;
int64 ref_block_num = 3;
bytes ref_block_hash = 4;
int64 expiration = 8;
repeated authority auths = 9;
bytes data = 10;
repeated Contract contract = 11;
bytes scripts = 12;
int64 timestamp = 14;
int64 fee_limit = 18;
}
We will consider to support this feature in a later version. Thanks for your suggestion.
Would be nice if TronWeb supports deserializing the
raw_data_hex
back into a transaction object. Currently, the lib supports going from transactionBuilder to a binary hex, but there's no way to go in reverse. Though all the necessary protobuf definition and transaction definitions are there. Would be nice to be able to do the reverse.