# web3

Web3 adapter — EIP-55 address checksums, BigInt ether-unit conversion, keccak-256, ENS namehash, function selectors and mnemonic/address validation. Pure and offline: no network calls, no database...


Offline blockchain/crypto utilities — **no network calls**, all deterministic crypto/encoding math.
Keccak-256 (Ethereum's pre-NIST variant, not SHA3-256) is a zero-dependency pure-JS implementation
imported from `@leumas/web3/keccak`, verified against the `transfer(address,uint256)` → `0xa9059cbb`
selector. This pack used to carry a byte-identical second copy; the ledger core owns the one.

## Tools

| Tool | Args | Returns |
|---|---|---|
| `toChecksumAddress` | `{ address }` | EIP-55 checksummed address |
| `isValidAddress` | `{ address }` | `{ valid, checksumValid, checksum }` |
| `convertUnit` | `{ value, from, to }` | exact BigInt unit conversion |
| `weiToEth` / `ethToWei` / `gweiToWei` | `{ value }` | shortcut conversions |
| `keccak256` | `{ input, encoding? }` | `{ hash }` (0x hex) |
| `namehash` | `{ name }` | ENS namehash |
| `isValidEnsName` | `{ name }` | `{ valid }` |
| `functionSelector` | `{ signature }` | `{ selector }` (4-byte 0x) |
| `shortenAddress` | `{ address, chars? }` | `0x1234…abcd` |
| `bip39Validate` | `{ mnemonic }` | structural validity |

**Limitation:** `bip39Validate` performs a structural check (word count 12/15/18/21/24 + lowercase
words) only — full 2048-word list membership and checksum verification are not bundled offline.
On-chain lookups (balances, gas, tx) are intentionally out of scope (no network).


---
Source: shared/engines/adapters/domain/web3/README.md
Canonical: https://docs.leumas.tech/p/adapters/adapter-web3
