How to get unspents for inputs using bitcoinjs-lib? I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs, but is there something I can add to it to keep track of unspents? Or is there a way to use some sort of API to automatically select unspents? I do see that it is fairly easily done with btc.com, but I would like to be able to do this with altcoins as well. Thanks in advance!
I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs


I assume that you are not creating a SPV wallet. In this case,


  is there something I can add to it to keep track of unspents?


No. You have to check if there are UTXOs on your address to be spent even if you store them on your app. Because these UTXOs you stored on your app might be spent by another wallet.


  is there a way to use some sort of API to automatically select unspents?


Yes. This website offers some APIs to select UTXOs with different cyptos( Bitcoin, Litecoin, Dogecoin, and Dash).