@@ -62,12 +62,20 @@ pub enum LSPS5ServiceEvent {
6262 /// Client node ID that requested their webhooks.
6363 counterparty_node_id : PublicKey ,
6464 /// App names with registered webhooks for this client.
65+ ///
66+ /// Each [`app_name`] in this list corresponds to a registered webhook.
67+ ///
68+ /// [`app_name`]: super::msgs::LSPS5AppName
6569 app_names : Vec < LSPS5AppName > ,
6670 /// The identifier of the issued bLIP-55 / LSPS5 webhook listing request.
6771 ///
6872 /// This can be used to track which request this event corresponds to.
6973 request_id : LSPSRequestId ,
7074 /// Maximum number of webhooks allowed by LSP per client.
75+ ///
76+ /// This is the value defined in [`max_webhooks_per_client`] within the service configuration.
77+ ///
78+ /// [`max_webhooks_per_client`]: super::service::LSPS5ServiceConfig::max_webhooks_per_client
7179 max_webhooks : u32 ,
7280 } ,
7381
@@ -78,6 +86,12 @@ pub enum LSPS5ServiceEvent {
7886 /// Client node ID that removed the webhook.
7987 counterparty_node_id : PublicKey ,
8088 /// App name that was removed.
89+ ///
90+ /// This identifies the webhook that was removed.
91+ ///
92+ /// **Note**: The [`app_name`] must have been previously registered via `lsps5.set_webhook`.
93+ ///
94+ /// [`app_name`]: super::msgs::LSPS5AppName
8195 app_name : LSPS5AppName ,
8296 /// The identifier of the issued bLIP-55 / LSPS5 webhook removal request.
8397 ///
@@ -96,18 +110,37 @@ pub enum LSPS5ServiceEvent {
96110 /// When the client receives this notification, they will process it and generate a
97111 /// `WebhookNotificationReceived` event on their side. The client will validate the
98112 /// signature using the LSP's node ID to ensure the notification is authentic.
99- SendWebhookNotifications {
113+ SendWebhookNotification {
100114 /// Client node ID to be notified.
101115 counterparty_node_id : PublicKey ,
102116 /// App name to be notified.
117+ ///
118+ /// This identifies which webhook registration should be notified.
119+ ///
120+ /// **Note**: The [`app_name`] must have been previously registered via `lsps5.set_webhook`.
121+ ///
122+ /// [`app_name`]: super::msgs::LSPS5AppName
103123 app_name : LSPS5AppName ,
104124 /// URL that to be contacted.
125+ ///
126+ /// This is the webhook URL (HTTPS) provided by the client during registration.
127+ ///
128+ /// **Note**: The URL must be a valid HTTPS URL that points to a public host.
129+ ///
130+ /// [`url`]: super::msgs::LSPS5WebhookUrl
105131 url : LSPS5WebhookUrl ,
106132 /// Notification method with its parameters.
133+ ///
134+ /// This contains the type of notification and any associated data to be sent to the client.
107135 notification : WebhookNotification ,
108136 /// Timestamp of the notification.
137+ ///
138+ /// This timestamp is used for signing the notification and must be within 10 minutes
139+ /// of the client's local time for the signature to be accepted.
109140 timestamp : LSPSDateTime ,
110141 /// Signature of the notification using the LSP's node ID.
142+ ///
143+ /// This signature helps the client verify that the notification was sent by the LSP.
111144 signature : String ,
112145 /// Headers to be included in the HTTP POST request.
113146 ///
@@ -124,7 +157,14 @@ pub enum LSPS5ClientEvent {
124157 /// A webhook was successfully registered with the LSP.
125158 ///
126159 /// This event is triggered when the LSP confirms successful registration
127- /// of a webhook via `lsps5.set_webhook`.
160+ /// of a webhook via `lsps5.set_webhook`. The [`app_name`] and [`url`]
161+ /// both must respect maximum lengths of [`MAX_APP_NAME_LENGTH`] and
162+ /// [`MAX_WEBHOOK_URL_LENGTH`] respectively, and the [`url`] must use HTTPS.
163+ ///
164+ /// [`app_name`]: super::msgs::LSPS5AppName
165+ /// [`url`]: super::msgs::LSPS5WebhookUrl
166+ /// [`MAX_APP_NAME_LENGTH`]: super::msgs::MAX_APP_NAME_LENGTH
167+ /// [`MAX_WEBHOOK_URL_LENGTH`]: super::msgs::MAX_WEBHOOK_URL_LENGTH
128168 WebhookRegistered {
129169 /// The node id of the LSP that confirmed the registration.
130170 counterparty_node_id : PublicKey ,
@@ -145,11 +185,22 @@ pub enum LSPS5ClientEvent {
145185 request_id : LSPSRequestId ,
146186 } ,
147187
148- /// A webhook registration attempt failed
188+ /// A webhook registration attempt failed.
149189 ///
150190 /// This event is triggered when the LSP rejects a webhook registration
151- /// via `lsps5.set_webhook`. This can happen if the app_name or URL is too long,
152- /// the URL uses an unsupported protocol, or the maximum number of webhooks is reached.
191+ /// via `lsps5.set_webhook`. This can happen if the [`app_name`]
192+ /// exceeds [`MAX_APP_NAME_LENGTH`], the [`url`] exceeds
193+ /// [`MAX_WEBHOOK_URL_LENGTH`], the [`url`] uses an unsupported protocol
194+ /// (HTTPS is required), or the maximum number of webhooks
195+ /// (`max_webhooks_per_client`) has been reached.
196+ ///
197+ /// See also [`LSPS5Error::AppNameTooLong`], [`LSPS5Error::WebhookUrlTooLong`],
198+ /// [`LSPS5Error::UnsupportedProtocol`], [`LSPS5Error::TooManyWebhooks`].
199+ ///
200+ /// [`app_name`]: super::msgs::LSPS5AppName
201+ /// [`url`]: super::msgs::LSPS5WebhookUrl
202+ /// [`MAX_APP_NAME_LENGTH`]: super::msgs::MAX_APP_NAME_LENGTH
203+ /// [`MAX_WEBHOOK_URL_LENGTH`]: super::msgs::MAX_WEBHOOK_URL_LENGTH
153204 WebhookRegistrationFailed {
154205 /// The node id of the LSP that rejected the registration.
155206 counterparty_node_id : PublicKey ,
@@ -167,7 +218,8 @@ pub enum LSPS5ClientEvent {
167218
168219 /// The list of registered webhooks was successfully retrieved.
169220 ///
170- /// This event is triggered when the LSP responds to a `lsps5.list_webhooks` request.
221+ /// This event is triggered when the LSP responds to a
222+ /// `lsps5.list_webhooks` request.
171223 WebhooksListed {
172224 /// The node id of the LSP that provided the list.
173225 counterparty_node_id : PublicKey ,
@@ -183,7 +235,8 @@ pub enum LSPS5ClientEvent {
183235
184236 /// The attempt to list webhooks failed.
185237 ///
186- /// This event is triggered when the LSP rejects a `lsps5.list_webhooks` request.
238+ /// This event is triggered when the LSP rejects a
239+ /// `lsps5.list_webhooks` request.
187240 WebhooksListFailed {
188241 /// The node id of the LSP that rejected the request.
189242 counterparty_node_id : PublicKey ,
@@ -213,7 +266,13 @@ pub enum LSPS5ClientEvent {
213266 /// A webhook removal attempt failed.
214267 ///
215268 /// This event is triggered when the LSP rejects a webhook removal
216- /// via `lsps5.remove_webhook`. The most common error is app_name_not_found (1010).
269+ /// via `lsps5.remove_webhook`. The most common error is
270+ /// [`LSPS5Error::AppNameNotFound`] (error code [`LSPS5_APP_NAME_NOT_FOUND_ERROR_CODE`]),
271+ /// which indicates the given [`app_name`] was not found.
272+ ///
273+ /// [`LSPS5Error::AppNameNotFound`]: super::msgs::LSPS5Error::AppNameNotFound
274+ /// [`LSPS5_APP_NAME_NOT_FOUND_ERROR_CODE`]: super::msgs::LSPS5_APP_NAME_NOT_FOUND_ERROR_CODE
275+ /// [`app_name`]: super::msgs::LSPS5AppName
217276 WebhookRemovalFailed {
218277 /// The node id of the LSP that rejected the removal.
219278 counterparty_node_id : PublicKey ,
@@ -230,8 +289,7 @@ pub enum LSPS5ClientEvent {
230289 /// A webhook notification was received from the LSP.
231290 ///
232291 /// This event is triggered when the client receives a webhook notification
233- /// from the LSP. This can happen for various reasons such as incoming payment,
234- /// expiring HTLCs, liquidity management requests, or incoming onion messages.
292+ /// from the LSP. The signature and timestamp must be verified before use.
235293 WebhookNotificationReceived {
236294 /// LSP node ID that sent the notification.
237295 counterparty_node_id : PublicKey ,
0 commit comments