Fix sending nip46 signer pubkey on connect

This commit is contained in:
Jon Staab
2025-03-24 12:35:41 -07:00
parent 0a40a71cc0
commit 4e49410b8b
4 changed files with 11 additions and 6 deletions
+7 -2
View File
@@ -433,8 +433,13 @@ export class Nip46Broker extends Emitter {
createAccount = (username: string, domain: string, perms = "") =>
this.send("create_account", [username, domain, "", perms])
connect = async (connectSecret = "", perms = "") =>
this.send("connect", [await this.signer.getPubkey(), connectSecret, perms])
connect = async (connectSecret = "", perms = "") => {
if (!this.params.signerPubkey) {
throw new Error("Attempted to `connect` with no signerPubkey")
}
return this.send("connect", [this.params.signerPubkey, connectSecret, perms])
}
signEvent = async (event: StampedEvent) =>
JSON.parse(await this.send("sign_event", [JSON.stringify(event)]))