Use this file to discover all available pages before exploring further.
Voltaire provides two API styles: a convenient constructor API with methods, and a functional API for tree-shaking. Both use identical function signatures. This documentation covers the constructor API, which is recommended for most use cases—the functional API follows identical signatures with the object as the first parameter.
For maximum tree-shaking, import only the functions you need:
import { from, toHex, equals } from '@tevm/voltaire/Address'const addr = from('0x742d35Cc6634C0532925a3b844Bc9e7595f51e3e')toHex(addr) // Only these 3 functions in bundleequals(addr, other)
Some functions require crypto dependencies. The functional API exposes factory functions for these:
import { ToChecksummed, CalculateCreateAddress } from '@tevm/voltaire/Address'import { hash as keccak256 } from '@tevm/voltaire/Keccak256'import { encode as rlpEncode } from '@tevm/voltaire/Rlp'// Create functions with injected dependenciesconst toChecksummed = ToChecksummed({ keccak256 })const calculateCreateAddress = CalculateCreateAddress({ keccak256, rlpEncode })// Now use themtoChecksummed(addr) // Only pulls in the crypto you actually use
The default exports (toChecksummed, calculateCreateAddress) have crypto pre-injected for convenience.