mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
cln-plugin: Add notification subscriptions and hooks to the plugins
For now hooks are treated identically to rpcmethods, with the exception of not being returned in the `getmanifest` call. Later on we can add typed handlers as well.
This commit is contained in:
committed by
Rusty Russell
parent
8c6af21169
commit
60e773239c
@@ -12,50 +12,49 @@ pub(crate) enum Request {
|
||||
// Builtin
|
||||
Getmanifest(GetManifestCall),
|
||||
Init(InitCall),
|
||||
|
||||
// Hooks
|
||||
PeerConnected,
|
||||
CommitmentRevocation,
|
||||
DbWrite,
|
||||
InvoicePayment,
|
||||
Openchannel,
|
||||
Openchannel2,
|
||||
Openchannel2Changed,
|
||||
Openchannel2Sign,
|
||||
RbfChannel,
|
||||
HtlcAccepted,
|
||||
RpcCommand,
|
||||
Custommsg,
|
||||
OnionMessage,
|
||||
OnionMessageBlinded,
|
||||
OnionMessageOurpath,
|
||||
// PeerConnected,
|
||||
// CommitmentRevocation,
|
||||
// DbWrite,
|
||||
// InvoicePayment,
|
||||
// Openchannel,
|
||||
// Openchannel2,
|
||||
// Openchannel2Changed,
|
||||
// Openchannel2Sign,
|
||||
// RbfChannel,
|
||||
// HtlcAccepted,
|
||||
// RpcCommand,
|
||||
// Custommsg,
|
||||
// OnionMessage,
|
||||
// OnionMessageBlinded,
|
||||
// OnionMessageOurpath,
|
||||
|
||||
// Bitcoin backend
|
||||
Getchaininfo,
|
||||
Estimatefees,
|
||||
Getrawblockbyheight,
|
||||
Getutxout,
|
||||
Sendrawtransaction,
|
||||
// Getchaininfo,
|
||||
// Estimatefees,
|
||||
// Getrawblockbyheight,
|
||||
// Getutxout,
|
||||
// Sendrawtransaction,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(tag = "method", content = "params")]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub(crate) enum Notification {
|
||||
ChannelOpened,
|
||||
ChannelOpenFailed,
|
||||
ChannelStateChanged,
|
||||
Connect,
|
||||
Disconnect,
|
||||
InvoicePayment,
|
||||
InvoiceCreation,
|
||||
Warning,
|
||||
ForwardEvent,
|
||||
SendpaySuccess,
|
||||
SendpayFailure,
|
||||
CoinMovement,
|
||||
OpenchannelPeerSigs,
|
||||
Shutdown,
|
||||
// ChannelOpened,
|
||||
// ChannelOpenFailed,
|
||||
// ChannelStateChanged,
|
||||
// Connect,
|
||||
// Disconnect,
|
||||
// InvoicePayment,
|
||||
// InvoiceCreation,
|
||||
// Warning,
|
||||
// ForwardEvent,
|
||||
// SendpaySuccess,
|
||||
// SendpayFailure,
|
||||
// CoinMovement,
|
||||
// OpenchannelPeerSigs,
|
||||
// Shutdown,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
@@ -128,6 +127,8 @@ pub(crate) struct RpcMethod {
|
||||
pub(crate) struct GetManifestResponse {
|
||||
pub(crate) options: Vec<ConfigOption>,
|
||||
pub(crate) rpcmethods: Vec<RpcMethod>,
|
||||
pub(crate) subscriptions: Vec<String>,
|
||||
pub(crate) hooks: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Default, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user