You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
687 B

3 years ago
  1. getpool();
  2. function getpool() {
  3. let promised = fetch(api_url + 'getpool').
  4. then(resp => resp.json()).
  5. then(obj => {
  6. document.getElementById('json').innerText = JSON.stringify(obj);
  7. let list = '<ol>';
  8. for (let txa of obj.txpool) {
  9. console.log('getpool.bh:',txa);
  10. let tx_url = api_url + `gettx?addr=${txa}`;
  11. list += `<li><a href="${tx_url}">${txa}</a></li>\n`
  12. }
  13. list += '</ol>';
  14. document.getElementById('list').innerHTML = list;
  15. return obj;
  16. }).
  17. catch(console.error);
  18. promised.then(obj => { console.log('obj:',obj); return obj; });
  19. }
  20. // ----------------------------------------------------
  21. console.log('txpool.js loaded');