diff --git a/lib/nostrAuth.ts b/lib/nostrAuth.ts index 4e67c11..14f6608 100644 --- a/lib/nostrAuth.ts +++ b/lib/nostrAuth.ts @@ -26,7 +26,7 @@ export class NostrAuthService { subscribe(callback: (state: NostrConnectState) => void): () => void { this.listeners.add(callback) callback(this.state) - return () => { + return (): void => { this.listeners.delete(callback) } } @@ -182,7 +182,7 @@ export class NostrAuthService { } private setupMessageListener(): void { - window.addEventListener('storage', (e) => { + window.addEventListener('storage', (e: StorageEvent): void => { if (e.key === 'nostr_auth_state') { this.loadStateFromStorage() } diff --git a/lib/nostrPrivateMessages.ts b/lib/nostrPrivateMessages.ts index c28e59e..519f0bb 100644 --- a/lib/nostrPrivateMessages.ts +++ b/lib/nostrPrivateMessages.ts @@ -42,7 +42,7 @@ export function getPrivateContent( throw new Error('Private key not set or pool not initialized') } - return new Promise((resolve) => { + return new Promise((resolve) => { let resolved = false const relayUrl = getPrimaryRelaySync() const { createSubscription } = require('@/types/nostr-tools-extended') @@ -57,7 +57,7 @@ export function getPrivateContent( resolve(result) } - sub.on('event', (event: Event) => { + sub.on('event', (event: Event): void => { void decryptContent(privateKey, event) .then((content) => { if (content) { @@ -119,7 +119,7 @@ export async function getDecryptionKey( throw new Error('Private key not set or pool not initialized') } - return new Promise((resolve) => { + return new Promise((resolve) => { let resolved = false const relayUrl = getPrimaryRelaySync() const { createSubscription } = require('@/types/nostr-tools-extended') diff --git a/lib/nostrZapVerification.ts b/lib/nostrZapVerification.ts index e74a3bf..947c5dd 100644 --- a/lib/nostrZapVerification.ts +++ b/lib/nostrZapVerification.ts @@ -65,7 +65,7 @@ export function checkZapReceipt( return Promise.resolve(false) } - return new Promise((resolve) => { + return new Promise((resolve) => { let resolved = false const relayUrl = getPrimaryRelaySync() const sub = createSubscription(pool, [relayUrl], createZapFilters(targetPubkey, targetEventId, userPubkey)) @@ -84,7 +84,9 @@ export function checkZapReceipt( handleZapReceiptEvent(event, targetEventId, targetPubkey, userPubkey, amount, finalize, resolvedRef) }) - const end = () => finalize(false) + const end = (): void => { + finalize(false) + } sub.on('eose', end) setTimeout(end, 3000) }) diff --git a/lib/platformSync.ts b/lib/platformSync.ts index e339dc3..49a5a1d 100644 --- a/lib/platformSync.ts +++ b/lib/platformSync.ts @@ -213,4 +213,3 @@ class PlatformSyncService { } export const platformSyncService = new PlatformSyncService() -