Quickstart
The whole process consists of:1
Authentication
Get a JWT to authenticate your requests.
2
Fetching bridge configs
Retrieve supported chains and tokens.
3
Getting a quote
Obtain transaction details, including fees.
4
Committing the quote
Confirm the transaction.
5
Executing the bridge transaction
Interact with the smart contract to complete the transfer.
1. Authentication
All non-public API endpoints are authenticated using a JSON Web Token. To authenticate your requests, include the token in theAuthorization header. Learn about API authentication.
2. Fetch Bridge Configs
Retrieve available chains to ensure your transaction uses the correct parameters.getBridgeConfigs.js
3. Fetch Swap token config
Retrieve available tokens for swap transactions.4. Get a Bridge & Swap Quote
Before executing a bridge transaction, you must generate a quote that provides transaction details, including fees and amounts.getBridgeSwapUserQuote.js
5. Commit the Quote
Once you have a quote, you must commit it to confirm the transaction before execution. The deadline to commit a quote is provided within theexpiresAtparam within the quote response.
commitBridgeSwapUserQuote.js
6. Execute the Bridge & Swap Transaction
Now, you can execute the bridge transaction by interacting with the smart contract. See examples for interacting with the bridge smart contracts across different blockchain environments.7. Full Example
Here’s the complete implementation combining all the steps above:index.js
Same-chain swaps
WhenchainIn === chainOut, the quote response is flagged as an atomic same-chain swap (isAtomicSwap: true). These go through a separate contract and a different transaction format than a regular bridge deposit — broadcasting a depositWithId / depositNativeWithId for an atomic same-chain swap commitment will be rejected by the deposit watcher.
Same-chain swaps are EVM-only.
The flow is identical up to step 5 (commit), then diverges:
Detect the case
After fetching the quote in step 4, check the response:Use a different approval target
For ERC-20 same-chain swaps, the approval target is the chain’ssameChainSwapsAddress (returned in GET /bridge/configs under the chain entry) — not the regular contractAddress. Native-token swaps don’t require an approval.
Fetch the swap calldata instead of building a deposit tx
Instead of calling the deposit contract, fetch the prepared calldata. ThecommitmentId is the quoteId you committed.
getSwapCalldata.js