nip46: fix getPublicKey() by making it actually call "get_public_key".

This commit is contained in:
fiatjaf
2024-10-23 16:38:14 -03:00
parent aba266b8e6
commit 4c2d2b5ce6
2 changed files with 6 additions and 4 deletions

View File

@@ -207,11 +207,13 @@ export class BunkerSigner {
} }
/** /**
* This was supposed to call the "get_public_key" method on the bunker, * Calls the "get_public_key" method on the bunker.
* but instead we just returns the public key we already know. * (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<string> { async getPublicKey(): Promise<string> {
return this.bp.pubkey return await this.sendRequest('get_public_key', [])
} }
/** /**

View File

@@ -1,7 +1,7 @@
{ {
"type": "module", "type": "module",
"name": "nostr-tools", "name": "nostr-tools",
"version": "2.8.1", "version": "2.9.0",
"description": "Tools for making a Nostr client.", "description": "Tools for making a Nostr client.",
"repository": { "repository": {
"type": "git", "type": "git",