From WEI
Converts cryptocurrency amounts from WEI or GWEI (hexadecimal format) to human-readable decimal format (ETH).
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Amount (GWEI) - The amount in hexadecimal format to convert (e.g., "0x0de0b6b3a7640000").
Options
- Unit - The source unit for conversion:
- WEI - Smallest unit (10^-18 ETH)
- GWEI - Gas price unit (10^-9 ETH)
- Precision - Number of decimal places in the output (default: 4).
Output
- Amount - The converted amount in decimal format (e.g., "1.2345").
How It Works
The From WEI node converts blockchain amounts to readable format. When executed, the node:
- Validates the hex format (must start with "0x")
- Converts hex to a big integer
- Divides by the appropriate factor (10^18 for WEI, 10^9 for GWEI)
- Formats to the specified precision
- Returns as a decimal string
Requirements
- Amount in hexadecimal format starting with "0x"
- Valid hex digits after the prefix
Error Handling
The node will return errors for:
- Amount not in hex format
- Amount not starting with "0x"
- Invalid hex characters
- Conversion errors
Precision Guidelines
- 1-2 decimals - For large amounts or when precision isn't critical
- 4 decimals - Default, good for most display purposes
- 6 decimals - High precision for financial applications
- 18 decimals - Maximum precision, shows full WEI value
Usage Notes
- Use this node to display amounts to users in friendly format
- The Balance node already returns amounts in ETH format
- Useful for converting raw transaction values from blockchain queries
- Higher precision shows more decimal places
- Minimum precision is 1 (always show at least one decimal)
Example
Converting 1 ETH from WEI:
Inputs:
- Amount (GWEI):
0x0de0b6b3a7640000
Options:
- Unit:
wei - Precision:
4
Output:
- Amount:
1.0000
Converting gas price from GWEI:
Inputs:
- Amount (GWEI):
0x012a05f200
Options:
- Unit:
gwei - Precision:
2
Output:
- Amount:
5.00
High precision conversion:
Inputs:
- Amount (GWEI):
0x016345785d8a0000
Options:
- Unit:
wei - Precision:
18
Output:
- Amount:
0.100000000000000000
Common Use Cases
Display Balances: Convert balance query results to user-friendly format.
Transaction Values: Show transaction amounts in readable form.
Gas Cost Display: Convert gas costs from WEI to ETH for reporting.
Price Calculations: Convert token prices to decimal for comparisons.
Audit Reports: Format blockchain data for human review.
User Notifications: Show payment amounts in emails or alerts.
Conversion Reference
From WEI to ETH:
- 1,000,000,000,000,000,000 WEI = 1.0 ETH
- 100,000,000,000,000,000 WEI = 0.1 ETH
- 10,000,000,000,000,000 WEI = 0.01 ETH
From GWEI to ETH:
- 1,000,000,000 GWEI = 1.0 ETH
- 100,000,000 GWEI = 0.1 ETH
- 10,000,000 GWEI = 0.01 ETH
Precision Examples
Same value with different precision settings:
Value: 0x016345785d8a0000 (0.1 ETH)
Precision 2:
- Output:
0.10
Precision 4:
- Output:
0.1000
Precision 6:
- Output:
0.100000
Precision 18:
- Output:
0.100000000000000000