accept npub/nprofile/nevent instead of just hex in flags.

This commit is contained in:
fiatjaf
2025-11-11 15:58:53 -03:00
parent 210c0aa282
commit bef3739a67
7 changed files with 56 additions and 14 deletions

View File

@@ -7,7 +7,6 @@ import (
"io"
"os"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/keyer"
"fiatjaf.com/nostr/nipb0/blossom"
"github.com/urfave/cli/v3"
@@ -38,11 +37,11 @@ var blossomCmd = &cli.Command{
var client *blossom.Client
pubkey := c.Args().First()
if pubkey != "" {
if pk, err := nostr.PubKeyFromHex(pubkey); err != nil {
pk, err := parsePubKey(pubkey)
if err != nil {
return fmt.Errorf("invalid public key '%s': %w", pubkey, err)
} else {
client = blossom.NewClient(c.String("server"), keyer.NewReadOnlySigner(pk))
}
client = blossom.NewClient(c.String("server"), keyer.NewReadOnlySigner(pk))
} else {
var err error
client, err = getBlossomClient(ctx, c)