diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/client.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index 92bf266..b8d2856 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -888,6 +888,13 @@ pub async fn fetch_public_key(signer: &Arc<dyn NostrSigner>) -> Result<nostr::Pu | |||
| 888 | } | 888 | } |
| 889 | 889 | ||
| 890 | pub async fn nip05_query(nip05_addr: &str) -> Result<Nip05Profile> { | 890 | pub async fn nip05_query(nip05_addr: &str) -> Result<Nip05Profile> { |
| 891 | // can be removed if this rust-nostr patch is merged | ||
| 892 | // nostr:nevent1qvzqqqqx2ypzpgqgmmc409hm4xsdd74sf68a2uyf9pwel4g9mfdg8l5244t6x4jdqqsv0xw23ejw77lfvlaqv5y5nnvdc0p68kmvp2vnklpe9wxx0lkugdcv4zjgk | ||
| 893 | let nip05_addr = if nip05_addr.contains('@') { | ||
| 894 | nip05_addr | ||
| 895 | } else { | ||
| 896 | &format!("_@{nip05_addr}") | ||
| 897 | }; | ||
| 891 | let addr_deconstructed = Nip05Address::parse(nip05_addr) | 898 | let addr_deconstructed = Nip05Address::parse(nip05_addr) |
| 892 | .context(format!("cannot parse nip05 address: {nip05_addr}"))?; | 899 | .context(format!("cannot parse nip05 address: {nip05_addr}"))?; |
| 893 | let json_res: Value = reqwest::Client::new() | 900 | let json_res: Value = reqwest::Client::new() |