From 85aa77dba840ec7908e0eaa284120ad4edbcacb5 Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 7 Oct 2025 05:48:50 +0100 Subject: [PATCH] revert: back to manual NIP-78 event creation - AppDataBlueprint is not available in npm package (only in local workspace) - Revert to manual event construction using factory.create() - This approach works on Vercel's build environment - Added comment explaining why we can't use the blueprint --- src/services/settingsService.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/services/settingsService.ts b/src/services/settingsService.ts index 83c547de..132509cc 100644 --- a/src/services/settingsService.ts +++ b/src/services/settingsService.ts @@ -3,7 +3,6 @@ import { EventFactory } from 'applesauce-factory' import { RelayPool, onlyEvents } from 'applesauce-relay' import { NostrEvent } from 'nostr-tools' import { firstValueFrom } from 'rxjs' -import * as Blueprints from 'applesauce-factory/blueprints' const SETTINGS_IDENTIFIER = 'com.dergigi.boris.user-settings' const APP_DATA_KIND = 30078 // NIP-78 Application Data @@ -137,13 +136,14 @@ export async function saveSettings( ): Promise { console.log('💾 Saving settings to nostr:', settings) - // Create NIP-78 application data event using the AppDataBlueprint - const draft = await factory.create( - Blueprints.AppDataBlueprint, - SETTINGS_IDENTIFIER, - settings, - false // no encryption - ) + // Create NIP-78 application data event manually + // Note: AppDataBlueprint is not available in the npm package + const draft = await factory.create(async () => ({ + kind: APP_DATA_KIND, + content: JSON.stringify(settings), + tags: [['d', SETTINGS_IDENTIFIER]], + created_at: Math.floor(Date.now() / 1000) + })) const signed = await factory.sign(draft)