tron-api icon indicating copy to clipboard operation
tron-api copied to clipboard

Transfer all TRX balance from address

Open frmiqueias opened this issue 1 year ago • 0 comments

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.

frmiqueias avatar Apr 27 '23 02:04 frmiqueias