GitHub Repository
Dependencies
- java.net.http
- systems.comodal.json_iterator
- software.sava.core
Features
- Every active HTTP RPC method with typed response records.
- WebSocket subscriptions which automatically re-subscribe on re-connection, including a generic passthrough for provider-specific methods.
- Typed, sealed error hierarchies: known
TransactionError
and InstructionError
variants and supported custom JSON-RPC error codes
parse to their own types, with
Unknownfallbacks for unrecognized variants or codes. - Asynchronous by default, every request returns a
CompletableFuture.
HTTP
See the official Solana docs for context on each HTTP RPC method.
Create Client
Fetch & Parse Accounts
Query Program Accounts with Filters
Note: You will need access to an RPC node which has getProgramAccounts enabled, such as Helius.
Fetch Transactions & Blocks
The built-in client automatically requestsmaxSupportedTransactionVersion: 1 for getTransaction and for getBlock with
BlockTxDetails.full. Both requests use Base64 transaction bytes. Other block-detail
modes omit the version ceiling; request full to retrieve serialized transactions.
The destination node and cluster still determine which transaction versions are available.
Given a transaction signature, inspect its wire version and v1 configuration:
slot, each BlockTx also exposes skeleton():
version() is 1 for v1, 0 for v0, and negative for legacy. Both skeleton helpers
deserialize on each call and return null when transaction bytes are absent or empty.
BlockTx reads the version from those bytes through its skeleton. Execution results,
such as the fee and consumed compute units, are available through meta() when present.
Version Errors & Submission Results
These failures describe different stages of a request:
For a JSON-RPC error,
join() throws a CompletionException whose cause is a
JsonRpcException. Preserve an Unknown case when handling error variants.
A successful sendTransaction response supplies a transaction signature. Check its
confirmation status and execution error afterward; skipping preflight can return a
signature even when the runtime will reject the transaction. See the
transaction lifecycle guide for building, simulation, signing,
and submission, including how to adjust v1 limits after simulation.
Request Encodings
UseRpcEncoding.base64, or RpcEncoding.base64_zstd (base64+zstd) for account
requests that support compression. Transaction fetch, simulation, and submission
use Base64. Account parsing remains client-side through the typed account factories;
jsonParsed is intentionally absent.
WebSocket
See the official Solana docs for context on each WebSocket RPC method.
Create Client
Stream Program Accounts
Token Accounts
Address Lookup Tables
Provider Specific Subscriptions
Subscription methods which are not part of the standard Solana API, or not supported by public RPC infrastructure, are reachable via the genericsubscribe passthrough. You
provide the method names, request parameters JSON, and a response parser; subscriptions
are replayed if the connection is re-established. See
HeliusRpcWebsocket
for a complete example wrapping Helius’ transactionSubscribe.