# Sample Transactions

## Overview

Here are some samples of the transaction object that is created in [swap](/api-integration/basic-api-single-step/api-reference/create-transaction-swap.md) method. Rango currently returns 6 different types of transactions based on the blockchain that the transaction is happening on. This includes:

* **EVM**: For all EVM-based blockchains, including Ethereum, Polygon, Avalanche, etc.
* **COSMOS**: For all the cosmos-based networks, including the Cosmos itself, Osmosis, Akash, Thorchain, Maya and etc.
* **TRANSFER**: For UTXO blockchains, including Bitcoin, Litecoin, Doge, etc.
* **SOLANA:** For Solana transactions.
* **TRON:** For Tron Transactions.&#x20;
* **STARKNET:** For Starknet transactions.
* **SUI:** For SUI transactions.
* **XRPL:** For XRPL transactions.
* **STELLAR**: For Stellar transactions

Let's see some examples here.

## EVM Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=POLYGON.MATIC\&to=OPTIMISM.ETH\&amount=1000000000000000000000\&slippage=8\&fromAddress=0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88\&toAddress=0x6f33bb1763eebead07cf8815a62fcd7b30311fa3\&disableEstimate=true\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

Here is the structure of an EVM transaction in the code below.

If the user does not have a sufficient approval amount for the transaction, the data for the approval transaction will be included in the `approveData` and `approveTo` fields. In this case, the user needs to sign the approval transaction first, ensure he has enough approval, and then signs the main transaction. However, if the `approveData` and `approveTo` fields are null, it indicates that the user already has enough approval for this quote and can directly sign the main transaction.

{% hint style="info" %}
For the gas price of the transaction, if the blockchain supports the new versions of gas price, such as `maxPriorityFeePerGas` and `maxFeePerGas`, these fields will be populated. However, for blockchains that have not yet updated their gas model, the gas price will be set in the `gasPrice` field as before. You can check the list of all chains that support the new gas price versions in the `meta` or `blockchains` methods. (There is an `enableGasV2` field in the response body, included for each blockchain.)
{% endhint %}

```json
"tx": {
  // This field equals to EVM for all EVM Transactions
  "type": "EVM",
  
  // The blockchain that this transaction is going to run in
  "blockChain": {      
    "name": "POLYGON",
    "defaultDecimals": 18,
    "addressPatterns": [
      "^(0x)[0-9A-Fa-f]{40}$"
    ],
    "feeAssets": [
      {
        "blockchain": "POLYGON",
        "symbol": "MATIC",
        "address": null
      }
    ],
    "type": "EVM",
    "chainId": "137"
  },
  
  // The source wallet address, can be null
  "from": "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
  
  // Address of dex/bridge smart contract that is going to be called
  // It's usually rango contract address
  "txTo": "0x69460570c93f9DE5E2edbC3052bf10125f0Ca22d",
  
  // 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": null, // e.g. 3308471992
  
  // Recommended max priority fee per gas for this transaction
  // Used only for blockchains with enableGasV2 = true (in meta endpoint)
  "maxPriorityFeePerGas": "46350100970",

  // Suggested max fee per gas for this transaction (max value for BaseGasPrice + PriorityGasPrice)
  // Used only for blockchains with enableGasV2 = true (in meta endpoint)
  "maxFeePerGas": "46350100971"
}
```

## COSMOS Sample Transaction:

For Cosmos based blockchains, we have two type of transactions based on `signType` field: `AMINO` and `DIRECT`.&#x20;

### Cosmos Amino Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=OSMOSIS.OSMO\&to=OSMOSIS.ATOM--ibc%2F27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2\&amount=1000000\&slippage=8\&fromAddress=osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl\&toAddress=osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl\&disableEstimate=true\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

