diff --git a/damus/Nostr/Nostr.swift b/damus/Nostr/Nostr.swift index e3369bc..fa95ca1 100644 --- a/damus/Nostr/Nostr.swift +++ b/damus/Nostr/Nostr.swift @@ -13,6 +13,21 @@ struct Profile: Decodable { let display_name: String? let about: String? let picture: String? + let website: String? + let lud06: String? + let lud16: String? + + var lightning_uri: URL? { + if let url = (self.lud06.flatMap { URL(string: "lightning:" + $0) }) { + return url + } + + if let url = (self.lud16.flatMap { URL(string: "lightning:" + $0) }) { + return url + } + + return nil + } static func displayName(profile: Profile?, pubkey: String) -> String { return profile?.name ?? abbrev_pubkey(pubkey)