Search documentation

Swap · Direct API · Step 1 of 5

Quickstart

Before You Start

Complete the shared setup requirements. This path additionally requires JSON HTTP requests with cancellation/timeouts, response validation, a wallet typed-data signer, contract read/write support, and a status poller. The TypeScript reference uses Viem; a different stack must implement those same operations.

Implement a quote adapter first, then connect the submit-swap.ts and types.ts reference files in Submit Swap. 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.