Rango Docs
Search…
πŸ—
Rango API
The ultimate way for cross-chain swaps and relaying messages

Introduction

Rango SDK enables you to get the best cross-chain route for converting a token on the source blockchain to another token in the destination blockchain. It also enables dApps to relay an arbitrary message to the destination blockchain without any difficulties.
We have currently two versions of SDKs which are maintained and actively under development. Here is a brief comparison between them:
Feature
Basic SDK (Single TX)
SDK v1 (Multistep TXs)
SDK NPM Package
​rango-sdk-basic​
​rango-sdk​
Support all the blockchains
βœ”
βœ”
Relaying arbitray message
βœ”
✘
call your contract on destination chain
βœ”
✘
Pros. & Cons.
  • Only one TX needed
  • No gas required on the destination
  • Better UX
  • Easier to integrate
  • Multiple TXs are needed to be signed
  • May need the gas on the destination or middle networks
Price
  • Optimal price for 95% scenarios
  • Sub-optimal price for 5% scenarios
  • Covers 85% of routes
  • Best rates for all paths
Referral
Full EVM support, Thorchain, Jupiter
1inch, Paraswap, Thorchain, Jupiter
To summarize, if you are only interested in single-step TXs or you want to use our message relaying features, you need to use Basic SDK. Otherwise, if you want the best rates for the price and like multi-steps routes, SDK v1 is suitable for you.
For almost all the scenarios, we recommend you to use Basic SDK except if you have a special requirement.

1. Basic SDK (Single TX)

If you are only interested in one-step (single-tx) routes (one action by user), this is what you need.
Besides basic single steps routes for the different blockchains (Solana, Cosmos, EVM, ...), it also supports aggregated cross-chain swaps for EVM blockchains in which users could perform a multistep route (dex-bridge-dex) in a single transaction.
It's a popular use case in the multichain areas to perform a cross-chain swap. By cross-chain swap, we mean: [dex swap on source chain] + bridge + [dex swap on destination chain]
We used recent message-passing protocols such as Celer IM, Multichain anycall, or Axelar GMP as underlying services to develop our own smart contracts to perform a cross-chain swap in a single transaction.
You can also relay your own custom message from the source chain to the destination and call your contract in the destination chain in case of success or error. So you can build a fully cross-chain dApp on top of Rango.
GitHub - rango-exchange/rango-sdk at basic-api
GitHub
npm: rango-sdk-basic
npm

2. SDK v1 (Multistep TXs)

If you like multi-steps routes which you might already see in the Rango Application, this version of SDK is suitable for you.
Sample multistep route by Rango
As you see in the picture above, Rango API gives a 4 steps route to the user for swapping BSC.BNB to Solana.SOL and the user needs to sign at least one transaction for each step to complete this route. He/she also needs to have enough network fees on all middle chains. (If the route goes through some middle blockchains other than the source and the destination blockchains.)
GitHub - rango-exchange/rango-sdk: Rango Exchange SDK
GitHub
npm: rango-sdk
npm
Copy link
On this page
Introduction
1. Basic SDK (Single TX)
2. SDK v1 (Multistep TXs)