Skip to content

Commit b8fa99d

Browse files
committed
add getzmqnotifications rpc
1 parent 1b51e3d commit b8fa99d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

client/src/client.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,11 @@ pub trait RpcApi: Sized {
12611261
) -> Result<json::ScanTxOutResult> {
12621262
self.call("scantxoutset", &["start".into(), into_json(descriptors)?])
12631263
}
1264+
1265+
/// Returns information about the active ZeroMQ notifications
1266+
fn get_zmq_notifications(&self) -> Result<Vec<json::GetZmqNotificationsResult>> {
1267+
self.call("getzmqnotifications", &[])
1268+
}
12641269
}
12651270

12661271
/// Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs.

json/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,14 @@ pub struct GetIndexInfoResult {
21402140
pub basic_block_filter_index: Option<IndexStatus>,
21412141
}
21422142

2143+
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
2144+
pub struct GetZmqNotificationsResult {
2145+
#[serde(rename = "type")]
2146+
pub notification_type: String,
2147+
pub address: String,
2148+
pub hwm: u64,
2149+
}
2150+
21432151
impl<'a> serde::Serialize for PubKeyOrAddress<'a> {
21442152
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21452153
where

0 commit comments

Comments
 (0)