PolymarketClob.HTTP (PolymarketClob v0.2.0)

Copy Markdown View Source

Thin Req wrapper for Polymarket CLOB HTTP calls.

Endpoint modules should build on this layer. It owns JSON byte encoding, timeout/retry defaults, L2 auth header injection for private requests, and normalized error returns.

Summary

Functions

Encodes request bodies into the exact JSON bytes used for HMAC signing.

Performs a private authenticated request using L2 CLOB credentials.

Performs a public unauthenticated request.

Types

result()

@type result() :: {:ok, term()} | {:error, PolymarketClob.Error.t()}

Functions

encode_body(body)

@spec encode_body(term()) :: String.t() | nil

Encodes request bodies into the exact JSON bytes used for HMAC signing.

private_request(client, method, path, opts \\ [])

@spec private_request(PolymarketClob.Client.t(), atom(), String.t(), keyword()) ::
  result()

Performs a private authenticated request using L2 CLOB credentials.

public_request(method, path, opts \\ [])

@spec public_request(atom(), String.t(), keyword()) :: result()

Performs a public unauthenticated request.