You can specify the exact fee you want to pay. The fee you pay is product of gas and gas price.
fee = gas * gasPrice
These give me the maximum values
No. These values are what you are willing to pay. You can estimate the gas before sending a transaction. See estimate gas. For EOA to EOA ether transfer (without additional data) the gas required is 21,000.
So if you are willing to pay 21GWei as your gasPrice. The exact price you pay is 0.000441 ether (0.000000021*21000).
Same applies to any transaction on the ethereum blockchain. You can estimate gas and then compute the exact dee that you will pay by computing gas*gasPrice
.
It's up to you that what gas
and gasPrice
you are willing to pay, so you decide what fee you are willing to pay for the transaction.
Note : Be aware of consequences of supplying less gas and gas Price. If you supply less gas than the transaction requires, the transaction will run out of gas exception and your fee will be consumed. If you supply higher gas than required, then excess gas is refunded to your account.