npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@runic-rpc/sdk

v0.1.2

Published

Production-grade Solana RPC load balancer with circuit breaking, retries, and health checks

Downloads

176

Readme

@runic-rpc/sdk

Ancient reliability for modern Solana infrastructure

Production-grade Solana RPC load balancer with zero runtime dependencies.

Features

  • Zero dependencies (only peer @solana/web3.js)
  • Circuit breaker prevents cascading failures
  • Intelligent routing (round-robin, latency-based, weighted, random)
  • Automatic retries with exponential backoff
  • Rate limiting per endpoint
  • Request caching with TTL
  • Request deduplication
  • Health checks with configurable intervals
  • WebSocket support with auto-reconnect
  • Comprehensive events for observability
  • Prometheus metrics export

Installation

npm install @runic-rpc/sdk @solana/web3.js
# or
pnpm add @runic-rpc/sdk @solana/web3.js
# or
yarn add @runic-rpc/sdk @solana/web3.js

Quick Start

import { RunicRPC, createHeliusEndpoint } from '@runic-rpc/sdk';

// Simple configuration with Helius
const rpc = new RunicRPC({
  providers: {
    helius: { apiKey: 'your-api-key' },
  },
  strategy: 'latency-based',
});

// Make RPC requests
const slot = await rpc.request('getSlot');
const balance = await rpc.request('getBalance', [publicKey]);

// Subscribe to WebSocket events
const subId = await rpc.subscribe(
  'accountSubscribe',
  [publicKey, { encoding: 'jsonParsed' }],
  (data) => {
    console.log('Account updated:', data);
  }
);

// Cleanup
await rpc.close();

Advanced Configuration

import { RunicRPC } from '@runic-rpc/sdk';

const rpc = new RunicRPC({
  // Multiple providers
  providers: {
    helius: { apiKey: 'helius-key' },
    alchemy: { apiKey: 'alchemy-key' },
  },

  // Routing strategy
  strategy: 'latency-based', // or 'round-robin', 'weighted', 'random'

  // Cache configuration
  cache: {
    enabled: true,
    ttl: 1000, // 1 second
    maxSize: 1000,
  },

  // Retry configuration
  retry: {
    maxAttempts: 3,
    initialDelay: 100,
    maxDelay: 5000,
    backoffMultiplier: 2,
  },

  // Circuit breaker
  circuitBreaker: {
    failureThreshold: 5,
    successThreshold: 2,
    timeout: 30000, // 30 seconds
  },

  // Health checks
  healthCheck: {
    enabled: true,
    interval: 30000, // 30 seconds
    timeout: 5000,
    unhealthyThreshold: 3,
    healthyThreshold: 2,
  },

  // Rate limiting
  rateLimit: 100, // requests per second per endpoint

  // Logging
  logLevel: 'info', // 'debug', 'info', 'warn', 'error'
});

Events

// Listen for events
rpc.on('endpoint:healthy', (event) => {
  console.log('Endpoint healthy:', event.endpoint);
});

rpc.on('endpoint:unhealthy', (event) => {
  console.log('Endpoint unhealthy:', event.endpoint, event.reason);
});

rpc.on('circuit:open', (event) => {
  console.log('Circuit opened:', event.endpoint);
});

rpc.on('request:retry', (event) => {
  console.log('Retrying request:', event.method, 'attempt:', event.attempt);
});

rpc.on('cache:hit', (event) => {
  console.log('Cache hit:', event.method);
});

Metrics

// Get statistics
const stats = rpc.getStats();
console.log('Total requests:', stats.totalRequests);
console.log('Total errors:', stats.totalErrors);
console.log('Cache hit rate:', stats.cacheHitRate);

// Export Prometheus metrics
const metrics = rpc.exportPrometheusMetrics();

Providers

Helius

import { createHeliusEndpoint } from '@runic-rpc/sdk';

const endpoint = createHeliusEndpoint('your-api-key');

Alchemy

import { createAlchemyEndpoint } from '@runic-rpc/sdk';

const endpoint = createAlchemyEndpoint('your-api-key');

QuickNode

import { createQuicknodeEndpoint } from '@runic-rpc/sdk';

const endpoint = createQuicknodeEndpoint(
  'https://your-endpoint.quiknode.pro/token/',
  'wss://your-endpoint.quiknode.pro/token/'
);

Public Fallback

import { createPublicEndpoint } from '@runic-rpc/sdk';

const endpoint = createPublicEndpoint();
// ⚠️  Warning: Public endpoints have strict rate limits

License

MIT