Remove nostr-wasm, add event validation sampling
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@welshman/lib": "~0.0.25",
|
||||
"nostr-tools": "^2.7.2",
|
||||
"nostr-wasm": "^0.1.0"
|
||||
"nostr-tools": "^2.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user