π²Token Prices
Contract IDs
1. Fetching HTR Price (Example)
curl -s -G "https://node1.mainnet.hathor.network/v1a/nano_contract/state" \
--data-urlencode "id=000080350ca5ef204bc29b3232bb197e12bec6b473f5e6bdb749a6921197e83c" \
--data-urlencode 'calls[]=get_token_price_in_usd("00")' \
| jq '.calls["get_token_price_in_usd(\"00\")"].value / 100000000'2. Fetching Other Token Prices
Command Template
# Define the Token UID you want to check
TOKEN_UID="YOUR_TOKEN_UID_HERE"
curl -s -G "https://node1.mainnet.hathor.network/v1a/nano_contract/state" \
--data-urlencode "id=000080350ca5ef204bc29b3232bb197e12bec6b473f5e6bdb749a6921197e83c" \
--data-urlencode "calls[]=get_token_price_in_usd(\"$TOKEN_UID\")" \
| jq --arg uid "$TOKEN_UID" '.calls["get_token_price_in_usd(\"" + $uid + "\")"].value / 100000000'Example: Fetching specific Token Value
Last updated