Example #1
0
async def history(connection, pubkey):
    """
    Get transactions history of public key

    :param duniterpy.api.bma.ConnectionHandler connection: Connection handler instance
    :param str pubkey: Public key
    :rtype: dict
    """

    client = API(connection, URL_PATH)

    r = await client.requests_get('/history/%s' % pubkey)
    return await parse_response(r, HISTORY_SCHEMA)
Example #2
0
 def test_reverse_url_only_ipv4(self):
     endpoint = BMAEndpoint(None, "124.2.2.1", None, 9092)
     api = API(next(endpoint.conn_handler()), "any")
     self.assertEqual(api.reverse_url("http", "/test/url"),
                      "http://124.2.2.1:9092/any/test/url")