@tevm/voltaire/utils provides a token-bucket RateLimiter for async RPC quotas plus throttle and debounce for high-frequency event handlers.
Source: rateLimit.ts.
RateLimiter
Constructor & Options (RateLimiterOptions)
Methods
Example
When
strategy: 'drop' is configured and the bucket is empty, execute() resolves to undefined cast to T. Check for undefined before dereferencing results under 'drop'.throttle
Executes fn immediately on the first call, then returns the cached lastResult without re-invoking fn until wait milliseconds have elapsed.
debounce
Delays execution until wait milliseconds pass without another call. Exposes .cancel() to clear any pending timer.
Related
- Rate Limiting Guide — Sizing budgets for Infura, Alchemy, and QuickNode compute units
- Batching Utilities — Reducing total RPC count via
BatchQueue - Retry Utilities — Handling upstream
429/-32005responses

