For a user in Discord I developed a JavaScript snippet that loops through all transactions and searches for transactions that have a positive `quantity` value.
### Live on JsBin
[https://jsbin.com/tipexuwemi/edit?js,console](https://jsbin.com/tipexuwemi/edit?js,console)
### Code snippet
```
const getNetworkInfo = async () => {
const response = await fetch('https://arweave.net/info');
return response.json();
}
const getLastBlock = async () => {
const info = await getNetworkInfo();
return info['current'];
}
const getTxQuantity = async id => {
const response = await fetch(`https://arweave.net/tx/${id}/quantity`);
return response.json();
}
const getBlock = async (hash) => {
const response = await fetch(`https://arweave.net/block/hash/${hash}`);
return response.json();
}
const getTxsFromBlock = block => {
return block["txs"];
}
const getPreviousBlock = block => {
return block["previous_block"];
}
const analyzeBlockTxs = async hash => {
const block = await getBlock(hash);
const txs = getTxsFromBlock(block);
if (txs.length) {
txs.forEach(async tx => {
const quantity = await getTxQuantity(tx);
if (quantity) {
console.log(tx, quantity * 0.000000000001, 'AR');
}
});
}
analyzeBlockTxs(getPreviousBlock(block));
}
getLastBlock().then(hash => analyzeBlockTxs(hash));
```