Low-level JSON-RPC 2.0 HTTP transport.

All Synapse SDK RPC calls flow through this class. It is instantiated once by SynapseClient and shared by every sub-module.

1.0.0

Constructors

Methods

Constructors

Methods

  • Execute a batch of JSON-RPC 2.0 calls in a single HTTP request.

    Type Parameters

    • T = unknown

      Expected result type for each call.

    Parameters

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

      Array of { method, params } objects.

    • opts: CallOptions = {}

      Per-call overrides (applied to the batch request).

    Returns Promise<T[]>

    Array of results in the same order as requests.

    If the batch exceeds the timeout.

    On HTTP / network failures.

    1.0.0

  • Execute a single JSON-RPC 2.0 call.

    Retries transparently on method-not-allowed (code -32601) up to maxRetries times, rotating upstreams if configured.

    Type Parameters

    • T = unknown

      Expected result type.

    Parameters

    • method: string

      RPC method name (e.g. 'getBalance').

    • params: Record<string, unknown> | unknown[] = []

      Positional parameters array.

    • opts: CallOptions = {}

      Per-call overrides.

    Returns Promise<T>

    The JSON-RPC result payload, typed as T.

    If the request exceeds the timeout.

    On HTTP / network failures.

    If the upstream returns an RPC error with upstream metadata.

    For all other RPC errors.

    1.0.0