<pre class="language-json"><code class="lang-json">"tx": {
  // This field equals to COSMOS for all COSMOS Transactions
  "type": "COSMOS",

  // Source wallet address for this transaction
  "fromWalletAddress": "osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl",

  // The blockchain that this transaction is going to run in
  "blockChain": "OSMOSIS",

  // A real cosmos message, most fields of this object should be directly passed
  // to wallet for signing by user, the important part is msgs field that contains
  // all the cosmos actions that should be performed.
  "data": {
      "chainId": "osmosis-1",
      "account_number": 102721,
      "sequence": "686",
      "msgs": [
        {
          "type": "osmosis/gamm/swap-exact-amount-in",
          "value": {
            "sender": "osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl",
            "routes": [
              {
                "pool_id": "5",
                "token_out_denom": "ibc/9712DBB13B9631EDFA9BF61B55F1B2D290B2ADB67E3A4EB3A875F3B6081B3B84"
              },
              {
                "pool_id": "6",
                "token_out_denom": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"
              }
            ],
            "token_in": {
              "denom": "uosmo",
              "amount": "1000000"
            },
            "token_out_min_amount": "49999"
          }
        }
      ],
      "protoMsgs": [
        {
          "type_url": "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn",
          "value": [
            10,
            43,
            // ...
          ]
        }
      ],
      "memo": "",
      "source": null,
      "fee": {
        "gas": "900000",
        "amount": [
          {
            "denom": "uosmo",
            "amount": "22500"
          }
        ]
      },
      // Sign type, could be AMINO or DIRECT
<strong>      "signType": "AMINO",
</strong>      "rpcUrl": "https://osmosis-rpc.polkachu.com"
    },
    
    // @deprecated An alternative to CosmosMessage object for the cosmos wallets 
    // that do not support generic Cosmos messages 
    "rawTransfer": null
  }
}
</code></pre>

### Cosmos Direct Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=JUNO.JUNO\&to=JUNO.ATOM--ibc%2Fc4cff46fd6de35ca4cf4ce031e643c8fdc9ba4b99ae598e9b0ed98fe3a2319f9\&amount=1000000\&slippage=8\&fromAddress=juno1unf2rcytjxfpz8x8ar63h4qeftadptg54xrtf3\&toAddress=juno1unf2rcytjxfpz8x8ar63h4qeftadptg54xrtf3\&disableEstimate=true\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

This type is only used in limited swappers like WYNDDex (and Juno Blockchain) and we are going to deprecate support for Cosmos Direct transaction types whenever possible.  You could sign this type of transactions using Stargate Client library.

<pre class="language-json"><code class="lang-json">"tx": {
  // This field equals to COSMOS for all COSMOS Transactions
  "type": "COSMOS",

  // Source wallet address for this transaction
  "fromWalletAddress": "juno1unf2rcytjxfpz8x8ar63h4qeftadptg54xrtf3",
  "blockChain": "JUNO",
  "data": {
    "chainId": "juno-1",
    "account_number": 125507,
    "sequence": "309",
    "msgs": [
      {
        "typeUrl": "/cosmwasm.wasm.v1.MsgExecuteContract",
        "value": {
          "sender": "juno1unf2rcytjxfpz8x8ar63h4qeftadptg54xrtf3",
          "contract": "juno1pctfpv9k03v0ff538pz8kkw5ujlptntzkwjg6c0lrtqv87s9k28qdtl50w",
          "msg": "eyJleGVjdXRlX3N3YXBfb3BlcmF0aW9ucyI6eyJvcGVyYXRpb25zIjpbeyJ3eW5kZXhfc3dhcCI6eyJhc2tfYXNzZXRfaW5mbyI6eyJuYXRpdmUiOiJpYmMvQzRDRkY0NkZENkRFMzVDQTRDRjRDRTAzMUU2NDNDOEZEQzlCQTRCOTlBRTU5OEU5QjBFRDk4RkUzQTIzMTlGOSJ9LCJvZmZlcl9hc3NldF9pbmZvIjp7Im5hdGl2ZSI6InVqdW5vIn19fV0sIm1heF9zcHJlYWQiOiIwLjAxIn19",
          "funds": [
            {
              "denom": "ujuno",
              "amount": "1000000"
            }
          ]
        }
      }
    ],
    "protoMsgs": [],
    "memo": "",
    "source": null,
    "fee": {
      "gas": "1000000",
      "amount": [
        {
          "denom": "ujuno",
          "amount": "2500"
        }
      ]
    },
    // Sign type, could be AMINO or DIRECT
<strong>    "signType": "DIRECT",
</strong>    "rpcUrl": "https://rpc-juno.itastakers.com:443/"
  },

  // @deprecated An alternative to CosmosMessage object for the cosmos wallets 
  "rawTransfer": null
}
</code></pre>

## Transfer Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=BCH.BCH\&to=ETH.ETH\&amount=10000000000\&slippage=8\&fromAddress=qruy9zr8x9k335pkvqpfas3jsjfesq5gzu4nreyn4j\&toAddress=0x6f33bb1763eebead07cf8815a62fcd7b30311fa3\&disableEstimate=true\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

Here is the structure of an UTXO (Transfer) transaction:&#x20;

```json
{
  "tx": {
    // This field equals to TRANSFER for all UTXO Transactions
    "type": "TRANSFER",

    // The method that should be passed to wallet including deposit, transfer
    "method": "transfer",

    // Source wallet address that can sign this transaction
    "fromWalletAddress": "qruy9zr8x9k335pkvqpfas3jsjfesq5gzu4nreyn4j",

    // Destination wallet address that the fund should be sent to
    "recipientAddress": "qzumtx6ufk3qu92slcsg5ajehujehzcquydmhaq0eh",

    // The memo of transaction, can be null
    "memo": "=:ETH.ETH:0x6f33bb1763eebead07cf8815a62fcd7b30311fa3:1080176077:rg:0",

    // The machine-readable amount of transaction
    "amount": "10000000000",

    // The decimals of the asset
    "decimals": 8,

    // An asset with its ticker
    "asset": {
      "blockchain": "BTC",
      "symbol": "BTC",
      "address": null,
      "ticker": "BTC"
    }
  },
  // Partially signed bitcoin transaction
  "psbt": {
    "unsignedPsbtBase64": "cHNidP8BAH0CAAAAAdeeknt27QIuENUtqyEuDWKi0HjMR6J8OyFIH0AeCowYAAAAAAD/////AoCWmAAAAAAAIlEgD5gCxhBANQBrbG92Di7Y0wPGEgBXxa9K7mVT0IIvONIM+SMCAAAAABYAFOoXzf1rD8gSxTM022thJ3/639UBAAAAAAABAR9QkbwCAAAAABYAFOoXzf1rD8gSxTM022thJ3/639UBAAAA",
    "inputsToSign": [
      {
        "address": "bc1qagtumlttplyp93fnxndkkcf80ladl4gpnmv25u",
        "signingIndexes": [0]
      }
    ]
  }
}

```

## Tron Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=TRON.TRX\&to=TRON.USDT--TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\&amount=1000000\&slippage=8\&fromAddress=TGmhZwFoCZYBcbJt82TmKQ3HXCmcV2UrGT\&toAddress=TGmhZwFoCZYBcbJt82TmKQ3HXCmcV2UrGT\&disableEstimate=true\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

Here is the structure of a Tron transaction. Similar to EVM transactions, if user doesn't have enough approval for this quote, he needs to sign approve transaction first based on `approve_payload`, `approve_raw_data`, and `approve_raw_data_hex` fields and then sign the main transaction.

