diff --git a/jsr.json b/jsr.json index 46ef08a..755e897 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@nostr/tools", - "version": "2.11.1", + "version": "2.11.2", "exports": { ".": "./index.ts", "./core": "./core.ts", diff --git a/nip04.ts b/nip04.ts index 230856d..83a279f 100644 --- a/nip04.ts +++ b/nip04.ts @@ -5,7 +5,7 @@ import { base64 } from '@scure/base' import { utf8Decoder, utf8Encoder } from './utils.ts' -export async function encrypt(secretKey: string | Uint8Array, pubkey: string, text: string): Promise { +export function encrypt(secretKey: string | Uint8Array, pubkey: string, text: string): string { const privkey: string = secretKey instanceof Uint8Array ? bytesToHex(secretKey) : secretKey const key = secp256k1.getSharedSecret(privkey, '02' + pubkey) const normalizedKey = getNormalizedX(key) @@ -21,7 +21,7 @@ export async function encrypt(secretKey: string | Uint8Array, pubkey: string, te return `${ctb64}?iv=${ivb64}` } -export async function decrypt(secretKey: string | Uint8Array, pubkey: string, data: string): Promise { +export function decrypt(secretKey: string | Uint8Array, pubkey: string, data: string): string { const privkey: string = secretKey instanceof Uint8Array ? bytesToHex(secretKey) : secretKey let [ctb64, ivb64] = data.split('?iv=') let key = secp256k1.getSharedSecret(privkey, '02' + pubkey) diff --git a/package.json b/package.json index e6f8e25..dbdbdf6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "nostr-tools", - "version": "2.11.1", + "version": "2.11.2", "description": "Tools for making a Nostr client.", "repository": { "type": "git",