dhan-rs 0.1.6

Unofficial Rust client library for the DhanHQ Broker API v2 — orders, market data, WebSocket feeds, and more
Documentation
# ⚠️ Disclaimer

## AI-Generated Code

**This entire crate (`dhan-rs`) was generated by AI** (GitHub Copilot / Claude).
Every line of source code — including types, API implementations, WebSocket
parsers, error handling, and documentation — was produced by a large language
model.

## Not Tested in Production

While this library:

- ✅ Compiles successfully with `cargo check` and `cargo build`
- ✅ Follows the [DhanHQ API v2 specification]https://dhanhq.co/docs/v2/
- ✅ Uses strongly-typed Rust structs with proper serde serialization

It has **NOT** been:

- ❌ Extensively tested against the live DhanHQ API
- ❌ Validated for correctness of order placement, modification, or cancellation
- ❌ Verified for accurate binary WebSocket market feed parsing with real data
- ❌ Audited for edge cases, race conditions, or failure modes
- ❌ Reviewed by DhanHQ or any financial technology professional

## Financial Risk Warning

**Trading in financial markets involves substantial risk of loss.** Using
unverified software for automated trading amplifies this risk significantly.

Before using this library with real money or in any production environment:

1. **Review the source code** — Read every file and understand what it does
2. **Write comprehensive tests** — Unit tests, integration tests against the
   sandbox API, and end-to-end tests
3. **Validate all order flows** — Place, modify, and cancel orders in a test
   environment before going live
4. **Verify market data** — Compare WebSocket feed output against known-good
   data sources
5. **Implement safeguards** — Rate limiting, position limits, circuit breakers,
   and monitoring
6. **Start small** — Begin with minimal positions and scale up only after
   thorough validation

## Not Affiliated with DhanHQ

This is an **unofficial** client library. It is:

- **Not** affiliated with, endorsed by, or supported by DhanHQ or Dhan
- **Not** an official DhanHQ product
- **Not** guaranteed to remain compatible with future API changes

For official SDKs and documentation, visit [dhanhq.co/docs/v2/](https://dhanhq.co/docs/v2/).

## No Warranty

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

**IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES, OR OTHER LIABILITY** — INCLUDING BUT NOT LIMITED TO FINANCIAL LOSSES,
TRADING LOSSES, OR ANY OTHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES — WHETHER IN AN ACTION OF CONTRACT, TORT,
OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.

## Recommendation

If you need a production-ready trading client:

1. Use [DhanHQ's official Python SDK]https://github.com/dhan-oss/DhanHQ-py
   which is maintained and tested by DhanHQ
2. Or build your own client with proper testing and validation
3. Consider this library as a **starting point** or **reference implementation**,
   not a production-ready solution