nostr-dev-kit / ndk

Nostr Development Kit with outbox-model support
https://nostr-dev-kit.github.io/ndk/
MIT License
366 stars 99 forks source link

Fix NIP46 RPC response parsing when processing the response of a 'nip04_decrypt' method #203

Closed Pleb5 closed 7 months ago

Pleb5 commented 7 months ago

This simple bug makes nip04 remote decryption - i.e. DM-s completely unusable with nsec bunkers until fixed.

In the response parsing part of the decryption method, there is a redundant JSON.parse() call on the response.result object instead of resolving the Promise with 'response.result' as it is (as is the case in the encryption method).

Made a PR for convenience