skip rate limit coupons #179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces changes to the
CouponService, rate limiter logic, and configuration files to enhance coupon functionality and streamline rate-limiting behavior. Key updates include adding new coupon properties, modifying rate limiter logic to consider coupon-based rate limit exemptions, and updating the configuration to support these changes.CouponService Enhancements
skipIpRateLimitandskipWalletRateLimitto theCoupontype to enable skipping specific rate limits for certain coupons. (CouponService/couponService.ts, CouponService/couponService.tsL6-R15)getCouponmethod to retrieve coupon details by ID. (CouponService/couponService.ts, CouponService/couponService.tsR174-R177)Rate Limiter Updates
RateLimiterclass to accept aCouponServiceinstance and atypeparameter (ip,wallet, orglobal). Added logic to skip rate limits based on the new coupon properties. (middlewares/rateLimiter.ts, [1] [2]CouponServiceinto the rate limiter initialization inserver.ts, enabling coupon-based rate limit exemptions for IP and wallet rate limiters. (server.ts, server.tsL48-L69)Configuration Changes
MAX_LIMITfrom 40 to 200 and reducedDRIP_AMOUNTfrom 2 to 0.01. (config.json, [1] [2]WAGMI,NMAC,MASA,LT0, etc.) to simplify the configuration file. (config.json, [1] [2] [3] [4] [5]Logging Enhancements
skippedIpRateLimitandskippedWalletRateLimitflags in the/sendTokenendpoint for better observability. (server.ts, [1] [2]