quicknode-sdk-patterns

Featured

Production-ready QuickNode SDK and ethers.js patterns for blockchain applications. Use when building production dApps, implementing retry logic, or establishing patterns. Trigger with phrases like "quicknode patterns", "ethers best practices", "web3 patterns".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# QuickNode SDK Patterns ## Overview Production-ready patterns for blockchain development with QuickNode: provider singletons, retry logic, batch RPC calls, and multi-chain support. ## Prerequisites - Completed `quicknode-install-auth` - ethers.js or @quicknode/sdk installed ## Instructions ### Step 1: Provider Singleton ```typescript import { ethers } from 'ethers'; let _provider: ethers.JsonRpcProvider | null = null; export function getProvider(): ethers.JsonRpcProvider { if (!_provider) { _provider = new ethers.JsonRpcProvider(process.env.QUICKNODE_ENDPOINT, undefined, { staticNetwork: true, // Skip chainId lookup on every call batchMaxCount: 10, // Enable batch RPC }); } return _provider; } ``` ### Step 2: Retry Wrapper with Backoff ```typescript async function withRetry<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> { for (let attempt = 0; attempt <= maxRetries; attempt++) { try { return await fn(); } catch (err: any) { const isRetryable = err.code === 'SERVER_ERROR' || err.code === 'TIMEOUT' || err.status === 429; if (!isRetryable || attempt === maxRetries) throw err; const delay = Math.min(1000 * Math.pow(2, attempt), 10000); await new Promise(r => setTimeout(r, delay)); } } throw new Error('Unreachable'); } // Usage const balance = await withRetry(() => getProvider().getBalance(address)); ``` ### Step 3: Multi-Chain Client Factory ```typescript const ENDPOINTS: Record<string, ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category