How can I retrieve the default token symbol of an Ethereum network via json-rpc?

Ethereum would return "ETH"
Ethereum classic would return "ETC"

Use Web3's getChainId() to get the chain ID.

Then map the returned chain ID into the list of known networks from https://chainid.network/chains.json, where the currency symbol is in the nativeCurrency nested object.

  • Thanks for the workaround, but the actual answer is it's not possible
    – S-K'
    Apr 29 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.