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:
Paul Miller
2023-04-14 16:26:33 +00:00
committed by fiatjaf
parent ac7598b5e3
commit 03cc18d53b
11 changed files with 268 additions and 253 deletions

View File

@@ -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)