> For the complete documentation index, see [llms.txt](https://docs.swapkit.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swapkit.dev/spotlights/transaction-formats-by-txtype.md).

# Transaction Formats by 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](https://docs.swapkit.dev/spotlights/transaction-payload-signing). Object `tx` types are canonicalized with RFC 8785 (JCS) before hashing; string `tx` types 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:

1. Call **`/v3/quote`** with a `sellAsset` on the target chain and a funded `sourceAddress`, then pick a route.
2. Request the transaction using that route's **`nextActions`** entry — it gives you the `method`, `url`, and `payload` to send, so you don't build the `/swap` call yourself.
3. From the response, copy the route's `txType`, `tx`, and — if signing is enabled — `meta.signedTx` / `meta.signature` / `meta.signedTxString` into the matching section.

See the [/v3/quote](https://docs.swapkit.dev/swapkit-api/v3-quote-request-a-swap-quote) and [/v3/swap](https://docs.swapkit.dev/swapkit-api/v3-swap-obtain-swap-transaction-details) 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](https://docs.swapkit.dev/spotlights/transaction-payload-signing).

### EVM

* **`txType`:** `EVM`
* **`tx` shape:** object (`{ from, to, data, value, gas, gasPrice, ... }`)
* **Chains:** Ethereum, BSC, Avalanche, Arbitrum, Base, Polygon
* **Example sell asset:** `ETH.ETH`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "EVM",
  "tx": {
    "to": "0xRECIPIENT_ADDRESS",
    "from": "0xYOUR_SOURCE_ADDRESS",
    "gas": "0x6270",
    "gasPrice": "0x7ecbe4e",
    "value": "0x2386f26fc10000",
    "data": "0x"
  },
  "meta": {
    "txType": "EVM",
    "signedTxString": "{\"data\":\"0x\",\"from\":\"0xYOUR_SOURCE_ADDRESS\",\"gas\":\"0x6270\",\"gasPrice\":\"0x7ecbe4e\",\"to\":\"0xRECIPIENT_ADDRESS\",\"value\":\"0x2386f26fc10000\"}",
    "signedTx": "<base64url(SHA-256 hex of signedTxString)>",
    "signature": "<base64url ES256 signature>"
  }
}
```

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`:** `COSMOS`
* **`tx` shape:** object (Cosmos SDK transaction)
* **Chains:** Cosmos Hub (GAIA), and other Cosmos SDK chains
* **Example sell asset:** `GAIA.ATOM`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "COSMOS",
  "tx": {
    "memo": "=:e:0xYOUR_DEST:659671/1/0:-_/nc:15/0",
    "accountNumber": 3695266,
    "sequence": 0,
    "chainId": "cosmoshub-4",
    "msgs": [
      {
        "typeUrl": "/cosmos.bank.v1beta1.MsgSend",
        "value": {
          "amount": [{ "amount": "10000000", "denom": "uatom" }],
          "fromAddress": "cosmos1YOUR_SOURCE",
          "toAddress": "cosmos1VAULT"
        }
      }
    ],
    "fee": { "amount": [{ "denom": "uatom", "amount": "5000" }], "gas": "200000" }
  },
  "meta": {
    "txType": "COSMOS",
    "signedTxString": "{\"accountNumber\":3695266,\"chainId\":\"cosmoshub-4\",\"fee\":{\"amount\":[{\"amount\":\"5000\",\"denom\":\"uatom\"}],\"gas\":\"200000\"},\"memo\":\"=:e:0xYOUR_DEST:659671/1/0:-_/nc:15/0\",\"msgs\":[{\"typeUrl\":\"/cosmos.bank.v1beta1.MsgSend\",\"value\":{\"amount\":[{\"amount\":\"10000000\",\"denom\":\"uatom\"}],\"fromAddress\":\"cosmos1YOUR_SOURCE\",\"toAddress\":\"cosmos1VAULT\"}}],\"sequence\":0}",
    "signedTx": "<base64url digest>",
    "signature": "<base64url ES256 signature>"
  }
}
```

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`:** `TRON`
* **`tx` shape:** 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`)**

```json
{
  "txType": "TRON",
  "tx": {
    "visible": true,
    "txID": "0f29b0bced8061478386652a4b07c0c8654561a502daf67ad83039db32c7d1f1",
    "raw_data": {
      "contract": [
        {
          "parameter": {
            "value": {
              "owner_address": "TYOUR_SOURCE_ADDRESS",
              "to_address": "TVAULT_ADDRESS",
              "amount": 55000000
            },
            "type_url": "type.googleapis.com/protocol.TransferContract"
          },
          "type": "TransferContract"
        }
      ],
      "ref_block_bytes": "f952",
      "ref_block_hash": "4b675bed33dccae0",
      "expiration": 1785273270000,
      "timestamp": 1785272972258,
      "data": "3d3a653a…2f30"
    },
    "raw_data_hex": "0a02f95222084b675bed33dccae0…e2e7bed4fa33"
  },
  "meta": {
    "txType": "TRON",
    "signedTxString": "{\"raw_data\":{\"contract\":[{\"parameter\":{\"type_url\":\"type.googleapis.com/protocol.TransferContract\",\"value\":{\"amount\":55000000,\"owner_address\":\"TYOUR_SOURCE_ADDRESS\",\"to_address\":\"TVAULT_ADDRESS\"}},\"type\":\"TransferContract\"}],\"data\":\"3d3a653a…2f30\",\"expiration\":1785273270000,\"ref_block_bytes\":\"f952\",\"ref_block_hash\":\"4b675bed33dccae0\",\"timestamp\":1785272972258},\"raw_data_hex\":\"0a02f952…bed4fa33\",\"txID\":\"0f29…d1f1\",\"visible\":true}",
    "signedTx": "<base64url digest>",
    "signature": "<base64url ES256 signature>"
  }
}
```

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](https://docs.swapkit.dev/spotlights/transaction-payload-signing).

### PSBT

* **`txType`:** `PSBT`
* **`tx` shape:** string (base64-encoded PSBT)
* **Chains:** Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Dash
* **Example sell asset:** `BTC.BTC`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "PSBT",
  "tx": "cHNidP8BAKQCAAAAAyFxJZDlxNYA3/36dLs5h2/…BcYepUBX5AAA",
  "meta": {
    "txType": "PSBT",
    "signedTxString": "cHNidP8BAKQCAAAAAyFxJZDlxNYA3/36dLs5h2/…BcYepUBX5AAA",
    "signedTx": "<base64url(SHA-256 hex of signedTxString)>",
    "signature": "<base64url ES256 signature>"
  }
}
```

