Skip to content

Helpers

applesauce-core comes with a bunch of methods to get data from events

WARNING

Some helper methods my throw errors. so make sure to have error handling and use the isValid* helpers to filter out invalid events

Events

Profiles

Mailboxes

Event relays

  • addSeenRelay Adds a relay to the list of relay the event was seen on
  • getSeenRelays Get the list of relays this event was seen on

Zaps

Lightning

Pointers

Delete events

Emojis

URLs

  • getURLFilename returns the filename part fo the path in a URL
  • isAudioURL Checks if the URL ends with a audio file extension
  • isVideoURL Checks if the URL ends with a video file extension
  • isImageURL Checks if the URL ends with a image file extension
  • isStreamURL Checks if the URL ends with a stream file extension

Tags

  • isETag Checks if tag is an "e" tag and has at least one value
  • isATag Checks if tag is an "a" tag and has at least one value
  • isPTag Checks if tag is an "p" tag and has at least one value
  • isDTag Checks if tag is an "d" tag and has at least one value
  • isRTag Checks if tag is an "r" tag and has at least one value
  • isTTag Checks if tag is an "t" tag and has at least one value

Hidden Tags

Hidden tags are used in NIP-51 lists and NIP-60 wallets

Filters

Time

  • unixNow Returns the current unix timestamp