```json
"tx": {
  // This field equals to TRON for all TRON Transactions
  "type": "TRON",
  // Transaction blockchain
  "blockChain": {
    "name": "TRON",
    "defaultDecimals": 18,
    "addressPatterns": [
      "^T[1-9A-HJ-NP-Za-km-z]{33}$"
    ],
    "feeAssets": [
      {
        "blockchain": "TRON",
        "symbol": "TRX",
        "address": null
      }
    ],
    "type": "TRON",
    "chainId": "728126428"
  },
  // The data of smart contract call
  "raw_data": {
    "contract": [
      {
        "parameter": {
          "value": {
            "data": "b24ebddb000000000000000000000000000000000000000000000000000000000001160500000000000000000000000000000000000000000000000000000189ea5a08a000000000000000000000000000000000000000000000000000000000000f4240",
            "owner_address": "414a9bbc3fe169c752a08de9c7becfb4921034ae4a",
            "contract_address": "41a2726afbecbd8e936000ed684cef5e2f5cf43008",
            "call_value": 1000000
          },
          "type_url": "type.googleapis.com/protocol.TriggerSmartContract"
        },
        "type": "TriggerSmartContract"
      }
    ],
    "ref_block_bytes": "1091",
    "ref_block_hash": "5310b46b57c59d0d",
    "expiration": 1691853975000,
    "fee_limit": 1500000000,
    "timestamp": 1691853916537
  },
  "approve_raw_data": null,
  "raw_data_hex": "0a02109122085310b46b57c59d0d40d8dbebd29e315ad301081f12ce010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741298010a15414a9bbc3fe169c752a08de9c7becfb4921034ae4a121541a2726afbecbd8e936000ed684cef5e2f5cf4300818c0843d2264b24ebddb000000000000000000000000000000000000000000000000000000000001160500000000000000000000000000000000000000000000000000000189ea5a08a000000000000000000000000000000000000000000000000000000000000f424070f992e8d29e31900180dea0cb05",
  "approve_raw_data_hex": null,
  "__payload__": {
    "call_value": 1000000,
    "contract_address": "41a2726afbecbd8e936000ed684cef5e2f5cf43008",
    "fee_limit": 1500000000,
    "function_selector": "trxToTokenSwapInput(uint256,uint256,uint256)",
    "owner_address": "414a9bbc3fe169c752a08de9c7becfb4921034ae4a",
    "parameter": "000000000000000000000000000000000000000000000000000000000001160500000000000000000000000000000000000000000000000000000189ea5a08a000000000000000000000000000000000000000000000000000000000000f4240",
    "chainType": 0
  },
  "approve_payload": null,
  "txID": "45a6390a1c1fe80832bd654cbb08bd5c6e804f4fe7f0fc4014421b84280e044c",
  "approveTxID": null,
  "visible": false,
  "approveVisible": null
}
```

## Starknet Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=STARKNET.ETH--0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\&to=STARKNET.DAI--0xda114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3\&amount=1000000\&slippage=8\&fromAddress=0x473ab17973104e37d341d8127e1b109e7960443a7b08abb63a76e1e3e405067\&toAddress=0x473ab17973104e37d341d8127e1b109e7960443a7b08abb63a76e1e3e405067)

Here is the structure of a Starknet transaction. Similar to EVM transactions, if user doesn't have enough approval for this quote, he needs to sign approve transaction first based on `approveCalls` field first and then sign the main transaction.

```json
"tx": {
  // This field equals to STARKNET for all STARKNET Transactions
  "type": "STARKNET",

  // Transaction blockchain
  "blockChain": "STARKNET",

  // List of calldata to sign a multiple transaction
  "calls": [
    {
      "contractAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "entrypoint": "approve",
      "calldata": [
        "0x07a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1",
        "0x000000000000000000000000000f4240",
        "0x00000000000000000000000000000000"
      ]
    },
    {
      "contractAddress": "0x07a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1",
      "entrypoint": "swapExactTokensForTokens",
      "calldata": [
        "0x000000000000000000000000000f4240",
        "0x00000000000000000000000000000000",
        "0x00000000000000000000000065434224",
        "0x00000000000000000000000000000000",
        "2",
        "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
        "0xda114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3",
        "0x473ab17973104e37d341d8127e1b109e7960443a7b08abb63a76e1e3e405067",
        "1691858292"
      ]
    }
  ],

  // List of approves calldata if needed
  "approveCalls": null,

  // Max fee for the transaction
  "maxFee": null
}
```

