Search documentation

Swap · Direct API · Step 1 of 5

Quickstart

Add the same Orbs Liquidity Hub swap flow using HTTP requests and your own wallet integration. Choose this path when you need to own quote validation, submission, and status polling. For a JavaScript or TypeScript app, the TypeScript SDK handles more of that work.

Follow the steps below from app setup through receipt confirmation. The goal is one successful on-chain swap, not merely an accepted API request.

Before You Start

Start with a connected wallet, an RPC client on the same chain, real token addresses/decimals, the wrapped-native address, and enough input balance and gas. This path also requires JSON HTTP requests with cancellation/timeouts, response validation, a wallet typed-data signer, contract read/write support, and a status poller. Use your existing wallet provider or library. The TypeScript examples illustrate these operations with Viem; adapt those calls to your wallet setup.

Implement a quote adapter first, then connect the submit-swap.ts and types.ts reference files provided in the execution step. Replace example wallet, chain, token, and amount values with host configuration. The host owns the entire HTTP and wallet sequence.

Liquidity Hub exposes one public API origin: https://hub.orbs.network. Hardcode it in every request, use it for every supported chain, and pass the active chainId in each endpoint's query string.

Do not accept an API origin from user input or replace it based on the chain. Send and receive JSON. Apply a 10-second timeout to quote requests and abort obsolete requests when the account, chain, pair, or input amount changes.