Developers
Cross-chain swaps
Bridge and swap across chains in one workflow. Quote, build the origin transaction, sign, then poll until the destination settles.
Cross-chain routes combine a bridge with optional swaps on either side. XAUConnect aggregates the 0x Cross-Chain API with a 1inch Fusion+ fallback and returns a composite quote so you can judge the route by the net amount received on the destination chain, not the headline rate on the source side.
POST /swap/cross-chain/quote— requiresfromChainKey,toChainKey, tokens,amountIn, andtakerPOST /swap/cross-chain/build— returns the origin transaction plusexecutionSteps[]- Sign and broadcast the origin transaction on the source chain
GET /swap/cross-chain/status/:quoteId— poll until the destination settles
1. Quote
POST /api/swap/cross-chain/quote
{
"fromChainKey": "ethereum",
"toChainKey": "base",
"tokenIn": "0xA0b8...", // USDC on Ethereum
"tokenOut": "0x8335...", // USDC on Base
"amountIn": "100000000", // 100 USDC (base units)
"taker": "0xYourWallet"
}If fromChainKey === toChainKey the API returns SAME_CHAIN — use the same-chain /swap/quote instead. If no bridge route exists you get NO_CROSS_CHAIN_ROUTE (HTTP 503).
2. Build
Pass the original request and the returned quote. The response includes the origin-chain transaction and an executionSteps[] array — composite routes (swap → bridge → swap) may require more than one wallet transaction, so always iterate the steps rather than assuming a single signature.
POST /api/swap/cross-chain/build
{ "request": { ...the quote request... }, "quote": { ...the returned quote... } }3. Sign & broadcast
Sign the origin transaction with the user's wallet on fromChainKey and broadcast it. Keep native gas on both chains — source gas to initiate the bridge, destination gas for any follow-up swap or transfer.
4. Poll status
GET /api/swap/cross-chain/status/{quoteId}?originChainKey=ethereum&originTxHash=0x...&toChainKey=basePoll every few seconds until the status reports settlement on the destination chain. Most configured routes finalize within a few minutes up to roughly fifteen. Never submit a second bridge while the first is in flight unless the interface clearly reports failure — duplicate bridges are a common, costly mistake.
Notes for agents
- Solana ⇄ EVM routes cross address-format boundaries — validate destination wallet format before signing.
- The token that arrives may be a bridged/wrapped representation with a different contract and decimals.
- Bridges carry smart-contract risk on top of swap risk; test unfamiliar routes with a small amount first.