Skip to main content
Looking for ethers or viem-style providers? See our Provider Skills—copyable implementations you can customize. This page documents the low-level EIP-1193 interface that Skills build upon.
Future Plans: This page is planned and under active development. Examples are not final and will be replaced with accurate, tested content.

JSONRPCProvider

EIP-1193 compliant Ethereum JSON-RPC provider interface with branded primitive types and standard event emitter pattern. All types auto-generated from the official OpenRPC specification.
New to JSONRPCProvider? Start with Getting Started for installation and your first requests.

Overview

JSONRPCProvider implements the EIP-1193 provider interface for interacting with Ethereum nodes via JSON-RPC:
  • EIP-1193 compliant - Standard request(args) method
  • Branded primitives - Type-safe params using Address, Hash, Hex, Quantity
  • Throws on error - Standard error handling with exceptions
  • EventEmitter pattern - Standard on/removeListener for events
  • Auto-generated types - Generated from ethereum/execution-apis OpenRPC spec

Provider Interface

Request Arguments

Create requests using request builders:

Key Features

EIP-1193 Compliant

Standard request(args) method. Compatible with all EIP-1193 tools and libraries.

Branded Primitives

Compile-time type safety with Address, Hash, Hex, and Quantity branded types.

EventEmitter Pattern

Standard on/removeListener for accountsChanged, chainChanged, connect, disconnect events.

Auto-Generated Types

All types generated from ethereum/execution-apis OpenRPC specification. Always in sync.

Request Builders

Type-safe request constructors that return RequestArguments objects.

Error Handling

Throws standard EIP-1193 errors. Use try/catch for error handling.

Architecture

API Methods

Method Namespaces

eth Methods

40 standard Ethereum methods for blocks, transactions, state, logs, and gas estimation.

debug Methods

5 debugging methods for transaction tracing and block analysis.

engine Methods

20 consensus layer methods for Engine API integration.

Core Concepts

Method API

Direct method calls, parameters, response handling, and request options.

Type System

Auto-generated types, branded primitives, and type hierarchy.

Events

Async generator subscriptions for newHeads, logs, pending transactions.

Advanced Topics

Adapters

EIP-1193 adapter, HTTP handler, and creating custom providers.

Error Handling

Response structure, error codes, and retry strategies.

Performance

Batching, caching, connection pooling, and optimization.

Types

Usage Patterns

Check Balance and Nonce

Query Contract State

Monitor Contract Events

Wait for Transaction Confirmation

Tree-Shaking

Import only what you need for optimal bundle size:
Importing primitives individually enables tree-shaking. Unused methods and types are excluded from your bundle.

Key Features Compared to Other Libraries

See Comparison for detailed differences and migration guides.

Primitives

  • Address - 20-byte Ethereum addresses with EIP-55 checksumming
  • Keccak256 - 32-byte keccak256 hashes
  • Hex - Hex-encoded byte strings
  • Transaction - Transaction types and encoding

Cryptography

Guides

Specifications