Transaction Formats by txType
Reference examples of the transaction payload SwapKit returns for each txType.
Every /v3/quote and /v3/swap route that includes a transaction returns two related fields:
tx— the transaction payload to sign and broadcast.txType— a tag identifying the payload's format, so you know how to decode and sign it.
The shape of tx depends on txType. Some chains return a JSON object (EVM, Cosmos, Tron); others return an already-serialized string (Bitcoin PSBT, Solana, Ripple, NEAR, Sui, Cardano, Zcash). This page catalogs the exact format for each txType with a real example response.
For how these payloads are signed and how to verify the signature, see Transaction Payload Signing. Object
txtypes are canonicalized with RFC 8785 (JCS) before hashing; stringtxtypes are hashed verbatim.
How to reproduce an example
To fill in a section below, run one real swap on that chain and paste the response:
Call
/v3/quotewith asellAsseton the target chain and a fundedsourceAddress, then pick a route.Request the transaction using that route's
nextActionsentry — it gives you themethod,url, andpayloadto send, so you don't build the/swapcall yourself.From the response, copy the route's
txType,tx, and — if signing is enabled —meta.signedTx/meta.signature/meta.signedTxStringinto the matching section.
See the /v3/quote and /v3/swap docs for the full request/response contract.
Object tx types
These return tx as a JSON object. The signed pre-image is the RFC 8785 (JCS) canonical JSON of the object — see Transaction Payload Signing.
EVM
txType:EVMtxshape: object ({ from, to, data, value, gas, gasPrice, ... })Chains: Ethereum, BSC, Avalanche, Arbitrum, Base, Polygon
Example sell asset:
ETH.ETH
Example response (tx + meta)
Notes: meta.signedTxString has the keys in alphabetical order (data, from, gas, gasPrice, to, value) — not the order they appear in tx. That's the RFC 8785 canonical form.
COSMOS
txType:COSMOStxshape: object (Cosmos SDK transaction)Chains: Cosmos Hub (GAIA), and other Cosmos SDK chains
Example sell asset:
GAIA.ATOM
Example response (tx + meta)
Notes: tx is a JSON object, canonicalized with RFC 8785 (JCS) before hashing — keys sorted recursively (nested objects too). Reproduce with a JCS canonicalizer, or just hash meta.signedTxString
TRON
txType:TRONtxshape: object (Tron transaction; may be an EVM-style object for TRC-20/contract calls)Chains: Tron
Example sell asset:
TRON.TRX
Example response (tx + meta)
Notes: tx is a JSON object (native Tron format: visible, txID, raw_data, raw_data_hex), canonicalized with RFC 8785 (JCS) — keys sorted recursively (top-level → raw_data, raw_data_hex, txID, visible; inside raw_data → contract, data, expiration, ref_block_bytes, ref_block_hash, timestamp; etc.).
String tx types
These return tx as an already-serialized string. The string is the exact signable bytes and is hashed verbatim (no canonicalization) — see Transaction Payload Signing.
PSBT
txType:PSBTtxshape: string (base64-encoded PSBT)Chains: Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Dash
Example sell asset:
BTC.BTC
Example response (tx + meta)
Notes: For a PSBT (string) tx, meta.signedTxString is identical to tx — string txs are hashed verbatim, not canonicalized.
SOLANA
txType:SERIALIZED_BASE64txshape: string (base64-serialized Solana transaction)Chains: Solana
Example sell asset:
SOL.SOL
Example response (tx + meta)
Notes: tx is a base64-serialized Solana transaction — a string, hashed verbatim (signedTxString === tx)
RIPPLE
txType:RIPPLEtxshape: stringChains: XRP Ledger
Example sell asset:
XRP.XRP
Example response (tx + meta)
Notes: tx is a JSON string (an XRPL Payment serialized with JSON.stringify). Even though it contains JSON, RIPPLE is a string txType — hashed verbatim. Do not JSON.parse + re-stringify it and do not canonicalize it: the keys are in XRPL order (Account, Amount, Destination,...), and any re-serialization changes the bytes and breaks verification. Hash the raw string exactly as received (meta.signedTxString, which equals tx).
NEAR
txType:NEARtxshape: stringChains: NEAR
Example sell asset:
NEAR.NEAR
Example response (tx + meta)
Notes: tx is a serialized NEAR transaction (a string, hashed verbatim: signedTxString === tx). String type → no canonicalization; binding check is sha256(signedTxString).
SUI
txType:SUItxshape: stringChains: Sui
Example sell asset:
SUI.SUI
Example response (tx + meta)
Notes: tx is base64 Sui transaction bytes (txBytes.toBase64()) — a string, hashed verbatim (signedTxString === tx). No canonicalization.
CARDANO
txType:CBORtxshape: string (CBOR-encoded transaction)Chains: Cardano
Example sell asset:
ADA.ADA
Example response (tx + meta)
Notes: tx is an unsigned Cardano transaction as a CBOR hex string — hashed verbatim (signedTxString === tx). No canonicalization.
STELLAR
txType:STELLARtxshape: string (base64 XDR)Chains: Stellar
Example sell asset:
XLM.XLM
Example response (tx + meta)
Notes: tx is a base64 XDR-encoded Stellar transaction envelope (a string, hashed verbatim: signedTxString === tx). String type → no canonicalization; binding check is sha256(signedTxString).
Zcash (unsigned)
txType:zcash-unsignedtxshape: stringChains: Zcash
Example sell asset:
ZEC.ZEC
Example response (tx + meta)
Notes: tx is a base64 PCZT (Partially Created Zcash Transaction — the shielded path; transparent ZEC returns PSBT). A string, hashed verbatim.
Last updated

