요금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"
    }
  ]
}'