Connect ETH HTTP REST API
The interface is based on Ethereum's JSON-RPC.
The following example is using ETH mainnet. Please see the supported chains and networks for all Bloq Connect supported blockchains.
TIP
The Bloq Ethereum Connect service supports calls to the blockchain: eth_
, network peers: net_
, and Web3 interface: web_
. Here is a list of Bloq supported Ethereum JSON-RPC calls.
POST eth_blockNumber
This resource returns the number of the most recent block.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | number |
Example responses
200 Response
Code sample
TIP
The hexidecimal (base-16) numerical system is default for Ethereum JSON-RPC input and output numerical values.
The followng Python can be piped into your calls to automatically convert numbers to decimal (base-10):
python3 -c "import sys, json; print(int(json.load(sys.stdin)['result'],0))"
For example, here's how to return the
eth_blockNumber
response as a decimal number:
Last updated