package polymarket

  1. Overview
  2. Docs
OCaml client library for the Polymarket prediction market API

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.2.0.tar.gz
md5=4eb4c5d2f63ff081c9713d90be5a51b2
sha512=0e3de0c9b40683e09ab8f9f966a44784ef1b9b482c3eefef84104a7e8042c92f1d79893ee9588b24fa3d0decaed7f365509f4d1c23c66ce8328efb64e721f276

doc/polymarket.rate_limiter/Polymarket_rate_limiter/Matcher/index.html

Module Polymarket_rate_limiter.MatcherSource

Route matching for rate limiting.

This module provides pattern matching for HTTP requests against route configurations. Pattern matching uses segment boundaries for paths, not simple prefix matching.

Sourceval matches_pattern : method_:string -> uri:Uri.t -> Types.route_pattern -> bool

Check if a request matches a route pattern.

  • parameter method_

    HTTP method (e.g., "GET", "POST")

  • parameter uri

    Request URI

Sourceval find_matching_routes : method_:string -> uri:Uri.t -> Types.route_config list -> Types.route_config list

Find all route configs that match the request. Routes are returned in the order they appear in the config list. All matching routes apply (not just first match).

Sourceval make_route_key : method_:string -> uri:Uri.t -> Types.route_pattern -> State.route_key

Generate a unique key for state lookup. The key format is: "host:method:path_prefix"

Sourceval path_matches_prefix : path:string -> prefix:string -> bool

Check if a path matches a prefix using segment boundaries. Examples:

  • "/orders" matches "/orders", "/orders/", "/orders/123"
  • "/orders" does NOT match "/orders-test", "/ordersX"
  • "/api/v1" matches "/api/v1/users"
  • "/api/v1" does NOT match "/api/v10"