RISE Logo-Light

Viem

Build with Viem on RISE

Viem is a TypeScript interface for Ethereum that provides low-level stateless primitives for interacting with Ethereum. It's lightweight, modular, and type-safe.

Why Viem?

  • Type-safe: First-class TypeScript support with inferred types
  • Lightweight: Tree-shakeable with minimal dependencies
  • Fast: Optimized for performance
  • Modular: Only import what you need
  • Modern: Built with latest JavaScript features

Quick Start

npm install viem

Basic Setup

import { createPublicClient, http } from 'viem'
import { riseTestnet } from 'viem/chains'

// Create a public client
const client = createPublicClient({
  chain: riseTestnet,
  transport: http()
})

// Get the latest block number
const blockNumber = await client.getBlockNumber()
console.log('Current block:', blockNumber)

Next Steps

Resources