How to implement token bridging
Parameter | Type | Required | Description |
---|---|---|---|
user | string | Yes | Address that will deposit funds and submit transactions |
originChainId | number | Yes | Source chain ID (e.g., 1 for Ethereum) |
destinationChainId | number | Yes | Destination chain ID (e.g., 8453 for Base) |
originCurrency | string | Yes | Currency contract on source chain (e.g., “0x0000000000000000000000000000000000000000”, “0x833589fcd6edb6e08f4c7c32d4f71b54bda02913”) |
destinationCurrency | string | Yes | Currency contract on destination chain |
amount | string | Yes | Amount in wei/smallest unit |
tradeType | string | Yes | ”EXACT_INPUT” or “EXACT_OUTPUT” |
recipient | string | No | Recipient address (defaults to user) |
slippageTolerance | string | No | Slippage in basis points (e.g., “50” for 0.5%) |
useExternalLiquidity | boolean | No | Use canonical+ bridging for more liquidity |
referrer | string | No | Identifier that can be used to monitor transactions from a specific source. |
refundTo | string | No | Address to send the refund to in the case of failure, if not specified the user address is used |
topupGas | boolean | No | If set, the destination fill will include a gas topup to the recipient (only supported for EVM chains if the requested currency is not the gas currency on the destination chain) |
topupGasAmount | string | No | The destination gas topup amount in USD decimal format, e.g 100000 = $1. topupGas is required to be enabled. Defaults to 2000000 ($2) |
/intents/status
endpoint:
Status | Description |
---|---|
waiting | Deposit tx for the request is yet to be indexed |
pending | Deposit tx was indexed, now the fill is pending |
success | Relay completed successfully |
failure | Relay failed |
refund | Funds were refunded due to failure |