EVM icon

EVM

Interact with an EVM chain

Overview

This node provides a versatile Ethereum Virtual Machine (EVM) utility with multiple operations, including a Unit Converter operation that converts values between different Ethereum units such as wei, gwei, ether, and others. The unit converter supports three types of conversions:

  • Converting from any supported unit to wei (the smallest unit).
  • Converting from wei to any other supported unit.
  • Converting between two arbitrary units.

This is useful in scenarios where you need to normalize or display token amounts in different denominations, for example:

  • Converting Ether amounts entered by users into wei for smart contract interactions.
  • Displaying balances stored in wei into human-readable Ether or Gwei.
  • Converting between intermediate units like Szabo or Finney for specialized use cases.

Practical examples:

  • A dApp backend converting user input "0.5" Ether into wei before sending a transaction.
  • A dashboard displaying wallet balances in Gwei instead of wei.
  • Automated workflows adjusting gas prices or token amounts between units dynamically.

Properties

Name Meaning
Conversion Type The type of conversion to perform. Options:
- To Wei (Base Unit): Convert from a unit to wei.
- From Wei (Base Unit): Convert from wei to another unit.
- Between Units: Convert between two different units.
Value The numeric value to convert, provided as a string. Required.
From Unit The unit to convert from. Available when Conversion Type is "To Wei" or "Between Units". Options: Wei, Kwei, Mwei, Gwei, Szabo, Finney, Ether. Default: Ether.
To Unit The unit to convert to. Available when Conversion Type is "From Wei" or "Between Units". Options: Wei, Kwei, Mwei, Gwei, Szabo, Finney, Ether. Default: Wei.

Output

The node outputs the converted value as JSON data. The output structure contains the result of the unit conversion corresponding to the input parameters. The exact field name is not explicitly shown in the source but typically includes the converted numeric value as a string or number.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential for connecting to an EVM-compatible blockchain network (e.g., Ethereum mainnet or testnets).
  • Uses the ethers library internally for unit conversion and blockchain interaction.
  • No additional external services are required specifically for the unit conversion operation.

Troubleshooting

  • Invalid Input Value: If the "Value" property is not a valid numeric string, the conversion may fail or produce incorrect results. Ensure the input is a proper decimal or integer string.
  • Unsupported Units: Only the predefined Ethereum units (wei, kwei, mwei, gwei, szabo, finney, ether) are supported. Using other units will cause errors.
  • Missing Required Fields: The "Value" field is mandatory. Omitting it will cause the node to throw an error.
  • Credential Issues: Since the node requires an API connection to an EVM chain, invalid or missing credentials can cause failures even if the unit conversion itself does not require on-chain calls.
  • Conversion Type Mismatch: Selecting incompatible combinations of "Conversion Type" and units (e.g., missing "From Unit" or "To Unit" when required) will lead to errors.

Links and References


This summary focuses exclusively on the Unit Converter operation within the EVM node, based on the provided properties and static code analysis.

Discussion