v1

latestOpenAPI 3.0.32026-07-1320201.0 MB
Tron Transactions

Build TRC20 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>

post/api/v2/tron/transactions/trc20/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

fromstring required

The address to send the transaction from.

tostring required

The address to send the transaction to.

contractaddressstring required

The contract address of the token.

amountnumber required

The amount to send.

Example request

{
  "from": "TLkkCeNdJKPNUwucdro84WjswkzM62LCTH",
  "to": "TUwmZghA7u2GxGxKaxM1mkCmsTF4wHs4vp",
  "contractaddress": "0x708c419d1b9ae123047f70787a503b6ba51e048a27966e0220cc5feXXXXXXXXX",
  "amount": 1
}

Response

Succesfully created transaction

statusinteger
okboolean
messagestring

Example response

{
  "status": 201,
  "ok": true,
  "message": "Succesfully built transaction",
  "data": {
    "result": {
      "result": true
    },
    "transaction": {
      "visible": false,
      "txID": "a5d6cbdfb3845312887ce9cf22967be9ebae30b0fa4ff74ce86adc9805a1e31a",
      "raw_data": {
        "contract": [
          {
            "parameter": {
              "value": {
                "data": "a9059cbb0000000000000000000000007a368be0e33278d1a688c290a61bf4c33474ec5600000000000000000000000000000000000000000000000000000000003567e0",
                "owner_address": "41ea6787eaf73447b41f08c7d3e2957cf7de583b94",
                "contract_address": "41ea51342dabbb928ae1e576bd39eff8aaf070a8c6"
              },
              "type_url": "type.googleapis.com/protocol.TriggerSmartContract"
            },
            "type": "TriggerSmartContract"
          }
        ],
        "ref_block_bytes": "3b77",
        "ref_block_hash": "f3e7eb650cc4ca62",
        "expiration": 1742192007000,
        "fee_limit": 15000000000,
        "timestamp": 1742191950387
      },
      "raw_data_hex": "0a023b772208f3e7eb650cc4ca6240d8aef195da325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541ea6787eaf73447b41f08c7d3e2957cf7de583b94121541ea51342dabbb928ae1e576bd39eff8aaf070a8c62244a9059cbb0000000000000000000000007a368be0e33278d1a688c290a61bf4c33474ec5600000000000000000000000000000000000000000000000000000000003567e070b3f4ed95da32900180acc7f037"
    }
  }
}