firewalletbrowser/plugins/txcount.py
Nathan Woodburn 42e8f642b4
All checks were successful
Build Docker / Build Image (push) Successful in 52s
feat: Add pagination for HSD v7 and return errors when node not connected
2025-01-30 12:32:20 +11:00

42 lines
840 B
Python

import json
import account
import requests
# Plugin Data
info = {
"name": "TX Count",
"description": "Plugin for checking how many txs are in a wallet",
"version": "1.0",
"author": "Nathan.Woodburn/"
}
# Functions
functions = {
"main":{
"name": "List TXs",
"type": "default",
"description": "Get TXs",
"params": {},
"returns": {
"txs":
{
"name": "Transactions",
"type": "text"
}
}
}
}
def main(params, authentication):
wallet = authentication.split(":")[0]
txCount = 0
page = 1
while True:
txs = account.getTransactions(wallet,page)
if len(txs) == 0:
break
txCount += len(txs)
page += 1
return {"txs": f'Total TXs: {txCount}'}