NIP-46: stringify event object in accordance with updated spec
This commit is contained in:
parent
d6b5fb8fe7
commit
22586004e8
2 changed files with 2 additions and 7 deletions
|
@ -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({
|
||||
|
|
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue