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)


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


ParametersParameter DescriptionType
amountthe amount of assets to be delegated(sun), larger than 0Integer
receiverAddressthe account address of receiving delegation (base58 or hex)String
resourceasset type to be delegated, optional BANDWIDTH or ENERGYString
addressowner address (base58 or hex)String
lockenable the lock time limit, the default is falseBoolean
lockPeriodwhen lock is true, can set the lock time by this parameter, 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
optionsoptional fieldsObject




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