ln_gateway::gateway_lnrpc::gateway_lightning_server

Trait GatewayLightning

source
pub trait GatewayLightning:
    Send
    + Sync
    + 'static {
    type RouteHtlcsStream: Stream<Item = Result<InterceptHtlcRequest, Status>> + Send + 'static;

Show 13 methods // Required methods fn get_node_info<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNodeInfoResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_route_hints<'life0, 'async_trait>( &'life0 self, request: Request<GetRouteHintsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetRouteHintsResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pay_invoice<'life0, 'async_trait>( &'life0 self, request: Request<PayInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<PayInvoiceResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pay_pruned_invoice<'life0, 'async_trait>( &'life0 self, request: Request<PayPrunedInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<PayInvoiceResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn route_htlcs<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::RouteHtlcsStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn complete_htlc<'life0, 'async_trait>( &'life0 self, request: Request<InterceptHtlcResponse>, ) -> Pin<Box<dyn Future<Output = Result<Response<EmptyResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_invoice<'life0, 'async_trait>( &'life0 self, request: Request<CreateInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateInvoiceResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_ln_onchain_address<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetLnOnchainAddressResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn withdraw_onchain<'life0, 'async_trait>( &'life0 self, request: Request<WithdrawOnchainRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WithdrawOnchainResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn open_channel<'life0, 'async_trait>( &'life0 self, request: Request<OpenChannelRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OpenChannelResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn close_channels_with_peer<'life0, 'async_trait>( &'life0 self, request: Request<CloseChannelsWithPeerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CloseChannelsWithPeerResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_active_channels<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ListActiveChannelsResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_balances<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBalancesResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with GatewayLightningServer.

Required Associated Types§

source

type RouteHtlcsStream: Stream<Item = Result<InterceptHtlcRequest, Status>> + Send + 'static

Server streaming response type for the RouteHtlcs method.

Required Methods§

source

fn get_node_info<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNodeInfoResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

GetNodeInfo returns the public key and alias of the associated lightning node

source

fn get_route_hints<'life0, 'async_trait>( &'life0 self, request: Request<GetRouteHintsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetRouteHintsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

GetRouteHints returns the route hints to the associated lightning node

source

fn pay_invoice<'life0, 'async_trait>( &'life0 self, request: Request<PayInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<PayInvoiceResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

PayInvoice attempts to pay an invoice using the associated lightning node

source

fn pay_pruned_invoice<'life0, 'async_trait>( &'life0 self, request: Request<PayPrunedInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<PayInvoiceResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

PayPrunedInvoice attempts to pay a pruned invoice, which is an invoice without a description, using the associated lightning node.

source

fn route_htlcs<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::RouteHtlcsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

RouteHtlcs opens a bi-directional stream for the client to receive intercepted HTLCs. InterceptHtlcRequest is sent from the server to alert the client that an HTLC has been intercepted and needs to be processed. The client is expected to response with InterceptHtlcResponse after the HTLC has been processed with the appropriate action (Settle, Forward, Cancel).

source

fn complete_htlc<'life0, 'async_trait>( &'life0 self, request: Request<InterceptHtlcResponse>, ) -> Pin<Box<dyn Future<Output = Result<Response<EmptyResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn create_invoice<'life0, 'async_trait>( &'life0 self, request: Request<CreateInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateInvoiceResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_ln_onchain_address<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetLnOnchainAddressResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a Bitcoin address that belongs to the underlying lightning node’s wallet.

source

fn withdraw_onchain<'life0, 'async_trait>( &'life0 self, request: Request<WithdrawOnchainRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WithdrawOnchainResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn open_channel<'life0, 'async_trait>( &'life0 self, request: Request<OpenChannelRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OpenChannelResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a channel on the underlying lightning node.

source

fn close_channels_with_peer<'life0, 'async_trait>( &'life0 self, request: Request<CloseChannelsWithPeerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CloseChannelsWithPeerResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close all channels with a given peer on the underlying lightning node.

source

fn list_active_channels<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ListActiveChannelsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all channels that are active and able to send and receive funds.

source

fn get_balances<'life0, 'async_trait>( &'life0 self, request: Request<EmptyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBalancesResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§