@@ -23,118 +23,6 @@ use super::msgs::WebhookNotification;
23
23
/// An event which an bLIP-55 / LSPS5 server should take some action in response to.
24
24
#[ derive( Debug , Clone , PartialEq , Eq ) ]
25
25
pub enum LSPS5ServiceEvent {
26
- /// A webhook was registered by a client.
27
- ///
28
- /// This event is triggered when a client successfully registers or updates a webhook
29
- /// via [`lsps5.set_webhook`]. The LSP should store this webhook information for future
30
- /// notifications to this client.
31
- ///
32
- /// When this event occurs, the LSP should:
33
- /// 1. Store the webhook information for the client
34
- /// 2. If `no_change` is `false` (i.e., this is a new registration or an update with changes),
35
- /// send an initial [`lsps5.webhook_registered`] notification to verify the webhook works.
36
- ///
37
- /// [`lsps5.set_webhook`]: super::msgs::LSPS5Request::SetWebhook
38
- /// [`lsps5.webhook_registered`]: super::msgs::WebhookNotificationMethod::LSPS5WebhookRegistered
39
- WebhookRegistered {
40
- /// Client node ID that registered the webhook.
41
- counterparty_node_id : PublicKey ,
42
- /// App name provided by the client.
43
- ///
44
- /// This app name is used to identify the webhook registration.
45
- ///
46
- /// **Note**: Ensure the app name is valid and its length does not exceed [`MAX_APP_NAME_LENGTH`].
47
- ///
48
- /// [`MAX_APP_NAME_LENGTH`]: super::msgs::MAX_APP_NAME_LENGTH
49
- app_name : LSPS5AppName ,
50
- /// Webhook URL (HTTPS) to be contacted for notifying the client.
51
- ///
52
- /// This URL is used by the LSP to send notifications.
53
- ///
54
- /// **Note**: Ensure the URL is valid and its length does not exceed [`MAX_WEBHOOK_URL_LENGTH`].
55
- /// Also ensure that the URL points to a public host.
56
- ///
57
- /// [`MAX_WEBHOOK_URL_LENGTH`]: super::msgs::MAX_WEBHOOK_URL_LENGTH
58
- url : LSPS5WebhookUrl ,
59
- /// The identifier of the issued bLIP-55 / LSPS5 webhook registration request.
60
- ///
61
- /// This can be used to track which request this event corresponds to.
62
- request_id : LSPSRequestId ,
63
- /// Whether this was a new registration or an update to existing one with no changes.
64
- /// If false, a notification should be sent to the registered webhook.
65
- no_change : bool ,
66
- } ,
67
-
68
- /// Webhooks were listed for a client.
69
- ///
70
- /// This event is triggered when a client successfully requests their registered webhooks
71
- /// via [`lsps5.list_webhooks`]. The LSP has responded with the list of app names that
72
- /// have registered webhooks for this client.
73
- ///
74
- /// When this event occurs, it indicates that:
75
- /// 1. The LSP has successfully fetched all registered webhook names for this client
76
- /// 2. The LSP has sent a response containing the list and maximum allowed webhooks
77
- /// 3. The client is now aware of all their currently registered webhooks
78
- ///
79
- /// This event is primarily informational and doesn't typically require further action.
80
- ///
81
- /// [`lsps5.list_webhooks`]: super::msgs::LSPS5Request::ListWebhooks
82
- WebhooksListed {
83
- /// Client node ID that requested their webhooks.
84
- counterparty_node_id : PublicKey ,
85
- /// App names with registered webhooks for this client.
86
- ///
87
- /// Each [`app_name`] in this list corresponds to a registered webhook.
88
- ///
89
- /// [`app_name`]: super::msgs::LSPS5AppName
90
- app_names : Vec < LSPS5AppName > ,
91
- /// The identifier of the issued bLIP-55 / LSPS5 webhook listing request.
92
- ///
93
- /// This can be used to track which request this event corresponds to.
94
- request_id : LSPSRequestId ,
95
- /// Maximum number of webhooks allowed by LSP per client.
96
- ///
97
- /// This is the value defined in [`max_webhooks_per_client`] within the service configuration.
98
- ///
99
- /// [`max_webhooks_per_client`]: super::service::LSPS5ServiceConfig::max_webhooks_per_client
100
- max_webhooks : u32 ,
101
- } ,
102
-
103
- /// A webhook was removed by a client.
104
- ///
105
- /// This event is triggered when a client successfully removes a webhook via
106
- /// [`lsps5.remove_webhook`]. The LSP has deleted the specified webhook registration from
107
- /// its storage and will no longer send notifications to this webhook URL.
108
- ///
109
- /// When this event occurs, the LSP should:
110
- /// 1. Confirm the webhook has been completely removed from all internal data structures
111
- /// 2. If there are any pending notifications for this webhook, cancel them
112
- /// 3. Update any related metrics or logs to reflect the webhook removal
113
- ///
114
- /// Note that if a client attempts to remove a webhook that doesn't exist, a
115
- /// [`LSPS5ProtocolError::AppNameNotFound`] error is returned instead, and this event
116
- /// will not be triggered.
117
- ///
118
- /// [`lsps5.remove_webhook`]: super::msgs::LSPS5Request::RemoveWebhook
119
- /// [`LSPS5ProtocolError::AppNameNotFound`]: super::msgs::LSPS5ProtocolError::AppNameNotFound
120
- WebhookRemoved {
121
- /// Client node ID that removed the webhook.
122
- counterparty_node_id : PublicKey ,
123
- /// App name that was removed.
124
- ///
125
- /// This identifies the webhook that was removed.
126
- ///
127
- /// **Note**: The [`app_name`] must have been previously registered via [`lsps5.set_webhook`].
128
- ///
129
- /// [`app_name`]: super::msgs::LSPS5AppName
130
- /// [`lsps5.set_webhook`]: super::msgs::LSPS5Request::SetWebhook
131
- app_name : LSPS5AppName ,
132
- /// The identifier of the issued bLIP-55 / LSPS5 webhook removal request.
133
- ///
134
- /// This can be used to track which request this event corresponds to.
135
- request_id : LSPSRequestId ,
136
- } ,
137
-
138
26
/// A notification needs to be sent to a client's webhook.
139
27
///
140
28
/// This event is triggered when the LSP needs to notify a client about an event
0 commit comments