nostr-tribes
v0.2.1
Published
Client library for using nostr tribes
Maintainers
Readme
Nostr Tribes
Typescript library to work with Nostr tribes in the browser and in nodejs.
Find out more about tribes at https://tribewiki.org/Tribe
Usage
Basic usage:
let tribe = new Tribe("<tribe-event-coordinates>", [relays])
await tribe.sync() // Fetch members
await tribe.sync_profiles() // Fetch member profiles (name, avatar, nip05)
tribe.subscribe() // Subscribe for changes in tribe membership
some_events = nostr.fetchEvents({some: filter})
let judgements = await tribe.judgeEvents(some_events)
// Returns {[event_id]: [verdict, object, stamp]}
// verdict is either 'curate', 'neutral' or 'ban'
// object is either 'pubkey' or 'event'
// if object is 'event', the corresponding kind:78 stamp is returned as the 3rd item in the list
await tribe.stamp_event(some_event) // Curate some event and upload the stamp to the tribe relays.
await tribe.stamp_pubkey(some_event.pubkey) // Add a new member to the tribe, store stamp on the tribe relays.