Skip to main content

Voltaire

Modern, high-performance Ethereum library for TypeScript

claude mcp add --transport http voltaire https://voltaire.tevm.sh/mcp

Type-Safe Primitives & Crypto

Branded types, denomination safety, ABI encoding, and WASM-accelerated cryptography.

import { Address, Wei } from '@tevm/voltaire'
import { Hex } from '@tevm/voltaire/Hex'
import { Keccak256 } from '@tevm/voltaire/Keccak256'
import { Rlp } from '@tevm/voltaire/Rlp'
import { Abi } from '@tevm/voltaire/Abi'

// Branded types - Address and Hash are distinct types
const addr = Address('0x742d35Cc6634C0532925a3b844Bc9e7595f51e3e')
console.log(addr.toChecksummed()) // "0x742d35Cc..."

// Denomination safety - Wei and Gwei can't be mixed
const value = Wei(1000000000000000000n)
console.log(Wei.toEther(value)) // "1"

// WASM-accelerated Keccak256
const hash = Keccak256('hello')
const selector = Keccak256.selector('transfer(address,uint256)')
// Uint8Array(4) [0xa9, 0x05, 0x9c, 0xbb]

// RLP encoding
const encoded = Rlp.encode([addr, Hex.fromNumber(42n)])

// ABI encoding with full type inference
const calldata = Abi.Function.encodeParams({
  type: 'function', name: 'transfer',
  inputs: [{ type: 'address', name: 'to' }, { type: 'uint256', name: 'amount' }],
  outputs: [{ type: 'bool' }], stateMutability: 'nonpayable'
} as const, ['0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 1000000000000000000n])

Need Providers, Signers, or Contract Interactions?

Voltaire focuses on primitives and cryptography. For providers, signers, contract reads/writes, and composable Effect.ts operations, use voltaire-effect.

🌐

Providers

HTTP, WebSocket, and fallback transports with retry and rate limiting

🔑

Signers

HD wallets, private key signers, and EIP-712 typed data signing

📜

Contracts

Type-safe contract reads, writes, and event subscriptions

Effect.ts

Composable operations with typed errors, retries, and timeouts