Skip to main content
Version: 6.0.0-beta.3 - 6.0.0-beta.4

delegateResource

After staking and obtaining resources, resources can be delegated to multiple recipients through this interface. The optional lock parameter can specify whether the delegation can be revoked within 3 days. (v5.1.0 new interface)

Usage

tronWeb.transactionBuilder.delegateResource(amount, receiverAddress, resource, address, lock, lockPeriod, options);

Parameters

ArgumentDescriptionType
amountThe amount of assets in sun to be delegated, larger than 0Integer
receiverAddressThe account address of receiving delegation (base58 or hex)String
resourceAsset type to be delegated. Optional, the default is BANDWIDTH.BANDWIDTH or ENERGY
addressOwner address (base58 or hex)String
lockIf the lock is true, delegation can not be revoked within 3 days. The default is falseBoolean
lockPeriodWhen lock is true, this parameter will set the lock time, with the unit of blocks. And the new resource delegating to the same address of same type should have this lockPeriod value larger than the lockup blocks left of the address.Integer
optionsThe permission id, optional, for multi-signature and block header for contract block header info.{ permissionId: number, blockHeader: ... }

Returns

Unsigned transaction object.

Example

> const transaction = await tronWeb.transactionBuilder.delegateResource(10e6, 'receiverAddress', 'BANDWIDTH', 'ownerAddress', true, 86400);