feat: Init code
This commit is contained in:
commit
5ee5f518a4
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.venv/
|
10
README.md
Normal file
10
README.md
Normal file
@ -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
|
||||
```
|
42
multi-wallet.py
Normal file
42
multi-wallet.py
Normal file
@ -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}
|
Loading…
Reference in New Issue
Block a user