mirror of
https://github.com/fiatjaf/nak.git
synced 2024-12-22 10:05:52 -05:00
fix(decode): handle pubkey flag
This commit is contained in:
parent
f425097c5a
commit
7033bfee19
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user