LayerHop for developers · Bridge API
A bridge API: move tokens between chains from your own code
To bridge tokens with the LayerHop API, call GET /v1/quote with a source and a destination chain, build the best route with POST /v1/orders, have the user's wallet sign it and follow it with the order status endpoint. The same call covers 71 chains and several providers, and GET /v1/track/{txHash} can follow a transfer made in any app.
https://api.layerhop.com/v1How to bridge with the API
- 1
Quote the bridge
Use the same token on both chains, for example USDC on Base to USDC on Arbitrum. Add gasOnArrival=true to also deliver a little native gas on an EVM destination.
- 2
Check what came back
Compare the quotes: dstAmount, dstAmountMin, estimatedSeconds and fees. When no route answers, the error is NO_ROUTE with suggestions, or AMOUNT_TOO_SMALL with the route's minimum.
- 3
Build, sign and report
POST /v1/orders for the chosen quoteId, send the unsigned transaction from the user's wallet, then POST /v1/orders/{quoteId}/submitted with its hash.
- 4
Follow it
GET /v1/orders/{provider}/{id} with the source hash, or GET /v1/track/{txHash} to follow any bridge transfer by its source transaction.
Code
Copy, then replace the addresses and the key.
curl "https://api.layerhop.com/v1/quote?srcChain=base&srcToken=USDC&amount=20000000&dstChain=arbitrum&dstToken=USDC&sender=0xYou&recipient=0xYou&gasOnArrival=true"
# gasOnArrivalUsd=0.5 to 20 chooses the amount; the default is $2.
# A quote that includes gas carries "gasOnArrival": { "amount", "symbol", "usd", ... }.
# When none does, the response has warnings: [{ "code": "GAS_ON_ARRIVAL_UNAVAILABLE", ... }].import { LayerHop } from "@layerhop/sdk";
const lh = new LayerHop({ apiKey: process.env.LAYERHOP_API_KEY });
const { best, quotes, errors } = await lh.quote({
srcChain: "base", srcToken: "USDC", amount: "20000000", // 20 USDC
dstChain: "arbitrum", dstToken: "USDC",
sender: address, recipient: address,
gasOnArrival: true, // or a USD amount, 0.5 to 20
});
console.log(best.provider, best.dstAmount, best.gasOnArrival?.usd);curl "https://api.layerhop.com/v1/track/0xd9a702a19c7ce879cf38ea79ea4a2ddae514ea3736f725221fe7d6a2269c3c60?chain=soneium"
# -> { "status": "filled", "protocol": { "name": "LI.FI", ... }, "dstTxHash": "0x...", "next": { "kind": "done", ... } }What works today, and what doesn't
So you know before you build.
Works today
- Cross-chain routes between EVM chains and Solana, in both directions where a provider serves them
- Gas on arrival: $2 by default, $0.50 to $20, on cross-chain routes into an EVM chain (today delivered by Relay)
- A transfer tracker that reads Relay, LI.FI, Across, deBridge, LayerZero, Wormhole, CCTP, Gas.zip and native bridges from the source transaction
- Route minimums and suggestions when a pair has no direct route
Good to know
- Gas on arrival does not apply to Solana destinations, or when the output is already the native coin
- Solana as a source is quoted by deBridge and LI.FI, not by Relay
- It does not sign or broadcast, and it cannot move funds in a stuck transfer: it shows where the transfer is and who can act
Questions
Do I need an API key?
Not to try it: requests without a key work under a per-IP rate limit. For production, sign in to the dashboard with a wallet and create a key (lh_live_…, sent in the x-api-key header). A key gets its own rate limit, shows your usage and logs, and lets your orders trigger webhooks. lh_test_ keys give sandbox quotes and simulated orders.
What does it cost?
LayerHop's fee on a trade made through the API channel is 0.10% of the input amount, reported on every quote as fees.ourFeeBps next to the provider's fees and gas. Partners can add their own fee on top.
How do I know how long a bridge takes?
Every quote carries the provider's estimatedSeconds. It is an estimate and LayerHop does not guarantee a time.
Which chains does it cover?
71 chains in the registry, returned live by GET /v1/chains; each chain page on the site lists its providers.
Does it hold keys or sign transactions?
No. It returns unsigned transactions and your own wallet library (viem, ethers, web3.py, go-ethereum, alloy, a Solana wallet, a KMS) signs and broadcasts them. LayerHop never holds funds or keys.