For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integration Guide

Khalani is non-custodial: users sign and submit on-chain transactions from their own wallets. Your integration is responsible for (1) requesting routes, (2) executing the returned wallet actions, and (3) tracking the resulting order lifecycle.

Who this is for

This section is written for:

  • Wallets and consumer apps that want to offer cross-chain swaps without running solver infrastructure

  • Aggregators who want an additional route source with a consistent deposit + tracking surface

  • Backend services that coordinate UI, quoting, deposits, and order status updates

If you are implementing solver/market-maker infrastructure, see Market Makers and Solvers instead.

Choose your integration approach

Approach
Best for
What you build
Notes

Direct API (HyperStream)

Any language / any stack

Call the REST endpoints directly

Most universal; easiest to embed into existing backends

Advanced / bespoke execution

Custom wallet UX and routing

Build your own wallet action executor

You still use deposit/build for canonical action ordering

HyperStream

HyperStream is a hosted Publishing Service for Khalani's cross chain intent markets. HyperStream exposes a set of APIs for integrators to make cross-chain intent publishing easier and streamlined.

HyperStream API integration end-to-end flow (happy path)

  1. Quote POST /v1/quotes → receive quoteId + routes[]

  2. Build deposit plan POST /v1/deposit/build with { from, quoteId, routeId } → receive approvals[]

  3. Execute wallet actions Execute approvals[] in order using the user’s wallet (EVM or Solana)

  4. Submit deposit PUT /v1/deposit/submit with { txHash, quoteId, routeId } → receive orderId

  5. Track GET /v1/orders/{address}?orderIds={orderId} until terminal status

You can see the complete API reference.

Environments

  • Production API: https://api.hyperstream.dev

  • We don't currently operate a testnet

Production expectations

  • Treat validBefore on quotes as authoritative; do not execute deposits for expired quotes.

  • Always execute approvals[] in order; do not reorder or parallelize unless you fully understand the dependency chain.

  • Track orders until terminal state and provide clear UX for refunds/timeouts/expiry.

  • Implement retry/backoff policies by error type (see Handling Exceptions).

Last updated