solana-rpc
БесплатноЗапускает вложенные скриптыНе проверенExpert assistant for Solana JSON-RPC — works with any provider: QuickNode, Helius, Triton, Ankr, Chainstack, or public endpoints. Standard JSON-RPC methods…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
Solana RPC Skill
Reference files:
references/core-methods.md— standard Solana JSON-RPC methods, parameters, response shapesreferences/helius-extensions.md— DAS API, Enhanced Transactions, Priority Fee, Sender, LaserStreamreferences/quicknode-extensions.md—qn_estimatePriorityFees, Metaplex DAS addon, Jitoreferences/patterns.md— batching, rate limits, resume, cost optimizationreferences/examples/— working Python scripts
🚨 Rule #1: use the provider's parsed/enhanced APIs when available
The biggest credit waste on Solana RPC is fetching raw data and parsing it yourself when the provider offers a parsed endpoint. Matrix:
| Task | Cheap option | Expensive / broken option |
|---|---|---|
| Wallet NFTs + tokens | Helius DAS getAssetsByOwner |
getTokenAccountsByOwner + metadata lookups |
| Complete tx history | Helius getTransactionsForAddress |
getSignaturesForAddress + N × getTransaction |
| Parsed DEX swap details | Helius Enhanced Tx or Solscan | getTransaction + manual program parsing |
| NFTs by collection | DAS getAssetsByGroup / searchAssets |
getProgramAccounts (expensive + slow) |
| Priority fee estimate | getPriorityFeeEstimate (Helius) or qn_estimatePriorityFees (QuickNode) |
getRecentPrioritizationFees (raw, needs math) |
| Compressed NFT history | DAS getSignaturesForAsset |
getSignaturesForAddress (doesn't work for cNFTs) |
When in doubt: check references/helius-extensions.md first — if Helius has a purpose-built endpoint, use it.
🚨 Rule #2: batch JSON-RPC requests
Single HTTP request can carry an array of JSON-RPC calls:
[
{"jsonrpc":"2.0","id":1,"method":"getTransaction","params":["sig1",{"encoding":"jsonParsed","maxSupportedTransactionVersion":0}]},
{"jsonrpc":"2.0","id":2,"method":"getTransaction","params":["sig2",{"encoding":"jsonParsed","maxSupportedTransactionVersion":0}]},
...up to ~100 items
]
Response is an array. Most providers count each call individually but save massive HTTP overhead. Always batch when fetching N items of same shape.
See references/patterns.md for semaphore tuning and provider-specific batch limits.
🚨 Rule #3: never getProgramAccounts without tight filters
getProgramAccounts scans ALL accounts under a program. On popular programs (SPL Token, Token 2022, NFT programs) it's catastrophically slow and expensive, often times out.
Always apply:
dataSizefilter (exact byte length)memcmpfilter (matches at specific offset) — typically for mint address, owner, or discriminator
If you're querying NFTs or tokens by collection/owner: use DAS instead (getAssetsByGroup, getAssetsByOwner).
Setup: provider URL
All Solana RPC calls need a URL. Configure via env var:
# Helius
export SOLANA_RPC_URL="https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
# QuickNode
export SOLANA_RPC_URL="https://YOUR-ENDPOINT.solana-mainnet.quiknode.pro/YOUR-TOKEN/"
# Ankr
export SOLANA_RPC_URL="https://rpc.ankr.com/solana/YOUR_KEY"
# Public (DON'T use for production)
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"
Scripts read from SOLANA_RPC_URL. Never hardcode. If user has separate endpoints for archive vs. frontend (common on QuickNode), support SOLANA_RPC_URL_ARCHIVE additionally.
Multi-provider fallback (optional)
If user has both Helius and QuickNode, you can configure fallback:
SOLANA_RPC_URL_PRIMARY— first choiceSOLANA_RPC_URL_FALLBACK— used when PRIMARY hits 429 or errors 5×× persistently
Script pattern in references/examples/.
Step-by-step workflow
1. Classify the task
- Read account data →
getAccountInfo,getMultipleAccounts - Read tx →
getTransaction(raw) or Helius Enhanced (parsed) - Read history →
getSignaturesForAddress+ batchgetTransaction, OR HeliusgetTransactionsForAddress - Read token balances/NFTs → DAS
getAssetsByOwner(preferred) orgetTokenAccountsByOwner - Submit tx →
sendTransactionor Helius Sender (better landing rate) - Estimate fee →
getPriorityFeeEstimate(Helius) orqn_estimatePriorityFees(QuickNode) - Stream real-time → WebSocket / LaserStream (not polling)
2. Check for batch opportunities If > 3 items of same method → batch them in one HTTP request. Don't loop.
3. Pick commitment level
- Default
confirmedfor reads finalizedfor financial audit / history- Never
processedfor production (may revert)
4. Execute (MCP or script)
- Single call: curl or httpx inline
- Batch: Python script with aiohttp + JSON-RPC array, output JSONL
5. Present results
- Lamports → divide by 1e9 for SOL
- Token amounts → divide by 10^decimals
- Timestamps:
block_timeis unix seconds (no sub-second precision ongetBlockTime)
Common mistakes & error codes
| Error | Cause | Fix |
|---|---|---|
-32009 "Slot ... skipped" |
Asked for a slot t |
Установить solana-rpc в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл solana-rpc?
Expert assistant for Solana JSON-RPC — works with any provider: QuickNode, Helius, Triton, Ankr, Chainstack, or public endpoints. Standard JSON-RPC methods are identical across providers; only the URL differs. Use whenever the user wants raw Solana data: fetch transactions by signature, read account state, get block data, check SPL token balances, query program accounts, submit transactions, estimate priority fees, or do anything requiring direct Solana node access. Also use when the user mentions Helius/QuickNode specifically, or wants Helius-specific features (DAS API, Enhanced Transactions, LaserStream, Webhooks) or QuickNode addons (qn_estimatePriorityFees, Metaplex DAS, Jito bundles). Enforces: batch JSON-RPC requests over loops, prefer DAS/Enhanced APIs over raw RPC when available, never use `getProgramAccounts` without tight filters.
Как установить скилл solana-rpc?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл solana-rpc запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic