Fixes missing nsec processing
This commit is contained in:
@@ -111,6 +111,7 @@ object Nip19Bech32 {
|
|||||||
val bytes = (type + key).bechToBytes()
|
val bytes = (type + key).bechToBytes()
|
||||||
|
|
||||||
when (type.lowercase()) {
|
when (type.lowercase()) {
|
||||||
|
"nsec1" -> nsec(bytes)
|
||||||
"npub1" -> npub(bytes)
|
"npub1" -> npub(bytes)
|
||||||
"note1" -> note(bytes)
|
"note1" -> note(bytes)
|
||||||
"nprofile1" -> nprofile(bytes)
|
"nprofile1" -> nprofile(bytes)
|
||||||
@@ -133,6 +134,11 @@ object Nip19Bech32 {
|
|||||||
return NEmbed(Event.fromJson(ungzip(bytes)))
|
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? {
|
private fun npub(bytes: ByteArray): NPub? {
|
||||||
if (bytes.isEmpty()) return null
|
if (bytes.isEmpty()) return null
|
||||||
return NPub(bytes.toHexKey())
|
return NPub(bytes.toHexKey())
|
||||||
|
|||||||
Reference in New Issue
Block a user