Skip to main content

Contract overview

The bridge contract exposes two functions for deposits:
The commitmentId is the quote ID from your committed quote. The API returns it as a hex string, so convert it to a uint256 before calling the contract: BigInt("0x" + quoteId).
Don’t use these functions for same-chain swaps. Those use a different contract and prepared calldata. See Same-chain swaps.

ABIs

Bridge contract ABI

ERC-20 ABI

Setup

This example uses ethers v6, but you can use any EVM library.

Call the contract

To send a deposit, call depositWithId for ERC-20 tokens or depositNativeWithId for the chain’s native token:
amount is the quote’s payAmount: a decimal string in whole token units, such as "250". See Amounts. Once the deposit is confirmed, track the transfer with webhooks or the status endpoint. See Track transactions.