Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gr0vity-dev/nanows
A simplistic library to interact with nanocurrency websockets
https://github.com/gr0vity-dev/nanows
nanocurrency
Last synced: about 2 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-25T23:01:44.000Z (2 months ago)
- Last Synced: 2024-11-25T23:16:19.227Z (2 months ago)
- Topics: nanocurrency
- Language: Python
- Homepage:
- Size: 8.79 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 NanoWebSocketasync def run():
accounts = ["nano_1a...", "nano_1b..."]
nano_ws = NanoWebSocket(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.