nami
nami copied to clipboard
getUtxos() returning inaccurate set when Value passed
Hi I was experimenting with finetuning my webstore and noticed that getUtxos(Value, pagination) does not always return null when the wallet does not have UTxOs that can match the Value provided.
I generated a value cbor string from Cardano Serialization Library for 1.35 ADA and 3500 $RAG to test against a wallet with no $RAG balance.
await wallet.getUtxos('821a00149970a1581cca942cb8bb5d1ef750766ded355f320880539111f10efa2b1a478ff9a143524147190dac') does not return null even though the wallet has no $RAG balance, but returns the full set of UTxOs of the wallet. Is this the expected behaviour?
This is not the expected behaviour. I'm having similar issues with getUtxos not returning the correct set. Too many utxos in my case. Much more than necessary to cover the value that I sent.
Here's the CIP-0030 definition:
api.getUtxos(amount: cbor = undefined, paginate: Paginate = undefined): Promise<TransactionUnspentOutput[] | null>
Errors: APIError, PaginateError
If amount is undefined, this shall return a list of all UTXOs (unspent transaction outputs) controlled by the wallet. If amount is not undefined, this request shall be limited to just the UTXOs that are required to reach the combined ADA/multiasset value target specified in amount, and if this cannot be attained, null shall be returned. The results can be further paginated by paginate if it is not undefined.