mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Fixes missing nsec processing
This commit is contained in:
parent
fdb0830d1b
commit
73e3b60721
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user