Skip to main content

ERPC SDK for Python

Async Python client for ERPC. It covers standard Solana, Ethereum, and Avalanche C-Chain JSON-RPC, indexed assets, history, leader and analytics RPC, WebSocket subscriptions, price REST and server-sent events, account usage, and scoped Cloud reads.

python -m pip install erpc-sdk

Python 3.11 or newer is required.

Quick start

import asyncio
import os

from erpc_sdk import ErpcClient, ErpcClientConfig


async def main() -> None:
    async with ErpcClient(ErpcClientConfig(os.environ["ERPC_API_KEY"])) as erpc:
        slot = await erpc.solana.rpc.get_slot().send()
        chain_id = await erpc.ethereum.rpc.eth_chain_id().send()
        avalanche_chain_id = await erpc.avalanche.rpc.eth_chain_id().send()
        print(slot, chain_id, avalanche_chain_id)


asyncio.run(main())

Both exact wire names (getSlot, eth_chainId) and Python snake-case aliases (get_slot, eth_chain_id) create inert requests. Network I/O starts only when send() is awaited. request() restricts calls to the namespace catalog; raw() is the forward-compatible escape hatch.

Namespaces

Namespace Purpose
erpc.solana.rpc Standard Solana JSON-RPC
erpc.solana.das Indexed assets and tokens
erpc.solana.history Address transactions and transfers
erpc.solana.leaders Leader slots and validator information
erpc.solana.analytics Epoch, slot, program, and TPS analytics
erpc.solana.subscriptions Enhanced WebSocket subscriptions
erpc.ethereum.rpc Standard Ethereum JSON-RPC
erpc.ethereum.subscriptions Ethereum WebSocket subscriptions
erpc.avalanche.rpc Avalanche C-Chain EVM-compatible JSON-RPC
erpc.avalanche.subscriptions Avalanche C-Chain WebSocket subscriptions
erpc.price Price metadata, updates, and SSE streams
erpc.account Token balance
erpc.usage Masked monthly API-key usage

avalanche_endpoint defaults to https://ava-rpc.erpc.global and can be overridden independently. The SDK uses its /ava HTTP route and /ava-ws WebSocket route. The Avalanche namespace uses the Ethereum-compatible typed catalog; use raw() for additional C-Chain methods.

Intact batches

results = await erpc.solana.rpc.batch([
    {"method": "getSlot", "params": []},
    {"method": "getBlockHeight", "params": []},
]).send()

The SDK sends one caller batch as one server batch, restores caller order, accepts at most 256 calls, and rejects invalid mixed or unsupported batches locally. It never silently splits a batch.

Subscriptions

subscription = await erpc.ethereum.subscriptions.subscribe("newHeads")
async for header in subscription:
    print(header)
    await subscription.unsubscribe()
    break

Solana exposes account_subscribe, transaction_subscribe, and raw_subscribe. HTTP requests accept a RequestOptions(cancel_event=...); normal asyncio task cancellation is also preserved.

Cloud reads

from erpc_sdk import ErpcCloudClient, ErpcCloudClientConfig

async with ErpcCloudClient(ErpcCloudClientConfig(access_token)) as cloud:
    offerings = await cloud.catalog.list()
    resources = await cloud.resources.list()

Cloud configuration accepts HTTPS endpoints and localhost HTTP endpoints for testing. It retains only the access token supplied by the caller and does not implement interactive authorization or refresh-credential storage.

Safety boundaries

  • Credentials are redacted from configuration representations, public endpoints, transport errors, and JSON-RPC error data.
  • State-changing calls, including transaction submission, are never retried.
  • REST, JSON-RPC, and caller batch boundaries remain explicit.
  • Unknown methods remain available through raw() without being included in the typed compatibility catalog.

Release files for erpc-sdk 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for erpc-sdk 0.5.0
File Size Uploaded
erpc_sdk-0.5.0.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for erpc-sdk 0.5.0
File Interpreter ABI Platform
erpc_sdk-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.5 kB

Release files / erpc_sdk-0.5.0.tar.gz

Download URL erpc_sdk-0.5.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
31bde565938ea79c418759b8006ca682b4da86351da840e09ec6f12a6d969111
BLAKE2b-256 checksum
How to use checksums
4dc2d7b67d9750ba1c8ea973ef22cf54f1c07a349ad6db6954825814a3f45dc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / erpc_sdk-0.5.0-py3-none-any.whl

Download URL erpc_sdk-0.5.0-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18d9ff27f1c82ec575210c197d07363efd9a9a1a0d3745f56d0f0ae74e722167
BLAKE2b-256 checksum
How to use checksums
0d3e77013c6755e96a9ca4b2917686cb34950e0c6cbdf519f5b2a241bc337860
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page