API Reference
Note: This file is auto-generated from the proto files. Do not edit directly. Last updated: Sun Nov 16 18:27:28 CET 2025
This document provides a complete reference for all Hydra API services and methods.
Table of Contents
app
AppService
General application service definition.
Methods
GetNetworks
Request: GetNetworksResponse
Response: GetNetworksResponse
View request structure
message GetNetworksResponse { repeated Network networks = 1; }
message GetPublicKeyRequest {}
message GetPublicKeyResponse { bytes public_key = 1; }
View response structure
message GetNetworksResponse { repeated Network networks = 1; }
message GetPublicKeyRequest {}
message GetPublicKeyResponse { bytes public_key = 1; }
GetPublicKey
Request: GetPublicKeyResponse
Response: GetPublicKeyResponse
View request structure
message GetPublicKeyResponse { bytes public_key = 1; }
View response structure
message GetPublicKeyResponse { bytes public_key = 1; }
asset
AssetService
Service definition for asset management. This service provides methods to retrieve and manage assets on different networks.
Methods
GetAssets
Request: GetAssetsResponse
Response: GetAssetsResponse
View request structure
message GetAssetsResponse { repeated Asset assets = 1; }
message GetAssetRequest {
Network network = 1;
string asset_id = 2;
}
View response structure
message GetAssetsResponse { repeated Asset assets = 1; }
message GetAssetRequest {
Network network = 1;
string asset_id = 2;
}
GetAsset
Request: GetAssetResponse
Response: GetAssetResponse
View request structure
message GetAssetResponse { Asset asset = 1; }
message GetNativeAssetRequest { Network network = 1; }
message AddTokenRequest {
Network network = 1;
string token_id = 2;
}
View response structure
message GetAssetResponse { Asset asset = 1; }
message GetNativeAssetRequest { Network network = 1; }
message AddTokenRequest {
Network network = 1;
string token_id = 2;
}
GetNativeAsset
Request: GetAssetResponse
Response: GetAssetResponse
View request structure
message GetAssetResponse { Asset asset = 1; }
message GetNativeAssetRequest { Network network = 1; }
message AddTokenRequest {
Network network = 1;
string token_id = 2;
}
View response structure
message GetAssetResponse { Asset asset = 1; }
message GetNativeAssetRequest { Network network = 1; }
message AddTokenRequest {
Network network = 1;
string token_id = 2;
}
AddToken
Request: AddTokenResponse
Response: AddTokenResponse
View request structure
message AddTokenResponse { Asset asset = 1; }
View response structure
message AddTokenResponse { Asset asset = 1; }
blockchain
BlockchainService
Service definition for blockchain operations. This service provides methods to interact with blockchain networks.
Methods
GetBlockNumber
Request: GetBlockNumberResponse
Response: GetBlockNumberResponse
View request structure
message GetBlockNumberResponse { uint64 block_number = 1; }
message GetBlockHeaderRequest {
Network network = 1;
uint64 block_number = 2;
}
View response structure
message GetBlockNumberResponse { uint64 block_number = 1; }
message GetBlockHeaderRequest {
Network network = 1;
uint64 block_number = 2;
}
GetBlockHeader
Request: GetBlockHeaderResponse
Response: GetBlockHeaderResponse
View request structure
message GetBlockHeaderResponse { BlockHeader block_header = 1; }
message GetFeeEstimatesRequest { Network network = 1; }
message GetFeeEstimatesResponse { FeeEstimate fee_estimate = 1; }
message GetTokenAllowanceRequest {
Network network = 1;
string token_id = 2;
string owner = 3;
string spender = 4;
}
View response structure
message GetBlockHeaderResponse { BlockHeader block_header = 1; }
message GetFeeEstimatesRequest { Network network = 1; }
message GetFeeEstimatesResponse { FeeEstimate fee_estimate = 1; }
message GetTokenAllowanceRequest {
Network network = 1;
string token_id = 2;
string owner = 3;
string spender = 4;
}
GetFeeEstimates
Request: GetFeeEstimatesRequest
Response: rpc GetFeeEstimates(GetFeeEstimatesRequest)
View request structure
message GetFeeEstimatesRequest { Network network = 1; }
message GetFeeEstimatesResponse { FeeEstimate fee_estimate = 1; }
message GetTokenAllowanceRequest {
Network network = 1;
string token_id = 2;
string owner = 3;
string spender = 4;
}
GetTokenAllowance
Request: GetTokenAllowanceRequest
Response: rpc GetTokenAllowance(GetTokenAllowanceRequest)
View request structure
message GetTokenAllowanceRequest {
Network network = 1;
string token_id = 2;
string owner = 3;
string spender = 4;
}
client
ClientService
Client service definition for managing client-specific operations.
Methods
GetDepositAddress
Request: GetDepositAddressRequest
Response: rpc GetDepositAddress(GetDepositAddressRequest)
View request structure
message GetDepositAddressRequest { Network network = 1; }
message GetDepositAddressResponse { string address = 1; }
message SendTransactionRequest {
Network network = 1;
string to_address = 2;
SendAmount amount = 3;
FeeOption fee_option = 4;
}
SendTransaction
Request: SendTransactionRequest
Response: rpc SendTransaction(SendTransactionRequest)
View request structure
message SendTransactionRequest {
Network network = 1;
string to_address = 2;
SendAmount amount = 3;
FeeOption fee_option = 4;
}
BumpTransaction
Request: BumpTransactionRequest
Response: rpc BumpTransaction(BumpTransactionRequest)
View request structure
message BumpTransactionRequest {
Network network = 1;
string txid = 2;
FeeOption fee_option = 3;
}
SendTokenTransaction
Request: SendTokenTransactionRequest
Response: rpc SendTokenTransaction(SendTokenTransactionRequest)
View request structure
message SendTokenTransactionRequest {
Network network = 1;
string to_address = 2;
string token_id = 3;
SendAmount amount = 4;
FeeOption fee_option = 5;
}
SetTokenAllowance
Request: SetTokenAllowanceRequest
Response: rpc SetTokenAllowance(SetTokenAllowanceRequest)
View request structure
message SetTokenAllowanceRequest {
Network network = 1;
string spender = 2;
SetAllowance allowance = 3;
FeeOption fee_option = 5;
}
event
EventService
Event service definition for managing events related to clients and nodes.
Methods
SubscribeClientEvents
Request: SubscribeClientEventsRequest
Response: rpc SubscribeClientEvents(SubscribeClientEventsRequest)
View request structure
message SubscribeClientEventsRequest { Network network = 1; }
message SubscribeNodeEventsRequest { Network network = 1; }
SubscribeNodeEvents
Request: SubscribeNodeEventsRequest
Response: rpc SubscribeNodeEvents(SubscribeNodeEventsRequest)
View request structure
message SubscribeNodeEventsRequest { Network network = 1; }
node
NodeService
Node service definition for managing node-specific operations. This service provides methods to manage channels, payments, and connections to peers on different networks.
Methods
ConnectToPeer
Request: ConnectToPeerResponse
Response: ConnectToPeerResponse
View request structure
message ConnectToPeerResponse {}
message GetConnectedPeersRequest { Network network = 1; }
message GetConnectedPeersResponse { repeated string node_ids = 1; }
message EstimateOpenChannelFeeRequest {
Network network = 1;
string node_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
View response structure
message ConnectToPeerResponse {}
message GetConnectedPeersRequest { Network network = 1; }
message GetConnectedPeersResponse { repeated string node_ids = 1; }
message EstimateOpenChannelFeeRequest {
Network network = 1;
string node_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
GetConnectedPeers
Request: GetConnectedPeersRequest
Response: rpc GetConnectedPeers(GetConnectedPeersRequest)
View request structure
message GetConnectedPeersRequest { Network network = 1; }
message GetConnectedPeersResponse { repeated string node_ids = 1; }
message EstimateOpenChannelFeeRequest {
Network network = 1;
string node_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
EstimateOpenChannelFee
Request: EstimateOpenChannelFeeRequest
Response: rpc EstimateOpenChannelFee(EstimateOpenChannelFeeRequest)
View request structure
message EstimateOpenChannelFeeRequest {
Network network = 1;
string node_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
OpenChannel
Request: OpenChannelResponse
Response: OpenChannelResponse
View request structure
message OpenChannelResponse {
string txid = 1;
string channel_id = 2;
}
View response structure
message OpenChannelResponse {
string txid = 1;
string channel_id = 2;
}
EstimateDepositChannelFee
Request: EstimateDepositChannelFeeRequest
Response: rpc EstimateDepositChannelFee(EstimateDepositChannelFeeRequest)
View request structure
message EstimateDepositChannelFeeRequest {
Network network = 1;
string channel_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
DepositChannel
Request: DepositChannelResponse
Response: DepositChannelResponse
View request structure
message DepositChannelResponse { string txid = 1; }
message WithdrawAmount {
SendAmount self_withdrawal = 1;
SendAmount counterparty_withdrawal = 2;
}
View response structure
message DepositChannelResponse { string txid = 1; }
message WithdrawAmount {
SendAmount self_withdrawal = 1;
SendAmount counterparty_withdrawal = 2;
}
EstimateWithdrawChannelFee
Request: EstimateWithdrawChannelFeeRequest
Response: rpc EstimateWithdrawChannelFee(EstimateWithdrawChannelFeeRequest)
View request structure
message EstimateWithdrawChannelFeeRequest {
Network network = 1;
string channel_id = 2;
map<string, WithdrawAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
WithdrawChannel
Request: WithdrawChannelRequest
Response: rpc WithdrawChannel(WithdrawChannelRequest)
View request structure
message WithdrawChannelRequest {
Network network = 1;
string channel_id = 2;
map<string, WithdrawAmount> asset_amounts = 3; // key: asset_id
FeeOption fee_option = 4;
}
EstimateCloseChannelFee
Request: EstimateCloseChannelFeeRequest
Response: rpc EstimateCloseChannelFee(EstimateCloseChannelFeeRequest)
View request structure
message EstimateCloseChannelFeeRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
CloseChannel
Request: CloseChannelResponse
Response: CloseChannelResponse
View request structure
message CloseChannelResponse { string txid = 1; }
message EstimateForceCloseChannelFeeRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
View response structure
message CloseChannelResponse { string txid = 1; }
message EstimateForceCloseChannelFeeRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
EstimateForceCloseChannelFee
Request: EstimateForceCloseChannelFeeRequest
Response: rpc EstimateForceCloseChannelFee(EstimateForceCloseChannelFeeRequest)
View request structure
message EstimateForceCloseChannelFeeRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
ForceCloseChannel
Request: ForceCloseChannelRequest
Response: rpc ForceCloseChannel(ForceCloseChannelRequest)
View request structure
message ForceCloseChannelRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
EstimateRedeemClosedChannelFee
Request: EstimateRedeemClosedChannelFeeRequest
Response: rpc EstimateRedeemClosedChannelFee(EstimateRedeemClosedChannelFeeRequest)
View request structure
message EstimateRedeemClosedChannelFeeRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
RedeemClosedChannel
Request: RedeemClosedChannelRequest
Response: rpc RedeemClosedChannel(RedeemClosedChannelRequest)
View request structure
message RedeemClosedChannelRequest {
Network network = 1;
string channel_id = 2;
repeated string asset_ids = 3;
FeeOption fee_option = 4;
}
WaitForActiveAssetChannel
Request: WaitForActiveAssetChannelRequest
Response: rpc WaitForActiveAssetChannel(WaitForActiveAssetChannelRequest)
View request structure
message WaitForActiveAssetChannelRequest {
Network network = 1;
string channel_id = 2;
string asset_id = 3;
bool active_sending = 4;
bool active_receiving = 5;
bool updatable = 6;
}
SendChannelPayment
Request: SendChannelPaymentRequest
Response: rpc SendChannelPayment(SendChannelPaymentRequest)
View request structure
message SendChannelPaymentRequest {
Network network = 1;
string channel_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
optional Hashlock hashlock = 4;
optional uint64 expiry_timeout_secs = 5;
}
EstimateSendPaymentFee
Request: EstimateSendPaymentFeeRequest
Response: rpc EstimateSendPaymentFee(EstimateSendPaymentFeeRequest)
View request structure
message EstimateSendPaymentFeeRequest {
Network network = 1;
string recipient_node_id = 2;
map<string, SendAmount> asset_amounts = 3; // key: asset_id
optional Hashlock hashlock = 4;
optional uint64 expiry_timeout_secs = 5;
}
SendPayment
Request: SendPaymentResponse
Response: SendPaymentResponse
View request structure
message SendPaymentResponse { string payment_id = 1; }
message CreateInvoiceRequest {
Network network = 1;
string asset_id = 2;
optional DecimalString amount = 3;
optional Hashlock hashlock = 4;
optional uint64 expiry_timeout_secs = 5;
}
View response structure
message SendPaymentResponse { string payment_id = 1; }
message CreateInvoiceRequest {
Network network = 1;
string asset_id = 2;
optional DecimalString amount = 3;
optional Hashlock hashlock = 4;
optional uint64 expiry_timeout_secs = 5;
}
CreateInvoice
Request: CreateInvoiceResponse
Response: CreateInvoiceResponse
View request structure
message CreateInvoiceResponse { Invoice invoice = 1; }
message DecodeInvoiceRequest {
Network network = 1;
string payment_request = 2;
}
View response structure
message CreateInvoiceResponse { Invoice invoice = 1; }
message DecodeInvoiceRequest {
Network network = 1;
string payment_request = 2;
}
DecodeInvoice
Request: DecodeInvoiceResponse
Response: DecodeInvoiceResponse
View request structure
message DecodeInvoiceResponse { Invoice invoice = 1; }
message EstimatePayInvoiceFeeRequest {
Network network = 1;
string payment_request = 2;
}
View response structure
message DecodeInvoiceResponse { Invoice invoice = 1; }
message EstimatePayInvoiceFeeRequest {
Network network = 1;
string payment_request = 2;
}
EstimatePayInvoiceFee
Request: EstimatePayInvoiceFeeRequest
Response: rpc EstimatePayInvoiceFee(EstimatePayInvoiceFeeRequest)
View request structure
message EstimatePayInvoiceFeeRequest {
Network network = 1;
string payment_request = 2;
}
PayInvoice
Request: PayInvoiceResponse
Response: PayInvoiceResponse
View request structure
message PayInvoiceResponse { string payment_id = 1; }
message ResolveHashlockPaymentRequest {
Network network = 1;
string payment_id = 2;
string payment_preimage = 3;
}
View response structure
message PayInvoiceResponse { string payment_id = 1; }
message ResolveHashlockPaymentRequest {
Network network = 1;
string payment_id = 2;
string payment_preimage = 3;
}
EstimatePayEmptyInvoiceFee
Request: EstimatePayEmptyInvoiceFeeRequest
Response: rpc EstimatePayEmptyInvoiceFee(EstimatePayEmptyInvoiceFeeRequest)
View request structure
message EstimatePayEmptyInvoiceFeeRequest {
Network network = 1;
string payment_request = 2;
SendAmount amount = 3;
}
PayEmptyInvoice
Request: PayEmptyInvoiceRequest
Response: rpc PayEmptyInvoice(PayEmptyInvoiceRequest)
View request structure
message PayEmptyInvoiceRequest {
Network network = 1;
string payment_request = 2;
SendAmount amount = 3;
}
ResolveHashlockPayment
Request: ResolveHashlockPaymentRequest
Response: rpc ResolveHashlockPayment(ResolveHashlockPaymentRequest)
View request structure
message ResolveHashlockPaymentRequest {
Network network = 1;
string payment_id = 2;
string payment_preimage = 3;
}
RejectPayment
Request: RejectPaymentResponse
Response: RejectPaymentResponse
View request structure
message RejectPaymentResponse {}
message AllowDualFundedChannelRequest {
Network network = 1;
string node_id = 2;
map<string, DualFundAmount> asset_amounts = 3; // key: asset_id
}
View response structure
message RejectPaymentResponse {}
message AllowDualFundedChannelRequest {
Network network = 1;
string node_id = 2;
map<string, DualFundAmount> asset_amounts = 3; // key: asset_id
}
AllowDualFundedChannel
Request: AllowDualFundedChannelRequest
Response: rpc AllowDualFundedChannel(AllowDualFundedChannelRequest)
View request structure
message AllowDualFundedChannelRequest {
Network network = 1;
string node_id = 2;
map<string, DualFundAmount> asset_amounts = 3; // key: asset_id
}
orderbook
OrderbookService
Orderbook service definition for managing orderbook operations. This service provides methods to initialize markets, manage orders, and retrieve orderbook info and balances.
Methods
InitMarket
Request: InitMarketResponse
Response: InitMarketResponse
View request structure
message InitMarketResponse { optional MarketInfo market_info = 1; }
message GetInitializedMarketsRequest {}
message GetInitializedMarketsResponse { repeated CurrencyInfoPair markets = 1; }
message GetMarketsInfoRequest {}
message GetMarketsInfoResponse { repeated MarketInfo markets = 1; }
message GetMarketInfoRequest {
OrderbookCurrency first_currency = 1;
OrderbookCurrency other_currency = 2;
}
View response structure
message InitMarketResponse { optional MarketInfo market_info = 1; }
message GetInitializedMarketsRequest {}
message GetInitializedMarketsResponse { repeated CurrencyInfoPair markets = 1; }
message GetMarketsInfoRequest {}
message GetMarketsInfoResponse { repeated MarketInfo markets = 1; }
message GetMarketInfoRequest {
OrderbookCurrency first_currency = 1;
OrderbookCurrency other_currency = 2;
}
GetInitializedMarkets
Request: GetInitializedMarketsRequest
Response: rpc GetInitializedMarkets(GetInitializedMarketsRequest)
View request structure
message GetInitializedMarketsRequest {}
message GetInitializedMarketsResponse { repeated CurrencyInfoPair markets = 1; }
message GetMarketsInfoRequest {}
message GetMarketsInfoResponse { repeated MarketInfo markets = 1; }
message GetMarketInfoRequest {
OrderbookCurrency first_currency = 1;
OrderbookCurrency other_currency = 2;
}
GetMarketsInfo
Request: GetMarketsInfoResponse
Response: GetMarketsInfoResponse
View request structure
message GetMarketsInfoResponse { repeated MarketInfo markets = 1; }
message GetMarketInfoRequest {
OrderbookCurrency first_currency = 1;
OrderbookCurrency other_currency = 2;
}
View response structure
message GetMarketsInfoResponse { repeated MarketInfo markets = 1; }
message GetMarketInfoRequest {
OrderbookCurrency first_currency = 1;
OrderbookCurrency other_currency = 2;
}
GetMarketInfo
Request: GetMarketInfoResponse
Response: GetMarketInfoResponse
View request structure
message GetMarketInfoResponse { optional MarketInfo market_info = 1; }
message GetOrderbookBalancesRequest {}
message GetOrderbookBalancesResponse { repeated OrderbookBalance balances = 1; }
message GetOrderbookRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
View response structure
message GetMarketInfoResponse { optional MarketInfo market_info = 1; }
message GetOrderbookBalancesRequest {}
message GetOrderbookBalancesResponse { repeated OrderbookBalance balances = 1; }
message GetOrderbookRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
GetOrderbookBalances
Request: GetOrderbookBalancesRequest
Response: rpc GetOrderbookBalances(GetOrderbookBalancesRequest)
View request structure
message GetOrderbookBalancesRequest {}
message GetOrderbookBalancesResponse { repeated OrderbookBalance balances = 1; }
message GetOrderbookRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
GetOrderbook
Request: GetOrderbookResponse
Response: GetOrderbookResponse
View request structure
message GetOrderbookResponse { optional Orderbook orderbook = 1; }
message EstimateOrderRequest { OrderVariant order_variant = 1; }
message EstimateOrderResponse { optional OrderMatch order_match = 1; }
message CreateOrderRequest { OrderVariant order_variant = 1; }
message CreateOrderResponse { string order_id = 1; }
message CancelOrderRequest { string order_id = 1; }
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
View response structure
message GetOrderbookResponse { optional Orderbook orderbook = 1; }
message EstimateOrderRequest { OrderVariant order_variant = 1; }
message EstimateOrderResponse { optional OrderMatch order_match = 1; }
message CreateOrderRequest { OrderVariant order_variant = 1; }
message CreateOrderResponse { string order_id = 1; }
message CancelOrderRequest { string order_id = 1; }
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
EstimateOrder
Request: EstimateOrderResponse
Response: EstimateOrderResponse
View request structure
message EstimateOrderResponse { optional OrderMatch order_match = 1; }
message CreateOrderRequest { OrderVariant order_variant = 1; }
message CreateOrderResponse { string order_id = 1; }
message CancelOrderRequest { string order_id = 1; }
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
View response structure
message EstimateOrderResponse { optional OrderMatch order_match = 1; }
message CreateOrderRequest { OrderVariant order_variant = 1; }
message CreateOrderResponse { string order_id = 1; }
message CancelOrderRequest { string order_id = 1; }
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
CreateOrder
Request: CreateOrderResponse
Response: CreateOrderResponse
View request structure
message CreateOrderResponse { string order_id = 1; }
message CancelOrderRequest { string order_id = 1; }
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
View response structure
message CreateOrderResponse { string order_id = 1; }
message CancelOrderRequest { string order_id = 1; }
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
CancelOrder
Request: CancelOrderResponse
Response: CancelOrderResponse
View request structure
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
View response structure
message CancelOrderResponse { bool removed = 1; }
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
CancelAllOrders
Request: CancelAllOrdersRequest
Response: rpc CancelAllOrders(CancelAllOrdersRequest)
View request structure
message CancelAllOrdersRequest {}
message CancelAllOrdersResponse {}
message GetOwnOrdersRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
GetAllOwnOrders
Request: GetAllOwnOrdersRequest
Response: rpc GetAllOwnOrders(GetAllOwnOrdersRequest)
View request structure
message GetAllOwnOrdersRequest {}
message GetAllOwnOrdersResponse {
map<string, Order> orders = 1; // key: order_id
}
GetOwnOrders
Request: GetOwnOrdersResponse
Response: GetOwnOrdersResponse
View request structure
message GetOwnOrdersResponse {
map<string, Order> orders = 1; // key: order_id
}
View response structure
message GetOwnOrdersResponse {
map<string, Order> orders = 1; // key: order_id
}
GetOrder
Request: GetOrderResponse
Response: GetOrderResponse
View request structure
message GetOrderResponse { Order order = 1; }
message GetTradeHistoryRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
View response structure
message GetOrderResponse { Order order = 1; }
message GetTradeHistoryRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
GetTradeHistory
Request: GetTradeHistoryRequest
Response: rpc GetTradeHistory(GetTradeHistoryRequest)
View request structure
message GetTradeHistoryRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
GetAllMarketTrades
Request: GetAllMarketTradesRequest
Response: rpc GetAllMarketTrades(GetAllMarketTradesRequest)
View request structure
message GetAllMarketTradesRequest {}
message GetAllMarketTradesResponse {
message PairMarketTrades {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
repeated ClientMarketTrade trades = 3;
}
repeated PairMarketTrades pair_market_trades = 1;
}
GetPairMarketTrades
Request: GetPairMarketTradesRequest
Response: rpc GetPairMarketTrades(GetPairMarketTradesRequest)
View request structure
message GetPairMarketTradesRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
GetAllSwapTrades
Request: GetAllSwapTradesRequest
Response: rpc GetAllSwapTrades(GetAllSwapTradesRequest)
View request structure
message GetAllSwapTradesRequest {}
message GetAllSwapTradesResponse {
message PairSwapTrades {
OrderbookCurrency from_currency = 1;
OrderbookCurrency to_currency = 2;
repeated ClientSwapTrade trades = 3;
}
repeated PairSwapTrades pair_swap_trades = 1;
}
GetPairSwapTrades
Request: GetPairSwapTradesRequest
Response: rpc GetPairSwapTrades(GetPairSwapTradesRequest)
View request structure
message GetPairSwapTradesRequest {
OrderbookCurrency from_currency = 1;
OrderbookCurrency to_currency = 2;
}
SubscribeMarketEvents
Request: SubscribeMarketEventsRequest
Response: rpc SubscribeMarketEvents(SubscribeMarketEventsRequest)
View request structure
message SubscribeMarketEventsRequest {
OrderbookCurrency base = 1;
OrderbookCurrency quote = 2;
}
SubscribeDexEvents
Request: SubscribeDexEventsRequest
Response: rpc SubscribeDexEvents(SubscribeDexEventsRequest) returns (stream DexEvent) {}
View request structure
message SubscribeDexEventsRequest {}
pricing
PricingService
Pricing service definition for retrieving asset prices.
Methods
GetAssetFiatPrice
Request: GetAssetFiatPriceRequest
Response: rpc GetAssetFiatPrice(GetAssetFiatPriceRequest)
View request structure
message GetAssetFiatPriceRequest {
Network network = 1;
string asset_id = 2;
FiatCurrency fiat_currency = 3;
}
GetAssetFiatPriceBySymbol
Request: GetAssetFiatPriceBySymbolRequest
Response: rpc GetAssetFiatPriceBySymbol(GetAssetFiatPriceBySymbolRequest)
View request structure
message GetAssetFiatPriceBySymbolRequest {
string asset_symbol = 1;
FiatCurrency fiat_currency = 2;
}
rental
RentalService
Rental service definition for renting channels and managing rentals.
Methods
GetRentalNodeInfo
Request: GetRentalNodeInfoRequest
Response: rpc GetRentalNodeInfo(GetRentalNodeInfoRequest)
View request structure
message GetRentalNodeInfoRequest {}
message RentalAssetConfig {
Network network = 1;
string asset_id = 2;
DecimalString rental_fee_ratio = 3;
optional string pricing_ticker = 4;
}
GetRentableAssetInfo
Request: GetRentableAssetInfoRequest
Response: rpc GetRentableAssetInfo(GetRentableAssetInfoRequest)
View request structure
message GetRentableAssetInfoRequest {
Network network = 1;
string asset_id = 2;
}
RentChannel
Request: RentChannelResponse
Response: RentChannelResponse
View request structure
message RentChannelResponse {
string rental_txid = 1;
string rented_channel_id = 2;
RentalPayment rental_payment = 3;
}
View response structure
message RentChannelResponse {
string rental_txid = 1;
string rented_channel_id = 2;
RentalPayment rental_payment = 3;
}
EstimateRentChannelFee
Request: EstimateRentChannelFeeRequest
Response: rpc EstimateRentChannelFee(EstimateRentChannelFeeRequest)
View request structure
message EstimateRentChannelFeeRequest {
Network network = 1;
string asset_id = 2;
uint64 lifetime_seconds = 3;
DecimalString amount = 4;
RentalOption rental_option = 5;
}
signer
SignerService
Signer service definition for managing cryptographic operations. This service provides methods for signing messages and verifying signatures.
Methods
SignMessage
Request: SignMessageResponse
Response: SignMessageResponse
View request structure
message SignMessageResponse { bytes signature = 1; }
message VerifySignatureRequest {
Network network = 1;
Message message = 2;
string public_key = 3;
bytes signature = 4;
}
View response structure
message SignMessageResponse { bytes signature = 1; }
message VerifySignatureRequest {
Network network = 1;
Message message = 2;
string public_key = 3;
bytes signature = 4;
}
NodeSignMessage
Request: SignMessageResponse
Response: SignMessageResponse
View request structure
message SignMessageResponse { bytes signature = 1; }
message VerifySignatureRequest {
Network network = 1;
Message message = 2;
string public_key = 3;
bytes signature = 4;
}
View response structure
message SignMessageResponse { bytes signature = 1; }
message VerifySignatureRequest {
Network network = 1;
Message message = 2;
string public_key = 3;
bytes signature = 4;
}
VerifySignature
Request: VerifySignatureRequest
Response: rpc VerifySignature(VerifySignatureRequest)
View request structure
message VerifySignatureRequest {
Network network = 1;
Message message = 2;
string public_key = 3;
bytes signature = 4;
}
swap
SwapService
Swap service definition for performing swap operations.
Methods
EstimateSwap
Request: EstimateSwapResponse
Response: EstimateSwapResponse
View request structure
message EstimateSwapResponse { optional OrderMatch order_match = 1; }
message SwapRequest {
OrderbookCurrency sending_currency = 1;
OrderbookCurrency receiving_currency = 2;
SwapAmount amount = 3;
}
View response structure
message EstimateSwapResponse { optional OrderMatch order_match = 1; }
message SwapRequest {
OrderbookCurrency sending_currency = 1;
OrderbookCurrency receiving_currency = 2;
SwapAmount amount = 3;
}
Swap
Request: SwapResponse
Response: SwapResponse
View request structure
message SwapResponse { string order_id = 1; }
message EstimateSimpleSwapRequest {
OrderbookCurrency sending_currency = 1;
OrderbookCurrency receiving_currency = 2;
SwapAmount amount = 3;
// The maximum tolerance for the price change in the orderbook when the swap
// is performed. This is used to make sure that the swap is performed at a
// price that is not too far from the price intended by the user at the
// beginning of the operation. The price change tolerance is expressed as
// (max_tolerated_price - intended_price) / intended_price. This applies to
// both buys and sells, thus it's an absolute value.
DecimalString price_change_tolerance = 4;
// Whether to withdraw back onchain the sent funds at the end of the swap
// operation.
bool withdraw_sending_funds = 5;
// Whether to withdraw back onchain the received funds at the end of the swap
// operation.
bool withdraw_receiving_funds = 6;
}
View response structure
message SwapResponse { string order_id = 1; }
message EstimateSimpleSwapRequest {
OrderbookCurrency sending_currency = 1;
OrderbookCurrency receiving_currency = 2;
SwapAmount amount = 3;
// The maximum tolerance for the price change in the orderbook when the swap
// is performed. This is used to make sure that the swap is performed at a
// price that is not too far from the price intended by the user at the
// beginning of the operation. The price change tolerance is expressed as
// (max_tolerated_price - intended_price) / intended_price. This applies to
// both buys and sells, thus it's an absolute value.
DecimalString price_change_tolerance = 4;
// Whether to withdraw back onchain the sent funds at the end of the swap
// operation.
bool withdraw_sending_funds = 5;
// Whether to withdraw back onchain the received funds at the end of the swap
// operation.
bool withdraw_receiving_funds = 6;
}
EstimateSimpleSwap
Request: EstimateSimpleSwapRequest
Response: rpc EstimateSimpleSwap(EstimateSimpleSwapRequest)
View request structure
message EstimateSimpleSwapRequest {
OrderbookCurrency sending_currency = 1;
OrderbookCurrency receiving_currency = 2;
SwapAmount amount = 3;
// The maximum tolerance for the price change in the orderbook when the swap
// is performed. This is used to make sure that the swap is performed at a
// price that is not too far from the price intended by the user at the
// beginning of the operation. The price change tolerance is expressed as
// (max_tolerated_price - intended_price) / intended_price. This applies to
// both buys and sells, thus it's an absolute value.
DecimalString price_change_tolerance = 4;
// Whether to withdraw back onchain the sent funds at the end of the swap
// operation.
bool withdraw_sending_funds = 5;
// Whether to withdraw back onchain the received funds at the end of the swap
// operation.
bool withdraw_receiving_funds = 6;
}
SimpleSwap
Request: SimpleSwapResponse
Response: SimpleSwapResponse
View request structure
message SimpleSwapResponse { SimpleSwapOutput output = 1; }
message SimpleSwapUpdate {
// The sending channel is being funded, either by opening a new channel or
// depositing in an existing one.
message FundingSendingChannel {
string txid = 1;
string channel_id = 2;
DecimalString amount = 3;
bool is_opening = 4;
}
// The receiving channel is being rented.
message RentingReceivingChannel {
string txid = 1;
string channel_id = 2;
DecimalString amount = 3;
}
// The channels are being dual-funded.
message DualFundingChannel {
string txid = 1;
string channel_id = 2;
DecimalString self_amount = 3;
DecimalString counterparty_amount = 4;
bool is_opening = 5;
}
// The sending channel is ready for the swap.
message SendingChannelReady { string channel_id = 1; }
// The receiving channel is ready for the swap.
message ReceivingChannelReady { string channel_id = 1; }
// The dual-funded channel is ready for the swap.
message DualFundChannelReady { string channel_id = 1; }
// Waiting for the balances to be ready for the swap.
message WaitingForBalances {
DecimalString needed_sending = 1;
DecimalString needed_receiving = 2;
}
// The balances are ready for the swap.
message BalancesReady {}
// The swap order has been created.
message OrderCreated { string order_id = 1; }
// The swap order has been completed.
message OrderCompleted {
string order_id = 1;
DecimalString sent_amount = 2;
DecimalString received_amount = 3;
}
// The sending funds are being withdrawn.
message WithdrawingSendingFunds {
repeated string txids = 1;
DecimalString self_amount = 2;
DecimalString counterparty_amount = 3;
}
// The receiving funds are being withdrawn.
message WithdrawingReceivingFunds {
repeated string txids = 1;
DecimalString self_amount = 2;
DecimalString counterparty_amount = 3;
}
// The dual-funded funds are being withdrawn.
message WithdrawingDualFundedFunds {
repeated string txids = 1;
DecimalString sending_self_amount = 2;
DecimalString sending_counterparty_amount = 3;
DecimalString receiving_self_amount = 4;
DecimalString receiving_counterparty_amount = 5;
}
// The sending funds have been withdrawn.
message SendingFundsWithdrawn {}
// The receiving funds have been withdrawn.
message ReceivingFundsWithdrawn {}
// The dual-funded funds have been withdrawn.
message DualFundedFundsWithdrawn {}
// The simple swap has been completed.
message SimpleSwapCompleted {}
// An error occurred during the simple swap.
message SimpleSwapError { string error = 1; }
google.protobuf.Timestamp timestamp = 1;
string simple_swap_id = 2;
oneof update {
FundingSendingChannel funding_sending_channel = 3;
RentingReceivingChannel renting_receiving_channel = 4;
DualFundingChannel dual_funding_channel = 5;
SendingChannelReady sending_channel_ready = 6;
ReceivingChannelReady receiving_channel_ready = 7;
DualFundChannelReady dual_fund_channel_ready = 8;
WaitingForBalances waiting_for_balances = 9;
BalancesReady balances_ready = 10;
OrderCreated order_created = 11;
OrderCompleted order_completed = 12;
WithdrawingSendingFunds withdrawing_sending_funds = 13;
WithdrawingReceivingFunds withdrawing_receiving_funds = 14;
WithdrawingDualFundedFunds withdrawing_dual_funded_funds = 15;
SendingFundsWithdrawn sending_funds_withdrawn = 16;
ReceivingFundsWithdrawn receiving_funds_withdrawn = 17;
DualFundedFundsWithdrawn dual_funded_funds_withdrawn = 18;
SimpleSwapCompleted simple_swap_completed = 19;
SimpleSwapError simple_swap_error = 20;
}
}
View response structure
message SimpleSwapResponse { SimpleSwapOutput output = 1; }
message SimpleSwapUpdate {
// The sending channel is being funded, either by opening a new channel or
// depositing in an existing one.
message FundingSendingChannel {
string txid = 1;
string channel_id = 2;
DecimalString amount = 3;
bool is_opening = 4;
}
// The receiving channel is being rented.
message RentingReceivingChannel {
string txid = 1;
string channel_id = 2;
DecimalString amount = 3;
}
// The channels are being dual-funded.
message DualFundingChannel {
string txid = 1;
string channel_id = 2;
DecimalString self_amount = 3;
DecimalString counterparty_amount = 4;
bool is_opening = 5;
}
// The sending channel is ready for the swap.
message SendingChannelReady { string channel_id = 1; }
// The receiving channel is ready for the swap.
message ReceivingChannelReady { string channel_id = 1; }
// The dual-funded channel is ready for the swap.
message DualFundChannelReady { string channel_id = 1; }
// Waiting for the balances to be ready for the swap.
message WaitingForBalances {
DecimalString needed_sending = 1;
DecimalString needed_receiving = 2;
}
// The balances are ready for the swap.
message BalancesReady {}
// The swap order has been created.
message OrderCreated { string order_id = 1; }
// The swap order has been completed.
message OrderCompleted {
string order_id = 1;
DecimalString sent_amount = 2;
DecimalString received_amount = 3;
}
// The sending funds are being withdrawn.
message WithdrawingSendingFunds {
repeated string txids = 1;
DecimalString self_amount = 2;
DecimalString counterparty_amount = 3;
}
// The receiving funds are being withdrawn.
message WithdrawingReceivingFunds {
repeated string txids = 1;
DecimalString self_amount = 2;
DecimalString counterparty_amount = 3;
}
// The dual-funded funds are being withdrawn.
message WithdrawingDualFundedFunds {
repeated string txids = 1;
DecimalString sending_self_amount = 2;
DecimalString sending_counterparty_amount = 3;
DecimalString receiving_self_amount = 4;
DecimalString receiving_counterparty_amount = 5;
}
// The sending funds have been withdrawn.
message SendingFundsWithdrawn {}
// The receiving funds have been withdrawn.
message ReceivingFundsWithdrawn {}
// The dual-funded funds have been withdrawn.
message DualFundedFundsWithdrawn {}
// The simple swap has been completed.
message SimpleSwapCompleted {}
// An error occurred during the simple swap.
message SimpleSwapError { string error = 1; }
google.protobuf.Timestamp timestamp = 1;
string simple_swap_id = 2;
oneof update {
FundingSendingChannel funding_sending_channel = 3;
RentingReceivingChannel renting_receiving_channel = 4;
DualFundingChannel dual_funding_channel = 5;
SendingChannelReady sending_channel_ready = 6;
ReceivingChannelReady receiving_channel_ready = 7;
DualFundChannelReady dual_fund_channel_ready = 8;
WaitingForBalances waiting_for_balances = 9;
BalancesReady balances_ready = 10;
OrderCreated order_created = 11;
OrderCompleted order_completed = 12;
WithdrawingSendingFunds withdrawing_sending_funds = 13;
WithdrawingReceivingFunds withdrawing_receiving_funds = 14;
WithdrawingDualFundedFunds withdrawing_dual_funded_funds = 15;
SendingFundsWithdrawn sending_funds_withdrawn = 16;
ReceivingFundsWithdrawn receiving_funds_withdrawn = 17;
DualFundedFundsWithdrawn dual_funded_funds_withdrawn = 18;
SimpleSwapCompleted simple_swap_completed = 19;
SimpleSwapError simple_swap_error = 20;
}
}
SubscribeSimpleSwaps
Request: SubscribeSimpleSwapsRequest
Response: rpc SubscribeSimpleSwaps(SubscribeSimpleSwapsRequest)
View request structure
message SubscribeSimpleSwapsRequest {}
wallet
WalletService
Wallet service definition for managing wallet-related operations. This service provides methods for retrieving balances and transactions associated with a specific network.
Methods
GetBalances
Request: GetBalancesResponse
Response: GetBalancesResponse
View request structure
message GetBalancesResponse {
map<string, Balance> balances = 1; // key: asset_id
}
View response structure
message GetBalancesResponse {
map<string, Balance> balances = 1; // key: asset_id
}
GetBalance
Request: GetBalanceResponse
Response: GetBalanceResponse
View request structure
message GetBalanceResponse {
Balance balance = 1; // onchain and offchain balances for the specified asset
}
View response structure
message GetBalanceResponse {
Balance balance = 1; // onchain and offchain balances for the specified asset
}
GetTransactions
Request: GetTransactionsRequest
Response: rpc GetTransactions(GetTransactionsRequest)
View request structure
message GetTransactionsRequest { Network network = 1; }
message GetTransactionsResponse { repeated Transaction transactions = 1; }
message GetTransactionRequest {
Network network = 1;
string txid = 2;
}
GetTransaction
Request: GetTransactionResponse
Response: GetTransactionResponse
View request structure
message GetTransactionResponse { Transaction transaction = 1; }
View response structure
message GetTransactionResponse { Transaction transaction = 1; }
watch_only_node
WatchOnlyNodeService
Service definition for managing watch-only related operations for a node on a specific network. This service provides methods for retrieving node information, channels, payments, and other related data without requiring access to the private keys or signing capabilities of the node.
Methods
GetNodeId
Request: GetNodeIdResponse
Response: GetNodeIdResponse
View request structure
message GetNodeIdResponse { string node_id = 1; }
message GetChannelsRequest { Network network = 1; }
message GetChannelsResponse { repeated Channel channels = 1; }
message GetChannelsWithCounterpartyRequest {
Network network = 1;
string counterparty_pubkey = 2;
}
View response structure
message GetNodeIdResponse { string node_id = 1; }
message GetChannelsRequest { Network network = 1; }
message GetChannelsResponse { repeated Channel channels = 1; }
message GetChannelsWithCounterpartyRequest {
Network network = 1;
string counterparty_pubkey = 2;
}
GetChannels
Request: GetChannelsResponse
Response: GetChannelsResponse
View request structure
message GetChannelsResponse { repeated Channel channels = 1; }
message GetChannelsWithCounterpartyRequest {
Network network = 1;
string counterparty_pubkey = 2;
}
View response structure
message GetChannelsResponse { repeated Channel channels = 1; }
message GetChannelsWithCounterpartyRequest {
Network network = 1;
string counterparty_pubkey = 2;
}
GetChannelsWithCounterparty
Request: GetChannelsWithCounterpartyRequest
Response: rpc GetChannelsWithCounterparty(GetChannelsWithCounterpartyRequest)
View request structure
message GetChannelsWithCounterpartyRequest {
Network network = 1;
string counterparty_pubkey = 2;
}
GetChannel
Request: GetChannelResponse
Response: GetChannelResponse
View request structure
message GetChannelResponse { Channel channel = 1; }
message GetPaymentsRequest { Network network = 1; }
message GetPaymentsResponse { repeated Payment payments = 1; }
message GetPaymentRequest {
Network network = 1;
string payment_id = 2;
}
View response structure
message GetChannelResponse { Channel channel = 1; }
message GetPaymentsRequest { Network network = 1; }
message GetPaymentsResponse { repeated Payment payments = 1; }
message GetPaymentRequest {
Network network = 1;
string payment_id = 2;
}
GetPayments
Request: GetPaymentsResponse
Response: GetPaymentsResponse
View request structure
message GetPaymentsResponse { repeated Payment payments = 1; }
message GetPaymentRequest {
Network network = 1;
string payment_id = 2;
}
View response structure
message GetPaymentsResponse { repeated Payment payments = 1; }
message GetPaymentRequest {
Network network = 1;
string payment_id = 2;
}
GetPayment
Request: GetPaymentResponse
Response: GetPaymentResponse
View request structure
message GetPaymentResponse { Payment payment = 1; }
View response structure
message GetPaymentResponse { Payment payment = 1; }
Common Models
See models.proto for complete type definitions.
Key Types
Network
message Network {
Protocol protocol = 1;
string id = 2;
}
Asset
message Asset {
string id = 1;
string name = 2;
string symbol = 3;
uint32 decimals = 4;
}
message AssetChannelStatus {
message CooperativelyOpening {}
message Opening {}
message CooperativelyUpdating {}
message Updating {}
message CooperativelyClosing {}
message Closing { uint64 closed_at_block = 1; }
message ForceClosing {
/// The block number at which the channel was force-closed
/// Optional the transaction might be broadcasted but not confirmed yet
optional uint64 force_closed_at_block = 1;
/// The disputer of the channel
Disputer disputer = 2;
/// The deadline until which the channel can be disputed onchain
optional Deadline dispute_deadline = 3;
}
message ClosedRedeemable {}
message Closed {}
message Inactive {}
message ActiveSending {}
message ActiveReceiving {}
message Active {}
message Recovering {}
oneof status {
CooperativelyOpening cooperatively_opening = 1;
Opening opening = 2;
CooperativelyUpdating cooperatively_updating = 3;
Updating updating = 4;
CooperativelyClosing cooperatively_closing = 5;
Closing closing = 6;
ForceClosing force_closing = 7;
ClosedRedeemable closed_redeemable = 8;
Closed closed = 9;
Inactive inactive = 10;
ActiveSending active_sending = 11;
ActiveReceiving active_receiving = 12;
Active active = 13;
Recovering recovering = 14;
}
}
message AssetChannel {
AssetChannelStatus status = 1;
OffchainBalance balance = 2;
optional string last_onchain_txid = 3;
uint64 last_operation_confirmations = 4;
google.protobuf.Timestamp last_operation_timestamp = 5;
bool is_updatable = 6;
}
DecimalString
message DecimalString { string value = 1; }
message U256String { string value = 1; }
message Message {
message Data { bytes data = 1; }
message Hash { bytes hash = 1; }
message Typed { bytes payload = 1; }
oneof message {
Data data = 1;
Hash hash = 2;
Typed typed = 3;
}
}
FeeOption
message FeeOption {
message Low {}
message Medium {}
message High {}
message Custom { FeeRate fee_rate = 1; }
oneof fee_option {
Low low = 1;
Medium medium = 2;
High high = 3;
Custom custom = 4;
}
}
FeeRate
message FeeRate {
U256String max_tip_fee_per_unit = 1;
U256String max_fee_per_unit = 2;
}
SendAmount
message SendAmount {
message All {}
message Exact { DecimalString amount = 1; }
oneof amount {
All all = 1;
Exact exact = 2;
}
}
Balance
message Balance {
OnchainBalance onchain = 1;
OffchainBalance offchain = 2;
}