tron-api
tron-api copied to clipboard
Transfer all TRX balance from address
I need to transfer all balance from an address, but when I try the default example of sent the transaction is not registered on the network!
$tron->setAddress('address'); $tron->setPrivateKey('privateKey');
try { $transfer = $tron->send( 'ToAddress', 100.6666); } catch (\IEXBase\TronAPI\Exception\TronException $e) { die($e->getMessage()); }
I suspect that the problem is that I send all the amount and there is no balance left for the fee, how could I debit the amount of the fee from the amount to be sent?
Thanks.