From 6c236d1c65254a92e81e077010a87e77018c0633 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Jan 2026 08:03:32 +0000 Subject: [PATCH] fix: remove double URL encoding in zap requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The zap request JSON was being encoded twice: 1. Manually via encodeURIComponent in serializeZapRequest() 2. Automatically by URLSearchParams.set() when building callback URL This caused overly-encoded URLs (e.g., '{' → '%7B' → '%257B'). Fix: Remove manual encoding and let URLSearchParams handle it. Verified: Tests pass, build succeeds --- src/lib/create-zap-request.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/create-zap-request.ts b/src/lib/create-zap-request.ts index fb486cb..34d1ea6 100644 --- a/src/lib/create-zap-request.ts +++ b/src/lib/create-zap-request.ts @@ -118,8 +118,9 @@ export async function createZapRequest( } /** - * Serialize zap request event to URL-encoded JSON for LNURL callback + * Serialize zap request event to JSON string for LNURL callback + * Note: Do NOT encodeURIComponent here - URLSearchParams.set() will handle encoding */ export function serializeZapRequest(event: NostrEvent): string { - return encodeURIComponent(JSON.stringify(event)); + return JSON.stringify(event); }