Claude Code Plugins

Community-maintained marketplace

Feedback

Viem blockchain client patterns for Ethereum interactions, transactions, signing, encoding, and smart contract calls. Triggers on viem, publicClient, walletClient, chain, abi.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name viem
description Viem blockchain client patterns for Ethereum interactions, transactions, signing, encoding, and smart contract calls. Triggers on viem, publicClient, walletClient, chain, abi.
triggers viem, ox, publicClient, walletClient, transport, chain, abi, transaction, signature, encode, decode
Build blockchain interactions using viem for Ethereum clients, transactions, signing, and smart contract interactions. Viem is the modern replacement for ethers.js with better TypeScript support. **CRITICAL: Always fetch viem documentation before implementing.**
MCPSearch({ query: "select:mcp__plugin_devtools_context7__query-docs" })
// Client patterns
mcp__context7__query_docs({
  context7CompatibleLibraryID: "/wevm/viem",
  topic: "createPublicClient createWalletClient"
})

// Contract interactions
mcp__context7__query_docs({
  context7CompatibleLibraryID: "/wevm/viem",
  topic: "readContract writeContract simulateContract"
})

// Signing
mcp__context7__query_docs({
  context7CompatibleLibraryID: "/wevm/viem",
  topic: "signMessage signTypedData EIP-712"
})

// Encoding
mcp__context7__query_docs({
  context7CompatibleLibraryID: "/wevm/viem",
  topic: "encodeFunctionData decodeFunctionResult encodeAbiParameters"
})
**Create clients:**
import { createPublicClient, createWalletClient, http } from "viem";
import { mainnet } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";

const publicClient = createPublicClient({
  chain: mainnet,
  transport: http(),
});

const walletClient = createWalletClient({
  chain: mainnet,
  transport: http(),
  account: privateKeyToAccount("0x..."),
});

Read contract:

const balance = await publicClient.readContract({
  address: "0x...",
  abi: erc20Abi,
  functionName: "balanceOf",
  args: [userAddress],
});

Write contract:

const hash = await walletClient.writeContract({
  address: "0x...",
  abi: erc20Abi,
  functionName: "transfer",
  args: [recipient, amount],
});

const receipt = await publicClient.waitForTransactionReceipt({ hash });
| Client | Purpose | Example Use | |--------|---------|-------------| | `PublicClient` | Reading blockchain data | `getBlockNumber()`, `readContract()` | | `WalletClient` | Transaction signing/sending | `sendTransaction()`, `signMessage()` | | `TestClient` | Testing and simulation | `mine()`, `setBalance()` | | `BundlerClient` | ERC-4337 User Operations | `sendUserOperation()` | **Unit conversions:**
import { parseEther, formatEther, parseUnits, formatUnits } from "viem";

parseEther("1.5");           // 1500000000000000000n
formatEther(1500000000000000000n);  // "1.5"
parseUnits("100", 6);        // 100000000n (USDC)
formatUnits(100000000n, 6);  // "100"

Address utilities:

import { getAddress, isAddress } from "viem";

getAddress("0xabc...");  // Checksummed address
isAddress("0x...");      // Validates format
**Banned:** SSRF protection for config-sourced URLs (they're developer-controlled)

Required:

  • Lazy initialization for chain resolution
  • Client caching by network name
  • WebSocket cleanup on destroy/refresh
  • Type-safe ABI interactions
- [ ] Context7 docs fetched for current API - [ ] Uses lazy chain resolution - [ ] Caches clients by network name - [ ] Type-safe ABI interactions - [ ] Proper error handling for blockchain ops