-
-
Save kevinho/1168f490f9e7943dbf608739e44b7a0b to your computer and use it in GitHub Desktop.
Revisions
-
shesek revised this gist
Feb 18, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ <h4>CSV</h4> .then(utxos => { document.querySelector('tbody').innerHTML = utxos.map(utxo => ` <tr> <td><a href="https://blockstream.info/api/tx/${utxo.txid}/hex" target="_blank">rawtx</a></td> <td>${utxo.txid}:${utxo.vout}</td> <td>${+utxo.value/100000000}</td> <td>${utxo.status.confirmed ? '#'+utxo.status.block_height : 'unconfirmed'}</td> -
shesek revised this gist
Feb 18, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,7 @@ <h2>Bitcoin address UTXO query</h2> <table class="table mt-5"> <thead> <tr> <th></th> <th>txid:vout</th> <th>value</th> <th>block height</th> @@ -40,6 +41,7 @@ <h4>CSV</h4> .then(utxos => { document.querySelector('tbody').innerHTML = utxos.map(utxo => ` <tr> <td><a href="https://blockstream.info/api/tx/${utxo.txid}/hex">rawtx</a></td> <td>${utxo.txid}:${utxo.vout}</td> <td>${+utxo.value/100000000}</td> <td>${utxo.status.confirmed ? '#'+utxo.status.block_height : 'unconfirmed'}</td> -
shesek revised this gist
Feb 18, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <!DOCTYPE html> <meta charset="utf-8"> <title>Bitcoin address UTXO extractor</title> <style> table, .csv { display: none } </style> -
shesek revised this gist
Feb 18, 2019 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,12 @@ <div class="container py-5"> <h2>Bitcoin address UTXO query</h2> <form class="mt-3"> <div class="form-group"> <label for="address">Bitcoin address</label> <input class="form-control" id="address" type="text" name="address"> </div> <input class="btn btn-primary" type="submit" value="Get UTXOs"> </form> <table class="table mt-5"> <thead> <tr> @@ -21,7 +26,8 @@ <h2>Bitcoin address UTXO query</h2> </table> <div class="csv mt-5"> <h4>CSV</h4> <p>Format: <em>txid,vout,satoshis,block_height</em></p> <textarea class="form-control" rows="6"></textarea> </div> </div> -
shesek created this gist
Feb 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ <!DOCTYPE html> <meta charset="utf-8"> <title>BItcoin address UTXO extractor</title> <style> table, .csv { display: none } </style> <div class="container py-5"> <h2>Bitcoin address UTXO query</h2> <form class="mt-3"> <div class="form-group"><label for="address">Bitcoin address</label><input class="form-control" id="address" type="text" name="address"></div><input class="btn btn-primary" type="submit" value="Get UTXOs"></form> <table class="table mt-5"> <thead> <tr> <th>txid:vout</th> <th>value</th> <th>block height</th> <th>block time</th> </tr> </thead> <tbody></tbody> </table> <div class="csv mt-5"> <h4>CSV</h4> <p>Format: <em>txid,vout,satoshis,block_height</em></p><textarea class="form-control" rows="6"></textarea> </div> </div> <script> document.querySelector('form').addEventListener('submit', e => { e.preventDefault() const address = e.target.querySelector('[name=address]').value fetch(`https://blockstream.info/api/address/${address}/utxo`) .then(r => r.json()) .then(utxos => { document.querySelector('tbody').innerHTML = utxos.map(utxo => ` <tr> <td>${utxo.txid}:${utxo.vout}</td> <td>${+utxo.value/100000000}</td> <td>${utxo.status.confirmed ? '#'+utxo.status.block_height : 'unconfirmed'}</td> <td>${utxo.status.confirmed ? new Date(utxo.status.block_time*1000).toLocaleString() : ''}</td> </tr> `).join('') document.querySelector('textarea').value = utxos.map(utxo => [utxo.txid, utxo.vout, utxo.value, utxo.status.block_height || '-1'].join(',')).join("\n") document.querySelector('table').style.display = document.querySelector('.csv').style.display = 'block' }) .catch(console.error) }) </script>