returns the balance object from blockcypher for address
961164
def get_balance(self, address):
        
        url_append = "/balance?token=%s" % self.api_key
        url = self.base_url("addrs/%s" % (address + url_append))
        result = json.loads(urlopen(url).read().decode("utf8"))
        return result
665602
def getbalance(self, address: str) -> Decimal:
        ''''''

        try:
            return Decimal(cast(float, self.ext_fetch('getbalance/' + address)))
        except TypeError:
            return Decimal(0)
55095
def get_aggregate_balance(self, _async=False):
        
        params = {}
        path = '/v1/subuser/aggregate-balance'
        return  api_key_get(params, path, _async=_async)
1030210
def eth_getBlockTransactionCountByNumber(self, block=BLOCK_TAG_LATEST):
        
        block = validate_block(block)
        return hex_to_dec((yield from self.rpc_call('eth_getBlockTransactionCountByNumber',
                                                    [block])))
1295980
def get_unspents(address, blockchain_client=BlockchainInfoClient()):
    
    if isinstance(blockchain_client, BlockcypherClient):
        return blockcypher.get_unspents(address, blockchain_client)
    elif isinstance(blockchain_client, BlockchainInfoClient):
        return blockchain_info.get_unspents(address, blockchain_client)
    elif isinstance(blockchain_client, ChainComClient):
        return chain_com.get_unspents(address, blockchain_client)
    elif isinstance(blockchain_client, (BitcoindClient, AuthServiceProxy)):
        return bitcoind.get_unspents(address, blockchain_client)
    elif hasattr(blockchain_client, "get_unspents"):
        return blockchain_client.get_unspents( address )
    elif isinstance(blockchain_client, BlockchainClient):
        raise Exception('That blockchain interface is not supported.')
    else:
        raise Exception('A BlockchainClient object is required')
649096
def parity_get_pending_transaction_hash_by_nonce(
            self,
            address: AddressHex,
            nonce: Nonce,
    ) -> Optional[TransactionHash]:
        
        assert self.eth_node is constants.EthClient.PARITY
        # https://wiki.parity.io/JSONRPC-parity-module.html?q=traceTransaction#parity_alltransactions
        transactions = self.web3.manager.request_blocking('parity_allTransactions', [])
        log.debug('RETURNED TRANSACTIONS', transactions=transactions)
        for tx in transactions:
            address_match = to_checksum_address(tx['from']) == address
            if address_match and int(tx['nonce'], 16) == nonce:
                return tx['hash']
        return None
1144999
def account_is_empty(address)
      get_balance(address) == 0 && get_code(address) == Constant::BYTE_EMPTY && get_nonce(address) == 0
    end
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}
1293114
def get_wallet_addresses(wallet_name, api_key, is_hd_wallet=False,
        zero_balance=None, used=None, omit_addresses=False, coin_symbol='btc'):
    '''
    
    '''
    assert is_valid_coin_symbol(coin_symbol)
    assert api_key
    assert len(wallet_name) <= 25, wallet_name
    assert zero_balance in (None, True, False)
    assert used in (None, True, False)
    assert isinstance(omit_addresses, bool), omit_addresses

    params = {'token': api_key}
    kwargs = {'hd/' if is_hd_wallet else '': wallet_name} # hack!
    url = make_url(coin_symbol, 'wallets', **kwargs)

    if zero_balance is True:
        params['zerobalance'] = 'true'
    elif zero_balance is False:
        params['zerobalance'] = 'false'
    if used is True:
        params['used'] = 'true'
    elif used is False:
        params['used'] = 'false'
    if omit_addresses:
        params['omitWalletAddresses'] = 'true'

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    return get_valid_json(r)
1246754
def eth_getBalance(self, address):
        
        account = self.reader._get_account(address)
        return account.balance
378867
def get_prev_block_hash(block_representation, coin_symbol='btc', api_key=None):
    '''
    
    '''
    return get_block_overview(block_representation=block_representation,
            coin_symbol=coin_symbol, txn_limit=1, api_key=api_key)['prev_block']
1232128
def address_reencode(address, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_address_reencode(address, **blockchain_opts)
    else:
        raise ValueError("Unknown blockchain '{}'".format(blockchain))
90656
def get_unspents(self):
        
        self.unspents[:] = NetworkAPI.get_unspent(self.address)
        self.balance = sum(unspent.amount for unspent in self.unspents)
        return self.unspents
1146899
def get_unspents(address, blockchain_client=BlockchainInfoClient()):
    
    if not isinstance(blockchain_client, BlockchainInfoClient):
        raise Exception('A BlockchainInfoClient object is required')

    url = BLOCKCHAIN_API_BASE_URL + "/unspent?format=json&active=" + address

    auth = blockchain_client.auth
    if auth and len(auth) == 2 and isinstance(auth[0], str):
        url = url + "&api_code=" + auth[0]

    r = requests.get(url, auth=auth)
    try:
        unspents = r.json()["unspent_outputs"]
    except ValueError, e:
        raise Exception('Invalid response from blockchain.info.')
    
    return format_unspents(unspents)
169414
def get_nonce(block_representation, coin_symbol='btc', api_key=None):
    '''
    
    '''
    return get_block_overview(block_representation=block_representation,
            coin_symbol=coin_symbol, txn_limit=1, api_key=api_key)['bits']
1121367
async function getBalance(from, type) {
  switch (type) {
    case gbl.constants.FUND_RAISE_TYPES.ETH:
      return await web3.eth.getBalance(from);
    case gbl.constants.FUND_RAISE_TYPES.POLY:
      return await polyToken.methods.balanceOf(from).call();
    default:
      return '0';
  }
}
64257
def transactions_by_address(address, options = {})
      agent.transactions_by_address(self['id'], address, options) do |data, resp|
        yield(data, resp) if block_given?
      end
    end