diff --git a/src/controllers/NostrController.ts b/src/controllers/NostrController.ts index 9e47ff3..15274f5 100644 --- a/src/controllers/NostrController.ts +++ b/src/controllers/NostrController.ts @@ -58,7 +58,7 @@ export class NostrController extends EventEmitter { const context = new LoginMethodContext(loginMethod) // Handle decryption - return await context.nip44EDecrypt(sender, content) + return await context.nip44Decrypt(sender, content) } /** @@ -94,7 +94,7 @@ export class NostrController extends EventEmitter { const loginMethod = (store.getState().auth as AuthState).loginMethod const context = new LoginMethodContext(loginMethod) - return await context.nip04EDecrypt(sender, content) + return await context.nip04Decrypt(sender, content) } /** diff --git a/src/services/LoginMethodStrategy/NostrLoginStrategy.ts b/src/services/LoginMethodStrategy/NostrLoginStrategy.ts index a427cc7..23d0215 100644 --- a/src/services/LoginMethodStrategy/NostrLoginStrategy.ts +++ b/src/services/LoginMethodStrategy/NostrLoginStrategy.ts @@ -28,7 +28,7 @@ export class NostrLoginStrategy extends LoginMethodStrategy { return encrypted } - async nip04EDecrypt(sender: string, content: string): Promise { + async nip04Decrypt(sender: string, content: string): Promise { if (!this.nostr.nip04) { throw new Error( `Your nostr extension does not support nip04 encryption & decryption` @@ -51,7 +51,7 @@ export class NostrLoginStrategy extends LoginMethodStrategy { return encrypted as string } - async nip44EDecrypt(sender: string, content: string): Promise { + async nip44Decrypt(sender: string, content: string): Promise { if (!this.nostr.nip44) { throw new Error( `Your nostr extension does not support nip44 encryption & decryption` diff --git a/src/services/LoginMethodStrategy/PrivateKeyStrategy.ts b/src/services/LoginMethodStrategy/PrivateKeyStrategy.ts index 1386c46..b1f646d 100644 --- a/src/services/LoginMethodStrategy/PrivateKeyStrategy.ts +++ b/src/services/LoginMethodStrategy/PrivateKeyStrategy.ts @@ -29,7 +29,7 @@ export class PrivateKeyStrategy extends LoginMethodStrategy { return encrypted } - async nip04EDecrypt(sender: string, content: string): Promise { + async nip04Decrypt(sender: string, content: string): Promise { const keys = (store.getState().auth as AuthState).keyPair if (!keys) { @@ -71,7 +71,7 @@ export class PrivateKeyStrategy extends LoginMethodStrategy { return encrypted } - async nip44EDecrypt(sender: string, content: string): Promise { + async nip44Decrypt(sender: string, content: string): Promise { const keys = (store.getState().auth as AuthState).keyPair // Check if the private and public key pair is available. diff --git a/src/services/LoginMethodStrategy/loginMethodContext.ts b/src/services/LoginMethodStrategy/loginMethodContext.ts index 4891d6d..a68f7df 100644 --- a/src/services/LoginMethodStrategy/loginMethodContext.ts +++ b/src/services/LoginMethodStrategy/loginMethodContext.ts @@ -28,14 +28,14 @@ export class LoginMethodContext implements LoginMethodOperations { nip04Encrypt(receiver: string, content: string): Promise { return this.strategy.nip04Encrypt(receiver, content) } - nip04EDecrypt(sender: string, content: string): Promise { - return this.strategy.nip04EDecrypt(sender, content) + nip04Decrypt(sender: string, content: string): Promise { + return this.strategy.nip04Decrypt(sender, content) } nip44Encrypt(receiver: string, content: string): Promise { return this.strategy.nip44Encrypt(receiver, content) } - nip44EDecrypt(sender: string, content: string): Promise { - return this.strategy.nip44EDecrypt(sender, content) + nip44Decrypt(sender: string, content: string): Promise { + return this.strategy.nip44Decrypt(sender, content) } signEvent(event: UnsignedEvent | EventTemplate): Promise { return this.strategy.signEvent(event) diff --git a/src/services/LoginMethodStrategy/loginMethodStrategy.ts b/src/services/LoginMethodStrategy/loginMethodStrategy.ts index 6211805..9ad99fb 100644 --- a/src/services/LoginMethodStrategy/loginMethodStrategy.ts +++ b/src/services/LoginMethodStrategy/loginMethodStrategy.ts @@ -4,9 +4,9 @@ import { SignedEvent } from '../../types/nostr' export interface LoginMethodOperations { nip04Encrypt(receiver: string, content: string): Promise - nip04EDecrypt(sender: string, content: string): Promise + nip04Decrypt(sender: string, content: string): Promise nip44Encrypt(receiver: string, content: string): Promise - nip44EDecrypt(sender: string, content: string): Promise + nip44Decrypt(sender: string, content: string): Promise signEvent(event: UnsignedEvent | EventTemplate): Promise } @@ -14,13 +14,13 @@ export class LoginMethodStrategy implements LoginMethodOperations { async nip04Encrypt(_receiver: string, _content: string): Promise { throw new Error('Login method strategy is undefined') } - async nip04EDecrypt(_sender: string, _content: string): Promise { + async nip04Decrypt(_sender: string, _content: string): Promise { throw new Error('Login method strategy is undefined') } async nip44Encrypt(_receiver: string, _content: string): Promise { throw new Error('Login method strategy is undefined') } - async nip44EDecrypt(_sender: string, _content: string): Promise { + async nip44Decrypt(_sender: string, _content: string): Promise { throw new Error('Login method strategy is undefined') } async signEvent(_event: UnsignedEvent | EventTemplate): Promise {