mirror of
https://git.wownero.com/lza_menace/tg-bot.git
synced 2024-08-15 00:23:12 +00:00
making cli commands better
This commit is contained in:
parent
1edeaadda4
commit
7b98ee33a3
2 changed files with 4 additions and 4 deletions
|
@ -17,7 +17,7 @@ def get_users():
|
||||||
users = db.User.select()
|
users = db.User.select()
|
||||||
wallet = wownero.Wallet()
|
wallet = wownero.Wallet()
|
||||||
for u in users:
|
for u in users:
|
||||||
click.echo(f'{u.telegram_user} ({u.telegram_id}) - wallet {u.account_index}')
|
click.echo(f'{u.telegram_user} ({u.telegram_id}) - wallet {u.account_index} ({u.address[0:12]})')
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.argument('account_index')
|
@click.argument('account_index')
|
||||||
|
@ -30,8 +30,8 @@ def get_balances():
|
||||||
wallet = wownero.Wallet()
|
wallet = wownero.Wallet()
|
||||||
accounts = wallet.accounts()
|
accounts = wallet.accounts()
|
||||||
for acc in accounts:
|
for acc in accounts:
|
||||||
balances = wallet.balances(account=acc)
|
balances = wallet.balances(account=acc[0])
|
||||||
click.echo(f'wallet {acc} - {float(balances[0])} locked, {float(balances[1])} unlocked')
|
click.echo(f'wallet {acc[0]} ({acc[1][0:12]}) - {float(balances[0])} locked, {float(balances[1])} unlocked')
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
def generate_bot_help():
|
def generate_bot_help():
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Wallet(object):
|
||||||
|
|
||||||
def accounts(self):
|
def accounts(self):
|
||||||
_accounts = self.make_wallet_rpc('get_accounts')
|
_accounts = self.make_wallet_rpc('get_accounts')
|
||||||
return [i['account_index'] for i in _accounts['subaddress_accounts']]
|
return [(i['account_index'], i['base_address']) for i in _accounts['subaddress_accounts']]
|
||||||
|
|
||||||
def new_account(self, label=None):
|
def new_account(self, label=None):
|
||||||
_account = self.make_wallet_rpc('create_account', {'label': label})
|
_account = self.make_wallet_rpc('create_account', {'label': label})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue