fix(decode): handle pubkey flag

This commit is contained in:
redraw 2024-12-01 23:17:09 -03:00 committed by fiatjaf_
parent f425097c5a
commit 7033bfee19

View File

@ -58,6 +58,10 @@ var decode = &cli.Command{
decodeResult = DecodeResult{EventPointer: evp} decodeResult = DecodeResult{EventPointer: evp}
} else if pp := sdk.InputToProfile(ctx, input); pp != nil { } else if pp := sdk.InputToProfile(ctx, input); pp != nil {
decodeResult = DecodeResult{ProfilePointer: pp} decodeResult = DecodeResult{ProfilePointer: pp}
if c.Bool("pubkey") {
stdout(pp.PublicKey)
return nil
}
} else if prefix, value, err := nip19.Decode(input); err == nil && prefix == "naddr" { } else if prefix, value, err := nip19.Decode(input); err == nil && prefix == "naddr" {
if ep, ok := value.(nostr.EntityPointer); ok { if ep, ok := value.(nostr.EntityPointer); ok {
decodeResult = DecodeResult{EntityPointer: &ep} decodeResult = DecodeResult{EntityPointer: &ep}