Fixes missing nsec processing

pull/788/head
Vitor Pamplona 2024-02-28 16:50:23 -05:00
rodzic fdb0830d1b
commit 73e3b60721
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -111,6 +111,7 @@ object Nip19Bech32 {
val bytes = (type + key).bechToBytes()
when (type.lowercase()) {
"nsec1" -> nsec(bytes)
"npub1" -> npub(bytes)
"note1" -> note(bytes)
"nprofile1" -> nprofile(bytes)
@ -133,6 +134,11 @@ object Nip19Bech32 {
return NEmbed(Event.fromJson(ungzip(bytes)))
}
private fun nsec(bytes: ByteArray): NSec? {
if (bytes.isEmpty()) return null
return NSec(bytes.toHexKey())
}
private fun npub(bytes: ByteArray): NPub? {
if (bytes.isEmpty()) return null
return NPub(bytes.toHexKey())