Skip to content

Commit

Permalink
added support for zapping replaceable events
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcoinpirate committed Aug 4, 2024
1 parent 6f334f3 commit 914504d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nip57.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function makeZapRequest({
comment = '',
}: {
profile: string
event: string | null
event: string | Event | null
amount: number
comment: string
relays: string[]
Expand All @@ -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
}
Expand Down

0 comments on commit 914504d

Please sign in to comment.