fix: Use WebSocket URL for NIP-98 'u' tag per NIP-86 spec

NIP-86 specifies "The `u` tag is the relay URL" which means the
canonical WebSocket URL (wss://...), not the HTTP URL we're making
the request to.
This commit is contained in:
Claude
2026-01-14 20:52:01 +00:00
parent 01f2c166cb
commit 3c5f460c72

View File

@@ -95,9 +95,10 @@ export class Nip86Client {
async call<T>(method: string, params: unknown[] = []): Promise<T> {
const body = JSON.stringify({ method, params });
// NIP-86: "The `u` tag is the relay URL" - use WebSocket URL, not HTTP
const authHeader = await createAuthHeader(
{
url: this.httpUrl,
url: this.relayUrl,
method: "POST",
payload: body,
},