How to get network fees before creating a send transaction

Through the Coinbase UI, a user is presented with the transaction fees before the transaction gets created, thus allowing the user to decide if they want to move forward with the transaction, given the fees that will be required.

How can this be accomplished through the Sign In With Coinbase API? I would like for my users to be able to see the amount of network fees that will be applied.

Hi @justin-ms! Thank you for using Coinbase APIs. We will look into it and reach out to you in sometime. Keep in touch.

Thanks for the ping @Loop_11! Look forward to hearing back.

Thank you for your patience @justin-ms! Please be informed that there is no API for network fees/gas fees. We would suggest you to implement the logic manually, however we are taking this as a feedback and will share this further. We hope this answers your question. Do let us know in case you have any more questions. Have a nice day!

How would we do this? Is there a flat fee percentage you charge for every crypto (or for each individual crypto)? Depending on the chain there’s unknown variables to us. For example, Cardano transaction fees depend on the transaction size, but depending on how many input UTOs you guys use (amongst other things) that would change the resulting network fee.

A nice to have would be creating a transaction where you specify the amount and the network fees would be extracted from that given amount (potentially with a flag on whether to commit it or not so that we could see the estimated network fee that was extracted). Right now I’m not sure of a good way to empty all the crypto from an account because I need to take the full amount but then subtract what I think the fees would be (which again I’m not sure how to estimate).

This would be similar to how Advanced Trade “create order” works. You specify an amount (eg $10) and then the fees are pulled from that (eg $9.90 crypto purchase, $0.10 used as fees).