QubicTypeScript

createQubicClient

Creates both a live and archive client in a single call, sharing the same fetch and abort configuration.

createQubicClient(options?)

Creates a QubicClient with .live (live API) and .archive (query API) sub-clients. Use this instead of calling createLiveClient and createQueryClient separately when you need both.

import { createQubicClient } from "@qubic.org/rpc"

const client = createQubicClient()

const tickResult = await client.live.getTickInfo()
if (tickResult.ok) console.log(tickResult.value.tick)

Parameters

NameTypeDescription
liveBaseUrlstringOverride the live API base URL. Default: https://rpc.qubic.org/live/v1
archiveBaseUrlstringOverride the archive API base URL. Default: https://rpc.qubic.org/query/v1
signalAbortSignalApplied to every request on both sub-clients
fetch(input: Request) => Promise<Response>Custom fetch implementation

Returns QubicClient — an object with live: LiveClient and archive: QueryClient.

On this page