Type Alias: RateLimiterState
RateLimiterState = {
capacity:bigint;rate:bigint;tokens:bigint; } |null
Defined in: chain.ts:202
Rate limiter state for token pool configurations.
Type Declaration
{ capacity: bigint; rate: bigint; tokens: bigint; }
capacity
capacity:
bigint
Maximum capacity of the rate limiter bucket.
rate
rate:
bigint
Rate at which tokens are replenished (tokens per second).
tokens
tokens:
bigint
Current token balance in the rate limiter bucket.
null
Remarks
- Returns the rate limiter bucket state when rate limiting is enabled
- Returns
nullwhen rate limiting is disabled (unlimited throughput)
Example
TypeScript
const remote = await chain.getTokenPoolRemotes(poolAddress)
const state = remote['ethereum-mainnet'].inboundRateLimiterState
if (state === null) {
console.log('Rate limiting disabled - unlimited throughput')
} else {
console.log(`Capacity: ${state.capacity}, Available: ${state.tokens}`)
}