Skip to content

Commit 04bb03e

Browse files
committed
add getzmqnotifications rpc
1 parent 7bd815f commit 04bb03e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

client/src/client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,10 @@ pub trait RpcApi: Sized {
12631263
) -> Result<json::ScanTxOutResult> {
12641264
self.call("scantxoutset", &["start".into(), into_json(descriptors)?])
12651265
}
1266+
1267+
fn get_zmq_notifications(&self) -> Result<Vec<json::GetZmqNotificationsResult>> {
1268+
self.call("getzmqnotifications", &[])
1269+
}
12661270
}
12671271

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

json/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,14 @@ pub struct GetIndexInfoResult {
21422142
pub basic_block_filter_index: Option<IndexStatus>,
21432143
}
21442144

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

0 commit comments

Comments
 (0)