diff --git a/client/src/client.rs b/client/src/client.rs index faea7490..e80215d8 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -1261,6 +1261,11 @@ pub trait RpcApi: Sized { ) -> Result { self.call("scantxoutset", &["start".into(), into_json(descriptors)?]) } + + /// Returns information about the active ZeroMQ notifications + fn get_zmq_notifications(&self) -> Result> { + self.call("getzmqnotifications", &[]) + } } /// Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs. diff --git a/json/src/lib.rs b/json/src/lib.rs index 3574ef1b..bcabe43b 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -2140,6 +2140,14 @@ pub struct GetIndexInfoResult { pub basic_block_filter_index: Option, } +#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)] +pub struct GetZmqNotificationsResult { + #[serde(rename = "type")] + pub notification_type: String, + pub address: String, + pub hwm: u64, +} + impl<'a> serde::Serialize for PubKeyOrAddress<'a> { fn serialize(&self, serializer: S) -> Result where