Return a list of Spendable objects for the
        given bitcoin address.
766527
def spendables_for_address(self, address):
        
        spendables = []
        r = json.loads(urlopen(self.base_url('get_tx_unspent', address)).read().decode("utf8"))

        for u in r['data']['txs']:
            coin_value = int(float(u['value']) * 100000000)
            script = h2b(u["script_hex"])
            previous_hash = h2b_rev(u["txid"])
            previous_index = u["output_no"]
            spendables.append(Tx.Spendable(coin_value, script, previous_hash, previous_index))

        return spendables
997710
def get_banks(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.BankList(self._results, runtime=self._runtime)
1032433
def get_block_transactions(
            self,
            header: BlockHeader,
            transaction_class: Type['BaseTransaction']) -> Iterable['BaseTransaction']:
        
        return self._get_block_transactions(header.transaction_root, transaction_class)
978169
def parse_hash(address):
    '''
    
    '''

    raw = parse(address)

    # Cash addresses
    try:
        if address.find(riemann.network.CASHADDR_PREFIX) == 0:
            if raw.find(riemann.network.CASHADDR_P2SH) == 0:
                return raw[len(riemann.network.CASHADDR_P2SH):]
            if raw.find(riemann.network.CASHADDR_P2PKH) == 0:
                return raw[len(riemann.network.CASHADDR_P2PKH):]
    except TypeError:
        pass

    # Segwit addresses
    try:
        if address.find(riemann.network.BECH32_HRP) == 0:
            if raw.find(riemann.network.P2WSH_PREFIX) == 0:
                return raw[len(riemann.network.P2WSH_PREFIX):]
            if raw.find(riemann.network.P2WPKH_PREFIX) == 0:
                return raw[len(riemann.network.P2WPKH_PREFIX):]
    except TypeError:
        pass

    # Legacy Addresses
    if raw.find(riemann.network.P2SH_PREFIX) == 0:
        return raw[len(riemann.network.P2SH_PREFIX):]
    if raw.find(riemann.network.P2PKH_PREFIX) == 0:
        return raw[len(riemann.network.P2PKH_PREFIX):]
920664
def get_outputs_by_public_key(self, public_key):
        """"""
        txs = list(query.get_owned_ids(self.connection, public_key))
        return [TransactionLink(tx['id'], index)
                for tx in txs
                for index, output in enumerate(tx['outputs'])
                if condition_details_has_owner(output['condition']['details'],
                                               public_key)]
469261
def fetch_deposits(self, limit: int) -> List[Deposit]:
        """"""
        return self._transactions(self._deposits, 'deposits', limit)
1110327
def listunspent(self, address: str) -> list:
        ''''''

        try:
            return cast(dict, self.ext_fetch('listunspent/' + address))['unspent_outputs']
        except KeyError:
            raise InsufficientFunds('Insufficient funds.')
540103
def GetCoinAssets(self):
        
        assets = set()
        for coin in self.GetCoins():
            assets.add(coin.Output.AssetId)
        return list(assets)
1275412
def get_keys_for(self, value):
        
        if callable(value):
            return value(self)
        hash_value = self.get_hash_for(value)
        return self._index[hash_value][:]
68350
def payments(self):
        """"""
        payments = self.client.subscription_payments.on(self).list()
        return payments
800156
def GetMacAddresses(self):
    """"""
    result = set()
    for interface in self.interfaces:
      if (interface.mac_address and
          interface.mac_address != b"\x00" * len(interface.mac_address)):
        result.add(Text(interface.mac_address.human_readable_address))
    return sorted(result)
6448
def list_forwarding_addresses(api_key, offset=None, coin_symbol='btc'):
    '''
    
    '''

    assert is_valid_coin_symbol(coin_symbol)
    assert api_key

    url = make_url(coin_symbol, 'payments')

    params = {'token': api_key}

    if offset:
        params['start'] = offset

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    return get_valid_json(r)
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
810194
def listkeys(ctx):
    
    t = [["Available Key"]]
    for key in ctx.bitshares.wallet.getPublicKeys():
        t.append([key])
    print_table(t)
256417
def get_transactions(self, account_id, **params):
        """"""
        response = self._get('v2', 'accounts', account_id, 'transactions', params=params)
        return self._make_api_object(response, Transaction)
939590
def items (self):
        """"""
        return [(key, value[1]) for key, value in super(LFUCache, self).items()]
549414
def list_(bank, cachedir=None):
    '''
    
    '''
    if cachedir is None:
        cachedir = __opts__['cachedir']

    try:
        cache = salt.cache.Cache(__opts__, cachedir=cachedir)
    except TypeError:
        cache = salt.cache.Cache(__opts__)
    return cache.list(bank)