Skip to main content

Essential Eth

A replacement for ethers & web3 that's 20x smaller

Lite

Essential Eth was designed from the ground up to be 20x smaller than ethers.js and web3.js. This compact form facilitates quicker setups and optimizes storage.

Fast

The bundle size of essential-eth is less than 5kb for most functions. Smaller bundles mean faster load times, leading to a more responsive and efficient user experience. See for yourself

Tested and Typed

Thanks to Essential Eth's slim codebase, fortified by full TypeScript integration and Jest testing, bugs have nowhere to hide – ensuring a delightful coding experience.

Easy to Try

Essential Eth matches the API of ethers.js as closely as possible. This is also similar to web3.js, so upgrading is a breeze.

Ready for Production

The reliability and stability of Essential Eth are clearly demonstrated by its extensive real-world usage. It is used in production by over 100,000 visitors per month on Earnifi 🚁

GitPOAP - Recognition for Contributions

In partnership with GitPOAP, Essential ETH wants to recognize  all contributors for their contributions toward the growth of this library. Developers can validate their contributions on Github and showcase their GitPOAP as proof-of-work toward their Web3 identity.



Utils

import { etherToWei, weiToEther } from 'essential-eth';

weiToEther(1000000000000000000).toNumber();
// 1

etherToWei('1000').toString();
// '1000000000000000000000'

import { isAddress } from 'essential-eth';

isAddress('0xc0deaf6bd3f0c6574a6a625ef2f22f62a5150eab');
// true

isAddress('bad');
// false

import { toChecksumAddress } from 'essential-eth';

toChecksumAddress('0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359');
// '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359'


JsonRpcProvider

import { JsonRpcProvider } from 'essential-eth';

const provider = new JsonRpcProvider();
await provider
.getBalance('0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8')
.then((balance) => console.log(balance.toString()));
// "28798127851528138"

FallthroughProvider

import { FallthroughProvider } from 'essential-eth';

// The FallthroughProvider handles falling through to the next valid URL.
// It's dynamic to never trust one URL again when it fails * until it has tried all other provided URLs
// The default timeout for a request is 8 seconds after which it moves to the next URL
const provider = new FallthroughProvider([
'https://bad.com',
'https://free-eth-node.com/api/eth',
]);
provider.getGasPrice().toNumber();
/*
39695942769
*/