This is your go-to for writing TypeScript that talks to Ethereum and other EVM chains outside of React apps. Think Node scripts, CLI tools, or backend services that need to read contracts, send transactions, or watch events. The skill hammers home the critical patterns like using `as const` on ABIs for type safety, always simulating contracts before writes, and handling BigInt correctly for token amounts. It's built around viem 2.x, which is genuinely cleaner than the old ethers.js patterns. If you're building a wagmi/React app, skip this and use the wagmi skill instead. This is strictly for non-hook blockchain code.

skills.sh installs
186
last updated
Aug 21, 2026

Install

$ npx -y skills add 0xsardius/onchain-typescript-skills --skill viem --agent claude-code

Installs into .claude/skills of the current project.

Files

Viem Skill

Version: Viem 2.x | Official Docs

Viem is the modern TypeScript interface for Ethereum. This skill ensures correct patterns for contract interactions, client setup, and type safety.

Quick Reference

import { createPublicClient, createWalletClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'

Critical Patterns

1. Client Setup

Public Client (read-only operations):

const publicClient = createPublicClient({
  chain: mainnet,
  transport: http('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY'),
})

Wallet Client (write operations):

const account = privateKeyToAccount('0x...')
const walletClient = createWalletClient({
  account,
  chain: mainnet,
  transport: http('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY'),
})

2. ABI Type Safety (CRITICAL)

Always use as const for ABIs to get full type inference:

Sponsors

Details

Repository
github.com/0xsardius/onchain-typescript-skills
Categories
Frontend Development, Backend & APIs, Documentation, CLI & Terminal, Finance & Trading, Web3 & Blockchain
First seen
Jun 3, 2026

More from 0xsardius/onchain-typescript-skills

All 2
1aiskillstore avatarplugin-structureaiskillstore/marketplaceThis skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plu184skills.sh installs
2blessonism avatarmineru-extractblessonism/openclaw-search-skillsUse the official MinerU (mineru.net) parsing API to convert a URL (HTML pages like WeChat articles, or direct PDF/Office/image links) into clean Markdown + stru184skills.sh installs
3aiskillstore avatarweb-artifacts-builderaiskillstore/marketplaceSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for180skills.sh installs
4hiyeshu avatarcodeck-designhiyeshu/codeckDesigner role. Reads deck.md, generates a single HTML presentation file with CSS design system + JS slide engine + per-slide content. Accepts visual references 177skills.sh installs
5harlan-zw avatarpinia-skilldharlan-zw/vue-ecosystem-skillspinia skilld170skills.sh installs
6oguzhan18 avatarnxoguzhan18/angular-ecosystem-skillsALWAYS use when working with Nx monorepo, workspace configuration, or Angular/Nx project setup.170skills.sh installs