Skip to main content

What is crosschainRouteMode?

crosschainRouteMode controls whether Enso may add same-chain routing around a bridge. It defaults to full. The option applies only when destinationChainId is set.

J
Written by Javier Diaz

crosschainRouteMode controls where Enso may add same-chain routing around a bridge on a cross-chain Route request. It defaults to "full". The option applies only when destinationChainId is set.

Definition

A cross-chain route can be a plain bridge of the requested tokens, or it can include a swap or other route on the source chain, the destination chain, or both. This parameter narrows that shape when your product requires it.

How it works

  • "direct" — bridge the requested tokenIn directly into the requested tokenOut.

  • "source" — route on the source chain before bridging, then bridge directly into tokenOut.

  • "destination" — bridge tokenIn directly, then route on the destination chain.

  • "sourceOrDestination" — allow routing on the source or destination chain, but not both.

  • "full" — route before and after the bridge. This is the default; you can omit the field to get it.

How Enso does this

Set crosschainRouteMode on a Route request that also has destinationChainId. See DeFi and Swap Routing. For Solana destinations, follow the Solana routing guide: Solana is a destination only, and no mode enables origin or callbacks on Solana.

FAQ

Do I need this field on a same-chain route?

No. It applies only when destinationChainId is set.

Does changing the mode change estimated delivery time?

It can change the selected path, including whether a swap happens on either side of the bridge. Always read bridgingEstimates from the quote you received.

Related articles

  • How do I add a same-asset bridge, not a swap?

  • How do I bridge and swap in one flow?

  • What is a destinationChainId?

  • Can I route assets to Solana with Enso?

  • What is a route path?

Sources

Did this answer your question?