iexbase / tron-api

A PHP API for interacting with Tron (TRX)
https://iexbase.github.io/tron-api/
MIT License
405 stars 287 forks source link

Transfer all TRX balance from address #168

Open frmiqueias opened 1 year ago

frmiqueias commented 1 year ago

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.