Typed account fetchers with built-in binary decoding.
Fetches raw accounts via RPC, base64-decodes the data, and applies zero-dep DataView decoders — returning fully typed objects for Token, Mint, Stake, Nonce, Lookup Table, and custom accounts.
Lazy-loaded on first access.
import { Pubkey } from '@oobe-protocol-labs/synapse-client-sdk';
const mint = await client.accounts.fetchMint(Pubkey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'));
console.log(`USDC supply: ${mint?.decoded.supply}, decimals: ${mint?.decoded.decimals}`);
const token = await client.accounts.fetchTokenAccount(Pubkey('...'));
console.log(`Balance: ${token?.decoded.amount}`);
gRPC transport for Yellowstone/Geyser streaming. Lazy-loaded on first access.
Node.js only — throws a descriptive error in browser environments. Use RPC or WebSocket for browser/Next.js client components.
Kit-native fully-typed Solana RPC client.
Uses the same endpoint as the Synapse transport but returns a
Rpc<SolanaRpcApi> instance from @solana/kit, giving you
access to Kit's type-safe .send() pattern with all 53+ methods.
Lazy-loaded on first access.
Kit-native fully-typed Solana RPC Subscriptions client.
Returns a RpcSubscriptions<SolanaRpcSubscriptionsApi> from @solana/kit
for real-time WebSocket subscriptions (account, slot, logs, signature, etc.)
with the Kit .subscribe() pattern.
Uses the WebSocket endpoint derived from the HTTP endpoint. Lazy-loaded on first access.
Batch multiple RPC calls in a single HTTP request.
Array of { method, params } objects.
Per-call overrides applied to the batch.
Array of results.
Raw RPC call pass-through to the underlying transport.
RPC method name.
Positional parameters.
Per-call overrides.
The result payload.
Returns the underlying HTTP transport.
Use this when a function requires a bare HttpTransport (e.g.
createExecutableSolanaTools, protocol tool factories) instead of
casting with (client as any)._transport.
The HttpTransport instance used by this client.
StaticfromCreate a SynapseClient from a network + region specification. Resolves the endpoint from the built-in registry and configures RPC, WebSocket, and gRPC transports automatically.
Minimal structural interface that any object with a
transportproperty satisfies.Protocol tool factories (
createMetaplexTools,createJupiterOnchainTools,createRaydiumOnchainTools,createProtocolTools) accept this type instead of the full SynapseClient class, so consumers are never forced to match every property / getter the SDK adds in future versions.Both the concrete
SynapseClientclass and a plain{ transport }object satisfy this interface — noas anycast needed.Since
1.0.8
Example