Skip to content

Commit

Permalink
add getzmqnotifications rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Apr 24, 2024
1 parent 1b51e3d commit b8fa99d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,11 @@ pub trait RpcApi: Sized {
) -> Result<json::ScanTxOutResult> {
self.call("scantxoutset", &["start".into(), into_json(descriptors)?])
}

/// Returns information about the active ZeroMQ notifications
fn get_zmq_notifications(&self) -> Result<Vec<json::GetZmqNotificationsResult>> {
self.call("getzmqnotifications", &[])
}
}

/// Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs.
Expand Down
8 changes: 8 additions & 0 deletions json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,14 @@ pub struct GetIndexInfoResult {
pub basic_block_filter_index: Option<IndexStatus>,
}

#[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<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down

0 comments on commit b8fa99d

Please sign in to comment.