dave on Nostr: // -- Fetchying Tranasactions from Blockstream -- // const fetchTxs = async () => { ...
// -- Fetchying Tranasactions from Blockstream -- //
const fetchTxs = async () => {
const data = await fetch('
https://blockstream.info/api/mempool/fees';)
.then((res) => res.json())
.then((data) => {
return data.mempool
.map((tx) => tx.txid)
.forEach((tx) => console.log(tx))
});
}
// Call the function
fetchTxs();
Published at
2022-12-09 00:33:21Event JSON
{
"id": "f56af97b809540bcddc4a775c285a0a0706048c3d751ef4070c87af342d0a27a",
"pubkey": "5c10ed0678805156d39ef1ef6d46110fe1e7e590ae04986ccf48ba1299cb53e2",
"created_at": 1670546001,
"kind": 1,
"tags": [
[
"e",
"f04c12f13467f1af68817979f65ea91a91b5cf2131644265f7c43155d5fc7ae9",
"",
"root"
],
[
"e",
"8e528dd1eda58dc2deadf608e3f9ef3c6a336f1431ec84b26a3810404d5306dc",
"",
"reply"
],
[
"p",
"2b36fb6ae1022d0d4eac2a9f13fc2638f3350acc9b07bdca1de43a7c63429644"
]
],
"content": "// -- Fetchying Tranasactions from Blockstream -- // \n\nconst fetchTxs = async () =\u003e {\n const data = await fetch('https://blockstream.info/api/mempool/fees')\n .then((res) =\u003e res.json())\n .then((data) =\u003e {\n return data.mempool\n .map((tx) =\u003e tx.txid)\n .forEach((tx) =\u003e console.log(tx))\n });\n}\n\n// Call the function\nfetchTxs();",
"sig": "7320328c62758a4b58ca3be8e02c82efadfba4de0c77f419bcf16a3a80585cbb813b39c54796060ef449ff6bd57cc85271f28feffff1d4db45f4949c0d306656"
}