TRON
wallet/delegateresource15クレジット
Builds an unsigned transaction that delegates staked resources to another account (Stake 2.0).
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
| owner_address | string | Transaction initiator address (base58 or hex). |
| receiver_address | string | Account that receives the resource (base58 or hex). |
| balance | number | Amount of staked TRX to delegate, in sun. |
| resource | string | BANDWIDTH or ENERGY. |
| lock | boolean | true = the delegation cannot be reclaimed during lock_period; default false. (任意) |
| lock_period | number | Lock duration in blocks (about 3 s each); only valid when lock is true. (任意) |
| Permission_id | number | Permission ID for multi-signature accounts; defaults to the owner permission (0). (任意) |
| visible | boolean | true = base58 addresses (in the request and the response); false (default) = hex addresses. (任意) |
戻り値
型
Object
Unsigned transaction object (txID, raw_data, raw_data_hex, visible). It is only built, not signed or broadcast; sign it and send it with wallet/broadcasttransaction. On failure an object with an Error string (still HTTP 200).
コード例
curl 'https://holy-burned-sky-tron-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7/wallet/delegateresource' \
-X POST \
-H 'content-type: application/json' \
-d '{
"owner_address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy",
"receiver_address": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",
"balance": 1000000,
"resource": "ENERGY",
"lock": false,
"visible": true
}'