Blockchain Explorer icon

Blockchain Explorer

Interact with multiple blockchain networks via their explorer APIs (Etherscan-compatible)

Overview

This node interacts with multiple blockchain networks through their explorer APIs that are compatible with Etherscan. Specifically, for the Token resource and the Get Token Supply operation, it retrieves the total supply of a token by querying its contract address on the selected blockchain network.

This is useful when you want to programmatically obtain the circulating or total supply of a specific token on various blockchains such as Ethereum, Binance Smart Chain, Polygon, Avalanche, and others supported by the node.

Practical examples:

  • Fetching the total supply of a DeFi token on Ethereum to display in a dashboard.
  • Monitoring token supplies across different chains for portfolio analysis.
  • Integrating token supply data into automated reports or alerts.

Properties

Name Meaning
Network The blockchain network to query. Options include: Arbitrum, Avalanche, Binance Smart Chain, Celo, Cronos, Ethereum, Fantom, Moonbeam, Optimism, Polygon. Default is Ethereum.
Contract Address The contract address of the token to query. This must be a valid blockchain address (e.g., starting with "0x..."). Required field.

Output

The output JSON contains the following fields:

  • network: The blockchain network queried.
  • resource: The resource type, here always "token".
  • operation: The operation performed, here "getTokenSupply".
  • Additional fields returned from the blockchain explorer API response, typically including:
    • status: Status code of the API response (e.g., "1" for success).
    • message: Message describing the result (e.g., "OK").
    • result: The actual token supply value as a string, usually representing the total supply in the smallest unit (like wei for Ethereum tokens).

The output is paired with the input item index for traceability.

Note: This node does not output binary data.

Dependencies

  • Requires an API key credential for a blockchain explorer service compatible with Etherscan APIs.
  • The node uses Axios HTTP client internally to make requests to the explorer API.
  • The base URL for the API depends on the selected network and environment configuration.
  • Proper network selection and valid contract addresses are necessary for successful queries.

Troubleshooting

  • Common issues:

    • Invalid or missing contract address will cause the API to return errors.
    • Using an unsupported or incorrect network name may lead to failed requests.
    • API key quota limits or invalid API keys can result in authentication errors.
    • Network connectivity issues can cause request failures.
  • Error messages:

    • API Error: <message> indicates the blockchain explorer API returned an error. Check the contract address and network parameters.
    • Errors related to credentials mean the API key is missing or invalid; ensure the API key credential is configured correctly.
    • If the node throws errors about parameter validation, verify that required properties like contract address are provided and correctly formatted.
  • How to resolve:

    • Double-check the contract address format and correctness.
    • Confirm the selected network matches the token's deployed chain.
    • Ensure the API key credential is set up and has sufficient permissions/quota.
    • Retry after fixing any network or parameter issues.

Links and References

Discussion