Get balance available to spend at the address
        :param address:
        :return:
771488
def get_balance(self, address):
        
        spendables = self.get_unspent_outputs(address)
        if not spendables:
            logging.warning('address %s has a balance of 0', address)
            return 0

        balance = sum(s.coin_value for s in spendables)
        return balance
421269
def get_account_tokens(self, address):
        
        cur = self.db.cursor()
        return namedb_get_account_tokens(cur, address)
132941
def _get_balance( self, get_address, min_confs ):
        
        bitcoind_opts = get_bitcoin_opts()
        bitcoind_host = bitcoind_opts['bitcoind_server']
        bitcoind_port = bitcoind_opts['bitcoind_port']
        bitcoind_user = bitcoind_opts['bitcoind_user']
        bitcoind_passwd = bitcoind_opts['bitcoind_passwd']

        bitcoind = create_bitcoind_service_proxy(bitcoind_user, bitcoind_passwd, server=bitcoind_host, port=bitcoind_port)
        address = virtualchain.address_reencode(get_address)

        try:
            unspents = get_unspents(address, bitcoind)
        except Exception as e:
            log.exception(e)
            return {'error': 'Failed to get unspents for {}'.format(get_address)}

        satoshis_confirmed = sum(confirmed_utxo['value'] for confirmed_utxo in 
                                 filter(lambda utxo: utxo['confirmations'] >= min_confs, unspents))

        return {'balance': satoshis_confirmed}
985570
def get_balance(self):
        
        
        response = util.call_api("merchant/{0}/balance".format(self.identifier), self.build_basic_request(),
                                 base_url=self.service_url)
        json_response = json.loads(response)
        self.parse_error(json_response)
        return json_response.get('balance')
335108
def getbalance(self, account=None, minconf=6):
        """"""
        if account:
            return self.req("getbalance", [account, minconf])
        else:
            return self.req("getbalance")
406834
def get_unspent_outputs(self, address):
        
        logging.debug('get_unspent_outputs for address=%s', address)
        spendables = self.spendables_for_address(bitcoin_address=address)
        if spendables:
            return sorted(spendables, key=lambda x: hash(x.coin_value))
        return None
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,
        )
988981
def address(self, s):
        
        s = parseable_str(s)
        return self.p2pkh(s) or self.p2sh(s) or self.p2pkh_segwit(s) or self.p2sh_segwit(s)
476014
def get_balance(self, address, block="latest"):
        
        response = self.make_request("eth_getBalance", [address, block])
        return int(response['result'], 16)
1106785
def get_balance(self):
        
        self.br.open(self.MOBILE_WEB_URL % {'accountno': self.account})
        try:
            # Search for the existence of the Register link - indicating a new account
            self.br.find_link(text='Register')
            raise InvalidAccountException
        except mechanize.LinkNotFoundError:
            pass

        self.br.follow_link(text='My sarafu')
        self.br.follow_link(text='Balance Inquiry')
        self.br.select_form(nr=0)
        self.br['pin'] = self.pin
        r = self.br.submit().read()

        # Pin valid?
        if re.search(r'Invalid PIN', r):
            raise AuthDeniedException

        # An error could occur for other reasons
        if re.search(r'Error occured', r):
            raise RequestErrorException

        # If it was successful, we extract the balance
        if re.search(r'Your balance is TSH (?P<balance>[\d\.]+)', r):
            match = re.search(r'Your balance is TSH (?P<balance>[\d\.]+)', r)
            return match.group('balance')
4198
def get_deposit_address(self, currency):
        
        self._validate_currency(currency)
        self._log('get deposit address for {}'.format(currency))
        coin_name = self.major_currencies[currency]
        return self._rest_client.post(
            endpoint='/{}_deposit_address'.format(coin_name)
        )
779293
def get_account(self, address, token_type):
        
        cur = self.db.cursor()
        return namedb_get_account(cur, address, token_type)
381339
def parse_address(self, address_line):
        
        params = {"term": address_line}
        json = self._make_request('/address/getParsedAddress', params)
        if json is None:
            return None
        return Address.from_json(json)
1128110
def getaddress(self, address: str) -> dict:
        ''''''

        return cast(dict, self.ext_fetch('getaddress/' + address))
55095
def get_aggregate_balance(self, _async=False):
        
        params = {}
        path = '/v1/subuser/aggregate-balance'
        return  api_key_get(params, path, _async=_async)
197163
def effective_balance(self, address: Address, block_identifier: BlockSpecification) -> Balance:
        
        fn = getattr(self.proxy.contract.functions, 'effectiveBalance')
        balance = fn(address).call(block_identifier=block_identifier)

        if balance == b'':
            raise RuntimeError(f"Call to 'effectiveBalance' returned nothing")

        return balance
201870
async def get_active(self, *args, **kwargs):
		

		# Get daya from request
		coinids = kwargs.get("coinids")
		uid = kwargs.get("uid",0)
		address = kwargs.get("address")

		try:
			coinid = coinid.replace("TEST", "")
		except:
			pass

		try:
			uid = int(uid)
		except:
			return await self.error_400("User id must be integer. ")

		if not uid and address:
			uid = await self.get_uid_by_address(address=address, coinid=coinid)
			if isinstance(uid, dict):
				return uid

		# Check if required fields exists
		if not all([coinids, uid]):
			return await self.error_400("Get active. Missed required fields.")
		if isinstance(coinids, list):
			actives = {}
			for coinid in coinids:
				database = self.client[self.collection]
				collection = database[coinid]
				# Get current balance
				balance = await collection.find_one({"uid":uid})
				if not balance:
					return await self.error_404(
						"Get active. Balance with uid:%s and type:%s not found" % (uid, coinid))
				# Collect actives
				actives[coinid] = int(balance["amount_active"])

		if isinstance(coinids, str):
			actives = {}
			for coinid in self.coinids:
				database = self.client[coinid]
				collection = database[self.collection]
				# Get current balance
				balance = await collection.find_one({"uid":uid})
				if not balance:
					return await self.error_404(
						"Get active. Balance with uid:%s and type:%s not found" % (uid, coinid))
				# Collect actives
				actives[coinid] = int(balance["amount_active"])
		return actives