61void eth_rpc_init(
const char *rpc_url,
const char *from_addr);
185 char *tx_hash_out,
size_t tx_hash_max,
186 char *err_out,
size_t err_max);
JSON-RPC response parsing helpers — kept in their own unit (cJSON + CW_Utils only,...
eth_rpc_receipt_result_t eth_rpc_get_tx_receipt(const eth_receipt_expect_t *want)
Poll the receipt of a broadcast transaction (one shot).
bool eth_rpc_get_nonce(uint64_t *nonce_out)
Fetch the confirmed transaction count (nonce) for from_addr.
void eth_rpc_init(const char *rpc_url, const char *from_addr)
Set the RPC URL and the from-address used for nonce queries and ecrecover comparison.
void eth_rpc_set_auth(const char *project_id, const char *api_secret)
Optional: set Infura-style HTTP Basic Auth credentials.
bool eth_rpc_get_token_decimals(const char *token_addr, uint64_t *dec_out)
Read an ERC-20 contract's decimals().
bool eth_rpc_get_balance(uint64_t *wei_out)
Fetch the native balance of from_addr, in wei.
bool eth_rpc_get_token_balance(const char *token_addr, uint64_t *units_out)
Fetch from_addr's balance of an ERC-20, via balanceOf over eth_call.
eth_rpc_receipt_result_t
Outcome of one eth_getTransactionReceipt poll.
@ ETH_RPC_RECEIPT_RPC_ERROR
@ ETH_RPC_RECEIPT_MISMATCH
@ ETH_RPC_RECEIPT_REVERTED
@ ETH_RPC_RECEIPT_PENDING
@ ETH_RPC_RECEIPT_SUCCESS
bool eth_rpc_send_raw_tx(const uint8_t *tx, size_t tx_len, char *tx_hash_out, size_t tx_hash_max, char *err_out, size_t err_max)
Broadcast a raw signed transaction (type-prefixed RLP bytes).
bool eth_rpc_err_already_known(const char *node_err)
true if a broadcast error message means the node already HAS this transaction ("already known",...
void eth_rpc_set_ca_cert(const char *ca_pem)
Optional: pin the RPC endpoint's TLS certificate.
bool eth_rpc_set_from(const char *addr)
Replace the from-address — the account a sale spends from.
What a receipt must show for the payment to count — see eth_json_receipt_check.