Actions
getQuote
Get a quote for a crosschain relay (bridge, swap, call, etc)
Parameters
Property | Description | Required |
---|---|---|
chainId | The chain id to deposit funds on | ✅ |
toChainId | The chain id to execute the txs on | ✅ |
currency | Address for a supported native currency or valid erc20 | ✅ |
toCurrency | Address for a supported native currency or valid erc20 | ✅ |
tradeType | Either EXACT_INPUT for quoting via an input amount, or EXPECTED_OUTPUT /EXACT_OUTPUT for quoting via an output amount. | ✅ |
amount | Amount in wei, in the supplied currency | ❌ |
wallet | A valid WalletClient from viem or an adapted wallet generated from an adapter that meets this interface. | ❌ |
recipient | A valid address to send the funds to, defaults to wallet address if not sepcified | ❌ |
txs | An array of either transaction objects (made up of a to, data and value properties) or viem request objects returned from viem’s simulateContract function. | ❌ |
options | Additional options that map directly to the quote API. | ❌ |
Native Bridge Example
Cross-Chain Swap Example
Wrap/Unwrap Example
Send Example
Note - Quotes can go stale after 30 seconds. Clients should regularly fetch fresh quotes so that users are always submitting valid transactions. See Getting a quote for more information on how quotes work.