mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-25 09:09:08 -05:00
add encode note.
This commit is contained in:
parent
455ec79e58
commit
ada76f281a
17
encode.go
17
encode.go
|
@ -187,6 +187,23 @@ var encode = &cli.Command{
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "note",
|
||||
Usage: "generate note1 event codes (not recommended)",
|
||||
Action: func(c *cli.Context) error {
|
||||
target := c.Args().First()
|
||||
if err := validate32BytesHex(target); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if npub, err := nip19.EncodeNote(target); err == nil {
|
||||
fmt.Println(npub)
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user