Notes: For a `PSBT` (string) tx, `meta.signedTxString` is **identical to `tx`** — string txs are hashed verbatim, not canonicalized.

### SOLANA

* **`txType`:** `SERIALIZED_BASE64`
* **`tx` shape:** string (base64-serialized Solana transaction)
* **Chains:** Solana
* **Example sell asset:** `SOL.SOL`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "SERIALIZED_BASE64",
  "tx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA…AwEGBAICAA==",
  "meta": {
    "txType": "SERIALIZED_BASE64",
    "signedTxString": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA…AwEGBAICAA==",
    "signedTx": "<base64url(SHA-256 hex of signedTxString)>",
    "signature": "<base64url ES256 signature>"
  }
}
```

Notes: `tx` is a base64-serialized Solana transaction — a **string**, hashed **verbatim** (`signedTxString === tx`)

### RIPPLE

* **`txType`:** `RIPPLE`
* **`tx` shape:** string
* **Chains:** XRP Ledger
* **Example sell asset:** `XRP.XRP`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "RIPPLE",
  "tx": "{\"Account\":\"rYOUR_XRP_ADDRESS\",\"Amount\":\"10000000\",\"Destination\":\"rVAULT_ADDRESS\",\"TransactionType\":\"Payment\",\"Memos\":[{\"Memo\":{\"MemoData\":\"<hex-encoded THORChain memo>\"}}],\"Flags\":0,\"Sequence\":105916205,\"Fee\":\"12\",\"LastLedgerSequence\":105916293}",
  "meta": {
    "txType": "RIPPLE",
    "signedTxString": "<identical to tx>",
    "signedTx": "<base64url digest>",
    "signature": "<base64url ES256 signature>"
  }
}
```

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`:** `NEAR`
* **`tx` shape:** string
* **Chains:** NEAR
* **Example sell asset:** `NEAR.NEAR`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "NEAR",
  "tx": "QAAAAGY5ZDEwZjY3YzE1YTU5YTI2MDIzNzNkYjZlMmRmZDEx…QLzQGAAAAAAA=",
  "meta": {
    "txType": "NEAR",
    "signedTxString": "QAAAAGY5ZDEwZjY3YzE1YTU5YTI2MDIzNzNkYjZlMmRmZDEx…QLzQGAAAAAAA=",
    "signedTx": "<base64url(SHA-256 hex of signedTxString)>",
    "signature": "<base64url ES256 signature>"
  }
}
```

