From ebdfa47bd8041d8a1a4dfcf3d43e0e9cb629911e Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 2 Oct 2025 09:27:28 +0200 Subject: [PATCH] debug: add signer method inspection for NIP-44 decryption - Add logging to inspect available methods on the applesauce signer - Try multiple possible method names for NIP-44 decryption - This will help identify the correct method name for decryption --- src/services/bookmarkService.ts | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/services/bookmarkService.ts b/src/services/bookmarkService.ts index d51ff227..3e847538 100644 --- a/src/services/bookmarkService.ts +++ b/src/services/bookmarkService.ts @@ -143,10 +143,30 @@ export const fetchBookmarks = async ( if (bookmarkListEvent.content && activeAccount.signer) { try { console.log('Decrypting private bookmarks...') - const decryptedContent = await activeAccount.signer.nip44_decrypt( - bookmarkListEvent.content, - activeAccount.pubkey - ) + console.log('Signer methods:', Object.getOwnPropertyNames(activeAccount.signer)) + console.log('Signer prototype methods:', Object.getOwnPropertyNames(Object.getPrototypeOf(activeAccount.signer))) + + // Try different possible method names + let decryptedContent = null + if (typeof activeAccount.signer.nip44_decrypt === 'function') { + decryptedContent = await activeAccount.signer.nip44_decrypt( + bookmarkListEvent.content, + activeAccount.pubkey + ) + } else if (typeof activeAccount.signer.decrypt === 'function') { + decryptedContent = await activeAccount.signer.decrypt( + bookmarkListEvent.content, + activeAccount.pubkey + ) + } else if (typeof activeAccount.signer.nip44Decrypt === 'function') { + decryptedContent = await activeAccount.signer.nip44Decrypt( + bookmarkListEvent.content, + activeAccount.pubkey + ) + } else { + console.log('No suitable decrypt method found on signer') + throw new Error('No suitable decrypt method found on signer') + } console.log('Decrypted content:', decryptedContent)