diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/nip17.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/nip17.ts b/src/lib/nip17.ts index 84790275..495f897e 100644 --- a/src/lib/nip17.ts +++ b/src/lib/nip17.ts @@ -79,13 +79,11 @@ const giftWrap = (event: object, receiverPK: string) => { return finalizeEvent(giftWrapEvent, secretKey); } -export const decryptNIP17MessageNIP07 = async (text: string): string => { - const wrapped = JSON.parse(text); +export const decryptNIP17MessageNIP07 = async (wrapped: object): object => { const sealedText = await window.nostr.nip44.decrypt( wrapped.pubkey, wrapped.content); const sealed = JSON.parse(sealedText); const rumourText = await window.nostr.nip44.decrypt( sealed.pubkey, sealed.content); - const rumour = JSON.parse(rumourText); - return rumour.content; + return JSON.parse(rumourText); } |
