'shows the amount ever received by a given address.'

def q_getreceivedbyaddress(abe, page, chain):

    addr = wsgiref.util.shift_path_info(page['env'])
    if ((chain is None) or (addr is None)):
        return 'returns    amount    of    money    received    by    given    address    (not    balance,    sends    are    not    subtracted)\n/chain/CHAIN/q/getreceivedbyaddress/ADDRESS\n'
    if (not util.possible_address(addr)):
        return 'ERROR:    address    invalid'
    (version, hash) = util.decode_address(addr)
    return format_satoshis(abe.store.get_received(chain.id, hash), chain)
