From 07b9f513bbca051592d798746524a6515d71435b Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Mon, 29 Dec 2025 00:10:03 +0100 Subject: [PATCH] Change default NIP-95 endpoint to nostrcheck.me as void.cat is not accessible --- lib/configStorageTypes.ts | 4 ++-- lib/nip95.ts | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/configStorageTypes.ts b/lib/configStorageTypes.ts index a3cfcfb..3fe2ddf 100644 --- a/lib/configStorageTypes.ts +++ b/lib/configStorageTypes.ts @@ -41,7 +41,7 @@ export const DEFAULT_RELAYS: RelayConfig[] = [ export const DEFAULT_NIP95_APIS: Nip95Config[] = [ { id: 'default', - url: 'https://void.cat/upload', + url: 'https://nostrcheck.me/api/v1/media', enabled: true, priority: 1, createdAt: Date.now(), @@ -49,7 +49,7 @@ export const DEFAULT_NIP95_APIS: Nip95Config[] = [ { id: 'nostrbuild', url: 'https://nostr.build/api/v2/upload', - enabled: false, + enabled: true, priority: 2, createdAt: Date.now(), }, diff --git a/lib/nip95.ts b/lib/nip95.ts index 1e7b5ff..c14903d 100644 --- a/lib/nip95.ts +++ b/lib/nip95.ts @@ -30,8 +30,10 @@ function validateFile(file: File): MediaRef['type'] { /** * Parse upload response from different NIP-95 providers - * Supports void.cat format: { ok: true, file: { id, url } } or { url: string } - * Supports nostr.build format: { url: string } + * Supports multiple formats: + * - Standard format: { url: string } + * - void.cat format: { ok: true, file: { id, url } } + * - nostrcheck.me format: { url: string } or { status: 'success', url: string } */ function parseUploadResponse(result: unknown, endpoint: string): string { if (typeof result !== 'object' || result === null) { @@ -48,6 +50,11 @@ function parseUploadResponse(result: unknown, endpoint: string): string { } } + // nostrcheck.me format: { status: 'success', url: string } + if ('status' in obj && obj.status === 'success' && 'url' in obj && typeof obj.url === 'string') { + return obj.url + } + // Standard format: { url: string } if ('url' in obj && typeof obj.url === 'string') { return obj.url