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

getpool();
function getpool() {
let promised = fetch(api_url + 'getpool').
then(resp => resp.json()).
then(obj => {
document.getElementById('json').innerText = JSON.stringify(obj);
let list = '<ol>';
for (let txa of obj.txpool) {
console.log('getpool.bh:',txa);
let tx_url = api_url + `gettx?addr=${txa}`;
list += `<li><a href="${tx_url}">${txa}</a></li>\n`
}
list += '</ol>';
document.getElementById('list').innerHTML = list;
return obj;
}).
catch(console.error);
promised.then(obj => { console.log('obj:',obj); return obj; });
}
// ----------------------------------------------------
console.log('txpool.js loaded');