TypeScript Interface for Ethereum
... and a lot more.
// 1. Import modules.
import { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';
// 2. Set up your client with desired chain & transport.
const client = createPublicClient({
chain: mainnet,
transport: http(),
});
// 3. Consume an action!
const blockNumber = await client.getBlockNumber();
Head to the documentation to read and learn more about viem.
Check out the following places for more viem-related content:
If you're interested in contributing, please read the contributing docs before submitting a pull request.
MIT License