Remove nostr-wasm, add event validation sampling

This commit is contained in:
Jon Staab
2024-11-21 16:03:34 -08:00
parent 2bc575dc21
commit 2fbcfc59a1
5 changed files with 30 additions and 17 deletions
+1 -8
View File
@@ -1,16 +1,9 @@
import {initNostrWasm, type Nostr} from 'nostr-wasm'
import {verifiedSymbol, getEventHash, verifyEvent} from 'nostr-tools'
import {cached, pick, now} from '@welshman/lib'
import {Tags} from './Tags'
import {getAddress} from './Address'
import {isEphemeralKind, isReplaceableKind, isPlainReplaceableKind, isParameterizedReplaceableKind} from './Kinds'
let nw: Nostr
initNostrWasm().then(nostrWasm => {
nw = nostrWasm
})
export type EventContent = {
tags: string[][]
content: string
@@ -109,7 +102,7 @@ const _hasValidSignature = cached<string, boolean, [SignedEvent]>({
},
getValue: ([e]: [SignedEvent]) => {
try {
nw ? nw.verifyEvent(e) : verifyEvent(e)
verifyEvent(e)
} catch (err) {
return false
}