initial version with basic event utils.

This commit is contained in:
fiatjaf
2022-02-09 19:40:45 -03:00
commit 8312d9ece7
10 changed files with 329 additions and 0 deletions

27
handlers/EventSigning.jsx Normal file
View File

@@ -0,0 +1,27 @@
import React from 'react'
import {getEventHash, serializeEvent} from 'nostr-tools'
import Item from '../components/item'
export default function EventSigning({value}) {
let evt = JSON.parse(value)
return (
<>
<Item label="serialized event">{serializeEvent(evt)}</Item>
<Item label="event id" hint="sha256 hash of serialized">
{getEventHash(evt)}
</Item>
</>
)
}
EventSigning.match = value => {
try {
let evt = JSON.parse(value)
return evt.kind && evt.content && evt.tags
} catch (err) {
/**/
}
return false
}