def list_address_txs(currency,
                     address,
                     page=None,
                     pagesize=None):  # noqa: E501
    """Get all transactions an address has been involved in

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str
    :param page: Resumption token for retrieving the next page
    :type page: str
    :param pagesize: Number of items returned in a single page
    :type pagesize: int

    :rtype: AddressTxs
    """
    try:
        return service.list_address_txs(currency=currency,
                                        address=address,
                                        page=page,
                                        pagesize=pagesize)
    except RuntimeError as e:
        return notfound(str(e))
def list_address_neighbors(currency,
                           address,
                           direction,
                           page=None,
                           pagesize=None):  # noqa: E501
    """Get an addresses' neighbors in the address graph

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str
    :param direction: Incoming or outgoing neighbors
    :type direction: str
    :param page: Resumption token for retrieving the next page
    :type page: str
    :param pagesize: Number of items returned in a single page
    :type pagesize: int

    :rtype: Neighbors
    """
    try:
        return service.list_address_neighbors(currency=currency,
                                              address=address,
                                              direction=direction,
                                              page=page,
                                              pagesize=pagesize)
    except RuntimeError as e:
        return notfound(str(e))
Пример #3
0
def list_entity_addresses(currency,
                          entity,
                          page=None,
                          pagesize=None):  # noqa: E501
    """Get an entity's addresses

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int
    :param page: Resumption token for retrieving the next page
    :type page: str
    :param pagesize: Number of items returned in a single page
    :type pagesize: int

    :rtype: EntityAddresses
    """
    try:
        return service.list_entity_addresses(currency=currency,
                                             entity=entity,
                                             page=page,
                                             pagesize=pagesize)
    except RuntimeError as e:
        return notfound(str(e))
Пример #4
0
def list_entity_neighbors(currency,
                          entity,
                          direction,
                          targets=None,
                          page=None,
                          pagesize=None):  # noqa: E501
    """Get an entity's neighbors in the entity graph

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int
    :param direction: Incoming or outgoing neighbors
    :type direction: str
    :param targets: Restrict result to given set of comma separated IDs
    :type targets: List[int]
    :param page: Resumption token for retrieving the next page
    :type page: str
    :param pagesize: Number of items returned in a single page
    :type pagesize: int

    :rtype: Neighbors
    """
    try:
        return service.list_entity_neighbors(currency=currency,
                                             entity=entity,
                                             direction=direction,
                                             targets=targets,
                                             page=page,
                                             pagesize=pagesize)
    except RuntimeError as e:
        return notfound(str(e))
Пример #5
0
def list_taxonomies():  # noqa: E501
    """Returns the supported taxonomies

     # noqa: E501


    :rtype: List[Taxonomy]
    """
    try:
        return service.list_taxonomies()
    except RuntimeError as e:
        return notfound(str(e))
Пример #6
0
def get_statistics():  # noqa: E501
    """Get statistics of supported currencies

     # noqa: E501


    :rtype: Stats
    """
    try:
        return service.get_statistics()
    except RuntimeError as e:
        return notfound(str(e))
Пример #7
0
def list_concepts(taxonomy):  # noqa: E501
    """Returns the supported concepts of a taxonomy

     # noqa: E501

    :param taxonomy: The taxonomy
    :type taxonomy: str

    :rtype: List[Concept]
    """
    try:
        return service.list_concepts(taxonomy=taxonomy)
    except RuntimeError as e:
        return notfound(str(e))
def list_address_txs_csv(currency, address):  # noqa: E501
    """Get all transactions an address has been involved in as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str

    :rtype: str
    """
    try:
        return service.list_address_txs_csv(currency=currency, address=address)
    except RuntimeError as e:
        return notfound(str(e))
Пример #9
0
def get_entity_with_tags(currency, entity):  # noqa: E501
    """Get an entity with tags

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int

    :rtype: EntityWithTags
    """
    try:
        return service.get_entity_with_tags(currency=currency, entity=entity)
    except RuntimeError as e:
        return notfound(str(e))
def get_address_entity(currency, address):  # noqa: E501
    """Get an address with tags

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str

    :rtype: EntityWithTags
    """
    try:
        return service.get_address_entity(currency=currency, address=address)
    except RuntimeError as e:
        return notfound(str(e))
Пример #11
0
def list_entity_tags_csv(currency, entity):  # noqa: E501
    """Get attribution tags for a given entity as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int

    :rtype: str
    """
    try:
        return service.list_entity_tags_csv(currency=currency, entity=entity)
    except RuntimeError as e:
        return notfound(str(e))
Пример #12
0
def get_tx(currency, tx_hash):  # noqa: E501
    """Returns details of a specific transaction identified by its hash.

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param tx_hash: The transaction hash
    :type tx_hash: str

    :rtype: Tx
    """
    try:
        return service.get_tx(currency=currency, tx_hash=tx_hash)
    except RuntimeError as e:
        return notfound(str(e))
Пример #13
0
def list_txs(currency, page=None):  # noqa: E501
    """Returns transactions

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param page: Resumption token for retrieving the next page
    :type page: str

    :rtype: Txs
    """
    try:
        return service.list_txs(currency=currency, page=page)
    except RuntimeError as e:
        return notfound(str(e))
def list_address_tags(currency, address):  # noqa: E501
    """Get attribution tags for a given address

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str

    :rtype: List[Tag]
    """
    try:
        return service.list_address_tags(currency=currency, address=address)
    except RuntimeError as e:
        return notfound(str(e))
Пример #15
0
def list_tags(label, currency=None):  # noqa: E501
    """Returns the tags associated with a given label

     # noqa: E501

    :param label: The label of an entity
    :type label: str
    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str

    :rtype: List[Tag]
    """
    try:
        return service.list_tags(label=label, currency=currency)
    except RuntimeError as e:
        return notfound(str(e))
Пример #16
0
def list_entity_addresses_csv(currency, entity):  # noqa: E501
    """Get an entity's addresses as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int

    :rtype: str
    """
    try:
        return service.list_entity_addresses_csv(currency=currency,
                                                 entity=entity)
    except RuntimeError as e:
        return notfound(str(e))
Пример #17
0
def list_block_txs_csv(currency, height):  # noqa: E501
    """Get all blocks as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param height: The block height
    :type height: int

    :rtype: str
    """
    try:
        return service.list_block_txs_csv(
            currency=currency,
            height=height)
    except RuntimeError as e:
        return notfound(str(e))
Пример #18
0
def search(q, currency=None, limit=None):  # noqa: E501
    """Returns matching addresses, transactions and labels

     # noqa: E501

    :param q: It can be (the beginning of) an address, a transaction or a label
    :type q: str
    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param limit: Maximum number of search results
    :type limit: int

    :rtype: SearchResult
    """
    try:
        return service.search(q=q, currency=currency, limit=limit)
    except RuntimeError as e:
        return notfound(str(e))
Пример #19
0
def get_block(currency, height):  # noqa: E501
    """Get a block by its height

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param height: The block height
    :type height: int

    :rtype: Block
    """
    try:
        return service.get_block(
            currency=currency,
            height=height)
    except RuntimeError as e:
        return notfound(str(e))
Пример #20
0
def get_exchange_rates(currency, height):  # noqa: E501
    """Returns exchange rate for a given height

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param height: The block height
    :type height: int

    :rtype: Rates
    """
    try:
        return service.get_exchange_rates(
            currency=currency,
            height=height)
    except RuntimeError as e:
        return notfound(str(e))
Пример #21
0
def search_entity_neighbors(currency,
                            entity,
                            direction,
                            key,
                            value,
                            depth,
                            breadth=None,
                            skip_num_addresses=None):  # noqa: E501
    """Search deeply for matching neighbors

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int
    :param direction: Incoming or outgoing neighbors
    :type direction: str
    :param key: Match neighbors against one and only one of these properties: - the category the entity belongs to - addresses the entity contains - total_received: amount the entity received in total - balance: amount the entity holds finally
    :type key: str
    :param value: If key is - category: comma separated list of category names - addresses: comma separated list of address IDs - total_received/balance: comma separated tuple of (currency, min, max)
    :type value: List[str]
    :param depth: How many hops should the transaction graph be searched
    :type depth: int
    :param breadth: How many siblings of each neighbor should be tried
    :type breadth: int
    :param skip_num_addresses: Skip entities containing more addresses
    :type skip_num_addresses: int

    :rtype: SearchPaths
    """
    try:
        return service.search_entity_neighbors(
            currency=currency,
            entity=entity,
            direction=direction,
            key=key,
            value=value,
            depth=depth,
            breadth=breadth,
            skip_num_addresses=skip_num_addresses)
    except RuntimeError as e:
        return notfound(str(e))
Пример #22
0
def list_entity_neighbors_csv(currency, entity, direction):  # noqa: E501
    """Get an entity's neighbors in the entity graph as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param entity: The entity ID
    :type entity: int
    :param direction: Incoming or outgoing neighbors
    :type direction: str

    :rtype: str
    """
    try:
        return service.list_entity_neighbors_csv(currency=currency,
                                                 entity=entity,
                                                 direction=direction)
    except RuntimeError as e:
        return notfound(str(e))
def list_address_links_csv(currency, address, neighbor):  # noqa: E501
    """Get transactions between two addresses as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str
    :param neighbor: Neighbor address
    :type neighbor: str

    :rtype: str
    """
    try:
        return service.list_address_links_csv(currency=currency,
                                              address=address,
                                              neighbor=neighbor)
    except RuntimeError as e:
        return notfound(str(e))
def list_address_neighbors_csv(currency, address, direction):  # noqa: E501
    """Get an addresses' neighbors in the address graph as CSV

     # noqa: E501

    :param currency: The cryptocurrency (e.g., btc)
    :type currency: str
    :param address: The cryptocurrency address
    :type address: str
    :param direction: Incoming or outgoing neighbors
    :type direction: str

    :rtype: str
    """
    try:
        return service.list_address_neighbors_csv(currency=currency,
                                                  address=address,
                                                  direction=direction)
    except RuntimeError as e:
        return notfound(str(e))