Install
Building the client
Here’s a client with every option set:context.Context, so pass a context with a deadline to bound a call:
Builder methods
.URL(url) - The primary endpoint to send requests to. If not set, the SDK checks the ORBITFLARE_RPC_URL environment variable.
.URLs(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(urls...) - Same as FallbackURL but takes several at once.
.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, and never printed in logs or errors.
.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. InitialDelay is the wait before the first retry. Multiplier scales the delay on each attempt. MaxDelay caps the backoff. MaxAttempts limits total retries (0 means infinite). Defaults: 100ms initial, 30s max, 2x multiplier, infinite attempts.
.Timeout(duration) - HTTP timeout for each individual request. Defaults to 30 seconds.
.Logger(logger) - A *slog.Logger for request retries and failovers. When unset, logging is controlled by the ORBITFLARE_LOG environment variable (trace|debug|info|warn|error|silent, default silent).
Available RPC methods
Typed helpers return Go values; everything else returnsjson.RawMessage you can unmarshal into your own types.
GetSlot(ctx)
Returns the current slot number.
GetBalance(ctx, address)
Returns the balance in lamports for an account.
GetAccountInfo(ctx, address)
Returns the full account data as json.RawMessage, or nil if the account doesn’t exist. Data is base64-encoded.
GetMultipleAccounts(ctx, 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(ctx)
Returns the most recent blockhash and the last block height it’s valid for.
GetTransaction(ctx, signature)
Fetches a confirmed transaction by its signature. Returns the full transaction with metadata as json.RawMessage.
GetSignaturesForAddress(ctx, address, limit)
Returns recent transaction signatures for an address, newest first.
GetProgramAccounts(ctx, programID)
Returns all accounts owned by a program. Can return a lot of data.
GetRecentPrioritizationFees(ctx, addresses)
Returns recent priority fees for a set of accounts. Useful for estimating compute unit pricing.
SendTransaction(ctx, txBase64)
Sends a signed transaction to the network. Takes a base64-encoded serialized transaction. Returns the transaction signature.
SimulateTransaction(ctx, txBase64)
Simulates a transaction without submitting it. Returns logs, compute units consumed, and any errors as json.RawMessage.
GetTokenAccountsByOwner(ctx, owner, mint, programID)
Returns token accounts for a wallet. Pass either a specific mint or a token program ID. If both are empty strings, defaults to the SPL Token program.
GetTransactionsForAddress(ctx, address, options)
OrbitFlare-specific method that combines getSignaturesForAddress and getTransaction into one call. Returns a GetTransactionsResult with the Data slice 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. options may be nil for defaults.
Request(ctx, method, params)
Call any RPC method by name. The SDK builds the JSON-RPC envelope, handles retry and failover, and returns the result field as json.RawMessage.