Links

Sample Transactions

Here are some samples of the transaction object that is created in swap service. Rango currently returns four different types of transactions based on the blockchain that the transaction is happening on. This includes:
  • EVM: This type supports all Ethereum-based blockchains, including Ethereum, BSC, Polygon, Fantom, Harmony, Avalanche, etc.
  • TRANSFER: This type is mostly used for UTXO blockchains, including BTC, LTC, BCH, DOGE, etc.
  • COSMOS: Rango uses this, as the name indicates, for all the cosmos-based networks, including the Cosmos itself, Sifchain, Osmosis, Sentinel, etc. + Thorchain/Terra and Binance Chain (BNB network)
  • SOLANA: For different types of Solana transactions.
Let's see some examples here.

EVM Transactions

Here is the structure of an EVM transaction:
"tx": {
// This fields equals to TransactionType.EVM for all EVMTransactions
"type": "EVM",
// The blockchain that this transaction is going to run in
"blockChain": {
"name": "FANTOM",
"defaultDecimals": 18,
"addressPatterns": [
"^(0x)[0-9A-Fa-f]{40}$"
],
"feeAssets": [
{
"blockchain": "FANTOM",
"symbol": "FTM",
"address": null
}
],
"type": "EVM",
"chainId": "250"
},
// The source wallet address, can be null
"from": "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
// Address of dex/bridge smart contract that is going to be called
"txTo": "0x2a7813412b8da8d18Ce56FE763B9eb264D8e28a8",
// Address of source token erc20 contract for increasing approve amount
"approveTo": null,
// The data of approve transaction (null value means no approve needed)
"approveData": null,
// The data of main transaction, it can be null in case of native token transfer
"txData": "0x0b320d9500000000000000000000000000000000000000000000000000000000000000000000000000000000000000006626c47c00f1d87902fc13eecfac3ed06d5e8d8a00000000000000000000000000000000000000000000000566fb0f266083987400000000000000000000000000000000000000000000000004cc4f07028c678c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000034d8edb091aed6929f535b0f06407964e2b935cc000000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000181a0615b7d0000000000000000000000000000000000000000000000000000000000007917000000000000000000000000000000000000000000000000054da24e2a77c01e000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f491e7b69e4244ad4002bc14e878a34207e38c29000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e47ff36ab50000000000000000000000000000000000000000000000078bed27ba3317dd2a00000000000000000000000000000000000000000000000000000000000000800000000000000000000000002a7813412b8da8d18ce56fe763b9eb264d8e28a80000000000000000000000000000000000000000000000000000000062b871de000000000000000000000000000000000000000000000000000000000000000200000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c830000000000000000000000006626c47c00f1d87902fc13eecfac3ed06d5e8d8a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e0000000000000000000000004691937a7508860f876c9c0a2a617e7d9e945d4b000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000000000000000000000000000001af7aa59c0e923100000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000062b875630000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eb2629a2734e272bcc07bda959863f316f4bd4cf0000000000000000000000002702d89c1c8658b49c45dd460deebcc45faec03c00000000000000000000000000000000000000000000000000000000000002200000000000000000000000001f5aaeedaa649712ccca0af8b3af0a4721c58cd2000000000000000000000000cb2a1486bcec00242b8e1934d2cb6a8075da18d900000000000000000000000000000000000000000000000000000000000000020000000000000000000000004691937a7508860f876c9c0a2a617e7d9e945d4b000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007e8a8b130272430008eca062419acd8b423d339d",
// The amount of transaction in case of native token transfer
"value": "0x57115007b8d87c01e",
// The suggested gas limit for this transaction
"gasLimit": "0x9eb10",
// The suggested gas price for this transaction
"gasPrice": "3308471992"
}

Metamask Example

Check SDK Metamask example for sample code of passing this transaction to EVM wallet:
Last modified 7mo ago