commit 5ee5f518a48d8e848c1e1eb4692a44ab31ea8d6a Author: Nathan Woodburn Date: Wed Jan 29 14:18:32 2025 +1100 feat: Init code diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21d0b89 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..9a59c8c --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Multi wallet Plugin for FireWallet + +This plugin allows you to use multiple wallets in FireWallet at the same time. + +## Import +Go to Plugins > Custom Plugin Manager +Import this URL: +``` +https://git.woodburn.au/nathanwoodburn/multi-wallet-plugin.git +``` \ No newline at end of file diff --git a/multi-wallet.py b/multi-wallet.py new file mode 100644 index 0000000..575a7e1 --- /dev/null +++ b/multi-wallet.py @@ -0,0 +1,42 @@ +import json +import account + +# Plugin Data +info = { + "name": "Multi Wallet Functions", + "description": "Access and manage multiple wallets at once", + "version": "1.0", + "author": "Nathan.Woodburn/" +} + +# Functions +functions = { + "balance": { + "name": "Wallet Balances", + "type": "default", + "description": "List balances of all wallets", + "params": {}, + "returns": { + "result": + { + "name": "Result", + "type": "list" + } + } + } +} + +def balance(params, authentication): + wallets = account.listWallets() + balances = [] + total = 0 + available = 0 + for wallet in wallets: + info = account.getBalance(wallet) + balances.append(f"{wallet}: Available: {info['available']:,.2f} HNS, Total: {info['total']:,.2f} HNS") + total += info['total'] + available += info['available'] + + balances.append(f"Total: Available: {available:,.2f} HNS, Total: {total:,.2f} HNS") + + return {"result": balances} \ No newline at end of file