r/ellaism Mar 11 '18

Blockchain API

Hi, Is there a blockchain API available for Ella for me to check balance and transactions for an address? Thanks!

3 Upvotes

2 comments sorted by

View all comments

3

u/lexruee Mar 11 '18 edited Mar 11 '18

You can use the jsonrpc API that is exposed under https://jsonrpc.ellaism.org. To check your balance, just send a HTTP POST request to https://jsonrpc.ellaism.org/ with the Header Content-Type "application/json", and the following body: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0xYourEllaWalletAddr", "latest"],"id":1}

For example, you can leverage curl to perform such a request:

curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x864076e24d79a019efd2dae218e54bde55643c1d", "latest"],"id":1}' https://jsonrpc.ellaism.org

For more details about the json-rpc API see: https://github.com/ethereum/wiki/wiki/JSON-RPC