flamingo icon indicating copy to clipboard operation
flamingo copied to clipboard

In the `signEvent` method, the `pubkey` of the `event` should be optional?

Open finian opened this issue 2 years ago • 0 comments

I'm signing this event:

window.nostr.signEvent({
  kind: 1,
  created_at: Math.floor(Date.now() / 1000),
  tags: [],
  content: 'hello world'
}).then(console.log).catch(console.error)

Flamingo doesn't popup, but Alby does. After I've added pubkey to the event object:

window.nostr.signEvent({
  kind: 1,
  created_at: Math.floor(Date.now() / 1000),
  pubkey: 'xxx',
  tags: [],
  content: 'hello world'
}).then(console.log).catch(console.error)

Flamingo does popup.

However, according to the NIPS-07:

async window.nostr.signEvent(event: Event): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it

pubkey is added after calling the signEvent mothod. So I think the pubkey should be optional to the event object passing to the signEvent method.

finian avatar Mar 13 '23 08:03 finian