35#define TRON_RAW_HEX_MAX 768U
128 uint64_t *units_out);
176 const char *contract_hex,
177 const char *to_hex, uint64_t amount,
178 uint64_t fee_limit_sun,
A created-and-verified transfer, ready to sign and broadcast.
char raw_hex[TRON_RAW_HEX_MAX]
bool tron_rpc_get_trc20_balance(const char *owner_hex, const char *contract_hex, uint64_t *units_out)
Read an account's TRC-20 balance via a constant balanceOf call.
bool tron_rpc_get_balance(const char *owner_hex, uint64_t *sun_out)
Read an account's TRX balance, in sun.
bool tron_rpc_create_trc20_transfer(const char *owner_hex, const char *contract_hex, const char *to_hex, uint64_t amount, uint64_t fee_limit_sun, tron_tx_ctx_t *out)
Create a TRC-20 transfer (USDT, USDC, …) and verify what the node serialised for us.
bool tron_rpc_get_energy(const char *owner_hex, uint64_t *energy_out)
Read the energy an account still has available.
void tron_rpc_set_ca_cert(const char *ca_pem)
Optional: pin the Tron endpoint's TLS certificate.
bool tron_rpc_broadcast(const tron_tx_ctx_t *tx, const uint8_t sig[65])
Broadcast a created transfer with its 65-byte signature.
#define TRON_RAW_HEX_MAX
Hex capacity for a raw_data protobuf.
tron_receipt_t
Outcome of one gettransactioninfobyid poll.
bool tron_rpc_create_transfer(const char *owner_hex, const char *to_hex, uint64_t amount_sun, tron_tx_ctx_t *out)
Create a TRX transfer and verify what the node serialised for us.
tron_receipt_t tron_rpc_get_receipt(const char *txid_hex)
Poll a broadcast transaction's receipt (one shot).
void tron_rpc_init(const char *base_url)
Set the Tron HTTP API base URL (no trailing slash).
bool tron_rpc_get_trc20_decimals(const char *contract_hex, uint64_t *dec_out)
Read a TRC-20 contract's decimals() — see eth_rpc_get_token_decimals for why it has to be 6.