Skip to navigation

Bridge Integration

This guide covers the HyperFlow Bridge API endpoints for generating bridge quotes (/quote) and constructing transactions (/encode), with the simplest path to fetch and execute a bridge. For advanced use cases, see the OpenAPI spec (open it in the viewer of your choice, e.g. Swagger UI — a third-party viewer).

Base URL: https://bridge-ag-api.hyperflow.fun/v1 — all endpoints serve mainnet only; there is no public testnet environment. No API key is required; for partner access, contact the team on Discord.

Bridge flow

Four steps: 1 Quote (GET /quote — compare routes, get requestId), 2 Encode within 30 seconds (POST /encode — assemble the transaction), 3 Submit (sign and send on the source chain), 4 Track (GET /hyperbridge/orders until done or refunded).
1

Generate a quote

Submit a request to /quote with:

Required parameters

ParameterDescription
fromChainSource chain identifier (e.g. ethereum)
fromTokenToken address on the source chain. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native gas tokens
toChainDestination chain identifier (e.g. hyperevm)
toTokenToken address on the destination chain (same native placeholder applies)
amountTransfer amount as a fixed-precision integer string in the token’s smallest unit (e.g. 500000000000000000 = 0.5 ETH)
protocolsComma-separated protocol ids to consider — see the table below; pass the full list to compare all routes

Optional (recommended)

ParameterDescription
senderAddress initiating the transfer
receiverAddress receiving funds on the destination chain
slippageMax slippage where 100 = 1% (default 100)
sourcePartner code for points attribution and CoreWriter flows — see Points Integration

Protocol ids

idRole
layerzeroBridge rail — USD₮0 / USDe canonical transfers
hyperunitBridge rail — native-asset rails (UETH, UBTC, USOL, UPUMP)
relayBridge rail — fast, low-cost transfers
mayanBridge rail — cross-chain swaps at size
gaszipBridge rail — small transfers and gas top-ups
orbitBridge rail — Elysium canonical bridge between HyperEVM and Elysium
hypercoreHyperliquid-native bridge — direct USDC via Hyperliquid’s bridge
hypercorespotHyperliquid-native swap leg — HyperCore spot order book
kyberswapSwap leg on EVM chains
hyperflowSwap leg — HyperFlow DEX aggregator on HyperEVM
wrapnativeSwap leg — wrap/unwrap the native token

The app’s “HyperFlow Prefunding” route is an app-level rail and has no public protocol id.

Chain identifiers, always lowercase:

ethereum · arbitrum · optimism · base · unichain · flare · plasma · hyperevm · hypercore · elysium

When sender and receiver are provided, /quote returns both the quote details and a requestId, which is required to assemble the transaction with /encode. Without them, /quote can still be used purely to fetch rates before a wallet is connected.

const api = "https://bridge-ag-api.hyperflow.fun/v1";
const params = {
fromChain: "ethereum",
fromToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
toChain: "hyperevm",
toToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
amount: "500000000000000000",
protocols: "kyberswap,hyperflow,wrapnative,hypercore,layerzero,hyperunit,gaszip,relay",
sender: "0xYourWalletAddress",
receiver: "0xYourWalletAddress",
slippage: "100",
};
const query = new URLSearchParams(params).toString();
const quote = await fetch(`${api}/quote?${query}`).then((r) => r.json());
const amountOuts = quote.data.map(
(path) => ({amountOut: path.amountOut, bridge: path.crossProtocol.id})
);
console.log("requestId:", quote.requestId);
console.log("amountOuts:", amountOuts);

Example output:

{
"requestId": "86ebef0d0cd6d1c7069fabcc1ca26989",
"amountOuts": [
{ "amountOut": "8034986893632684032", "bridge": "gaszip" },
{ "amountOut": "8012536653122581124", "bridge": "layerzero" },
{ "amountOut": "8012260919909958289", "bridge": "layerzero" },
{ "amountOut": "7923594347065026878", "bridge": "relay" },
{ "amountOut": "7888846554498563072", "bridge": "mayan" }
]
}
2

Assemble the transaction

The HyperFlow API assembles the on-chain transaction — manual construction is not supported. Submit the requestId and your chosen quote index to /encode.

The requestId expires 30 seconds after the quote is generated.

const selectedQuoteIndex = 0;
const txData = await fetch(`${api}/encode`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
requestId: quote.requestId,
quoteIdx: selectedQuoteIndex,
}),
}).then((r) => r.json());
console.log("txData:", txData);

/encode returns the transaction under data:

{
"status": "ok",
"data": {
"to": "0xb4580138102bda0c7e8c9a05529ba5f70cdf1e93",
"value": "10000000000000000000",
"data": "0xb4c95169…"
},
"requestId": "52a26c2b01f0feadbb968869f7d40c82"
}

data contains only to, value, and data — set the chain via your provider (connect to the source-chain RPC) and let your wallet estimate gas. Note that /encode returns a new requestId, distinct from the quote’s.

3

Submit the transaction

Sign and send txData.data with an EOA wallet, or execute it via a low-level contract call using the txData.data.data calldata. Modifying the calldata or hand-crafting HyperFlow router calls is unsupported and at your own risk.

import { ethers } from "ethers"; // ^6
const rpc = "https://ethereum-rpc.publicnode.com"; // RPC of the SOURCE chain (fromChain)
const provider = new ethers.JsonRpcProvider(rpc);
const wallet = new ethers.Wallet(process.env.PRV_KEY, provider);
const txRes = await wallet.sendTransaction(txData.data); // { to, value, data }
console.log("tx_hash:", txRes.hash);
const receipt = await txRes.wait();
console.log("mined_block:", receipt.blockNumber);
4

Track the bridge status

A confirmed source-chain transaction does not mean the bridge is complete. Poll /hyperbridge/orders with the source transaction hash. Each order’s state field can be pending, done, refunded, or failed.

const status = await fetch(`${api}/hyperbridge/orders?src_tx=${txRes.hash}`).then((r) => r.json());
if (status.orders.length > 0) console.log("order state:", status.orders[0].state);

Elysium routes

Elysium connects to HyperEVM through its canonical bridge, protocol id orbit. Quote and encode it like any other route, with elysium as the chain identifier and orbit in protocols.

DirectionTokensTimeFee
HyperEVM → ElysiumHYPE, WHYPE, USDCAbout 1–2 minutesA delivery fee in HYPE, included in the transaction value. Any unused part is refunded to the receiver on Elysium
Elysium → HyperEVMHYPE, WHYPE, USDCSeveral days, until the withdrawal is final on HyperEVMGas only

The quote’s duration field shows the expected time for each route. Elysium has no direct route from other chains: bridge to HyperEVM first, then from HyperEVM to Elysium.

Token on ElysiumAddress
HYPE (native)0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
WHYPE0xbA876237B0F021A6c6D852d6c26E107997cC5E81
USDC0xb47c4C8F73F009CC0C0d3f92B388d13E293F0B65
const params = {
fromChain: "hyperevm",
fromToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
toChain: "elysium",
toToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
amount: "1000000000000000000",
protocols: "orbit",
sender: "0xYourWalletAddress",
receiver: "0xYourWalletAddress",
};

Errors

Errors are returned as {"error": "<message>"}:

ResponseMeaning
400 {"error":"no quotes found"}The requestId is expired or unknown — re-quote and call /encode within 30 seconds
400 {"error":"chain not found"}Unrecognized chain identifier

Need help?