bitcoinjs / bitcoinjs-lib

A javascript Bitcoin library for node.js and browsers.
MIT License
5.69k stars 2.11k forks source link

How to get unspent with this lib #1652

Closed idoor88 closed 3 years ago

idoor88 commented 3 years ago

I have used this url: https://insight.bitpay.com/api/addr/${address}/utxo/ to fetch Unspent List, for some reason, it has error: statusCode: 525, 2020-11-13T04:09:12.747466+00:00 app[web.1]: statusMessage: 'Origin SSL Handshake Error', the example url is: https://insight.bitpay.com/api/addr/18HLJ9miBraVz4REwyShpYqWPyWMLifzqm/utxo/

Googled around, found other people had the same issue https://community.cloudflare.com/t/bitpay-address-api-error/209705

so is there a way in the bitcoinjs-lib to get the unspent list so need to call insight.bitpay.com ?

Thanks

junderw commented 3 years ago

There's a million other sites: https://blockstream.info/api/address/18HLJ9miBraVz4REwyShpYqWPyWMLifzqm/utxo

BitcoinJS does not endorse any specific explorer. It is recommended to run your own Bitcoin node and use RPC calls (or other layers like esplora, NBXplorer, etc. to index transaction/utxo data).