Skip to main content

ERPC SDK for Python

Async Python client for ERPC. It covers standard Solana and Ethereum 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()
        print(slot, 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.price Price metadata, updates, and SSE streams
erpc.account Token balance
erpc.usage Masked monthly API-key usage

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erpc_sdk-0.4.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

erpc_sdk-0.4.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file erpc_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: erpc_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for erpc_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6947c5ef6b72dd87e1029e8118b27b3d03710c76a9b8fe385213ef0bec7e2e46
MD5 eb12794352f9d694a141327a958d46ef
BLAKE2b-256 94aefd0ebc100f23695cd2ed50d48ec032ac66b79020232ca8878d65bad6d38c

See more details on using hashes here.

Provenance

The following attestation bundles were made for erpc_sdk-0.4.0.tar.gz:

Publisher: release.yml on elsoul/erpc-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file erpc_sdk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: erpc_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for erpc_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29244c4af8df0063d39a3ddb52f140dd0f2f36e3cc43ef2a5d9cb5a507ca25d3
MD5 e1ebd64ae09756f43eacf5bf767d5502
BLAKE2b-256 f46fe8824bf3df0a6b16436a599f41411d8416ae316b81b1691ab12a869c25b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for erpc_sdk-0.4.0-py3-none-any.whl:

Publisher: release.yml on elsoul/erpc-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 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