Api

Hydra API Documentation

Complete documentation for the Hydra gRPC-Web API.

Hydra API Documentation

Complete documentation for the Hydra gRPC-Web API.

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

ServicePurposeKey Operations
AppServiceNetwork configurationGet networks, check sync status
WalletServiceWallet managementGet balances, transactions, deposit addresses
NodeServiceChannel operationsOpen/close channels, send payments, manage peers

Trading Services

ServicePurposeKey Operations
OrderbookServiceMarket operationsInitialize markets, get orderbook data
RentalServiceChannel rentalsRent inbound liquidity
AssetServiceAsset queriesGet asset info, available assets

Utility Services

ServicePurposeKey Operations
BlockchainServiceBlockchain dataGet fee estimates, block info
PricingServicePrice conversionsGet fiat prices, USD conversions

Resources

Internal Documentation

External Resources

Contributing

When adding new API calls:

  1. Check the API Reference for the correct structure
  2. Use proper request/response types from @/proto/*
  3. Handle errors appropriately
  4. Add examples to this documentation
  5. Update relevant documentation sections

Support

For issues or questions:

  1. Check the Common Patterns guide
  2. Review the Examples
  3. Consult the API Reference
  4. Review the specific service documentation (e.g., Node API, Wallet API)

Last updated: $(date)


Copyright © 2025