LSPS5ClientHandler

Struct LSPS5ClientHandler 

Source
pub struct LSPS5ClientHandler<ES: Deref, K: Deref + Clone>{ /* private fields */ }
Expand description

Client-side handler for the LSPS5 (bLIP-55) webhook registration protocol.

LSPS5ClientHandler is the primary interface for LSP clients to register, list, and remove webhook endpoints with an LSP.

This handler is intended for use on the client-side (e.g., a mobile app) which has access to the node’s keys and can send/receive peer messages.

For validating incoming webhook notifications on a server, see LSPS5Validator.

§Core Capabilities

Implementations§

Source§

impl<ES: Deref, K: Deref + Clone> LSPS5ClientHandler<ES, K>

Source

pub fn set_webhook( &self, counterparty_node_id: PublicKey, app_name: String, webhook_url: String, ) -> Result<LSPSRequestId, LSPS5Error>

Register or update a webhook endpoint under a human-readable name.

Sends a lsps5.set_webhook JSON-RPC request to the given LSP peer.

§Parameters
  • counterparty_node_id: The LSP node ID to contact.
  • app_name: A UTF-8 name for this webhook.
  • webhook_url: HTTPS URL for push notifications.
§Returns

A unique LSPSRequestId for correlating the asynchronous response.

Response from the LSP peer will be provided asynchronously through a LSPS5Response::SetWebhook or LSPS5Response::SetWebhookError message, and this client will then enqueue either a WebhookRegistered or WebhookRegistrationFailed event.

Note: Ensure the app name is valid and its length does not exceed MAX_APP_NAME_LENGTH. Also ensure the URL is valid, has HTTPS protocol, its length does not exceed MAX_WEBHOOK_URL_LENGTH and that the URL points to a public host.

Your request may fail if you recently opened a channel or started an LSPS1 / LSPS2 flow. Please retry shortly.

Source

pub fn list_webhooks(&self, counterparty_node_id: PublicKey) -> LSPSRequestId

List all webhook names currently registered with the LSP.

Sends a lsps5.list_webhooks JSON-RPC request to the peer.

§Parameters
  • counterparty_node_id: The LSP node ID to query.
§Returns

A unique LSPSRequestId for correlating the asynchronous response.

Response from the LSP peer will be provided asynchronously through a LSPS5Response::ListWebhooks message, and this client will then enqueue a WebhooksListed event.

Source

pub fn remove_webhook( &self, counterparty_node_id: PublicKey, app_name: String, ) -> Result<LSPSRequestId, LSPS5Error>

Remove a previously registered webhook by its name.

Sends a lsps5.remove_webhook JSON-RPC request to the peer.

§Parameters
  • counterparty_node_id: The LSP node ID to contact.
  • app_name: The name of the webhook to remove.
§Returns

A unique LSPSRequestId for correlating the asynchronous response.

Response from the LSP peer will be provided asynchronously through a LSPS5Response::RemoveWebhook or LSPS5Response::RemoveWebhookError message, and this client will then enqueue either a WebhookRemoved or WebhookRemovalFailed event.

Auto Trait Implementations§

§

impl<ES, K> !Freeze for LSPS5ClientHandler<ES, K>

§

impl<ES, K> RefUnwindSafe for LSPS5ClientHandler<ES, K>

§

impl<ES, K> Send for LSPS5ClientHandler<ES, K>
where ES: Send, K: Sync + Send,

§

impl<ES, K> Sync for LSPS5ClientHandler<ES, K>
where ES: Sync, K: Sync + Send,

§

impl<ES, K> Unpin for LSPS5ClientHandler<ES, K>
where ES: Unpin,

§

impl<ES, K> UnwindSafe for LSPS5ClientHandler<ES, K>
where ES: UnwindSafe, K: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.