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.3.0.tar.gz (21.3 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.3.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: erpc_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 21.3 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.3.0.tar.gz
Algorithm Hash digest
SHA256 a29cd5d1600ebe5cdd0b2c6182c23cb7993d7d15030079c39e7310590534464b
MD5 89a89574e3a80cd97e49d90939dbb734
BLAKE2b-256 d43a00e69f4a1802223eda02a42bdcf70b607e36bc4d5ba23dfe98758630fc40

See more details on using hashes here.

Provenance

The following attestation bundles were made for erpc_sdk-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: erpc_sdk-0.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd1a2ed4cd468f15f362c49d4bad2c260a901a2880ada94bfd69a5307a3d58aa
MD5 7bd52f79bbd8aca34fc587423e40bd4a
BLAKE2b-256 3fbe0824e9fefde84442ba29168360be29ad38917ebe041ffbf100537408b466

See more details on using hashes here.

Provenance

The following attestation bundles were made for erpc_sdk-0.3.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

0.4.0

2 files

This release

0.3.0 This release

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