API Endpoints
API examples
This API is a simple wrapper around the SDK offered for convenience on getting estimated bonder fee and transfer status.
Although this API is offered as a free service, it's recommended to host your own API server (see docs here) to not have any rate limit restrictions.
Endpoints
GET /v1/quote
Get estimated bonder fee to use for transfers
Input query parameters:
amount
(required) Amount in smallest use (eg. amount=1000000
which is 1 USDC)
token
(required) Token symbol (eg. token=USDC
)
fromChain
(required) From chain slug (eg. fromChain=optimism
)
toChain
(required) To chain slug (eg. toChain=polygon
)
slippage
(required) Slippage percentage (eg. slippage=0.5
which is 0.5%)
network
(optional) Ethereum network to use. Options are mainnet
(default), goerli
for testnet (eg. network=goerli
)
Chain options are: ethereum
, optimism
, arbitrum
, polygon
, gnosis
, nova
, base
Example request
Example response
Output response:
amountIn
Specified amount in.
slippage
Specified slippage.
amountOutMin
The minimum amount out to receive from AMM at origin chain (or destination chain if sending from L1), taking account AMM fees, slippage, and total bonder fee.
destinationAmountOutMin
The minimum amount out to receive from AMM at destination chain, taking account, AMM fees, slippage, and total bonder fee. Note: There is no AMM on L1, so this should be 0 when sending to L1.
bonderFee
The suggested bonder fee for the amount in. The bonder fee also includes the cost of the destination transaction fee.
estimatedReceived
The estimated amount you'll receive at the destination taking account all fees and slippage.
deadline
A default deadline of 7 days to perform swap at origin AMM (or destination AMM if sending from L1).
destinationDeadline
A default deadline of 7 days to perform swap at destination AMM. Note: There is no AMM on L1, so this should be 0 when sending to L1.
GET /v1/transfer-status
Get transfer status for tx
Input query parameters:
transferHash
(optional*) Origin transfer transaction hash
transferId
(optional*) Transfer ID
network
(optional) Ethereum network to use. Options are mainnet
(default), goerli
for testnet
* Must use at lease one option, either transactionHash
or transferId
.
Example request
Example response
Output response:
transferId
Transfer ID
transactionHash
Origin transaction hash
sourceChainId
Chain ID of origin chain
sourceChainSlug
Chain slug of origin chain
destinationChainId
Chain ID of destination chain
destinationChainSlug
Chain slug of destination chain
accountAddress
Address of transfer originator
amount
Original amount transferred in smallest unit (eg. wei)
amountFormatted
Original amount transferred in human readable format
amountUsd
Original amount transferred in USD
amountOutMin
The minimum amount out specified for AMM swap
deadline
Deadline timestamp specified in transfer
recipientAddress
Address of recipient set for transfer
bonderFee
The bonder fee amount specified in transfer in smallest unit in terms of token transferred (eg. wei)
bonderFeeFormatted
The bonder fee amount specified in transfer in human readable format
bonded
True if this transfer has been bonded (received) at the destination. Will be false if the transfer is still pending or is unbondable
bondTransactionHash
Bond (received) destination transaction hash
bonderAddress
Address of bonder for this transfer
token
Token symbol of asset bridged
timestamp
Unix timestamp of origin transfer transaction
GET /v1/available-routes
Get available routes
Input query parameters:
network
(optional) Ethereum network to use. Options are mainnet
(default), goerli
for testnet
Example request
Example response
Output response:
token
Token Symbol
sourceChainSlug
Source chain slug
sourceChainId
Source chain ID
destinationChainSlug
Destination chain slug
destinationChainId
Destination chain ID
Using custom RPC providers
You can set query parameter to specify what RPC url to use for a chain.
By default, public RPC urls are used, which are subject to rate limits. You can get better performance by specifying your own custom provider instead.
Input query parameters:
rpcUrl[ethereum]
(optional) Ethereum RPC url (eg. rpcUrl[ethereum]=https://mainnet.infura.io/v3/84842078b09946638c03157f83405213)
rpcUrl[optimism]
(optional) Optimism RPC url (eg. rpcUrl[optimism]=https://mainnet.optimism.io)
rpcUrl[arbitrum]
(optional) Arbitrum RPC url (eg. rpcUrl[arbitrum]=https://arb1.arbitrum.io/rpc)
rpcUrl[polygon]
(optional) Polygon RPC url (eg. rpcUrl[polygon]=https://polygon-rpc.com)
rpcUrl[gnosis]
(optional) Gnosis Chain RPC url (eg. rpcUrl[gnosis]=https://rpc.gnosischain.com)
rpcUrl[nova]
(optional) Nova RPC url (eg. rpcUrl[nova]=https://nova.arbitrum.io/rpc)
rpcUrl[base]
(optional) Base RPC url (eg. rpcUrl[base]=https://goerli.base.org)
Example request
Source code
The API server source code is available on github.
Additional endpoints
If you're looking for a complete API to compose bridge transfer transactions, checking approvals, and more; check out this self hosted server example on github.
Last updated