Module @welshman/util

@welshman/util version

Some nostr-specific utilities. For the most part, these will not have side effects or manage state. Includes:

  • Event kind constants
  • A nostr address class
  • Utilities for working with nostr filters and tags
  • Helpers for working with zap events and lightning invoices
  • A Encryptable for ensuring payloads get encrypted
  • An implementation of an in-memory relay, backed by an events repository
  • Utilities for building events, validating signatures, and checking event type (replaceable, etc.)
  • Types and utilities for NIP 89 handlers
  • Types and utilities for NIP 51 lists
  • Types and utilities for NIP 01 profile metadata
  • Types and utilities for NIP 11 relay profiles

Classes

Address
Encryptable
Relay
Repository

Type Aliases

CreateEventOpts
DecryptedEvent
Encrypt
EncryptableUpdates
EventContent
EventTemplate
Filter
Handler
HashedEvent
List
ListParams
OwnedEvent
Profile
PublishedList
PublishedProfile
RelayProfile
SignedEvent
StampedEvent
TrustedEvent
UnwrappedEvent
Zap
Zapper

Variables

APP_DATA
APPROVAL
AUDIO
AUTH_INVITE
AUTH_JOIN
BADGE_AWARD
BADGE_DEFINITION
BADGES
BID
BID_CONFIRMATION
BLOCKED_RELAYS
BOGUS_RELAY_URL
BOOKMARKS
CALENDAR
CHANNEL_CREATE
CHANNEL_HIDE_MESSAGE
CHANNEL_MESSAGE
CHANNEL_MUTE_USER
CHANNEL_UPDATE
CHANNELS
CLASSIFIED
CLIENT_AUTH
COMMENT
COMMUNITIES
COMMUNITY
DAY
DELETE
DEPRECATED_DIRECT_MESSAGE
DEPRECATED_NAMED_GENERIC
DEPRECATED_RELAY_RECOMMENDATION
DIRECT_MESSAGE
DRAFT_CLASSIFIED
DVM_FEEDBACK
DVM_REQUEST_COUNT
DVM_REQUEST_DISCOVER_CONTENT
DVM_REQUEST_DISCOVER_PEOPLE
DVM_REQUEST_IMAGE_GENERATION
DVM_REQUEST_IMAGE_TO_VIDEO_CONVERSION
DVM_REQUEST_MALWARE_SCAN
DVM_REQUEST_OP_RETURN
DVM_REQUEST_OTS
DVM_REQUEST_PUBLISH_SCHEDULE
DVM_REQUEST_SEARCH_CONTENT
DVM_REQUEST_SEARCH_PEOPLE
DVM_REQUEST_TEXT_EXTRACTION
DVM_REQUEST_TEXT_GENERATION
DVM_REQUEST_TEXT_SUMMARY
DVM_REQUEST_TEXT_TO_SPEECH
DVM_REQUEST_TEXT_TRANSLATION
DVM_REQUEST_VIDEO_CONVERSION
DVM_REQUEST_VIDEO_TRANSLATION
DVM_RESPONSE_COUNT
DVM_RESPONSE_DISCOVER_CONTENT
DVM_RESPONSE_DISCOVER_PEOPLE
DVM_RESPONSE_IMAGE_GENERATION
DVM_RESPONSE_IMAGE_TO_VIDEO_CONVERSION
DVM_RESPONSE_MALWARE_SCAN
DVM_RESPONSE_OP_RETURN
DVM_RESPONSE_OTS
DVM_RESPONSE_PUBLISH_SCHEDULE
DVM_RESPONSE_SEARCH_CONTENT
DVM_RESPONSE_SEARCH_PEOPLE
DVM_RESPONSE_TEXT_EXTRACTION
DVM_RESPONSE_TEXT_GENERATION
DVM_RESPONSE_TEXT_SUMMARY
DVM_RESPONSE_TEXT_TO_SPEECH
DVM_RESPONSE_TEXT_TRANSLATION
DVM_RESPONSE_VIDEO_CONVERSION
DVM_RESPONSE_VIDEO_TRANSLATION
EMOJIS
EPOCH
EVENT_DATE
EVENT_RSVP
EVENT_TIME
FEED
FEEDS
FILE_METADATA
FILE_SERVERS
FOLLOWS
GENERIC_REPOST
GIT_ISSUE
GIT_PATCH
GIT_REPLY
GIT_REPOSITORY
GIT_STATUS_CLOSED
GIT_STATUS_COMPLETE
GIT_STATUS_DRAFT
GIT_STATUS_OPEN
GROUP
GROUP_ADD_PERM
GROUP_ADD_USER
GROUP_ADMINS
GROUP_CREATE
GROUP_DELETE_EVENT
GROUP_EDIT_META
GROUP_EDIT_STATUS
GROUP_JOIN
GROUP_LEAVE
GROUP_META
GROUP_REMOVE_PERM
GROUP_REMOVE_USER
GROUPS
HANDLER_INFORMATION
HANDLER_RECOMMENDATION
HIGHLIGHT
HTTP_AUTH
INBOX_RELAYS
LABEL
LIGHTNING_PUB_RPC
LIVE_CHAT_MESSAGE
LIVE_EVENT
LOCAL_RELAY_URL
LONG_FORM
LONG_FORM_DRAFT
MARKET_UI
MESSAGE
MUTES
NAMED_ARTIFACTS
NAMED_BOOKMARKS
NAMED_COMMUNITIES
NAMED_CURATIONS
NAMED_EMOJIS
NAMED_PEOPLE
NAMED_RELAYS
NAMED_TOPICS
NAMED_WIKI_AUTHORS
NAMED_WIKI_RELAYS
neverFilter
NOSTR_CONNECT
NOSTROCKET_PROBLEM
NOTE
OTS
PINS
PRODUCT
PRODUCT_SOLD_AS_AUCTION
PROFILE
REACTION
RELAYS
REMIX
REPORT
REPOST
REVIEW
SEAL
SEARCH_RELAYS
STALL
STATUS
THREAD
TOPICS
WALLET_INFO
WALLET_REQUEST
WALLET_RESPONSE
WIKI
WRAP
WRAP_NIP04
ZAP_GOAL
ZAP_REQUEST
ZAP_RESPONSE

