user2068: Is there any prebuild method in Cardano Serialization Lib that allows to select some UTXOs that cover the balance needed for a transaction?
Or should i make a script that querys all the utxo in that addres and selects the first ones that covers this given amount?

user28: You are speaking about what we call Coin Selection Algorithms and they are described in CIP2.
There are several implementations floating around on Github, such as  BerryPool implementation of the Random-Improve coin selection algorithm or what Yoroi does.

2068: <p>Is there any prebuild method in Cardano Serialization Lib that allows to select some UTXOs that cover the balance needed for a transaction?</p>
<p>Or should i make a script that querys all the utxo in that addres and selects the first ones that covers this given amount?</p>
 28: <p>You are speaking about what we call <em>Coin Selection Algorithms</em> and they are described in <a href="https://cips.cardano.org/cips/cip2/" rel="nofollow noreferrer">CIP2</a>.</p>
<p>There are several implementations floating around on Github, such as  <a href="https://github.com/Berry-Pool/nami-wallet/blob/main/src/lib/coinSelection.js" rel="nofollow noreferrer">BerryPool implementation of the Random-Improve coin selection algorithm</a> or <a href="https://github.com/Emurgo/yoroi-frontend/blob/develop/packages/yoroi-extension/app/api/ada/transactions/shelley/transactions.js" rel="nofollow noreferrer">what Yoroi does</a>.</p>
