From 4c2d2b5ce6ef9954ffa7ba76860263ee70e36c20 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 23 Oct 2024 16:38:14 -0300 Subject: [PATCH] nip46: fix getPublicKey() by making it actually call "get_public_key". --- nip46.ts | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nip46.ts b/nip46.ts index e1252a9..e758d2f 100644 --- a/nip46.ts +++ b/nip46.ts @@ -207,11 +207,13 @@ export class BunkerSigner { } /** - * This was supposed to call the "get_public_key" method on the bunker, - * but instead we just returns the public key we already know. + * Calls the "get_public_key" method on the bunker. + * (before we would return the public key hardcoded in the bunker parameters, but + * that is not correct as that may be the bunker pubkey and the actual signer + * pubkey may be different.) */ async getPublicKey(): Promise { - return this.bp.pubkey + return await this.sendRequest('get_public_key', []) } /** diff --git a/package.json b/package.json index a79be74..9949c36 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "nostr-tools", - "version": "2.8.1", + "version": "2.9.0", "description": "Tools for making a Nostr client.", "repository": { "type": "git",