Functions

addRepostFilters
addToListPrivately
addToListPublicly
asDecryptedEvent
asEventTemplate
asHashedEvent
asOwnedEvent
asSignedEvent
asStampedEvent
asTrustedEvent
asUnwrappedEvent
calculateFilterGroup
createEvent
createProfile
displayHandler
displayProfile
displayPubkey
displayRelayProfile
displayRelayUrl
editProfile
fromNostrURI
getAddress
getAddressTags
getAddressTagValues
getAncestorTags
getAncestorTagValues
getEventTags
getEventTagValues
getFilterGenerality
getFilterId
getFilterResultCardinality
getGroupTags
getGroupTagValues
getHandlerAddress
getHandlerKey
getIdAndAddress
getIdentifier
getIdFilters
getIdOrAddress
getInvoiceAmount
getKindTags
getKindTagValues
getListTags
getLnUrl
getPubkeyTags
getPubkeyTagValues
getRelayHints
getRelayTags
getRelayTagValues
getReplyFilters
getTag
getTags
getTagValue
getTagValues
getTopicTags
getTopicTagValues
guessFilterDelta
hasValidSignature
hrpToMillisat
intersectFilters
isChildOf
isDVMKind
isEphemeral
isEphemeralKind
isEventTemplate
isHashedEvent
isOwnedEvent
isParameterizedReplaceable
isParameterizedReplaceableKind
isPlainReplaceable
isPlainReplaceableKind
isPublishedProfile
isRegularKind
isRelayUrl
isReplaceable
isReplaceableKind
isShareableRelayUrl
isSignedEvent
isStampedEvent
isTrustedEvent
isUnwrappedEvent
makeList
makeProfile
matchFilter
matchFilters
normalizeRelayUrl
profileHasName
readHandlers
readList
readProfile
removeFromList
removeFromListByPredicate
tagsFromIMeta
toNostrURI
trimFilter
trimFilters
unionFilters
uniqTags
zapFromEvent