v1

latestOpenAPI 3.0.32026-07-1320201.0 MB
Tron Transactions

Build TRX transaction (self signing)

This method creates a new TRC20 transaction for self signing, so this method will return the raw transaction hex. <br> Using this method, the transaction will not be broadcasted to the blockchain. <br>

You should use this method for self signing transactions. <br>

To send the transaction to the blockchain, you can use the broadcast endpoint. <br>

post/api/v2/tron/transactions/build

Headers

X-Network'testnet' | 'mainnet'

Specify "testnet" for test network or leave empty for main network. Defaults to "mainnet" if not provided.

Authorizationstring required

Bearer token for authorization. Required for authenticated endpoints.

Content-Type'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' required

The MIME type of the request body.

Request body

amountnumber required

The amount to send.

tostring required

The address to send the transaction to. Must match the regex /^T[a-zA-Z0-9]{33}$/.

fromstring required

The address to send the transaction from. Must match the regex /^T[a-zA-Z0-9]{33}$/.

Example request

{
  "amount": 1,
  "to": "TUwmZghA7u2GxGxKaxM1mkCmsTF4wHs4vp",
  "from": "TLkkCeNdJKPNUwucdro84WjswkzM62LCTH"
}

Response

Succesfully created transaction

statusinteger
okboolean
messagestring

Example response

{
  "status": 201,
  "ok": true,
  "message": "Succesfully created transaction",
  "data": {
    "visible": true,
    "txID": "b1e0eaa2b4ea985338d6684b796d458ad2c762633ad7b9d8b003542ab067530f",
    "raw_data": {
      "contract": [
        {
          "parameter": {
            "value": {
              "amount": 3500000,
              "owner_address": "TM7QnQtPGAyMGokd3KjKdTpKjFUgTHW7pP",
              "to_address": "TXLd9QHrGF4Kvm4eng1hCcCFoqUGQKBH43"
            },
            "type_url": "type.googleapis.com/protocol.TransferContract"
          },
          "type": "TransferContract"
        }
      ],
      "ref_block_bytes": "3a8f",
      "ref_block_hash": "4989085e2c13dd74",
      "expiration": 1742191278000,
      "timestamp": 1742191220631
    },
    "raw_data_hex": "0a023a8f22084989085e2c13dd7440b0efc495da325a68080112640a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412330a15417a368be0e33278d1a688c290a61bf4c33474ec56121541ea6787eaf73447b41f08c7d3e2957cf7de583b9418e0cfd5017097afc195da32"
  }
}