Guides usage of essential-eth, a lightweight Ethereum utility library (43 kB alternative to ethers.js/web3.js). Covers providers, contracts, conversions, hashing, and address utilities. Use when writing code that imports from essential-eth.
A tree-shakeable Ethereum library using native bigint (no BigNumber). Minimal alternative to ethers.js and web3.js.
essential-eth -- full library with providers, contracts, and utilitiesessential-eth/utils -- utilities without providers (smaller)essential-eth/conversions -- unit conversions only (~1.2 kB)bigint instead of BigNumberTo see all available exports, read node_modules/essential-eth/dist/index.d.ts. This is the generated type declarations file and is always up to date.
For source code and JSDoc examples, read files in node_modules/essential-eth/dist/. Each function includes @example blocks showing usage.
Providers: JsonRpcProvider, FallthroughProvider, AlchemyProvider -- create with an RPC URL, then call methods like getBalance, getBlock, call, getLogs, resolveName.
Contracts: new Contract(address, jsonAbi, provider) -- ABI methods become async functions on the instance. Read-only.
Conversions: etherToWei, weiToEther, etherToGwei, gweiToEther, formatUnits, parseUnits -- accept string | number | bigint.
Hashing: keccak256, solidityKeccak256, id, hashMessage, namehash.
Addresses: isAddress, getAddress, toChecksumAddress, computeAddress, computePublicKey.
ABI: encodeFunctionData, decodeFunctionResult, decodeEventLog.
Bytes: arrayify, hexlify, concat, hexZeroPad, isHexString, and more.