I am trying to make transactions on Polygon Mainnet, but unfortunately when I automatically try to calculate the transaction fees, the transaction gets reverted because I assume that the fees are to low. Here is what I automatically generate:
{
'data':'0xf0f63daddb56b93eae180d01fea3e85f986af747f3903959afd249061e871d35a11417fa0000000000000000000000000000000000000000000000000000000064d017e00000000000000000000000000000000000000000000000000000000000000000'
'gas' : 169986
'maxFeePerGas': 191060633150
'maxPriorityFeePerGas': 30000000000
'nonce' : 54
'to' : '0x38f1CAd3B8Ee3a93Dd3aE30bb5f0Df900f05771F'
}
That is why I tried to manually adjust the values to:
{
'data' : '0xf0f63dad94a098029154d1664f2565f762099c82ec54ef69af8eb06252147950c0e82cf80000000000000000000000000000000000000000000000000000000064d017e00000000000000000000000000000000000000000000000000000000000000000'
'gas' : 169986
'maxFeePerGas': 169307244988
'maxPriorityFeePerGas': 30000000000
'nonce' : 54
'to' : '0x38f1CAd3B8Ee3a93Dd3aE30bb5f0Df900f05771F'
}
However with those new values, sometimes it works, sometimes it doesn't. Can you advise me what should I change in order to be sure that the transaction always succeeds. The wallet which pays the transaction fees has always enough balance.