From 57354b9fb48f0955ed92a9877f5de061acc081f8 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 28 May 2025 14:50:25 -0300 Subject: [PATCH] expose hexToBytes and bytesToHex helpers. --- nip47.ts | 2 +- utils.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nip47.ts b/nip47.ts index 6d34e1d..55f7892 100644 --- a/nip47.ts +++ b/nip47.ts @@ -32,7 +32,7 @@ export async function makeNwcRequestEvent( invoice, }, } - const encryptedContent = await encrypt(secretKey, pubkey, JSON.stringify(content)) + const encryptedContent = encrypt(secretKey, pubkey, JSON.stringify(content)) const eventTemplate = { kind: NWCWalletRequest, created_at: Math.round(Date.now() / 1000), diff --git a/utils.ts b/utils.ts index 0801995..a2e68b3 100644 --- a/utils.ts +++ b/utils.ts @@ -3,6 +3,8 @@ import type { Event } from './core.ts' export const utf8Decoder: TextDecoder = new TextDecoder('utf-8') export const utf8Encoder: TextEncoder = new TextEncoder() +export { bytesToHex, hexToBytes } from '@noble/hashes/utils' + export function normalizeURL(url: string): string { try { if (url.indexOf('://') === -1) url = 'wss://' + url