We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc1294e commit e8927d7Copy full SHA for e8927d7
1 file changed
nip57.ts
@@ -18,13 +18,13 @@ export async function getZapEndpoint(metadata: Event): Promise<null | string> {
18
try {
19
let lnurl: string = ''
20
let { lud06, lud16 } = JSON.parse(metadata.content)
21
- if (lud06) {
+ if (lud16) {
22
+ let [name, domain] = lud16.split('@')
23
+ lnurl = new URL(`/.well-known/lnurlp/${name}`, `https://${domain}`).toString()
24
+ } else if (lud06) {
25
let { words } = bech32.decode(lud06, 1000)
26
let data = bech32.fromWords(words)
27
lnurl = utf8Decoder.decode(data)
- } else if (lud16) {
- let [name, domain] = lud16.split('@')
- lnurl = new URL(`/.well-known/lnurlp/${name}`, `https://${domain}`).toString()
28
} else {
29
return null
30
}
0 commit comments