Core JSON-RPC transport layer #3

Closed
opened 2026-08-03 04:10:46 +00:00 by scheerenkevin · 1 comment
scheerenkevin commented 2026-08-03 04:10:46 +00:00 (Migrated from github.com)

Why

Bundler and Sponsorship APIs are both JSON-RPC over HTTP. A shared transport layer avoids duplicating request/response/error/retry logic.

Scope

  • httpx-based HTTP client wrapper (sync client to start; async can be a follow-up)
  • JSON-RPC request/response Pydantic (or dataclass) models
  • Error handling: map JSON-RPC error responses and HTTP-level failures to typed exceptions
  • Retry logic (e.g. exponential backoff for transient/5xx/timeout failures, no retry on 4xx client errors)
  • Fully unit tested with respx — no live HTTP calls

Acceptance criteria

  • JsonRpcTransport (or similar) class sends requests and parses responses
  • Typed exception hierarchy (e.g. AlchemyRpcError, AlchemyHttpError, AlchemyTimeoutError)
  • Retry behavior covered by tests (respx mocked failures then success)
  • No live network calls anywhere in the test suite
## Why Bundler and Sponsorship APIs are both JSON-RPC over HTTP. A shared transport layer avoids duplicating request/response/error/retry logic. ## Scope - `httpx`-based HTTP client wrapper (sync client to start; async can be a follow-up) - JSON-RPC request/response Pydantic (or dataclass) models - Error handling: map JSON-RPC error responses and HTTP-level failures to typed exceptions - Retry logic (e.g. exponential backoff for transient/5xx/timeout failures, no retry on 4xx client errors) - Fully unit tested with `respx` — no live HTTP calls ## Acceptance criteria - [ ] `JsonRpcTransport` (or similar) class sends requests and parses responses - [ ] Typed exception hierarchy (e.g. `AlchemyRpcError`, `AlchemyHttpError`, `AlchemyTimeoutError`) - [ ] Retry behavior covered by tests (respx mocked failures then success) - [ ] No live network calls anywhere in the test suite
scheerenkevin commented 2026-08-03 04:23:08 +00:00 (Migrated from github.com)

Merged into develop via #13.

Merged into develop via #13.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kevin/alchemy-wallet-client#3
No description provided.