Rate-limit configuration: a maximum order count over a rolling window.

Constructors

Properties

Methods

Constructors

  • Constructs a rate limit from a max order count and a window.

    windowMs is the rolling-window length in milliseconds. Fractional milliseconds retain nanosecond precision.

    Errors

    Throws ParamError when windowMs cannot be represented as a Rust duration. Positive and maximum-window validation is performed by the core settings constructor when the policy is built.

    Parameters

    • max_orders: number
    • window_ms: number

    Returns RateLimit

Properties

maxOrders: number

The maximum number of orders accepted within the window.

windowMs: number

The rolling-window length in milliseconds.

Methods

  • Returns void

  • Returns a fresh copy of this rate limit.

    Returns RateLimit

  • Returns void