1//! Response type for the `validateaddress` RPC.
23/// `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")]
10pub is_valid: bool,
1112/// The zcash address that has been validated.
13#[serde(skip_serializing_if = "Option::is_none")]
14pub address: Option<String>,
1516/// If the key is a script.
17#[serde(rename = "isscript")]
18 #[serde(skip_serializing_if = "Option::is_none")]
19pub is_script: Option<bool>,
20}
2122impl Response {
23/// Creates an empty response with `isvalid` of false.
24pub fn invalid() -> Self {
25Self::default()
26 }
27}