/** * Websocket re-connect timeout */ export const DefaultConnectTimeout = 2000 /** * Hashtag regex */ // eslint-disable-next-line no-useless-escape export const HashtagRegex = /(#[^\s!@#$%^&*()=+./,[{\]};:'"?><]+)/g /** * Legacy tag reference regex */ export const TagRefRegex = /(#\[\d+\])/gm /** * How long profile cache should be considered valid for */ export const ProfileCacheExpire = 1_000 * 60 * 60 * 6 /** * How long before relay lists should be refreshed */ export const RelayListCacheExpire = 1_000 * 60 * 60 * 12 /** * Extract file extensions regex */ // eslint-disable-next-line no-useless-escape export const FileExtensionRegex = /\.([\w]{1,7})$/i /** * Simple lightning invoice regex */ export const InvoiceRegex = /(lnbc\w+)/gi /* * Regex to match any base64 string */ export const CashuRegex = /(cashuA[A-Za-z0-9_-]{0,10000}={0,3})/gi /** * Regex to match any npub/nevent/naddr/nprofile/note */ export const MentionNostrEntityRegex = /@n(pub|profile|event|ote|addr|)1[acdefghjklmnpqrstuvwxyz023456789]+/g /** * Regex to match markdown code content (triple backticks) */ export const MarkdownCodeRegex = /(```.*?```)/gms /** * Regex to match inline code content (single backticks) */ export const InlineCodeRegex = /(`[^`\n]+?`)/g /** * Public metadata relays */ export const MetadataRelays = ["wss://purplepag.es/", "wss://relay.nostr.band/", "wss://relay.snort.social/"] /** * Default public relays used when user has no configured relays */ export const DefaultRelays = [ "wss://relay.damus.io", "wss://nos.lol", "wss://relay.nostr.band", "wss://relay.snort.social", "wss://nostr.wine", ] /** * Timeout for relay AUTH challenge response (ms) */ export const AuthTimeout = 10_000 /** * Timeout for NIP-46 remote signer RPC response (ms) */ export const Nip46RpcTimeout = 30_000 /** * Timeout for query EOSE in QueryManager.fetch() (ms) */ export const QueryFetchTimeout = 30_000 /** * Grace period after first EOSE before FetchAll resolves (ms). * Relays race — once the first one responds with EOSE we wait this * long for stragglers before returning whatever data we have. */ export const FetchAllGracePeriod = 500 /** * Timeout for NIP-55 clipboard-based signer response (ms) */ export const Nip55SignerTimeout = 120_000