Context
Using the Avalanche Explorer, I selected a random address that has some AVAX in it:
https://cchain.explorer.avax.network/address/0xB9F79Fc4B7A2F5fB33493aB5D018dB811c9c2f02/transactions
At the time that I looked that address up, the AVAX balance is around 39,166:
Code
I'm using the following REST call to retreive the balance of that address:
curl --location --request POST 'https://api.avax.network/ext/bc/C/rpc' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0xB9F79Fc4B7A2F5fB33493aB5D018dB811c9c2f02",
"latest"
],
"id": 1
}'
At the time that I made the call, it returned the following:
{"jsonrpc":"2.0","id":1,"result":"0x8868dc30a5d07460032"}
Question
As you can see, the balance comes back as:
0x8868dc30a5d07460032
What's the recommended way to convert that to the decimal balance?
Feel free to point me to the right place in the developer documentation if this is discussed there.
Thanks!