diff --git a/src/api/hooks/nostr/useSignerStream.ts b/src/api/hooks/nostr/useSignerStream.ts index b163469e3..374cda57a 100644 --- a/src/api/hooks/nostr/useSignerStream.ts +++ b/src/api/hooks/nostr/useSignerStream.ts @@ -21,7 +21,7 @@ function useSignerStream() { const respMsg = { id: reqMsg.data.id, - result: await signer.signEvent(reqMsg.data.params[0]), + result: JSON.stringify(await signer.signEvent(JSON.parse(reqMsg.data.params[0]))), }; const respEvent = await signer.signEvent({ diff --git a/src/schemas/nostr.ts b/src/schemas/nostr.ts index 087b3f24e..8288e9791 100644 --- a/src/schemas/nostr.ts +++ b/src/schemas/nostr.ts @@ -24,16 +24,11 @@ const eventSchema = eventTemplateSchema.extend({ /** Nostr event schema that also verifies the event's signature. */ const signedEventSchema = eventSchema.refine(verifyEvent); -/** NIP-46 signer options. */ -const signEventOptsSchema = z.object({ - pow: z.number().int().nonnegative(), -}).partial(); - /** NIP-46 signer request. */ const connectRequestSchema = z.object({ id: z.string(), method: z.literal('sign_event'), - params: z.tuple([eventTemplateSchema]).or(z.tuple([eventTemplateSchema, signEventOptsSchema])), + params: z.tuple([z.string()]), }); /** NIP-47 signer response. */