> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# tron_signTransaction

> Sign a Tron transaction without broadcasting it

Sign a Tron transaction using the wallet's private key. Returns the full signed transaction hex — you are responsible for broadcasting it.

<Info>
  For a combined sign-and-broadcast call, use
  [`tron_sendTransaction`](/api-reference/wallets/tron/tron-send-transaction) instead.
</Info>

***

<Warning>
  **Idempotency on errors:** On 4xx or 5xx, Privy caches the response and replays it for the same
  key. Generate a new key to retry after a server error. Policy violations are an exception and
  allow same-key retries.
</Warning>

<RequestExample>
  ```sh TRX transfer theme={"system"} theme={"system"}
  curl --request POST \
    --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
    --header 'Authorization: Basic <encoded-value>' \
    --header 'Content-Type: application/json' \
    --header 'privy-app-id: <privy-app-id>' \
    --data '{
    "method": "tron_signTransaction",
    "params": {
      "raw_data": {
        "contract": [
          {
            "type": "TransferContract",
            "owner_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
            "to_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
            "amount": 1000000
          }
        ],
        "ref_block_bytes": "a2b4",
        "ref_block_hash": "1234567890abcdef",
        "expiration": 1735689600000,
        "timestamp": 1735689540000
      }
    }
  }'
  ```

  ```sh TRC-20 transfer theme={"system"} theme={"system"}
  curl --request POST \
    --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
    --header 'Authorization: Basic <encoded-value>' \
    --header 'Content-Type: application/json' \
    --header 'privy-app-id: <privy-app-id>' \
    --data '{
    "method": "tron_signTransaction",
    "params": {
      "raw_data": {
        "contract": [
          {
            "type": "TriggerSmartContract",
            "owner_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
            "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
            "data": "a9059cbb000000000000000041e552f6487585c2b58bc2c9bb4492bc1f17132cd000000000000000000000000000000000000000000000000000000000000f4240",
            "call_value": 0
          }
        ],
        "ref_block_bytes": "a2b4",
        "ref_block_hash": "1234567890abcdef",
        "expiration": 1735689600000,
        "timestamp": 1735689540000,
        "fee_limit": 100000000
      }
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"} theme={"system"}
  {
    "method": "tron_signTransaction",
    "data": {
      "signed_transaction": "0a02a2b42208...",
      "encoding": "hex"
    }
  }
  ```
</ResponseExample>

### Headers

<ParamField header="privy-app-id" type="string" required>
  ID of your Privy app.
</ParamField>

<ParamField header="privy-authorization-signature" type="string">
  Request authorization signature. If multiple signatures are required, they should be comma
  separated.
</ParamField>

### Path Parameters

<ParamField path="wallet_id" type="string" required>
  ID of the Tron wallet to sign with.
</ParamField>

### Body

<ParamField body="method" type="string" required>
  Must be `"tron_signTransaction"`.
</ParamField>

<ParamField body="params" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="params.raw_data" type="object" required>
      <Expandable title="properties" defaultOpen>
        <ParamField body="params.raw_data.contract" type="array" required>
          Array of exactly one contract object. Use `TransferContract` for native TRX transfers; use `TriggerSmartContract` for TRC-20 transfers and other smart contract calls. All addresses must be 41-prefixed hex (use `TronWeb.address.toHex()` to convert from base58check).

          **TransferContract:**

          * `type`: `"TransferContract"`
          * `owner_address`: sender, 41-prefixed hex
          * `to_address`: recipient, 41-prefixed hex
          * `amount`: sun (1 TRX = 1,000,000 sun)

          **TriggerSmartContract:**

          * `type`: `"TriggerSmartContract"`
          * `owner_address`: caller, 41-prefixed hex
          * `contract_address`: contract, 41-prefixed hex
          * `data` (optional): ABI-encoded calldata, hex string
          * `call_value` (optional): TRX value in sun sent with the call
          * `call_token_value` (optional): TRC-10 token value
          * `token_id` (optional): TRC-10 token ID
        </ParamField>

        <ParamField body="params.raw_data.ref_block_bytes" type="string" required>
          Block reference bytes — 4 hex characters. Must be fetched fresh from chain before signing (expires in \~60s). Use `TronWeb.trx.getCurrentRefBlockParams()`.
        </ParamField>

        <ParamField body="params.raw_data.ref_block_hash" type="string" required>
          Block reference hash — 16 hex characters. Fetched alongside `ref_block_bytes`.
        </ParamField>

        <ParamField body="params.raw_data.expiration" type="number" required>
          Transaction expiration in Unix milliseconds.
        </ParamField>

        <ParamField body="params.raw_data.timestamp" type="number">
          Transaction creation timestamp in Unix milliseconds. Defaults to `Date.now()` if omitted.
        </ParamField>

        <ParamField body="params.raw_data.fee_limit" type="number">
          Maximum energy fee in sun. Required for `TriggerSmartContract`. `100_000_000` (100 TRX) is a safe default for standard TRC-20 transfers.
        </ParamField>

        <ParamField body="params.raw_data.data" type="string">
          Transaction memo, hex-encoded. Distinct from `TriggerSmartContract.data` (calldata).
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

### Returns

<ResponseField name="method" type="string">
  Always `"tron_signTransaction"`.
</ResponseField>

<ResponseField name="data.signed_transaction" type="string">
  The signed transaction hex: `rawDataHex + signatureHex`. The signature occupies the last 130 hex
  characters (65 bytes). Pass directly to `POST /wallet/broadcasthex` on a Tron full node, or use
  `TronWeb.trx.sendRawTransaction()`.
</ResponseField>

<ResponseField name="data.encoding" type="string">
  Always `"hex"`.
</ResponseField>
