SDK
crossbell.js
Guides
Notification

Notification

Notifications are a way to inform the character of something that has happened related to the character.

Notification Types

Here is a list of all the notification types and what they mean.

export enum NotificationType {
  OPERATOR_ADDED = 'OPERATOR_ADDED',
  OPERATOR_REMOVED = 'OPERATOR_REMOVED',
  LINKED = 'LINKED',
  UNLINKED = 'UNLINKED',
  NOTE_MINTED = 'NOTE_MINTED',
  NOTE_POSTED = 'NOTE_POSTED',
  MENTIONED = 'MENTIONED',
  TIPPED = 'TIPPED',
}
  • OPERATOR_ADDED - An operator was added to the character.
  • OPERATOR_REMOVED - An operator was removed from the character.
  • LINKED - A character was linked to the character or something the character owns.
  • UNLINKED - A character was unlinked from the character or something the character owns.
  • NOTE_MINTED - The character's note was minted.
  • NOTE_POSTED - A note was posted by another character to the character's note or something the character owns.
  • MENTIONED - The character was mentioned in a note using the @ syntax.
  • TIPPED - The character was tipped by another character.

Query Notifications

To get notifications of a character:

const { list } = await indexer.notification.getMany(42)

You can filter the notifications by type:

const { list } = await indexer.notification.getMany(42, {
  type: [NotificationType.NOTE_POSTED], // only get NOTE_POSTED notifications
})