
NEAR Balancer
High-performance NEAR RPC client with round-robin load balancing, automatic retry, and rate limit handling
Project Overview
NEAR Balancer is a zero-dependency RPC client for the NEAR blockchain that distributes requests across multiple public endpoints using round-robin rotation. It solves the common pain points of NEAR development: rate limiting from public RPCs, unreliable endpoints, and slow response times during heavy usage.
The client automatically rotates through 5 mainnet endpoints (Official NEAR, Lava Network, BlockPI, dRPC, and Omnia) on each request, and if one fails it retries the next with exponential backoff. This means rate limit errors (429) are handled gracefully by simply rotating to the next endpoint, rather than failing the entire operation.
Built in pure TypeScript with zero dependencies beyond native fetch, it works cross-platform on Node.js, Bun, Deno, and browsers. It includes helper functions for common operations like NFT view calls and account balance queries, plus configurable retry counts, timeouts, and custom endpoint lists for production deployments.