Add logging to nip46

This commit is contained in:
Jon Staab
2024-11-02 07:24:24 -07:00
parent 51f9ae2e29
commit 0ac4cc66f4
+4
View File
@@ -104,6 +104,8 @@ export class Nip46Broker extends Emitter {
console.error(`Invalid nostr-connect response: ${json}`)
}
console.log('nip46 response:', res)
if (res.result === "auth_url") {
this.emit(`auth-${res.id}`, res)
} else {
@@ -157,6 +159,8 @@ export class Nip46Broker extends Emitter {
const content = await this.#signer[this.#algorithm].encrypt(recipient, payload)
const template = createEvent(NOSTR_CONNECT, {content, tags: [["p", recipient]]})
console.log('nip46 request:', {id, method, params})
publish({
relays: this.#handler.relays,
event: await this.#signer.sign(template),