nostr-websocket-utils / PowRateLimiter
Rate limiter interface for proof of work
shouldRateLimit(
pubkey
,currentTime
):boolean
Checks if an event should be rate limited
string
Publisher's public key
number
Current timestamp
boolean
True if should be rate limited
recordEvent(
pubkey
,difficulty
,currentTime
):void
Records an event for rate limiting
string
Publisher's public key
number
Event difficulty
number
Current timestamp
void