rawJson property
Optional. Raw transaction JSON as returned by a Tron node or DApp, containing at least the fields:
- 'txID' – the expected transaction hash (hex-encoded SHA-256 of the raw bytes).
- 'raw_data' – structured transaction fields (used to deserialize the transaction).
- 'raw_data_hex'– hex-encoded serialized transaction bytes (used to compute and verify the hash, if provided).
When this field is set, transaction is ignored. The library will:
- Deserialize the transaction from
raw_datainto the internal Tron protobuf representation. - Re-serialize it to bytes and compute SHA-256, then compare against
txID. - On success, sign and encode the transaction as usual.
Possible errors:
Error_invalid_params-rawJsonis not a valid JSON string or missing required fields (txID,raw_data,raw_data_hex).Error_tx_hash_mismatch–txIDdoes not match SHA-256(raw_data_hex), indicating a tampered or malformed input.Error_not_supported–rawJsoncould not be deserialized as a known TronInternal protobuf message (i.e. not supported).
Implementation
@$pb.TagNumber(4)
$core.String get rawJson => $_getSZ(2);
Implementation
@$pb.TagNumber(4)
set rawJson($core.String value) => $_setString(2, value);