# 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+
- `grpcio` and `grpcio-tools`
- `pysocks` for SOCKS5 proxy support (optional)
- Haveno server running and accessible
## Installation
1. **Clone the repository**:
```bash
git clone https://github.com/KewbitXMR/python-haveno-client.git
cd python-haveno-client
```
2. **Create a virtual environment** (optional but recommended):
```bash
python3 -m venv venv
source venv/bin/activate
```
3. **Install dependencies**:
```bash
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:
```python
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:
```python
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:
```python
# Example: Get account information
account_info = client.account_client.get_account_info('account_id')
```
## Development
### Building the Package
To compile the package for distribution:
```bash
python -m build
```
This will create the distribution files in the `dist/` directory.
### Running Tests
To run the test suite, use:
```bash
python -m unittest discover tests/
```
## Contributing
1. Fork the repository.
2. Create a new branch: `git checkout -b my-feature-branch`.
3. Make your changes and commit them: `git commit -m 'Add new feature'`.
4. Push to the branch: `git push origin my-feature-branch`.
5. 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 `grpcio` and `pysocks` libraries.
- **THIS PROJECT IS A WORK IN PROGRESS, ITS IS NOT YET SUITABLE FOR PRODUCTION ENVIRONMENTS**
## Contributors
The main contributor for this project is [Kewbit](https://kewbit.org) 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](https://haveno.app).
Raw data
{
"_id": null,
"home_page": null,
"name": "haveno-client",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "haveno, monero, p2p, exchange",
"author": null,
"author_email": "Kewbit <support@haveno.app>",
"download_url": "https://files.pythonhosted.org/packages/d8/d2/153a85158437c87047f48716effa3b78ca2da2f84e4a7f125d9ff8df548c/haveno_client-0.2.2.tar.gz",
"platform": null,
"description": "# Python Haveno Client\n\nThe 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.\n\n## Features\n\n- Connect to multiple Haveno servers using gRPC.\n- Manage accounts, access market data, and make trades.\n- Supports SOCKS5 proxy for secure and private connections.\n- Modular design for different gRPC services (e.g., Accounts, Trades, Offers).\n\n## Requirements\n\n- Python 3.7+\n- `grpcio` and `grpcio-tools`\n- `pysocks` for SOCKS5 proxy support (optional)\n- Haveno server running and accessible\n\n## Installation\n\n1. **Clone the repository**:\n\n```bash\n git clone https://github.com/KewbitXMR/python-haveno-client.git\n cd python-haveno-client\n```\n\n2. **Create a virtual environment** (optional but recommended):\n\n```bash\n python3 -m venv venv\n source venv/bin/activate\n```\n\n3. **Install dependencies**:\n\n```bash\n pip install -r requirements.txt\n```\n\n## Usage\n\n### 1. Initialize the Haveno Client\n\nHere is an example of how to initialize the client and connect to a Haveno server:\n\n```python\n from haveno_client import HavenoClient\n\n # Create a Haveno client instance and connect to the server\n client = HavenoClient(host='localhost', port=3201, password='your_password', use_socks5=True, socks5_host='127.0.0.1', socks5_port=9050)\n\n # Perform operations using the client\n account_info = client.account_client.get_account_info('account_id')\n print(account_info)\n\n # Disconnect from the server\n client.disconnect()\n```\n\n### 2. Connect to Multiple Servers\n\nYou can create multiple instances of `HavenoClient` to connect to different Haveno servers:\n\n```python\n client1 = HavenoClient(host='localhost', port=50051, password='password1')\n client2 = HavenoClient(host='localhost', port=50052, password='password2', use_socks5=True)\n\n # Perform operations with each client...\n client1.disconnect()\n client2.disconnect()\n```\n\n### 3. Using Modular Service Stubs\n\nThe client provides modular stubs for each gRPC service, such as `AccountClient`, `TradesClient`, and `OffersClient`. Each stub can be accessed via the `HavenoClient` instance:\n\n```python\n # Example: Get account information\n account_info = client.account_client.get_account_info('account_id')\n```\n\n## Development\n\n### Building the Package\n\nTo compile the package for distribution:\n\n```bash\n python -m build\n```\n\nThis will create the distribution files in the `dist/` directory.\n\n### Running Tests\n\nTo run the test suite, use:\n\n```bash\n python -m unittest discover tests/\n```\n\n## Contributing\n\n1. Fork the repository.\n2. Create a new branch: `git checkout -b my-feature-branch`.\n3. Make your changes and commit them: `git commit -m 'Add new feature'`.\n4. Push to the branch: `git push origin my-feature-branch`.\n5. Submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\n\n## Acknowledgments\n\n- The Haveno development team for building the Haveno decentralized exchange.\n- Contributors to the `grpcio` and `pysocks` libraries.\n- **THIS PROJECT IS A WORK IN PROGRESS, ITS IS NOT YET SUITABLE FOR PRODUCTION ENVIRONMENTS**\n\n## Contributors\nThe main contributor for this project is [Kewbit](https://kewbit.org) 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](https://haveno.app).\n",
"bugtrack_url": null,
"license": "AGPL-3.0-or-later",
"summary": "A client for interacting with the Haveno daemon.",
"version": "0.2.2",
"project_urls": {
"Changelog": "https://haveno.app/changelog",
"Documentation": "https://haveno.app/documentation",
"Funding": "https://haveno.app/donate",
"Homepage": "https://haveno.app",
"Issues": "https://git.haveno.app/haveno-network/python-haveno-client/issues",
"Repository": "https://git.haveno.app/haveno-network/python-haveno-client"
},
"split_keywords": [
"haveno",
" monero",
" p2p",
" exchange"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c248bc2ad8435a28dbb42dc7abba8bea4e310569550c15af2fd764ad7ea8cfd4",
"md5": "8fc43665b2b88053e4596aa40602bb2c",
"sha256": "7519dccb41b5448444c1724df200995154e3ff814d867370f7ac9fcdaba1cb23"
},
"downloads": -1,
"filename": "haveno_client-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fc43665b2b88053e4596aa40602bb2c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 85956,
"upload_time": "2025-09-13T05:52:09",
"upload_time_iso_8601": "2025-09-13T05:52:09.679639Z",
"url": "https://files.pythonhosted.org/packages/c2/48/bc2ad8435a28dbb42dc7abba8bea4e310569550c15af2fd764ad7ea8cfd4/haveno_client-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d8d2153a85158437c87047f48716effa3b78ca2da2f84e4a7f125d9ff8df548c",
"md5": "c2703114a70390c91a84fc83dd259d7c",
"sha256": "2742dca457e281ffce7827fbf7b3d106d614d7609c0220fba788bac9ddf0e656"
},
"downloads": -1,
"filename": "haveno_client-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "c2703114a70390c91a84fc83dd259d7c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 84428,
"upload_time": "2025-09-13T05:52:13",
"upload_time_iso_8601": "2025-09-13T05:52:13.113193Z",
"url": "https://files.pythonhosted.org/packages/d8/d2/153a85158437c87047f48716effa3b78ca2da2f84e4a7f125d9ff8df548c/haveno_client-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-13 05:52:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "haveno-client"
}