Please note that this code is more than likely totally wrong (Until updated/fixed by @5-142857 as discussed on discord)
NIPs
For a full list of the Nostr protocol NIPS (Nostr Implementation Protocols) see: nostr-protocol/nips
📒 Hyper-nostr API
A full list of the hyper-nostr API
Send A REQ Event To Subscribe To A Subscription
const me = await createSwarm(sdk, 'topic');
me.sendEvent('REQ', 'news', {});
# or with filters
me.sendEvent('REQ', 'news', {
id: '<32-bytes lowercase hex-encoded sha256 of the serialized event data>', // see nostr-tools module
pubkey: '<32-bytes lowercase hex-encoded public key of the event creator>', // see nostr-tools module
created_at: '<unix timestamp in seconds>',
kind: '<integer between 0 and 65535>',
tags: [
['<arbitrary string>...'],
...
],
content: '<arbitrary string>',
sig: '<64-bytes lowercase hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>' // see nostr-tools module
});
Send A CLOSE Event To Unsubscribe From A Subscription
const me = await createSwarm(sdk, 'topic');
me.sendEvent('CLOSE', 'news');
NIPs
For a full list of the Nostr protocol NIPS (Nostr Implementation Protocols) see: nostr-protocol/nips
📒 Hyper-nostr API
A full list of the
hyper-nostr
APISend A REQ Event To Subscribe To A Subscription
Send A CLOSE Event To Unsubscribe From A Subscription
Send An EVENT:
Delete An Event:
List Subscriptions
???
Query Events
???
Send A Query To Subscriptions
What is this for ?
Update Your Database To Sync To/From The Network