TRON
buildTransaction15 crédits
Builds an unsigned TRON transaction from JSON-RPC parameters (TRON-specific method).
Paramètres
| Nom | Type | Description |
|---|---|---|
| transaction | Object | Build 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. |
Valeur renvoyée
Type
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.
Exemples de code
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"
}
]
}'