Polymarket.Schemas.Geoblock (Polymarket v0.1.1)

Copy Markdown View Source

The geoblock status for the caller, as returned by GET /api/geoblock on the Polymarket site (https://polymarket.com).

Reports whether the request is blocked, along with the detected ip, country, and region. The keys arrive already lower-cased, so from_attrs/1 normalisation is a no-op here but kept for consistency with the other schemas.

Summary

Functions

Builds a Geoblock from the raw (JSON-decoded) attributes returned by the geoblock endpoint. Keys may be in camelCase (atom or string); they are normalised to the snake_case fields. Returns {:error, {:missing_fields, fields}} when the blocked flag is absent.

Types

t()

@type t() :: %Polymarket.Schemas.Geoblock{
  blocked: boolean() | nil,
  country: String.t() | nil,
  ip: String.t() | nil,
  region: String.t() | nil
}

Functions

from_attrs(attrs)

@spec from_attrs(map()) :: {:ok, t()} | {:error, {:missing_fields, [atom()]}}

Builds a Geoblock from the raw (JSON-decoded) attributes returned by the geoblock endpoint. Keys may be in camelCase (atom or string); they are normalised to the snake_case fields. Returns {:error, {:missing_fields, fields}} when the blocked flag is absent.