Add is lnurl-auth

This commit is contained in:
benthecarman
2023-04-26 14:06:58 -05:00
parent bca66d32ac
commit 134a5ac813
2 changed files with 11 additions and 0 deletions

View File

@@ -67,4 +67,9 @@ impl PaymentParams {
pub fn lnurl(&self) -> Option<String> {
self.params.lnurl().map(|lnurl| lnurl.to_string())
}
#[wasm_bindgen(getter)]
pub fn is_lnurl_auth(&self) -> bool {
self.params.is_lnurl_auth()
}
}

View File

@@ -141,6 +141,12 @@ impl PaymentParams<'_> {
PaymentParams::LightningAddress(ln_addr) => Some(LnUrl::from_url(ln_addr.lnurlp_url())),
}
}
pub fn is_lnurl_auth(&self) -> bool {
self.lnurl()
.map(|lnurl| lnurl.is_lnurl_auth())
.unwrap_or(false)
}
}
impl FromStr for PaymentParams<'_> {