Notes: `tx` is a serialized NEAR transaction (a **string**, hashed **verbatim**: `signedTxString === tx`). String type → no canonicalization; binding check is `sha256(signedTxString)`.

### SUI

* **`txType`:** `SUI`
* **`tx` shape:** string
* **Chains:** Sui
* **Example sell asset:** `SUI.SUI`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "SUI",
  "tx": "AAACAAgAuh3SBQAAAAAgKbUATN1/dlfYgu135boj9uTDvIhgZ/V1lsp0J7yK5J4CAg…gPD6AgAAAAAA",
  "meta": {
    "txType": "SUI",
    "signedTxString": "AAACAAgAuh3SBQAAAAAgKbUATN1/dlfYgu135boj9uTDvIhgZ/V1lsp0J7yK5J4CAg…gPD6AgAAAAAA",
    "signedTx": "<base64url digest>",
    "signature": "<base64url ES256 signature>"
  }
}
```

Notes: `tx` is base64 Sui transaction bytes (`txBytes.toBase64()`) — a **string**, hashed **verbatim** (`signedTxString === tx`). No canonicalization.

### CARDANO

* **`txType`:** `CBOR`
* **`tx` shape:** string (CBOR-encoded transaction)
* **Chains:** Cardano
* **Example sell asset:** `ADA.ADA`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "CBOR",
  "tx": "84a40081825820bdfd6582d231bc8f4db1a2973d98159dda73e719461bff1a0edc7ef64bf3d62d00…031a0b8bccd1a0f5f6",
  "meta": {
    "txType": "CBOR",
    "signedTxString": "84a40081825820bdfd6582d231bc8f4db1a2973d98159dda73e719461bff1a0edc7ef64bf3d62d00…031a0b8bccd1a0f5f6",
    "signedTx": "<base64url digest>",
    "signature": "<base64url ES256 signature>"
  }
}
```

Notes: `tx` is an unsigned Cardano transaction as a **CBOR hex string** — hashed **verbatim** (`signedTxString === tx`). No canonicalization.

### STELLAR

* **`txType`:** `STELLAR`
* **`tx` shape:** string (base64 XDR)
* **Chains:** Stellar
* **Example sell asset:** `XLM.XLM`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "STELLAR",
  "tx": "AAAAAgAAAABJsaHU9Ev9qTHMGCvskZX0JUWmI+brCIUIPhCqEsbi5w…AAAAAAA==",
  "meta": {
    "txType": "STELLAR",
    "signedTxString": "AAAAAgAAAABJsaHU9Ev9qTHMGCvskZX0JUWmI+brCIUIPhCqEsbi5w…AAAAAAA==",
    "signedTx": "<base64url(SHA-256 hex of signedTxString)>",
    "signature": "<base64url ES256 signature>"
  }
}
```

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-unsigned`
* **`tx` shape:** string
* **Chains:** Zcash
* **Example sell asset:** `ZEC.ZEC`

**Example response (`tx` + `meta`)**

```json
{
  "txType": "zcash-unsigned",
  "tx": "UENaVAEAAAAFis6ctQLbrJS9AwEA8t7RAY…AAAA==",
  "meta": {
    "txType": "zcash-unsigned",
    "signedTxString": "UENaVAEAAAAFis6ctQLbrJS9AwEA8t7RAY…AAAA==",
    "signedTx": "<base64url(SHA-256 hex of signedTxString)>",
    "signature": "<base64url ES256 signature>"
  }
}
```

Notes: `tx` is a base64 **PCZT** (Partially Created Zcash Transaction — the **shielded** path; transparent ZEC returns `PSBT`). A **string**, hashed **verbatim**.
