Getting Started
Get started with viem in just a few lines of code.
Overview
viem is a TypeScript interface for Ethereum that provides low-level stateless primitives for interacting with Ethereum. viem is focused on developer experience, stability, bundle size, and performance:
- Developer experience Automatic type safety and inference, comprehensive documentation, composable APIs.
- Stability Test suite runs against forked Ethereum networks, complete test coverage.
- Bundle size Tree-shakable lightweight modules.
- Performance Optimized encoding/parsing, async tasks only when necessary.
You can learn more about the rationale behind the project in the Why viem section.
Installation
Quick Start
1. Set up your Client & Transport
Firstly, set up your Client with a desired Transport & Chain.
import { , } from 'viem'
import { } from 'viem/chains'
const = ({
: ,
: (),
}) 2. Consume Actions
Now that you have a Client set up, you can now interact with Ethereum and consume Actions!
import { , } from 'viem'
import { } from 'viem/chains'
const = ({
: ,
: (),
})
const = await .()