Api
Hydra API Documentation
Complete documentation for the Hydra gRPC-Web API.
Hydra API Documentation
Complete documentation for the Hydra gRPC-Web API.
Quick Links
- Getting Started - Learn the basics and make your first API call
- Common Patterns - Master complex data structures and avoid common pitfalls
- Examples - Real-world examples from the Hydra Dashboard
- API Reference - Complete API reference
Overview
The Hydra Dashboard communicates with the Hydra backend using gRPC-Web with Protocol Buffers. This provides type-safe, efficient communication between the frontend and backend.
Future Support: JSON-RPC support is planned to provide an alternative API interface alongside gRPC-Web for easier integration with tools and libraries that prefer REST-like APIs.
Architecture
┌─────────────────┐ gRPC-Web ┌──────────────────┐
│ │ ◄────────────────────► │ │
│ React Frontend │ Protocol Buffers │ Hydra Backend │
│ │ │ (Rust) │
└─────────────────┘ └──────────────────┘
│ │
│ │
grpcWebClient.ts gRPC Services
│ │
├── AppService ├── Network management
├── WalletService ├── Balance & transactions
├── NodeService ├── Channels & payments
├── RentalService ├── Channel rentals
├── OrderbookService ├── Market trading
├── AssetService ├── Asset queries
├── BlockchainService ├── Fee estimates
└── PricingService └── Price conversions
Services Overview
Core Services
| Service | Purpose | Key Operations |
|---|---|---|
| AppService | Network configuration | Get networks, check sync status |
| WalletService | Wallet management | Get balances, transactions, deposit addresses |
| NodeService | Channel operations | Open/close channels, send payments, manage peers |
Trading Services
| Service | Purpose | Key Operations |
|---|---|---|
| OrderbookService | Market operations | Initialize markets, get orderbook data |
| RentalService | Channel rentals | Rent inbound liquidity |
| AssetService | Asset queries | Get asset info, available assets |
Utility Services
| Service | Purpose | Key Operations |
|---|---|---|
| BlockchainService | Blockchain data | Get fee estimates, block info |
| PricingService | Price conversions | Get fiat prices, USD conversions |
Resources
Internal Documentation
- Getting Started Guide - First steps with the API
- Common Patterns - Data structure patterns
- Examples - Real-world usage examples
- API Reference - Complete method reference
External Resources
- Protocol Buffers - Proto language guide
- gRPC-Web - gRPC-Web documentation
Contributing
When adding new API calls:
- Check the API Reference for the correct structure
- Use proper request/response types from
@/proto/* - Handle errors appropriately
- Add examples to this documentation
- Update relevant documentation sections
Support
For issues or questions:
- Check the Common Patterns guide
- Review the Examples
- Consult the API Reference
- Review the specific service documentation (e.g., Node API, Wallet API)
Last updated: $(date)