From a35e41b656a6afbac286a03a310f386e62f7b44a Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 29 Jan 2025 14:46:21 +1100 Subject: [PATCH] feat: Add domains info --- multi-wallet.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/multi-wallet.py b/multi-wallet.py index 1b70f43..5897ed9 100644 --- a/multi-wallet.py +++ b/multi-wallet.py @@ -26,6 +26,19 @@ functions = { } } }, + "domains": { + "name": "Domains", + "type": "default", + "description": "List number of domains in each wallet", + "params": {}, + "returns": { + "result": + { + "name": "Result", + "type": "list" + } + } + }, "dash": { "name": "Dashboard widget", "type": "dashboard", @@ -118,6 +131,18 @@ def dash(params, authentication): return {"result": f"Available: {available:,.2f} HNS
Total: {total:,.2f} HNS"} +def domains(params, authentication): + wallets = account.listWallets() + domains = [] + total = 0 + for wallet in wallets: + numDomains = len(account.getDomains(wallet)) + domains.append(f"{wallet}: {numDomains}") + total += numDomains + + domains.append(f"Total: {total}") + return {"result": domains} + def enable(params, authentication): with open("user_data/multiwallet.json", "r") as f: multiwallet = json.load(f)