How to execute cross-chain transactions
txs
array before the actual contract call. See the ERC20 examples below.txs
array. The approval must come before the actual contract call.
amount: "0"
since there’s no ETH value
Problem: Approval transaction succeeds but contract call fails
Solution: Verify the contract address in the approval matches the contract you’re calling
Parameter | Type | Required | Description |
---|---|---|---|
user | string | Yes | Address that will pay for the transaction |
originChainId | number | Yes | Chain ID where payment originates |
destinationChainId | number | Yes | Chain ID where contract calls execute |
originCurrency | string | Yes | Currency contract on source chain (e.g., “0x0000000000000000000000000000000000000000”, “0x833589fcd6edb6e08f4c7c32d4f71b54bda02913”) |
destinationCurrency | string | Yes | Currency contract on destination chain |
amount | string | Yes | Total value of all txs combined |
tradeType | string | Yes | Must be “EXACT_OUTPUT” |
txs | array | Yes | Array of transaction objects |
txs[].to | string | Yes | Contract address to call |
txs[].value | string | Yes | ETH value to send with call |
txs[].data | string | Yes | Encoded function call data |
recipient | string | No | Alternative recipient for any surplus |
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 |
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 |
amount
equals the sum of all txs[].value
fields
☐ Check tradeType - Must be set to "EXACT_OUTPUT"
for cross-chain calls
☐ Validate call data - Ensure contract function calls are properly encoded
☐ Token addresses - Use correct ERC20 contract addresses for each chain
☐ Test contract calls - Verify contract functions work as expected on destination chain
☐ Balance verification - Confirm user has sufficient funds for amount + fees
☐ Error handling - Implement proper error handling for failed contract executions
☐ Monitor progress - Use status endpoints to track execution progress
☐ Gas estimation - Account for potential gas usage variations in contract calls