https://github.com/gr0vity-dev/nanows
A simplistic library to interact with nanocurrency websockets
https://github.com/gr0vity-dev/nanows
nanocurrency
Last synced: 4 months ago
JSON representation
A simplistic library to interact with nanocurrency websockets
- Host: GitHub
- URL: https://github.com/gr0vity-dev/nanows
- Owner: gr0vity-dev
- Created: 2024-01-23T22:22:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-28T19:12:17.000Z (6 months ago)
- Last Synced: 2025-11-30T23:30:03.383Z (6 months ago)
- Topics: nanocurrency
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nanows
`nanows` is a Python library providing an easy-to-use interface for interacting with Nano cryptocurrency nodes via WebSockets. It abstracts the complexities of WebSocket communication, allowing developers to focus on handling Nano node events like account confirmations.
## Features
- Subscribe to confirmation events for specific Nano accounts.
- Update subscription settings to add or remove accounts dynamically.
- Stream confirmation events in real-time with an asynchronous API.
## Installation
To install `nanows`, run:
```bash
pip install nanows
```
## Quick Start
Here's a quick example to get you started:
```python
import asyncio
from nanows.api import NanoWebSocketClient
async def run():
accounts = ["nano_1a...", "nano_1b..."]
nano_ws = NanoWebSocketClient(url="ws://localhost:7078")
await nano_ws.subscribe_confirmation(accounts)
async for message in nano_ws.receive_messages():
print(f"Received confirmation: {message}")
asyncio.run(run())
```
This example demonstrates how to subscribe to confirmation events for a list of Nano accounts and print out each confirmation as it is received.
## Contributing
Contributions to `nanows` are welcome!
## License
`nanows` is released under the MIT License.