文档
定价GitHub控制台

TRON

buildTransaction15 额度

Builds an unsigned TRON transaction from JSON-RPC parameters (TRON-specific method).

网络: tron

参数

名称类型描述
transactionObjectBuild request. TransferContract: from, to, value. TransferAssetContract: from, to, tokenId, tokenValue. CreateSmartContract: from, name, abi, data (or input), gas, value, consumeUserResourcePercent, originEnergyLimit, tokenId, tokenValue. TriggerSmartContract: from, to, data (or input), gas, value, tokenId, tokenValue. Addresses are 20-byte DATA, amounts are hex.

返回值

类型

Object

Object with transaction: txID, raw_data (contract, ref_block_bytes, ref_block_hash, expiration, timestamp, fee_limit), raw_data_hex, visible and, for CreateSmartContract, contract_address. The transaction is unsigned. Errors come as a JSON-RPC error object.

代码示例

curl https://holy-burned-sky-tron-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "buildTransaction",
  "params": [
    {
      "from": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c",
      "to": "0x0000000000000000000000000000000000000000",
      "value": "0xf4240"
    }
  ]
}'