Minimal structural interface that any object with a transport property 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 SynapseClient class and a plain { transport } object satisfy this interface — no as any cast needed.

1.0.8

import { SynapseClient, type SynapseClientLike } from '@oobe-protocol-labs/synapse-client-sdk';

// Full client works as before:
const client = new SynapseClient({ endpoint: '...' });
const metaplex = createMetaplexTools(client);

// Minimal object also works — useful in tests or across versions:
const lite: SynapseClientLike = { transport: client.transport };
const tools = createMetaplexTools(lite);

Implements

Constructors

Properties

transport: HttpTransport

The HTTP transport used for RPC calls.

Accessors

  • get accounts(): AccountsClient
  • 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.

    Returns AccountsClient

    1.1.0

    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}`);
  • get grpc(): GrpcTransport
  • 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.

    Returns GrpcTransport

    1.0.0

  • get kitRpc(): Rpc<SolanaRpcApiForTestClusters>
  • 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.

    Returns Rpc<SolanaRpcApiForTestClusters>

    1.1.0

    import { address } from '@oobe-protocol-labs/synapse-client-sdk/kit';

    const { value: balance } = await client.kitRpc
    .getBalance(address('So11111111111111111111111111111111111111112'))
    .send();
  • get kitSubscriptions(): RpcSubscriptions<SolanaRpcSubscriptionsApi>
  • 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.

    Returns RpcSubscriptions<SolanaRpcSubscriptionsApi>

    1.1.0

    const subs = client.kitSubscriptions;
    const notifications = await subs
    .slotNotifications()
    .subscribe({ abortSignal: AbortSignal.timeout(30_000) });

    for await (const slot of notifications) {
    console.log('New slot:', slot.slot);
    }

Methods

  • Batch multiple RPC calls in a single HTTP request.

    Type Parameters

    • T = unknown

      Expected result type per call.

    Parameters

    • requests: {
          method: string;
          params?: unknown[];
      }[]

      Array of { method, params } objects.

    • opts: CallOptions = {}

      Per-call overrides applied to the batch.

    Returns Promise<T[]>

    Array of results.

    1.0.0

  • Raw RPC call pass-through to the underlying transport.

    Type Parameters

    • T = unknown

      Expected result type.

    Parameters

    • method: string

      RPC method name.

    • params: unknown[] = []

      Positional parameters.

    • opts: CallOptions = {}

      Per-call overrides.

    Returns Promise<T>

    The result payload.

    1.0.0

  • Gracefully shut down all active connections (WebSocket, gRPC).

    Returns void

    1.0.0

  • 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.

    Returns HttpTransport

    The HttpTransport instance used by this client.

    1.2.2

    const tools = createExecutableSolanaTools(client.getTransport());
    
  • Create a SynapseClient from a network + region specification. Resolves the endpoint from the built-in registry and configures RPC, WebSocket, and gRPC transports automatically.

    Parameters

    Returns SynapseClient

    import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
    import { SynapseNetwork, SynapseRegion } from '@oobe-protocol-labs/synapse-client-sdk/utils';

    const client = SynapseClient.fromEndpoint({
    network: SynapseNetwork.Mainnet,
    region: SynapseRegion.US,
    apiKey: 'sk-...',
    });