Closed stanvladut closed 2 weeks ago
@Julietnacy Thanks for your response!
Is there a way to do it manually? (to calculate the fee needed and construct the transaction with it)
ahh I see you're looking to drain the wallet, I can add an option for that. give me some time and I'll put together a PR for it. are you guys facing another issue in wallet VESPR?
Thanks a lot @solidsnakedev! Really appreciate it.
No issues at all. The transition was smooth and the integration is already in production. It works smooth so far 👌
ahh I see you're looking to drain the wallet, I can add an option for that. give me some time and I'll put together a PR for it. are you guys facing another issue in wallet VESPR?
Hi @solidsnakedev and thank you for this! It may not necessarily be only about draining the wallet. The user may only send all spendabla ada (but not the NFTs/Tokens). I believe the ideal approach is to have a configuration where we can select one of the options when the refund ada is not enough to be put in a return utxo:
Sometimes (3) may be preferable because the user may make a payment for a service/product that checks automatically for the exact requested amount (in which case option 2 would be problematic).
P.s. Having an option to get the required fee for a transaction before calling complete would have allowed us to have a work-around for this, assuming the utxo selection is the same to not change the required fee.
@stanvladut @AlexDochioiu
There is setMinFee
when building the transaction.
e.g., This will force the transaction to set the fee to a minimum of 10 ADA
newTx().setMinFee(10_000_000)...
let me know if this works for your use case
@solidsnakedev I am aware, but it's not useful. Unless I know which utxos have been selected, I cannot know by how much I need to increase the fee to burn the extra ada that would otherwise be returned in an utxo.
And I guess there's no utxo selection happening before you call complete
, which we cannot do because it would throw an error.
Hi @solidsnakedev just following up on this.
We pushed an update you can do .complete({ includeLeftoverLovelaceAsFee: true });
, please let us know if it works for you
@solidsnakedev Seems to work perfect 🙏🏻 . Thank you a lot for the help!
Hi Lucid Evolution team, I'm contacting you on behalf of the VESPR Wallet team. We've recently migrated to using Lucid Evolution for transaction building and we are currently facing a new scenario in our wallet. When a user tries to send all his ADA to another address, or if there's not enough ADA left in the wallet for an UTxO to be created, we receive the following error;
{ Complete: Your wallet does not have enough funds to cover required minimum ADA for change output: { "lovelace": "4032" } Or it contains UTxOs with reference scripts; which are excluded from coin selection. }
Previously, what would happen is that, if the amount left was not enough to return an UTxO, that amount would be added to the fee.
Is there an option like that for Lucid Evolution to do this automatically when completing the transaction?