Table of Contents
EtherHound API is an asynchronous Python client library designed to interact seamlessly with the EtherHound Core API. It provides a simple and efficient interface for making HTTP requests to EtherHound-powered services, supporting modern Python features and type hints. Built on top of aiohttp and leveraging pydantic for data validation, this library enables developers to quickly integrate EtherHound API endpoints into their applications with minimal boilerplate.
Key features:
- Asynchronous HTTP requests for high performance
- Configurable host, port, and protocol settings
- Designed for extensibility
- python >= 3.11
- pydantic
- aiohttp
- clone the repo
git clone https://github.com/EtherHounds/API.git- cd into the repo
cd API- build
pip install . -U- done!
pip install etherhound-apifrom houndapi import HoundAPI, LogsSubscription
import asyncio
async def main():
client = HoundAPI(
host="127.0.0.1", # local host
port=8080
)
result = await client.subscribe(LogsSubscription(
label="deposits",
address="0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", # BSC-WBNB Contract
topics=["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"] # The Deposit Event Hash
))
print(f"Subscribed Successfully ✔️, Subscription ID: ({result.result[0]})")
await client.close()
asyncio.run(main())from houndapi import HoundAPI
import asyncio
async def main():
client = HoundAPI(
host="127.0.0.1", # local host
port=8080
)
result = await client.poll(
subscription_id="0xYourSubscriptionID",
limit=10 # poll only first 10 events
)
for res in result:
print(f"New Event From Subscription {res.label}")
print(f"({res.result.address}) Has Deposited {(int(res.result.data, base=16))*10**-18:.8f} WBNB")
print(f"(https://bscscan.com/tx/{res.result.transaction_hash})")
print("-"*50)
await client.close()
asyncio.run(main())- Examples
- Better Documentation
See the open issues for a full list of proposed features (and known issues).
Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the project_license. See LICENSE.txt for more information.
SpicyPenguin - @kerolis55463
Project Link: https://github.com/EtherHounds/API