Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for zapping replaceable events #424

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bitcoinpirate
Copy link

fixes #291

I tried to keep it backwards compatible by allowing the event id and the event object.

@bitcoinpirate bitcoinpirate force-pushed the support_replaceable_events branch from e337b1e to 914504d Compare August 4, 2024 15:57
@fiatjaf
Copy link
Collaborator

fiatjaf commented Aug 4, 2024

This code isn't zapping the replaceable event itself, but another replaceable events referenced by the target. To zap the replaceable event you would have to check if the target is replaceable, then build your own a tag from its kind, pubkey and d tag.

@bitcoinpirate bitcoinpirate marked this pull request as draft August 4, 2024 16:00
@bitcoinpirate bitcoinpirate force-pushed the support_replaceable_events branch from 914504d to 7ae5831 Compare August 4, 2024 16:13
@bitcoinpirate bitcoinpirate force-pushed the support_replaceable_events branch from 7ae5831 to 6b35f06 Compare August 4, 2024 16:14
nip57.ts Show resolved Hide resolved
zr.tags.push(['e', event.id])
// replacable event
if ((10000 <= event.kind && event.kind < 20000) || event.kind == 0 || event.kind == 3){
const a = ["a", `${event.kind}:${event.pubkey}`]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const a = ["a", `${event.kind}:${event.pubkey}`]
const a = ["a", `${event.kind}:${event.pubkey}:`]

@fiatjaf fiatjaf force-pushed the master branch 2 times, most recently from 4d4b83e to bf0c4d4 Compare November 4, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for zapping replaceable events
3 participants