38#define TRON_ADDR_HEX_LEN 42U
41#define TRON_SIG_HEX_LEN 130U
44#define TRON_TRC20_SELECTOR "a9059cbb"
47#define TRON_TRC20_PARAM_HEX_LEN 128U
51#define TRON_TX_MAX_EXPIRY_MS (15ULL * 60ULL * 1000ULL)
84 const char *to_hex, uint64_t amount_sun,
85 uint64_t
now_ms, uint64_t *expiration_ms);
102 char *out,
size_t out_size);
129 const char *contract_hex,
const char *to_hex,
130 uint64_t amount, uint64_t fee_limit_sun,
131 uint64_t
now_ms, uint64_t *expiration_ms);
145 char *out,
size_t out_size);
static uint64_t now_ms(void)
Unix time in ms, 0 if the clock is unset (the checks then refuse).
bool tron_tx_contract_ok(const char *raw_data_hex, const char *owner_hex, const char *to_hex, uint64_t amount_sun, uint64_t now_ms, uint64_t *expiration_ms)
Verify that a node-serialised raw_data really transfers what we asked.
bool tron_tx_trc20_ok(const char *raw_data_hex, const char *owner_hex, const char *contract_hex, const char *to_hex, uint64_t amount, uint64_t fee_limit_sun, uint64_t now_ms, uint64_t *expiration_ms)
Verify that a node-serialised raw_data really is the TRC-20 transfer we asked for.
size_t tron_trc20_param_hex(const char *to_hex, uint64_t amount, char *out, size_t out_size)
ABI-encode the arguments of transfer(address,uint256), hex.
size_t tron_varint_hex(uint64_t v, char *out, size_t out_size)
Hex-encode a value as a protobuf base-128 varint.
size_t tron_tx_envelope_hex(const char *raw_data_hex, const char *sig_hex, char *out, size_t out_size)
Build the hex of a signed Transaction protobuf for broadcasthex.