bigint or string. This prevents bugs that have caused real financial losses.
The Problem
Consider this ethers.js code:The Solution
Voltaire makes denomination a type-level concern:WeiType, you know it’s in wei. The type system enforces it.
Beyond Denominations
The same pattern applies to other Ethereum concepts that look similar but aren’t interchangeable:Address vs Hash
Both are hex strings. Both are fixed-size bytes. But mixing them is always a bug:Numeric Types
Block numbers, chain IDs, and nonces are all numbers—but semantically distinct:Crypto Types
Private keys, public keys, and signatures have critical security implications:Comparison with Other Libraries
The difference: Voltaire catches misuse at compile time. Other libraries catch it at runtime (or not at all).
Parse, Don’t Validate
Once you have a typed value, it’s guaranteed valid. This enables a powerful pattern:All Typed Values
Learn More
Branded Types
How the type system implements these guarantees
Denomination
Complete Wei/Gwei/Ether API reference

