
ethers-js
JavaScript library for interacting with Ethereum blockchain, including wallet management and smart contract calls.
- Installs
- 62
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/alphaonedev/openclaw-graph --skill ethers-js- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ethers-js automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
ethers-js
Purpose
Ethers.js is a JavaScript library for interacting with the Ethereum blockchain, enabling developers to manage wallets, sign transactions, and call smart contracts programmatically. It abstracts low-level Ethereum APIs for easier integration in web and Node.js applications.
When to Use
Use ethers.js when building Ethereum-based dApps that require wallet operations, transaction handling, or smart contract interactions in JavaScript environments. It's ideal for projects needing a lightweight alternative to Web3.js, especially for browser-based or server-side Ethereum scripting.
Key Capabilities
- Wallet management: Create, import, and derive wallets using mnemonic phrases or private keys.
- Provider support: Connect to Ethereum nodes via HTTP, WebSocket, or third-party services like Infura.
- Transaction handling: Sign and send transactions, including gas estimation and nonce management.
- Smart contract interactions: Read and write to contracts using ABI definitions, with support for events and multicall.
- Utility functions: Encode/decode data, handle big numbers, and compute hashes for Ethereum-specific tasks.
Usage Patterns
Always import ethers.js as a module in your JavaScript file. Initialize a provider first, then create a wallet or signer. For asynchronous operations, use async/await patterns. Set up error catching around all blockchain calls to handle network failures. Use environment variables for sensitive data like private keys (e.g., process.env.PRIVATE_KEY).
Common Commands/API
- Create a wallet: Use
ethers.Wallet.createRandom()to generate a new wallet.const ethers = require('ethers'); const wallet = ethers.Wallet.createRandom(); console.log(wallet.address); - Connect to a provider: Specify a URL or use Infura with an API key.
const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/' + process.env.INFURA_API_KEY); - Call a smart contract: Use
Contractclass with ABI and address.const contract = new ethers.Contract(address, abi, signer); const result = await contract.functionName(arg1); - Sign and send a transaction: Prepare and broadcast via signer.
const tx = await signer.sendTransaction({ to: '0xAddress', value: ethers.utils.parseEther('1.0') });
Integration Notes
Integrate ethers.js into Node.js projects by installing via npm: npm install ethers. For browser use, include via a CDN or bundle with Webpack. If using third-party providers like Infura, set the API key in an environment variable (e.g., $INFURA_API_KEY) and pass it to the provider URL. Handle Web3 compatibility by using ethers.js's Web3Provider wrapper if needed. For testing, use Hardhat or Ganache and connect with a local provider like new ethers.providers.JsonRpcProvider('http://localhost:8545').
Error Handling
Wrap all ethers.js calls in try/catch blocks to handle common errors like network issues or invalid inputs. Check for specific error types, such as ethers.errors.ServerError for provider failures. Use provider.on('error', handler) for event-based error listening. Example:
try {
await provider.getBlockNumber();
} catch (error) {
if (error.code === 'SERVER_ERROR') console.error('Network issue:', error.message);
}
Always validate inputs before operations, like ensuring addresses are checksummed with ethers.utils.getAddress(address).
Concrete Usage Examples
-
Generate and fund a wallet: Create a new wallet, get its address, and simulate funding it from another account.
const ethers = require('ethers'); const wallet = ethers.Wallet.createRandom(); const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL); console.log('New wallet address:', wallet.address);Then, use this address in a transaction from a funded wallet to send Ether.
-
Interact with a ERC-20 token contract: Connect to a token contract, check balance, and transfer tokens.
const abi = [{ "constant": true, "inputs": [{ "name": "_owner", "type": "address" }], "name": "balanceOf", "outputs": [{ "name": "", "type": "uint256" }], "type": "function" }]; const contract = new ethers.Contract('0xTokenAddress', abi, signer); const balance = await contract.balanceOf(signer.address); await contract.transfer('0xRecipient', ethers.utils.parseUnits('10', 18));
Graph Relationships
- Related to cluster: blockchain (e.g., shares connections with other blockchain tools like web3.js).
- Linked by tags: ethereum (e.g., relates to skills for Ethereum development), javascript (e.g., connects to JS-based libraries), blockchain (e.g., associates with general blockchain utilities).
FAQ
What does the ethers-js skill do?
JavaScript library for interacting with Ethereum blockchain, including wallet management and smart contract calls.
How do I install ethers-js?
Run npx skills add https://github.com/alphaonedev/openclaw-graph --skill ethers-js in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ethers-js/ (personal) or .claude/skills/ethers-js/ (project).
Which AI agents can use ethers-js?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ethers-js safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ethers-js?
It is published by alphaonedev in alphaonedev/openclaw-graph. It has 62 recorded installs.
More from alphaonedev/openclaw-graph
playwright-scraper
alphaonedev/openclaw-graph
Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots
humanize-ai-text
alphaonedev/openclaw-graph
Open the skill to read its SKILL.md instructions.
gcp-iam
alphaonedev/openclaw-graph
Open the skill to read its SKILL.md instructions.
macos-automation
alphaonedev/openclaw-graph
Open the skill to read its SKILL.md instructions.
tavily-web-search
alphaonedev/openclaw-graph
Open the skill to read its SKILL.md instructions.
Popular business & finance skills
sales-enablement
coreyhaines31/marketingskills
When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),
revops
coreyhaines31/marketingskills
When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.
sales-funnel-blueprint
autonnel/autonnel-skills
Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.
pricing
coreyhaines31/marketingskills
When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.
cross-border-ecommerce
nexscope-ai/ecommerce-skills
Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.
pricing-strategy
coreyhaines31/marketingskills
When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' or 'should I offer a free plan.' Use this whenever someone is figuring out what to charge or how to structure their plans. For in-app upgrade screens, see paywall-upgrade-cro.