viem-v2

viem-v2 is a skill for Claude Code, Codex from blockmatic/basilic. It costs 69 tokens per session (2,000 once invoked), scanned A, a copy of viem-integration, MIT.

A set of TypeScript tools and patterns for interacting with EVM blockchains such as Ethereum.

In plain words
What is it for?
It helps set up viem, read blockchain data, send transactions, and integrate wallets with smart contracts.
Why use it?
It removes repeated setup work for reading blockchain data, sending transactions, and calling smart contracts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit It helps set up viem, read blockchain data, send transactions, and integrate wallets with smart contracts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/blockmatic/basilic/viem-v2
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add blockmatic/basilic --skill viem-v2
Clone the repo
git clone --depth 1 https://github.com/blockmatic/basilic

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for viem-v2

README.md
[![agentmods](https://agentmods.dev/badge/skills/blockmatic/basilic/viem-v2.svg)](https://agentmods.dev/skills/blockmatic/basilic/viem-v2)
Your own site
<a href="https://agentmods.dev/skills/blockmatic/basilic/viem-v2"><img src="https://agentmods.dev/badge/skills/blockmatic/basilic/viem-v2.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,000 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 86% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.02000
Opus 5 $0.00034 $0.01000
Sonnet 5 $0.00014 $0.00400
Haiku 4.5 $0.00007 $0.00200

Measured 4d ago against content hash 58aa2960f02a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

viem-v2 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

86% identical to viem-integration — 12 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/viem-v2/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

viem Integration

Integrate EVM blockchains using viem for TypeScript/JavaScript applications.

Wallet UI: React wallet connect and hooks belong in wagmi-v3. Do not add wagmi to an app that has no wallet UI yet. Use viem directly for backends, scripts, and address/signature verification.

Quick Decision Guide

Building... Use This
Node.js script/backend viem with http transport
React/Next.js frontend wagmi hooks (built on viem)
Real-time event monitoring viem with webSocket transport
Browser wallet integration wagmi or viem custom transport

Installation

# Core library
npm install viem

# For React apps, also install wagmi
npm install wagmi viem @tanstack/react-query

Core Concepts

Clients

viem uses two client types:

Client Purpose Example Use
PublicClient Read-only operations Get balances, read contracts, fetch logs
WalletClient Write operations Send transactions, sign messages

Transports

Transport Use Case
http() Standard RPC calls (most common)
webSocket() Real-time event subscriptions
custom() Browser wallets (window.ethereum)

Chains

viem includes 50+ chain definitions. Import from viem/chains:

import { mainnet, arbitrum, optimism, base, polygon } from 'viem/chains';

Input Validation Rules

Before interpolating ANY user-provided value into generated TypeScript code:

  • Ethereum addresses: MUST match ^0x[a-fA-F0-9]{40}$ — use viem's isAddress() for validation
  • Chain IDs: MUST be from viem's supported chain definitions
  • Private keys: MUST NEVER be hardcoded — always use process.env.PRIVATE_KEY with runtime validation
  • RPC URLs: MUST use https:// or wss:// protocols only
  • ABI inputs: Validate types match expected Solidity types before encoding

Read the full file on GitHub · 277 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 277 lines · 69 tokens per session scan A 58aa2960f02a

Subscribe to this mod's changes

viem-v2 is a skill published in the GitHub repository blockmatic/basilic (89 stars, last pushed yesterday), licensed MIT. It adds 69 tokens to every session and 2,000 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 86% identical to viem-integration, differing in 12 lines, and is treated as a copy.

Related

Other skills, from other repositories

starknet-js

Use when writing or debugging JavaScript/TypeScript that interacts with Starknet through the starknet.js SDK — building Call objects or calldata, encoding/decoding Cairo types (felt252, u256, structs, arrays, spans, ByteArray, Option/Result/custom enums), or working with contracts, accounts, providers, transactions…

starknet-io/starknet.js · 79 tokens

viem-integration

Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.

Uniswap/uniswap-ai · 69 tokens

wallet-cli

Operate the TypeScript TRON wallet CLI for accounts, transfers, staking, governance, contracts, signing, chain queries, and password input with wallet-cli 4.13.0. Refuse wallet passwords in argv and require the supported stdin channel. For Java REPL requests, refuse that entry and offer the TypeScript one-shot CLI…

BofAI/skills · 82 tokens

upgrade-viem

Input: optionally a target viem version. Without one, use the latest release on npm.

evmts/tevm · 0 tokens

solana

Use when working on Solana software, including one or more of: Solana client code using TypeScript, Rust libraries that use Solana crates, Anchor programs, Quasar programs, LiteSVM tests, including Rust program files, TypeScript tests, and Anchor.toml or Quasar.toml configuration. Designed to create minimal, reusable…

quicknode/solana-finance-claude-plugin · 76 tokens

bnb-chain-toolkit-guide

Guide to the BNB Chain Toolkit — a modular TypeScript toolkit for building, deploying, and interacting with smart contracts on BNB Chain. Includes BEP-20 token utilities, DeFi integrations, wallet management, and cross-chain bridging. Built for BNB Chain Hackathon by the Sperax team.

nirholas/three.ws · 67 tokens