alchemy-hello-world
Provides quick-start code templates for the Alchemy SDK to query blockchain data.
Install
mkdir -p .claude/skills/alchemy-hello-world && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19406" && unzip -o skill.zip -d .claude/skills/alchemy-hello-world && rm skill.zipInstalls to .claude/skills/alchemy-hello-world
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create a minimal Alchemy Web3 example: get ETH balance, fetch NFTs,Key capabilities
- →Retrieve ETH wallet balances
- →Fetch NFT collections for specific addresses
- →Query ERC-20 token balances
- →Access latest blockchain block information
How it works
The skill provides TypeScript code snippets that utilize the Alchemy SDK to query blockchain data such as balances, NFT ownership, and block details.
Inputs & outputs
When to use alchemy-hello-world
- →Getting ETH wallet balance
- →Fetching NFTs for an address
- →Testing Alchemy API connectivity
- →Querying token balances
About this skill
Alchemy Hello World
Overview
Minimal working examples with the real Alchemy SDK: get ETH balance, fetch NFTs for a wallet, read ERC-20 token balances, and subscribe to pending transactions.
Prerequisites
- Completed
alchemy-install-authsetup alchemy-sdkinstalled (npm install alchemy-sdk)- Valid API key configured
Instructions
Step 1: Get ETH Balance
// src/hello-world/get-balance.ts
import { Alchemy, Network, Utils } from 'alchemy-sdk';
const alchemy = new Alchemy({
apiKey: process.env.ALCHEMY_API_KEY,
network: Network.ETH_MAINNET,
});
async function getBalance(address: string) {
const balanceWei = await alchemy.core.getBalance(address);
const balanceEth = Utils.formatEther(balanceWei);
console.log(`Balance of ${address}: ${balanceEth} ETH`);
return balanceEth;
}
// Query Vitalik's address
getBalance('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045').catch(console.error);
Step 2: Fetch NFTs for a Wallet
// src/hello-world/get-nfts.ts
import { Alchemy, Network } from 'alchemy-sdk';
const alchemy = new Alchemy({
apiKey: process.env.ALCHEMY_API_KEY,
network: Network.ETH_MAINNET,
});
async function getNftsForOwner(owner: string) {
const nfts = await alchemy.nft.getNftsForOwner(owner);
console.log(`Total NFTs: ${nfts.totalCount}`);
for (const nft of nfts.ownedNfts.slice(0, 5)) {
console.log(` ${nft.contract.name} — ${nft.name || nft.tokenId}`);
console.log(` Contract: ${nft.contract.address}`);
console.log(` Token ID: ${nft.tokenId}`);
if (nft.image?.cachedUrl) {
console.log(` Image: ${nft.image.cachedUrl}`);
}
}
return nfts;
}
getNftsForOwner('vitalik.eth').catch(console.error);
Step 3: Get ERC-20 Token Balances
// src/hello-world/get-tokens.ts
import { Alchemy, Network } from 'alchemy-sdk';
const alchemy = new Alchemy({
apiKey: process.env.ALCHEMY_API_KEY,
network: Network.ETH_MAINNET,
});
async function getTokenBalances(address: string) {
const balances = await alchemy.core.getTokenBalances(address);
console.log(`Token balances for ${address}:`);
for (const token of balances.tokenBalances.slice(0, 10)) {
if (token.tokenBalance && token.tokenBalance !== '0x0') {
// Get token metadata for human-readable names
const metadata = await alchemy.core.getTokenMetadata(token.contractAddress);
const balance = parseInt(token.tokenBalance, 16) / Math.pow(10, metadata.decimals || 18);
console.log(` ${metadata.symbol}: ${balance.toFixed(4)}`);
}
}
}
getTokenBalances('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045').catch(console.error);
Step 4: Get Latest Block Info
// src/hello-world/get-block.ts
import { Alchemy, Network } from 'alchemy-sdk';
const alchemy = new Alchemy({
apiKey: process.env.ALCHEMY_API_KEY,
network: Network.ETH_MAINNET,
});
async function getLatestBlock() {
const blockNumber = await alchemy.core.getBlockNumber();
const block = await alchemy.core.getBlock(blockNumber);
console.log(`Block #${blockNumber}`);
console.log(` Hash: ${block.hash}`);
console.log(` Timestamp: ${new Date(block.timestamp * 1000).toISOString()}`);
console.log(` Transactions: ${block.transactions.length}`);
console.log(` Gas Used: ${block.gasUsed.toString()}`);
}
getLatestBlock().catch(console.error);
Output
- ETH balance query with Wei → ETH conversion
- NFT enumeration with metadata and images
- ERC-20 token balances with symbol resolution
- Block data with timestamp and gas usage
Error Handling
| Error | Cause | Solution |
|---|---|---|
Invalid address | Malformed Ethereum address | Use checksummed 0x-prefixed address |
429 Too Many Requests | Rate limit exceeded | Add delay between calls or upgrade plan |
ENS name not found | ENS not resolving | Verify ENS name exists on mainnet |
| Timeout | Slow node response | Increase timeout in SDK config |
Resources
- Alchemy SDK Reference
- Alchemy NFT API
- Alchemy Enhanced APIs
Next Steps
Proceed to alchemy-local-dev-loop for development workflow setup.
When not to use it
- →When performing complex smart contract interactions
- →When requiring real-time transaction monitoring beyond basic subscriptions
Prerequisites
Limitations
- →Requires checksummed 0x-prefixed addresses
- →Subject to API rate limits
How it compares
It provides pre-configured, minimal boilerplate code for common Web3 queries, avoiding the need to manually construct SDK initialization and error handling.
Compared to similar skills
alchemy-hello-world side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| alchemy-hello-world (this skill) | 0 | 10d | Review | Beginner |
| mcp-builder | 136 | 3mo | Review | Advanced |
| telegram-mini-app | 62 | 6mo | Review | Advanced |
| stripe-integration | 48 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →You might also like
mcp-builder
anthropics
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
telegram-mini-app
davila7
Expert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, payments, user authentication, and building viral mini apps that monetize. Use when: telegram mini app, TWA, telegram web app, TON app, mini app.
stripe-integration
wshobson
Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.
copilot-sdk
github
Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.
nodejs-backend-patterns
wshobson
Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.
chatgpt-app-builder
mcp-use
Build ChatGPT apps with interactive widgets using mcp-use and OpenAI Apps SDK. Use when creating ChatGPT apps, building MCP servers with widgets, defining React widgets, working with Apps SDK, or when user mentions ChatGPT widgets, mcp-use widgets, or Apps SDK development.