Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

Rate Limiter

Demo of the p/moul/x/daily/ratelimit library — an on-chain token-bucket limiter (port of golang.org/x/time/rate).

Config

Parameter Value
Rate (tokens/block) 0.5
Burst (capacity) 5
Clock height 803814

Callers

No caller has hit the limiter yet.


Call Allow(cur) to consume a token; read Tokens(addr) for a caller's balance.