Practical question to the devs who write web clients, what is the preferred way to reject the request from nip07? Return rejected promise, return undefined, empty string? I’ve broke a few clients testing since they assumed some data types and cached the returned object/string without checking.

Replies (16)

async window.nostr.getPublicKey(): string // returns a public key as hex async window.nostr.signEvent(event: { created_at: number, kind: number, tags: string[][], content: string }): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it From the nip07, and I assume many clients blindly expect string 😂🤣😭
Too many clients still assume a valid object/string return and skip any type checks or try/catch. It’s a mess. I believe that , u need a stronger convention in the NIP itself, lik a standardized error object { error: "rejected" }... so clients stop guessing what “failure” means.