mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 08:38:50 +00:00
change tests and nips to use the new api.
This commit is contained in:
4
nip57.ts
4
nip57.ts
@@ -1,6 +1,6 @@
|
||||
import { bech32 } from '@scure/base'
|
||||
|
||||
import { validateEvent, verifySignature, type Event, type EventTemplate } from './event.ts'
|
||||
import { validateEvent, verifyEvent, type Event, type EventTemplate } from './pure.ts'
|
||||
import { utf8Decoder } from './utils.ts'
|
||||
|
||||
var _fetch: any
|
||||
@@ -86,7 +86,7 @@ export function validateZapRequest(zapRequestString: string): string | null {
|
||||
|
||||
if (!validateEvent(zapRequest)) return 'Zap request is not a valid Nostr event.'
|
||||
|
||||
if (!verifySignature(zapRequest)) return 'Invalid signature on zap request.'
|
||||
if (!verifyEvent(zapRequest)) return 'Invalid signature on zap request.'
|
||||
|
||||
let p = zapRequest.tags.find(([t, v]) => t === 'p' && v)
|
||||
if (!p) return "Zap request doesn't have a 'p' tag."
|
||||
|
||||
Reference in New Issue
Block a user