Python Haveno Client
The Haveno Client is a Python gRPC client that allows you to interact with the Haveno daemon, a decentralized cryptocurrency trading platform. This client enables you to connect to Haveno servers, access market data, manage accounts, and perform trades programmatically.
Features
- Connect to multiple Haveno servers using gRPC.
- Manage accounts, access market data, and make trades.
- Supports SOCKS5 proxy for secure and private connections.
- Modular design for different gRPC services (e.g., Accounts, Trades, Offers).
Requirements
- Python 3.7+
grpcioandgrpcio-toolspysocksfor SOCKS5 proxy support (optional)- Haveno server running and accessible
Installation
- Clone the repository:
git clone https://github.com/KewbitXMR/python-haveno-client.git
cd python-haveno-client
- Create a virtual environment (optional but recommended):
python3 -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
Usage
1. Initialize the Haveno Client
Here is an example of how to initialize the client and connect to a Haveno server:
from haveno_client import HavenoClient
# Create a Haveno client instance and connect to the server
client = HavenoClient(host='localhost', port=3201, password='your_password', use_socks5=True, socks5_host='127.0.0.1', socks5_port=9050)
# Perform operations using the client
account_info = client.account_client.get_account_info('account_id')
print(account_info)
# Disconnect from the server
client.disconnect()
2. Connect to Multiple Servers
You can create multiple instances of HavenoClient to connect to different Haveno servers:
client1 = HavenoClient(host='localhost', port=50051, password='password1')
client2 = HavenoClient(host='localhost', port=50052, password='password2', use_socks5=True)
# Perform operations with each client...
client1.disconnect()
client2.disconnect()
3. Using Modular Service Stubs
The client provides modular stubs for each gRPC service, such as AccountClient, TradesClient, and OffersClient. Each stub can be accessed via the HavenoClient instance:
# Example: Get account information
account_info = client.account_client.get_account_info('account_id')
Development
Building the Package
To compile the package for distribution:
python -m build
This will create the distribution files in the dist/ directory.
Running Tests
To run the test suite, use:
python -m unittest discover tests/
Contributing
- Fork the repository.
- Create a new branch:
git checkout -b my-feature-branch. - Make your changes and commit them:
git commit -m 'Add new feature'. - Push to the branch:
git push origin my-feature-branch. - Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Acknowledgments
- The Haveno development team for building the Haveno decentralized exchange.
- Contributors to the
grpcioandpysockslibraries. - THIS PROJECT IS A WORK IN PROGRESS, ITS IS NOT YET SUITABLE FOR PRODUCTION ENVIRONMENTS
Contributors
The main contributor for this project is Kewbit for the purpose of making a funtional and effecient interface for the Django website on the original haveno.com but now used on haveno.app.
Release files for haveno-client 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| haveno_client-0.2.2.tar.gz | 84.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| haveno_client-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 170.4 kB
Release files / haveno_client-0.2.2.tar.gz
| Download URL | haveno_client-0.2.2.tar.gz |
|---|---|
| Size | 84.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2742dca457e281ffce7827fbf7b3d106d614d7609c0220fba788bac9ddf0e656
|
|
BLAKE2b-256 checksum How to use checksums |
d8d2153a85158437c87047f48716effa3b78ca2da2f84e4a7f125d9ff8df548c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / haveno_client-0.2.2-py3-none-any.whl
| Download URL | haveno_client-0.2.2-py3-none-any.whl |
|---|---|
| Size | 86.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7519dccb41b5448444c1724df200995154e3ff814d867370f7ac9fcdaba1cb23
|
|
BLAKE2b-256 checksum How to use checksums |
c248bc2ad8435a28dbb42dc7abba8bea4e310569550c15af2fd764ad7ea8cfd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|