spacebudz / lucid

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
https://lucid.spacebudz.io
MIT License
336 stars 133 forks source link

getUtxosByOutRef consistency across providers #212

Open dpbeaumont opened 11 months ago

dpbeaumont commented 11 months ago

Firstly i'd like to say, this project is amazing, and I really value the work that has been done here.

I have been using the getUtxosByOutRef function to retrieve utxos for a transaction, it works great because the collectFrom requires the Utxo model to be in a certain specified Lucid format, so I could not use the Blockfrost response directly for example.

However I am using a mixture of providers, Blockfrost & Kupmios, I've noticed the Kupmios provider filters getUtxosByOutRef by unspent, where Blockfrost doesn't, which in turn was giving me some strange results depending on provider used.

Getting utxos that are not spent in here, is also really useful, especially when reclaiming a DEX order for example. Is it possible to have the option of excluding unspent potentially as a parameter in each of these providers maybe to keep consistently :) as currently I am forced to use the blockfrost implementation in conjunction with the collectFrom implementation.