diff --git a/nip57.ts b/nip57.ts index a95a52d..ec67d3d 100644 --- a/nip57.ts +++ b/nip57.ts @@ -49,7 +49,7 @@ export function makeZapRequest({ comment = '', }: { profile: string - event: string | null + event: string | Event | null amount: number comment: string relays: string[] @@ -68,9 +68,14 @@ export function makeZapRequest({ ], } - if (event) { + if (event && typeof event === 'string') { zr.tags.push(['e', event]) } + if (event && typeof event === 'object') { + zr.tags.push(['e', event.pubkey]) + let a = event.tags.find(([t, v]) => t === 'a' && v) + if (a) zr.tags.push(a) + } return zr }