Fix sending nip46 signer pubkey on connect
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@welshman/app",
|
||||
"version": "0.0.43",
|
||||
"version": "0.0.44",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
"description": "A collection of svelte stores for use in building nostr client applications.",
|
||||
|
||||
@@ -206,8 +206,8 @@ thunkWorker.addGlobalHandler((thunk: Thunk) => {
|
||||
|
||||
try {
|
||||
event = await signer.sign(event)
|
||||
} catch (e) {
|
||||
return fail(String(e))
|
||||
} catch (e: any) {
|
||||
return fail(String(e.error || e))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@welshman/signer",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
"description": "A nostr signer implemenation supporting several login methods.",
|
||||
|
||||
@@ -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)]))
|
||||
|
||||
Reference in New Issue
Block a user