Viem
ListedViem generates React code from your Rust/Svelte/Zig code, streamlining cross-platform development and boosting developer productivity.
Install on your platform
Showing Claude Code. One command installs this skill into any of the agents below.
- 1
Run this in your project
terminal$ npx skills add 0xsardius/onchain-typescript-skills --skill viem -a claude-code Uses the open-source
skillsCLI and needs Node.js. Add-gto install it for your user instead of this project.
What we know about this skill
Publisher
0xsardius
Taken from the source listing. We haven't verified who controls this account.
Install target
Live repository
Not pinned. Installing fetches whatever the repository holds at the time you run the command.
Automated safety checks
This skill failed 1 of 6 checks. A failure is not proof of bad intent; it means something in the code needs a human to look at it before you run it.
No undeclared network calls: failed
Contacts 4 hosts that are neither well-known infrastructure nor declared in the skill's frontmatter: eth-mainnet.g.alchemy.com, mainnet.infura.io, rpc.ankr.com, rpc.mychain.com.
Every host the skill dials — from its scripts, its config endpoints or the commands it tells the agent to run — is either well-known package and API infrastructure or declared in its own frontmatter. Links in documentation are not counted.
Hosts contacted
eth-mainnet.g.alchemy.comundeclaredrpc.mychain.comundeclaredmainnet.infura.ioundeclaredrpc.ankr.comundeclaredWhat it found (3 of 6)
- skills/viem/SKILL.md:30contacts eth-mainnet.g.alchemy.com
transport: http('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY'), - skills/viem/SKILL.md:40contacts eth-mainnet.g.alchemy.com
transport: http('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY'), - skills/viem/references/common-errors.md:154contacts eth-mainnet.g.alchemy.com
http('https://eth-mainnet.g.alchemy.com/v2/KEY1'),
Declares what it does: passed
SKILL.md parses and declares a name and a description.
SKILL.md exists, its frontmatter parses, and it declares a name and a description.
No obfuscated payloads: passed
No encoded or obfuscated payloads.
No base64, hex or compressed blob is decoded and then executed, and no encoded shell commands.
No credential access: passed
Reads no keys, tokens, keychains or credential files.
Neither the code nor the SKILL.md instructions read SSH keys, cloud credentials, keychains, token stores, browser cookie databases or dotfiles that hold secrets.
No pipe-to-shell installers: passed
No pipe-to-shell or download-and-run installers.
No `curl … | sh` pattern, in the code or in the instructions, that runs code fetched at run time.
Pinned to a commit: passed
Scanned 0xsardius/onchain-typescript-skills at 098575e6c3.
The exact upstream commit SHA that was scanned is recorded, so the result refers to specific bytes.
- Commit
- 098575e6c3
- Manifest
- skills/viem/SKILL.md
- Scanned
- 3 files, 526 lines
About this skill
What it does
This skill provides a TypeScript interface for interacting with Ethereum using Viem. It streamlines common development patterns for contract interactions, client setup, and ensures type safety when working with smart contracts. The skill facilitates secure and efficient operations such as reading contract data, writing transactions, watching events, and performing batch reads via multicall.
When to use it
- Developing decentralized applications (dApps) that interact with Ethereum smart contracts.
- Building tools for managing or analyzing on-chain data.
- Implementing secure wallet interactions requiring read and write capabilities.
- Automating tasks involving Ethereum contract calls, such as simulating transactions before execution.
- Monitoring blockchain events to react to specific contract actions.
Key capabilities
- Client Setup: Creates both public (read-only) and wallet (write) clients for interacting with the Ethereum network.
- ABI Type Safety: Enforces correct usage of
as constwhen defining ABIs to ensure full type inference. - Contract Read Pattern: Provides a standardized pattern for reading data from smart contracts.
- Contract Write Pattern: Includes simulation steps before executing transactions to prevent errors.
- Event Watching: Enables monitoring of specific contract events and reacting to their occurrences.
- Multicall: Facilitates batch reads to multiple contracts efficiently.
Example prompts
- "Create a public client for interacting with the Ethereum mainnet."
- "Show me how to set up a wallet client using a private key."
- "Demonstrate reading the balance of a contract using Viem's readContract function."
- "How do I simulate a transaction before writing it to the blockchain?"
Tips & gotchas
- ABI
as const: Always useas constwhen defining ABIs to ensure proper type inference and avoid errors. - BigInt for Amounts: Use BigInt literals (e.g.,
1000000n) when specifying amounts in contract function arguments, as Ethereum uses uint256 data types. - Simulate Before Writing: Always simulate transactions using
simulateContractbefore executing them withwriteContractto catch potential errors early on.