I am trying to create an application which is actually a Tron(TRX) wallet, how can I make it calculate the fee for every transaction before being confirmed from the user? I understand the fact that tron uses some BP(Bandwidth Points) every time for making a transaction if possible and it would be amazing if anyone could help with related calculations as well.
By the way, I am using python to create such application but I don't mind using javascript if needed, so help of any kind will be appreciated.
I have tried using tronpy and tronapi as google bard recommended but they can't calculate the transaction fees as long as I know. There might be some ways around using tronweb, but since i am not a professional in javascript and crypto, I couldn't use it much. Maye some code snippets from experts will help me more with the understanding.
Please feel free to mention some APIs and SDKs that you think will help in any ways.
I finally have the trick.
The fee estimation used to return 0.2 TRX at first because I forgot to sign the transaction with private key. It returns 0.267 TRX now by including the private key and signature.
It does not need energy to transfer Tron(TRX) on it's own unless you start dealing with smart contracts.
the following code should work just perfectly for my needs, hope it can help anyone else having similar issues.