## Solana Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=SOLANA.SOL\&to=SOLANA.USDC--EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\&amount=1000000000\&slippage=3.0\&disableEstimate=true\&fromAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&toAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

{% hint style="warning" %}
**Base64 Encoding**

Remember to broadcast the signed transaction to Solana RPCs with **base64** encoding. The **base58 encoding is deprecated**, but it is still the default method in Solana [docs](https://solana.com/docs/rpc/http/sendtransaction).&#x20;
{% endhint %}

{% hint style="info" %}
**Versioned vs Legacy**

All supported routes for Solana are `VERSIONED` transactions except a special case of converting `SOL` to `WSOL` or vice versa via Solana Wrapper. (which you can ignore it.)

* [Sample for versioned transaction](https://api.rango.exchange/basic/swap?from=SOLANA.SOL\&to=SOLANA.USDC--EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\&amount=1000000000\&slippage=3.0\&disableEstimate=true\&fromAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&toAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)
* [Sample for legacy transaction](https://api.rango.exchange/basic/swap?from=SOLANA.SOL\&to=SOLANA.WSOL--So11111111111111111111111111111111111111112\&amount=1000000000\&slippage=3.0\&disableEstimate=true\&fromAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&toAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)
  {% endhint %}

<pre class="language-json"><code class="lang-json">"tx": {
     // This field equals to SOLANA for all SOLANA Transactions
    "type": "SOLANA",
    
    // Transaction blockchain
    "blockChain": "SOLANA",
    
    // Wallet address of transaction initiator
    "from": "3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F",
    
    // Transaction identifier in case of retry
    "identifier": "Swap",
    
    // List of instructions
    "instructions": [ ],

    // Recent blockHash. Nullable. Filled only if message is already partially signed
    "recentBlockhash": null,
    
    // List of signatures. Filled only if message is already partially signed
    "signatures": [ ],
    
    // When serialized message appears, there is no need for other fields and you just sign and send it
    "serializedMessage": [1, 0, 95, 96, ..., 1, 253], 
    
    // Could be LEGACY or VERSIONED
<strong>    "txType": "VERSIONED"
</strong>  }
</code></pre>

## SUI Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=SUI.SUI\&to=SOLANA.SOL\&amount=10000000000\&slippage=3.0\&disableEstimate=true\&fromAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&toAddress=3HsNMDtxPRUzwLpDJemmNVbasm11Ei5CGGCjktgHh27F\&apiKey=c6381a79-2817-4602-83bf-6a641a409e32)

{% hint style="info" %}
**Key Notes:**

* The **unsignedPtbBase64** field is a base64-encoded string that contains the transaction's raw data. This is typically used to create the signed transaction, which would then be broadcasted to the blockchain.
  {% endhint %}

<pre class="language-json"><code class="lang-json"><strong>"tx": {
</strong>    "type": "SUI",
    "blockChain": "SUI",
    // Base64-encoded unsigned transaction data
    "unsignedPtbBase64": "AAAA...&#x3C;base64_encoded_data>..."
  }

</code></pre>

## XRPL Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=XRPL.XRP\&to=BASE.ETH\&amount=5000000)

{% hint style="info" %}
**Key Notes:**

* **Trust lines (IOUs):** When the destination token is not the native XRP, you need to set up a trust line to the issuer account before the swap (wallets can sign this as a pre-tx)
  {% endhint %}

{% hint style="warning" %}
Make sure to check and implement the [Transaction Prerequisites](/api-integration/basic-api-single-step/transaction-prerequisites.md) before integration of XRPL network.
{% endhint %}

```json
 "tx": {
        "type": "XRPL",
        "blockChain": "XRPL",
        "data": {
            "TransactionType": "Payment",
            "Destination": "rM27yzkCw6WA3T4g1sPaeC1kpxHUhuxRWn",
            "Amount": "10231000",
            "Memos": [
                {
                    "Memo": {
                        "MemoData": "7B2266726F6D546F6B656E223A22307865656565656565656565656565656565656565656565656565656565656565656565656565656565222C22746F546F6B656E223A2258525041594E45547C72616E676F4465787C302E3031222C2273656E646572223A22724769537053387177614B4E62386E6D6A3234616831794767724434346B36543663222C2264657374696E6174696F6E223A22724769537053387177614B4E62386E6D6A3234616831794767724434346B36543663222C226D696E52657475726E416D6F756E74223A22393136393338353234373034303030303030303030303030222C2266726F6D416D6F756E74223A223130323331303030227D"
                    }
                }
            ]
        },
        "type": "XRPL"
    }


```

```json
 "tx": {
        "type": "XRPL",
        "blockChain": "XRPL",
        "data": {
            "TransactionType": "Payment",
            "Destination": "rM27yzkCw6WA3T4g1sPaeC1kpxHUhuxRWn",
            "Amount": "10231000",
            "Memos": [
                {
                    "Memo": {
                        "MemoData": "7B2266726F6D546F6B656E223A22307865656565656565656565656565656565656565656565656565656565656565656565656565656565222C22746F546F6B656E223A2258525041594E45547C72616E676F4465787C302E3031222C2273656E646572223A22724769537053387177614B4E62386E6D6A3234616831794767724434346B36543663222C2264657374696E6174696F6E223A22724769537053387177614B4E62386E6D6A3234616831794767724434346B36543663222C226D696E52657475726E416D6F756E74223A22393136393338353234373034303030303030303030303030222C2266726F6D416D6F756E74223A223130323331303030227D"
                    }
                }
            ]
        },
        "prerequisites": [
                {
                        "type": "XRPL_CHANGE_TRUSTLINE",
                        "currency": "The Xrpl output asset currency, such as USDC",
                        "issuer": "The Xrpl output asset issuer",
                        "value": "Minimum expected value of trust for the Xrpl asset",
                        "wallet": "User's wallet address which must have this trustline allowed for the Xrpl asset" 
                }
        ],
    }


```

```json
 "tx": {
        "type": "XRPL",
        "blockChain": "XRPL",
        "data": {
            "TransactionType": "Payment",
            "Destination": "rM27yzkCw6WA3T4gsPaeC1kpxHUhuxRWn",
            "Amount": {
                "currency": "CSC",
                "value": "256461.000000000000000000",
                "issuer": "rCSCManTZ8ME9EoLrSHHY1KW8PPwWMgkwr"
            },
            "Memos": [
                {
                    "Memo": {
                        "MemoData": "7B2266726F6D546F6B656E223A22724353434D616E545A384D4539456F4C72534848594B5738505077574D676B7772222C22746F546F6B656E223A22307865656565656565656565656565656565656565656565656565656565656565656565656565656565222C2273656E646572223A22724769537053387177614B4E62386E6D6A3234616831794767724434346B36543663222C2264657374696E6174696F6E223A22724769537053387177614B4E62386E6D6A3234616831794767724434346B36543663222C226D696E52657475726E416D6F756E74223A2237303230333339222C2266726F6D416D6F756E74223A22323536343631303030303030303030303030303030303030227D"
                    }
                }
            ]
        },
        "prerequisites": [
                {
                        "type": "XRPL_CHANGE_TRUSTLINE",
                        "currency": "The Xrpl output asset currency, such as USDC",
                        "issuer": "The Xrpl output asset issuer",
                        "value": "Minimum expected value of trust for the Xrpl asset",
                        "wallet": "User's wallet address which must have this trustline allowed for the Xrpl asset" 
                }
        ],
    }
```

## Stellar Sample Transaction: [(Test)](https://api.rango.exchange/basic/swap?from=STELLAR.XLM\&to=STELLAR.USDC--USDC-GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN\&amount=50000000)

In order to execute a transaction on stellar network, Rango provides you a base64 encoded External Data Representation or XDR for operations and memo of the transaction, and preconditions of a PreconditionsV2. You can check the [official Stellar docs regarding XDRs](https://developers.stellar.org/docs/learn/fundamentals/data-format/xdr) in Stellar Network. This value must be signed by user's wallet.

{% hint style="info" %}
**Key Notes:**

* **Trust lines:** When the destination token is not the native XLM, the API returns a trust-line prerequisites which must be signed and broadcasted before signing and broadcasting the swap transaction. In some of the swaps, Rango would be able to include the `ChangeTrustOperation` in the transaction itself, and so no trust-line prerequisite would be returned by the API.
  {% endhint %}

{% hint style="warning" %}
Make sure to check and implement the [Transaction Prerequisites](/api-integration/basic-api-single-step/transaction-prerequisites.md) before integration of Stellar network.
{% endhint %}

Note that for non-native Stellar assets, user's wallet must allow a trustline for the asset in order to receive it.&#x20;

<pre class="language-json"><code class="lang-json"><strong> "transaction": {
</strong>        "type": "STELLAR",
        "blockChain": "STELLAR",
        "data": {
                "baseFee": null, // Optional BigInt value, Recommended base fee (in stroops) for building the stellar transaction
                "preconditions": {        // CAP-21 PreconditionsV2 of transaction transaction
                        "timeBounds": { // Optional, time bounds of stellar transaction data
                                "minTime": 1778506995, // BigInt value, Unix timestamped constraint for minimum time of transaction validity
                                "maxTime": 1779506995 // BigInt value, Unix timestamped constraint for maximum time of transaction validity
                        },
                        "ledgerBounds": { // Optional, ledger bounds of stellar transaction data, Transaction only valid for ledger numbers n such that minLedger &#x3C;= n &#x3C; maxLedger
                                "minLedger": 1000, // BigInt value, Minimum ledger for transaction validity
                                "maxLedger": 0 // BigInt value, Maximum ledger for transaction validity, 0 here means NO maxLedger
                        },
                        "minSeqNumber": null, // BigInt value, If NULL, only valid when sourceAccount's sequence number is seqNum - 1.  Otherwise, valid when sourceAccount's sequence number n satisfies minSeqNum &#x3C;= n &#x3C; tx.seqNum
                        "minSeqAge": null, // BigInt value, For the transaction to be valid, the current ledger time must be at least minSeqAge greater than sourceAccount's seqTime
                        "minSeqLedgerGap": null, // BigInt value, For the transaction to be valid, the current ledger number must be at least minSeqLedgerGap greater than sourceAccount's seqLedger
                        "extraSigners": null // Optional list of strings, For the transaction to be valid, there must be a signature corresponding to every Signer in this array
                },
                "operationsXdrBase64": [ // list of operations as base 64 encoded strings
                        "AAA...",
                        "AAA..."
                ],
                "memoXdrBase64": null // base 64 encoded memo of transaction
        },
        "prerequisites": [
                {
                        "type": "STELLAR_CHANGE_TRUSTLINE",
                        "code": "The stellar output asset code, such as USDC",
                        "issuer": "The stellar asset issuer, e.g.: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
                        "value": "The minimum amount of required trustline for this stellar asset, such as 11.50",
                        "wallet": "User's wallet address which must have this trustline allowed for the stellar asset" 
                }
        ]
    }
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rango.exchange/api-integration/basic-api-single-step/sample-transactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
