š¤Choosing the Right API
Choosing the Right API: A Tailored Comparison for Your Needs
Introduction
Rango API 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 APIs / SDKs which are maintained and actively under development. Here is a brief comparison between them:
For almost all the scenarios, we recommend you to use Basic API except if you have a special requirement.
Feature | Basic API (Single-step TX) | Main API (Multi-step TXs) |
---|---|---|
ā | ā | |
ā | ā | |
ā | ā | |
ā | ā | |
Multi-Routing Support | ā (Not implemented yet) | ā |
Pros. & Cons. | ā Only one TX needed ā Better UX ā Easier to integrate | ā Multi-Step Routes ā Multiple transactions are needed to be signed ā May need the gas on the destination or middle networks |
Routing (Price & Coverage) | ā Optimal price for 95% scenarios ā Sub-optimal price for 5% scenarios ā Covers 85% of routes | ā Best rates for all paths |
SDK NPM Package | ||
Github |
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, Multi Step SDK is suitable for you.
Basic API (Single-Step TX)
If you are only interested in one-step (single-tx) routes (one action by user), this is what you need.
Besides basic single step routes for the different blockchains (EVM, TRON, Solana, Cosmos, ...), 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 multi-chain areas to perform a cross-chain swap. By cross-chain swap, we mean: [DEX swap on source chain] + Bridge + [DEX swap on destination chain]
š¦Basic API - Single StepMain API (Multi-Step TXs)
If you like multi-steps routes which you might already see in the Rango dApp, this version of API/SDK is suitable for you.
As you see in the picture above, Rango API gives multiple routes with multiple steps to the user for swapping STARKNET.ETH to SOLANA.SOL and the user needs to sign at least one transaction for each step to complete this route. Users also need 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.)
š¦Main API - Multi StepLast updated