How to get a gas fee estimation for transactions that are expected to fail

Upon discussion with @Torres-ssf , he enlightened me to the fact that the receipts array that will be present within the FuelError metadata property, which can will contain the gasUsed

So once you handle this error, you can use this property calculate the gas used (in a similar fashion to this method)

Please note though, as I had mentioned that this gas used more than likely isn’t an accurate representation of the gas that would be used should the transaction be successfully dry run.

Please let me know if this works for you @mpoplavkov