retrieve balance, If [account] is specified, returns the balance in the account.
335108
def getbalance(self, account=None, minconf=6):
        """"""
        if account:
            return self.req("getbalance", [account, minconf])
        else:
            return self.req("getbalance")
436916
def GET_account_balance(self, path_info, account_addr, token_type):
        
        if not check_account_address(account_addr):
            return self._reply_json({'error': 'Invalid address'}, status_code=400)

        if not check_token_type(token_type):
            return self._reply_json({'error': 'Invalid token type'}, status_code=400)

        blockstackd_url = get_blockstackd_url()
        res = blockstackd_client.get_account_balance(account_addr, token_type, hostport=blockstackd_url)
        if json_is_error(res):
            log.error("Failed to get account balance for {} {}: {}".format(account_addr, token_type, res['error']))
            return self._reply_json({'error': 'Failed to get balance of {} for {}: {}'.format(token_type, account_addr, res['error'])}, status_code=res.get('http_status', 500))

        self._reply_json({'balance': str(res)})     # NOTE: use a string, since this can be too big for js clients to parse
        return
41341
def get_balance(self, address, api_token):
        
        broadcast_url = self.base_url + '?module=account&action=balance'
        broadcast_url += '&address=%s' % address
        broadcast_url += '&tag=latest'
        if api_token:
            '&apikey=%s' % api_token
        response = requests.get(broadcast_url)
        if int(response.status_code) == 200:
            balance = int(response.json().get('result', None))
            logging.info('Balance check succeeded: %s', response.json())
            return balance
        raise BroadcastError(response.text)
1373255
def account(self):
        
        j, _ = self.request('GET', '')
        if 'login' in j and self.login == 'my':
            self.login = j['login']
        return j
4323
def get_amount_arrears_transactions(self, billing_cycle):
        """"""
        previous_billing_cycle = billing_cycle.get_previous()
        if not previous_billing_cycle:
            return Decimal(0)
        return self.to_account.balance(
            transaction__date__lt=previous_billing_cycle.date_range.upper,
            transaction__date__gte=previous_billing_cycle.date_range.lower,
        )
1059039
def get_account(self, account):
        
        selector = account.to_selector()
        resp = self.request_single('GetAccount', {'account': selector})
        return zobjects.Account.from_dict(resp)
1144999
def account_is_empty(address)
      get_balance(address) == 0 && get_code(address) == Constant::BYTE_EMPTY && get_nonce(address) == 0
    end
929642
def balance(self, date=None):
        

        qs = self._entries()
        if date:
            qs = qs.filter(transaction__t_stamp__lt=date)
        r = qs.aggregate(b=Sum('amount'))
        b = r['b']

        flip = self._DEBIT_IN_DB()
        if self._positive_credit():
            flip *= -1

        if b is None:
            b = Decimal("0.00")
        b *= flip

        #print "returning balance %s for %s" % (b, self)
        return b
27830
def getbalance(self, **params):
        
        if not all([self.api_key, self.api_secret]):
            raise AuthException()

        endpoint = "/v1/me/getbalance"
        return self.request(endpoint, params=params)
1265226
def balance(self):
        
        if self._balance is None:
            self._balance = BalanceList(self._version, account_sid=self._solution['sid'], )
        return self._balance
519457
def _get_account_number(self, token, uuid):
        """"""
        # Data
        data = {"accessToken": token,
                "uuid": uuid}
        # Http request
        try:
            raw_res = yield from self._session.post(ACCOUNT_URL,
                                                    data=data,
                                                    headers=self._headers,
                                                    timeout=self._timeout)
        except OSError:
            raise PyFidoError("Can not get account number")
        # Load answer as json
        try:
            json_content = yield from raw_res.json()
            account_number = json_content\
                            .get('getCustomerAccounts', {})\
                            .get('accounts', [{}])[0]\
                            .get('accountNumber')
        except (OSError, ValueError):
            raise PyFidoError("Bad json getting account number")
        # Check collected data
        if account_number is None:
            raise PyFidoError("Can not get account number")

        return account_number
1246754
def eth_getBalance(self, address):
        
        account = self.reader._get_account(address)
        return account.balance
372974
def get_accounts(self, fetch=False):
        """"""
        return Accounts(self.resource.accounts, self.client, wallet=self, populate=fetch)
199148
def _get_account(self, address):
        
        state = self._get_head_state()
        account_address = binascii.a2b_hex(utils.remove_0x_head(address))
        return state.get_and_cache_account(account_address)
355904
def account(self):
        
        resp = self._call(endpoint='account')
        return Account(resp['credits'], resp['jobs_completed'], resp['jobs_processing'])
245547
def check_balances(self, account=None):
        ''' 
        '''
        a = self.account(account)
        if a is not False and a is not None:
            self.sbdbal = Amount(a['sbd_balance']).amount
            self.steembal = Amount(a['balance']).amount
            self.votepower = a['voting_power']
            self.lastvotetime = a['last_vote_time']
            vs = Amount(a['vesting_shares']).amount
            dvests = Amount(a['delegated_vesting_shares']).amount
            rvests = Amount(a['received_vesting_shares']).amount
            vests = (float(vs) - float(dvests)) + float(rvests)
            try:
                self.global_props()
                self.steempower_delegated = self.util.vests_to_sp(dvests)
                self.steempower_raw = self.util.vests_to_sp(vs)
                self.steempower = self.util.vests_to_sp(vests)
            except Exception as e:
                self.msg.error_message(e)
            else:
                return [self.sbdbal, self.steembal, self.steempower, 
                        self.votepower, self.lastvotetime]
        return False
1084370
public Balance getBalance(Currency currency) {

    Balance balance = this.balances.get(currency);
    return balance == null ? Balance.zero(currency) : balance;
  }