Bridge
Bridge tokens from your agent
ChainHilt asks Circle CCTP, Across, deBridge, Relay, Socket and LayerZero for routes, ranks them by what arrives, and returns the approval and bridge transactions for your wallet to sign. Comparing routes costs $0.001, preparing the transactions $0.01, and each status lookup $0.001.
How a bridge runs
Compare routes ($0.001)
Send
POST /api/v1/bridge/simulatethrough your x402 client. It needs no wallet authorization. PasssenderAddressso providers quote for that wallet.POST https://chainhilt.ai/api/v1/bridge/simulate { "sourceAmount": "10000000", "sourceChainId": 8453, "targetChainId": 999, "sourceToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "targetToken": "0xb88339CB7199b77E23DB6E890353E22632Ba630f", "targetType": "hyperCore", "hyperCoreBalance": "perps", "senderAddress": "0xE4934BB19E0B97109033dBfDcCc6957E32F9Cc60" }Routes come best first by what arrives, net of fees paid in the native token. Each has its estimated and minimum target amounts and its fees, plus a duration and an expiry when the provider gives them.
Authorize
Once the user picks a route, call the wallet's
authorize_requestwith the exact execute request: method, URL and JSON body.Execute ($0.01)
Send the request with the header it returned.
adapterIdnames the chosen route, andminTargetAmountandmaxNativeFeeare the bounds the user accepted.POST https://chainhilt.ai/api/v1/bridge/execute X-ChainHilt-Authorization: <from authorize_request> { "sourceAmount": "10000000", "sourceChainId": 8453, "targetChainId": 999, "sourceToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "targetToken": "0xb88339CB7199b77E23DB6E890353E22632Ba630f", "targetType": "hyperCore", "hyperCoreBalance": "perps", "senderAddress": "0xE4934BB19E0B97109033dBfDcCc6957E32F9Cc60", "adapterId": "across", "recipientAddress": "0xE4934BB19E0B97109033dBfDcCc6957E32F9Cc60", "minTargetAmount": "9944085", "maxNativeFee": "0" }Execute quotes again. If the fresh quote delivers less or charges more native fee, it returns
409with the new amounts and no actions. Otherwise the actions are an approval of exactlysourceAmountwhen needed, then the bridge transaction.Ethereum USDT and a few other tokens refuse to change one nonzero allowance to another, so for them an approval to 0 comes first and there are three actions. The wallet skips that reset when there is no allowance to clear.
Sign and send
Pass all the actions' nonce and hashes to
process_actionin one call, right away. Each action'sverification.expiresAtsays when the wallet stops accepting it: 10 minutes after execute, or the route's expiry if that comes sooner (two minutes for deBridge).Track it ($0.001 a lookup)
Poll
GET /api/v1/bridge/status?adapter=…&sourceChainId=…&txHash=…with the bridge transaction's hash every 10 to 15 seconds, until it isfilled,refundedorfailed. LayerZero and Relay also need theproviderRefthat execute returned.not_foundis normal for up to a minute.
Before you sign
- Bridges are not reversible. Confirm the route's minimum received, fees and any estimated duration with the user, not just the estimated amount.
sourceAmountis exactly what leaves the wallet, in the token's smallest unit, and fees come out of it. Fees in the native token, such as deBridge's flat fee, are paid on top, so keep enough for them and for gas.- Bridges deliver only to the sending wallet:
recipientAddressis your own address. - Tokens can change on the way, for example USDC on Base to ETH on Arbitrum. Across, Relay, deBridge and Socket swap as part of the bridge; Circle CCTP moves only USDC, and LayerZero only the same asset.
- Quotes move between calls. Unless the user wants exact bounds, pass the route's
minTargetAmountless about 0.5%, and its native fees plus about 20% asmaxNativeFee.
Bridging USDC to Hyperliquid (targetChainId: 999 with HyperEVM USDC) credits the HyperCore perps balance by default, ready to trade. deBridge, Socket and LayerZero can't deliver there and return an error.
Endpoints
| Endpoint | Price | What it does |
|---|---|---|
POST /api/v1/bridge/simulate | $0.001 | Compare bridge routes, best first: tokens, estimated and minimum target amounts, fees by token, duration, expiry and the approval each route needs. |
POST /api/v1/bridge/execute | $0.01 | Prepare the selected bridge route as ordered unsigned transactions: an exact-amount ERC-20 approval when needed (after an approval to 0 for tokens like Ethereum USDT), then the bridge transaction. |
GET /api/v1/bridge/status | $0.001 | Look up a bridge after its transaction was sent, by the adapter that built it and the hash of the bridge transaction on the source chain; layerzero and relay also need the providerRef that bridge/execute returned (0x and 64 hex characters). |
Next
- New here? Start with the quickstart.
- The API reference has the full request and response schemas.