Skip to main content
Retrieves quotes from all supported bridge protocols for comparison. Parameters:
  • tokenIn (required): Input token address
  • tokenOut (required): Output token address
  • sourceChain (required): Source blockchain
  • destinationChain (required): Destination blockchain
  • amount (required): Amount in token units
  • amountSymbol (optional): The denomination of the amount (e.g., USDC, DAI, ETH).
  • excludeBridges (optional): Comma-separated bridges to exclude
  • excludeChains (optional): Comma-separated chains to exclude from results (e.g., “BASE_TESTNET,STARKNET_TESTNET”)
  • recipient (optional): Recipient address
The amountSymbol parameter is used to specify the denomination of the amount you want to send. For quotes in USD, you need to set amountSymbol to USDC (or leave empty).You can quote in a different denomination than the token you want to send. For example, you can set amountSymbol to USDC, while sending ETH as tokenIn
import { crapi, Chainrails } from "@chainrails/sdk"

Chainrails.config({
  api_key: "your_api_key_here",
})

const quotes = await crapi.quotes.getFromAllBridges({
  tokenIn: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  tokenOut: "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4",
  sourceChain: "BASE_MAINNET",
  destinationChain: "ARBITRUM_MAINNET",
  amount: "10000000",
  excludeBridges: "GATEWAY,CCTP",
  recipient: "0x742d35Cc6635C0532925a3b8D62A7fe7B58123D1"
})

console.log("Quotes from all bridges:", quotes)