zebra_rpc/methods/types/
validate_address.rs

1//! Response type for the `validateaddress` RPC.
2
3/// `validateaddress` response
4#[derive(Clone, Default, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5pub struct Response {
6    /// Whether the address is valid.
7    ///
8    /// If not, this is the only property returned.
9    #[serde(rename = "isvalid")]
10    pub is_valid: bool,
11
12    /// The zcash address that has been validated.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub address: Option<String>,
15
16    /// If the key is a script.
17    #[serde(rename = "isscript")]
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub is_script: Option<bool>,
20}
21
22impl Response {
23    /// Creates an empty response with `isvalid` of false.
24    pub fn invalid() -> Self {
25        Self::default()
26    }
27}