def confirmed_balance(ctx, account): """ Prints the current *confirmed* balance """ w = ctx.obj['wallet'] cb = w.confirmed_balance(account) click.echo("Confirmed balance: %0.8f BTC" % convert_to_btc(cb))
def balance(ctx, account): """ Prints the current total balance. """ w = ctx.obj['wallet'] ucb = w.unconfirmed_balance(account) click.echo("Total balance (including unconfirmed txns): %0.8f BTC" % convert_to_btc(ucb))
def balance(ctx, account): """ Prints the current balance. \b The balance displayed by this command includes both confirmed and unconfirmed transactions. To get only your confirmed balance, use 'wallet confirmedbalance'. """ w = ctx.obj['wallet'] ucb = w.unconfirmed_balance(account) click.echo("Total balance (including unconfirmed txns): %0.8f BTC" % convert_to_btc(ucb))
def list_balances(ctx, byaddress): """ Prints the current balances of each account. """ w = ctx.obj['wallet'] for a in w.account_names: ucb = w.unconfirmed_balance(a) cb = w.confirmed_balance(a) click.echo("Account: %s\nConfirmed: %0.8f BTC, Total: %0.8f BTC" % (a, convert_to_btc(cb), convert_to_btc(ucb))) if byaddress: by_addr = w.balances_by_address(a) if by_addr: click.echo("") for addr, balances in by_addr.items(): if balances['confirmed'] > 0 or \ balances['total'] > 0: click.echo("%35s: %0.8f (confirmed), %0.8f (total)" % (addr, convert_to_btc(balances['confirmed']), convert_to_btc(balances['total']))) click.echo("") click.echo("Account Totals\nConfirmed: %0.8f BTC, Total: %0.8f BTC" % (convert_to_btc(w.confirmed_balance()), convert_to_btc(w.unconfirmed_balance())))