Install
Building the client
Here’s a client with every option set:Builder methods
.url(url) - The primary endpoint to send requests to. If not set, the SDK checks the ORBITFLARE_RPC_URL environment variable.
.urls([...]) - Set the primary and all fallbacks in one call. The first element is the primary, the rest are fallbacks.
.fallbackUrl(url) - Add a single fallback endpoint. Call multiple times to add several. When the primary fails, the SDK tries fallbacks in order.
.fallbackUrls([...]) - Same as fallbackUrl but takes an array.
.apiKey(key) - Your OrbitFlare license key. If not set, the SDK checks ORBITFLARE_LICENSE_KEY from the environment. The key is injected into the URL at request time, never stored in the endpoint.
.commitment(level) - Default commitment level used for all typed helpers. Options: 'processed', 'confirmed', 'finalized'. Defaults to 'confirmed'.
.retry(policy) - Controls how the SDK retries failed requests. initialDelayMs is the wait before the first retry. multiplier scales the delay on each attempt. maxDelayMs caps the backoff. maxAttempts limits total retries per endpoint (0 means infinite). Defaults: 100ms initial, 30s max, 2x multiplier, infinite attempts.
.timeoutMs(ms) - HTTP timeout for each individual request. Defaults to 30 seconds.
Available RPC methods
getSlot()
Returns the current slot number.
getBalance(address)
Returns the balance in lamports for an account.
getAccountInfo(address)
Returns the full account data or null if the account doesn’t exist. Data is base64-encoded.
getMultipleAccounts(addresses)
Fetches multiple accounts in one call. Automatically chunks into batches of 100 (Solana’s per-request limit), so you can pass any number of addresses.
getLatestBlockhash()
Returns the most recent blockhash and the last block height it’s valid for.
getTransaction(signature)
Fetches a confirmed transaction by its signature. Returns the full transaction with metadata.
getSignaturesForAddress(address, limit)
Returns recent transaction signatures for an address, newest first.
getProgramAccounts(programId)
Returns all accounts owned by a program. Can return a lot of data.
getRecentPrioritizationFees(addresses)
Returns recent priority fees for a set of accounts. Useful for estimating compute unit pricing.
sendTransaction(txBase64)
Sends a signed transaction to the network. Takes a base64-encoded serialized transaction. Returns the transaction signature.
simulateTransaction(txBase64)
Simulates a transaction without submitting it. Returns logs, compute units consumed, and any errors.
getTokenAccountsByOwner(owner, mint?, programId?)
Returns token accounts for a wallet. Pass either a specific mint or a token program ID. If both are omitted, defaults to the SPL Token program.
getTransactionsForAddress(address, options)
OrbitFlare-specific method that combines getSignaturesForAddress and getTransaction into one call. Returns a GetTransactionsResult with the data array and an optional paginationToken for fetching the next page.
Supports four detail levels (signatures, none, accounts, full), bidirectional sorting, time/slot filtering, status filtering, and token account inclusion.
request(method, params)
Call any RPC method by name. The SDK builds the JSON-RPC envelope, handles retry and failover, and returns the result field.