1
0
mirror of git://jb55.com/damus synced 2024-10-01 09:20:47 +00:00

nostrscript: fix nscripts not loading

This was broken by the recent nip19 changes, let's fix it again

Fixes: cb4adf06f1 ("nip19: added swift enums")
Changelog-Fixed: Fix nostrscripts not loading
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2024-02-02 12:01:00 -08:00
parent 4defab73d0
commit 28f292f692

View File

@ -72,6 +72,10 @@ enum Bech32Object : Equatable {
case naddr(NAddr) case naddr(NAddr)
static func parse(_ str: String) -> Bech32Object? { static func parse(_ str: String) -> Bech32Object? {
if str.starts(with: "nscript"), let decoded = try? bech32_decode(str) {
return .nscript(decoded.data.bytes)
}
var b: nostr_bech32_t = nostr_bech32() var b: nostr_bech32_t = nostr_bech32()
let bytes = Array(str.utf8) let bytes = Array(str.utf8)