Convert from Smallest Unit (Wei)
Convert a smallest-unit integer (e.g. '3750000') back to a human-readable decimal string (e.g. '3.75' for USDC with 6 decimals). Uses string math — no floating-point errors. Works for any ERC-20 token.
Built-in action Built In
Convert a smallest-unit integer (e.g. '3750000') back to a human-readable decimal string (e.g. '3.75' for USDC with 6 decimals). Uses string math — no floating-point errors. Works for any ERC-20 token.
At a Glance
| Field | Value |
|---|---|
| Action ID | convert-from-wei |
| Category | Built In |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | utility, transformer, wei, token, conversion, onchain |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
wei | string | Yes | Integer string in smallest units (wei) to convert. Supports workflow variables like {{node.result.amount}}. |
decimals | number | Yes | Number of decimals for the token. Common values: 6 (USDC, USDT), 8 (WBTC), 18 (ETH, most ERC-20). |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
value | string | Yes | Human-readable decimal string. Trailing zeros are trimmed (e.g. '3.75' not '3.750000'). |
Examples
json{ "type": "convert-from-wei", "payload": { "wei": "3750000", "decimals": 6 }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/convert-from-wei/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "wei": "3750000", "decimals": 6 }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
