Cross-chain swaps for your product, without running a bridge.
One API in front of Jupiter, Relay, deBridge, 0x, KyberSwap and LI.FI, across 70 chains. Your users sign from their own wallets, and you get typed responses, stable error codes and signed webhooks.
The API, dashboard, webhooks, widget and hosted MCP server are live. SDK packages are being published to npm, PyPI and crates.io.
Dashboard and API keys
Sign in with an EVM or Solana wallet. No email, no password. Create keys, then watch usage, request logs and orders as they come in.
- API keys you can create, name and revoke
- Usage charts and per-request logs
- Orders with live status
- Webhook endpoints, test sends and replays
- Partner profile, earnings and payouts
- Wallet sign-in for EVM and Solana
Quotes work without a key. API requests carry a 0.20% LayerHop fee, shown on every quote.
Open the dashboard (opens in a new tab)SDKs
Typed clients for TypeScript, React, Python, Go and Rust, plus a CLI. Each one quotes, builds the unsigned transaction and watches the order. None of them ever touch keys.
import { LayerHop } from "@layerhop/sdk";
const lh = new LayerHop({ apiKey: process.env.LAYERHOP_API_KEY });
const { best } = await lh.quote({
srcChain: "base", srcToken: "USDC", amount: "100000000",
dstChain: "solana", dstToken: "SOL", sender, recipient,
});
const tx = await lh.buildTx(best.quoteId); // your user signs itnpm install @layerhop/sdk # TypeScript
npm install @layerhop/react # React hooks
pip install layerhop # Python
go get github.com/layerhop/layerhop-go # Go
cargo add layerhop # Rust
npm install -g @layerhop/cli # layerhop quote …TypeScript quickstart
Quote, build the transaction, have the user sign it, then watch the order until it's final. Works in Node and the browser.
import { LayerHop, LayerHopApiError } from "@layerhop/sdk";
const lh = new LayerHop({ baseUrl: "https://api.layerhop.com" });
try {
// 100 USDC on Base to SOL on Solana. Amounts are integer strings in base units.
const { best, quotes, errors } = await lh.quote({
srcChain: "base", srcToken: "USDC", amount: "100000000",
dstChain: "solana", dstToken: "SOL",
sender: "0xYourEvmAddress", recipient: "YourSolanaAddress",
slippageBps: 50,
});
console.log(best.provider, best.dstAmount, best.fees.ourFeeBps);
// EVM: { vm: "evm", to, data, value, approval? }. Solana: { vm: "svm", serializedTx }.
const tx = await lh.buildTx(best.quoteId);
const srcTxHash = await signAndSend(tx); // your wallet code
for await (const status of lh.watch(best.provider, srcTxHash)) {
console.log(status.state); // pending, filled, refunded or failed
}
} catch (e) {
if (e instanceof LayerHopApiError) console.error(e.code, e.message);
}REST API
Prefer plain HTTP? Every SDK call maps to a versioned endpoint under /v1. Failed requests return an error code and a request id.
curl "https://api.layerhop.com/v1/quote\
?srcChain=base&srcToken=USDC&amount=100000000\
&dstChain=solana&dstToken=SOL\
&sender=0xYourEvmAddress&recipient=YourSolanaAddress\
&slippageBps=50"
# { "best": { "quoteId", "provider", "dstAmount", "dstAmountMin",
# "estimatedSeconds", "fees": { "ourFeeBps", ... }, "expiresAt" },
# "quotes": [ ... every route that answered ... ],
# "errors": [ ... routes that couldn't quote, with a code ... ] }Webhooks
Add an HTTPS endpoint in the dashboard and get a signed POST for every order change. Failed deliveries retry for up to 24 hours, and you can replay any of them.
Events
import { verifyWebhookSignature } from "@layerhop/shared";
app.post("/layerhop/webhook", async (c) => {
const raw = await c.req.text(); // the raw body, before JSON.parse
const ok = await verifyWebhookSignature(secret, c.req.header("LayerHop-Signature"), raw);
if (!ok) return c.text("bad signature", 400);
const event = JSON.parse(raw); // order.submitted | order.filled | order.refunded | order.failed
// deduplicate on event.id: retries resend the same id
return c.text("ok");
});Embed the swap widget
Drop a full swap card into any page with an iframe, a React component or a script tag. It runs on our domain, so wallets connect there and your page never touches keys.
import { LayerHopWidget } from "@layerhop/widget";
export function Deposit() {
return <LayerHopWidget srcChain="base" dstChain="solana" theme="dark" />;
}<iframe
src="https://layerhop.com/embed?srcChain=base&dstChain=solana&dstToken=SOL&theme=dark&integrator=myapp"
title="Swap with LayerHop"
width="440" height="680" style="border:0"
></iframe>
<script>
// Only trust messages from LayerHop.
window.addEventListener("message", (event) => {
if (event.origin !== "https://layerhop.com" || event.data?.source !== "layerhop") return;
const { type, payload } = event.data;
if (type === "resize") document.querySelector("iframe").style.height = payload.height + "px";
if (type === "status" && payload.state === "filled") console.log("Delivered", payload.srcTxHash);
});
</script>| theme | dark or light |
|---|---|
| accent | Hex colour without #, for example 22d3ee |
| radius | Card corner radius in px |
| lockSrc / lockDst | 1 locks that side's chain and token |
| hideHistory | 1 hides the recent orders list |
| integrator | Your label for attribution, a-z, 0-9 and - |
| ready | { version } |
|---|---|
| quote | { provider, srcChain, dstChain, amount, dstAmount } |
| submitted | { provider, srcChainId, srcTxHash } |
| status | { provider, srcTxHash, state } |
| error | { code, message } |
| resize | { height } |
Live preview
Deep links
Send people to a prefilled swap from a bot, a post or your own UI. Amounts are in normal units, and anything invalid falls back to defaults. The Telegram bot uses the same links.
https://layerhop.com/swap?srcChain=base&srcToken=USDC&dstChain=solana&dstToken=SOL&amount=100Try it: open this swap or ask the bot.
AI agents (MCP)
The LayerHop MCP server lets Claude, ChatGPT, Cursor and other agents list chains and tokens, quote with every fee spelled out and hand back a prefilled swap link. It holds no keys and never signs.
# Claude Code, hosted server (nothing to install)
claude mcp add --transport http layerhop https://mcp.layerhop.com/mcp
# Any stdio client: Claude Desktop, Cursor, …
npx -y @layerhop/mcpAgent setup guide · Docs for LLMs: llms.txt
Partner program
Earn your own fee on top of LayerHop's 0.30% on every swap you send through the widget, deep links or the API. Users see it as a separate line, and payouts go to your wallet.
- 1. Get listed. Send us a partner id, your fee and your EVM or Solana payout address.
- 2. Send swaps. Pass
integratoron the widget, deep links or SDK, or use your partner API key server-side to set a fee per request. - 3. Track earnings. Your swaps, fees and payouts are in the dashboard.
- LayerHop fee
- 0.30%
- Partner fee (myapp)
- Your rate
- Provider fees, gas
- When reported
Your share is recorded on every swap and paid out to your wallet.
https://layerhop.com/embed?dstChain=base&dstToken=USDC&integrator=myapp