How to fix phantom "Failed to estimate balance changes. This transaction may be unsafe" #209
Replies: 2 comments 1 reply
-
Hi @shirecoding, Thank you for writing in! If the user has to sign and broadcast a transaction there's no way that I'm aware of to bypass that. If you have some documentation on how this is possible on the Solana network, I would be happy to review it. Maybe it would make more sense for the user to sign a message and then your backend could receive that message and handle whatever transactions are necessary on behalf of the user? |
Beta Was this translation helpful? Give feedback.
-
Hi @adamdelphantom thanks for replying! Yep there was 2 ways to do it depending whether the backend does the partial sign and the user does the final sign or the backend does the partial sign and the user does the partial sign. I choose to make the backend partial sign and the user in the client do the final sign as it was easier to implement (no need FE polling to see if the transaction has went through) This is how i do it currently, it works including in tests, however the wallet shows that warning. |
Beta Was this translation helpful? Give feedback.
-
dApp Name
Community Crossover
dApp URL
running locally on development
Program ID
running locally on development
Steps to reproduce
I have an issue where I create a transaction on the backend and pay for the transaction fees, then I serialize and send the transaction to the frontend for the user to sign. It works however I get this Prompt from phantom always and it takes a long time after clicking confirm - but the transaction goes through.
How do you properly make a transaction such that it is safe and able to show the balance changes? should be 0 here since the transaction/rent fees are already paid for by a backend wallet.
Thanks!
Here is the transaction:
Why does it show a network fee when i've already paid for the user's transaction in the backend? Also how do you properly implement this with the warning "Failed to simulate the results of this request. Confirming is unsafe and may lead to losses.". I think no one will be using dapps with this warning.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions