The TypeScript Apex client is part of
@orbitflare/sdk, not a separate package. It talks to Apex over HTTP JSON-RPC only. There is no QUIC transport for TypeScript yet, because Node has no QUIC implementation that is reliable enough to send on. For the lowest-latency path over QUIC, use the Rust client or the Go client.Install
@solana/kit and the two program packages build and sign the transaction. The Apex client itself only needs @orbitflare/sdk.
Set your Apex API key, a funded keypair, and a Solana RPC endpoint for the blockhash and confirmation. The example uses OrbitFlare RPC with your license key:
Quick Start
This program sends 1,000 lamports to an address of your choice (itself by default) with the minimum tip, then waits for it to land. Save it assend.ts and run it with npx tsx send.ts.
apex, solana and the signed transaction bytes (wire) from this program.
Sending
Two methods send a single transaction. Both return the signature as soon as the endpoint accepts it.mevProtect (skip Shield-blocklisted leaders, see MEV protection) and maxRetries (cap how many times Apex resubmits), overriding the builder defaults for that call. A transaction must be between 1 and 4,096 bytes (APEX_MAX_TRANSACTION_SIZE).
Batches
sendBatch sends up to 16 transactions (APEX_MAX_BATCH) in one request. Each transaction is checked and raced on its own, so one bad transaction does not stop the others.
Bundles
sendBundle sends 1 to 4 transactions (APEX_MAX_BUNDLE) that land together or not at all, through Jito leaders only. Exactly one transaction in the bundle carries the tip.
state is Pending, Landed, Failed or Invalid. Bundle statuses can lag behind the chain, so confirm the bundle’s signatures with waitForConfirmation rather than waiting on the status alone. See Bundles for the rules and rate limits.
Tips and Confirmation
The tip rules are on the Tips page.
Regions and Failover
fra, ams, dub, lon, nyc, slc, sgp, tyo, sqq and global (the nearest healthy endpoint). With no region set, the client uses ORBITFLARE_APEX_URL, then ORBITFLARE_APEX_REGION, then Frankfurt. See Endpoints.
Options
By default the client makes one attempt per endpoint and moves straight on to the next fallback instead of retrying. That is deliberate: resending a transaction Apex already accepted wastes your rate limit, and Apex keeps resubmitting accepted transactions itself.
Keep the Connection Warm
apex.ping() calls GET /ping and resolves when the endpoint answers pong. Calling it every few seconds keeps the HTTP connection open, so the next send skips the TCP handshake.
Errors
Every failure is anOrbitflareError with a kind:
The Apex error codes and rate limits are listed in Errors and rate limits.