You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e9d43ca
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+82Lines changed: 82 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,88 @@ bun run pr
45
45
46
46
CI runs the same checks (all except `format`) on every pull request.
47
47
48
+
## Retracting a bounty
49
+
50
+
There is no retract button yet. Until there is, publish a [NIP-09](https://github.com/nostr-protocol/nips/blob/master/09.md) deletion request by hand, from the browser console on any SatCode page, signed in with your NIP-07 extension.
51
+
52
+
Start by grabbing your pubkey and the relay list. Both later steps use them.
53
+
54
+
```js
55
+
constpubkey=awaitwindow.nostr.getPublicKey();
56
+
57
+
// Keep in sync with DEFAULT_RELAYS in src/lib/ndk.ts
58
+
constrelays= [
59
+
'wss://relay.damus.io',
60
+
'wss://relay.snort.social',
61
+
'wss://relay.nos.social',
62
+
'wss://nos.lol',
63
+
'wss://nostr.bitcoiner.social',
64
+
'wss://relay.primal.net',
65
+
'wss://nostr.land'
66
+
];
67
+
```
68
+
69
+
Now list the bounties you have published, and copy the address of the one you want gone. A bounty usually reaches only some of the relays, so ask all of them and collapse the answers by address. Cards link to `/bounties/<address>`, so you can also read one out of the URL bar instead.
70
+
71
+
```js
72
+
constmine=newMap();
73
+
74
+
for (consturlof relays) {
75
+
constws=newWebSocket(url);
76
+
ws.onopen= () =>
77
+
ws.send(
78
+
JSON.stringify([
79
+
'REQ',
80
+
'mine',
81
+
{ kinds: [30050], authors: [pubkey], limit:50 }
82
+
])
83
+
);
84
+
ws.onmessage= ({ data }) => {
85
+
const [type, , event] =JSON.parse(data);
86
+
if (type !=='EVENT') returnws.close(); // EOSE, CLOSED, NOTICE
Both tags matter. `a` names the bounty by address rather than by event id, so the request covers every revision of it. `k` is what the listing subscribes to, so a request without `["k", "30050"]` reaches the relays but stays invisible to SatCode.
125
+
126
+
Each relay answers `["OK", <id>, true, ""]` on success, or `false` with a reason. Relays that require [NIP-42](https://github.com/nostr-protocol/nips/blob/master/42.md) authentication will reject this, because the snippet does not authenticate and the app does, so a bounty published through SatCode may sit on relays this cannot reach.
127
+
128
+
Deletion is a request, not a command, and a relay may keep serving the event regardless. SatCode filters retracted bounties out client side, and only honours a request signed by the bounty's own author, so the card leaves the listing either way.
129
+
48
130
## License
49
131
50
132
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
0 commit comments