πΉSample Transactions
Sample transactions for all types of transactions in main API
Overview
Here are some samples of the transaction object that is created in create transaction 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.
STARKNET: For Starknet transactions.
SUI: For SUI transactions.
XRPL: For XRPL transactions.
Let's see some examples here.
EVM Sample Transaction: (Test)
Here is the structure of an EVM transaction in the code below.
If the user lacks sufficient approval for the transaction, the create transaction method will respond with an approval transaction. (isApproval field is true in this case.) The user must first sign this approval transaction to ensure they have the necessary approval. Then, they should call the create transaction method again to obtain and sign the main transaction. The fields and schema for the approval and main transactions are identical.
Sample for non-approval:
COSMOS Sample Transaction:
For Cosmos based blockchains, we have two type of transactions based on signType field: AMINO and DIRECT.
Cosmos Amino Sample Transaction: (Test)
Cosmos Direct Sample Transaction: (Test)
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.
Transfer Sample Transaction: (Test)
Here is the structure of an UTXO (Transfer) transaction:
Tron Sample Transaction: (Test)
Here is the structure of a Tron transaction. Similar to EVM transactions, it can be either an approval transaction or a main transaction, depending on the isApproval field
Starknet Sample Transaction: (Test)
Here is the structure of a Starknet transaction. Like EVM transactions, it can be either an approval transaction or a main transaction, depending on the isApproval field. Whenever possible, in Starknet, we batch the approval and main transactions into a single transaction using the calls array, as shown in the example below.
Solana Sample Transaction: (Test)
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.
SUI Sample Transaction:(Test)
XRPL Sample Transaction:(Test)
Last updated
Was this helpful?