mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 08:38:50 +00:00
bring back @noble/curves instead of @noble/secp256k1.
fixes https://github.com/nbd-wtf/nostr-tools/issues/196#issuecomment-1537549606
This commit is contained in:
13
nip57.ts
13
nip57.ts
@@ -1,6 +1,12 @@
|
||||
import {bech32} from '@scure/base'
|
||||
|
||||
import {Event, EventTemplate, validateEvent, verifySignature, Kind} from './event'
|
||||
import {
|
||||
Event,
|
||||
EventTemplate,
|
||||
validateEvent,
|
||||
verifySignature,
|
||||
Kind
|
||||
} from './event'
|
||||
import {utf8Decoder} from './utils'
|
||||
|
||||
var _fetch: any
|
||||
@@ -13,7 +19,9 @@ export function useFetchImplementation(fetchImplementation: any) {
|
||||
_fetch = fetchImplementation
|
||||
}
|
||||
|
||||
export async function getZapEndpoint(metadata: Event<Kind.Metadata>): Promise<null | string> {
|
||||
export async function getZapEndpoint(
|
||||
metadata: Event<Kind.Metadata>
|
||||
): Promise<null | string> {
|
||||
try {
|
||||
let lnurl: string = ''
|
||||
let {lud06, lud16} = JSON.parse(metadata.content)
|
||||
@@ -86,6 +94,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.'
|
||||
|
||||
let p = zapRequest.tags.find(([t, v]) => t === 'p' && v)
|
||||
|
||||
Reference in New Issue
Block a user