You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey Ales, sorry to add to the list..I just thought there might be a simple solution to a problem I was encountering...
Description of the issue:
My wallet has 1 specific UTxO I want to use in a tx
I want to send the entire contents of that UTxO to another address.
So I add the UTxO to the inputs and outputs via payToAddress and collectFrom
When completing the transaction however, an error is thrown Insufficient inputs.
// Fetch the specific utxo I want to consume entirely (at index 0)constspecificUtxo=awaitwallet.getUtxos()[0];// Create txconsttx=awaitlucid.newTx().payToAddress(receiver,specificUtxo.assets).collectFrom([specificUtxo]).complete({coinSelection: false})// Console: Insufficient input
Basically, I'm looking for an easy way to "Spend Everything" from a UTxO - but the fee isn't being adjusted. Any ideas on how to fix this easily?
The text was updated successfully, but these errors were encountered:
I think we need another flag for this. Lucid can't really tell if you ran out of funds or your intention really is to spend everything. Also if you have like 10 outputs, the question is which output should the fees be subtracted from.
+1 for this. This would be a great quality of life feature. I've been digging Lucid and things like this will just make it more powerful and dev-friendly.
Also if you have like 10 outputs, the question is which output should the fees be subtracted from.
Perhaps you could add a feeFrom or payFeeFrom method which accepted a tx hash. Otherwise, another selection algo would be needed to choose the output at random. I'm not sure how you want to implement the flag...but the feeFrom method might look something like this?
@alessandrokonrad Is there by any chance workaround around this? @eliasearlym Have you found something that works for your case, the fee from is exatcly something that I am looking for.
Thanks
Hey Ales, sorry to add to the list..I just thought there might be a simple solution to a problem I was encountering...
Description of the issue:
payToAddress
andcollectFrom
Insufficient inputs
.Basically, I'm looking for an easy way to "Spend Everything" from a UTxO - but the fee isn't being adjusted. Any ideas on how to fix this easily?
The text was updated successfully, but these errors were encountered: