Add rpc/client2.go implementing a second-generation Solana JSON RPC c…#437
Add rpc/client2.go implementing a second-generation Solana JSON RPC c…#437928799934 wants to merge 3 commits into
Conversation
…lient. Supports configuring custom HTTP clients, request headers, and rate limiters via options, with automatic rate limit checks before each request.
Greptile SummaryThis PR adds
Confidence Score: 3/5The new client introduces a public API whose documented usage examples will not compile, which would immediately break any caller who follows the docs. The rpc/client2.go — the Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Client2
participant rate.Limiter
participant jsonrpc.RPCClient
Caller->>Client2: CallForInto / CallWithCallback / CallBatch
alt limiter is nil
Client2->>jsonrpc.RPCClient: forward call directly
jsonrpc.RPCClient-->>Client2: result
else limiter is set
Client2->>rate.Limiter: Wait(ctx)
rate.Limiter-->>Client2: nil or ctx error
alt ctx cancelled / deadline exceeded
Client2-->>Caller: error
else token acquired
Client2->>jsonrpc.RPCClient: forward call
jsonrpc.RPCClient-->>Client2: result
end
end
Client2-->>Caller: result / error
Reviews (3): Last reviewed commit: "change CustomHeaders -> CustomHeader" | Re-trigger Greptile |
…lient.
Supports configuring custom HTTP clients, request headers, and rate limiters via options, with automatic rate limit checks before each request.