PolymarketClob.API.Account (PolymarketClob v0.2.0)

Copy Markdown View Source

Private CLOB account endpoint wrappers.

These functions require a PolymarketClob.Client with complete L2 credentials and are intentionally thin wrappers over PolymarketClob.HTTP.

Summary

Functions

Reports scoring (reward-eligibility) status for a list of order IDs.

Drops notifications via DELETE /notifications.

Lists API keys for the authenticated account.

Gets closed-only ban status for the authenticated account.

Gets notifications for the authenticated account.

Gets a single order by order ID.

Gets pre-migration orders directly from the CLOB data endpoint.

Gets a single page of trade history.

Reports whether a single order is in the scoring (reward-eligible) set.

Updates balance and allowance via the official GET /balance-allowance/update endpoint.

Types

result()

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

Functions

are_orders_scoring(client, order_ids, opts \\ [])

@spec are_orders_scoring(PolymarketClob.Client.t(), [String.t()], keyword()) ::
  result()

Reports scoring (reward-eligibility) status for a list of order IDs.

The body is a JSON array of order ID strings, matching the Python client's are_orders_scoring(order_ids) shape.

drop_notifications(client, params \\ [], opts \\ [])

@spec drop_notifications(PolymarketClob.Client.t(), keyword() | map(), keyword()) ::
  result()

Drops notifications via DELETE /notifications.

Accepted params mirror the Python client: :ids, a list of notification IDs joined into the ids query parameter.

get_api_keys(client, opts \\ [])

@spec get_api_keys(
  PolymarketClob.Client.t(),
  keyword()
) :: result()

Lists API keys for the authenticated account.

get_balance_allowance(client, params \\ [], opts \\ [])

@spec get_balance_allowance(PolymarketClob.Client.t(), keyword(), keyword()) ::
  result()

Gets balance and allowance.

signature_type is always included, matching the official client. Optional params: :asset_type and :token_id.

get_closed_only_mode(client, opts \\ [])

@spec get_closed_only_mode(
  PolymarketClob.Client.t(),
  keyword()
) :: result()

Gets closed-only ban status for the authenticated account.

get_notifications(client, opts \\ [])

@spec get_notifications(
  PolymarketClob.Client.t(),
  keyword()
) :: result()

Gets notifications for the authenticated account.

get_open_orders(client, params \\ [], opts \\ [])

@spec get_open_orders(PolymarketClob.Client.t(), keyword(), keyword()) :: result()

Gets open orders.

Accepted params mirror the Python client: :market, :asset_id, :id, and :next_cursor.

get_order(client, order_id, opts \\ [])

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

Gets a single order by order ID.

get_pre_migration_orders(client, params \\ [], opts \\ [])

@spec get_pre_migration_orders(PolymarketClob.Client.t(), keyword(), keyword()) ::
  result()

Gets pre-migration orders directly from the CLOB data endpoint.

get_trades(client, params \\ [], opts \\ [])

@spec get_trades(PolymarketClob.Client.t(), keyword(), keyword()) :: result()

Gets trade history.

Accepted params mirror the Python client: :market, :asset_id, :id, :after, :before, :maker_address, and :next_cursor.

get_trades_paginated(client, params \\ [], opts \\ [])

@spec get_trades_paginated(PolymarketClob.Client.t(), keyword(), keyword()) ::
  result()

Gets a single page of trade history.

Same path and signing scope as get_trades/3. This wrapper exposes the Python get_trades_paginated name for callers that want the explicit page shape (%{"trades" => [...], "next_cursor" => ..., "limit" => ..., "count" => ...}). Both wrappers are direct-page calls; auto-pagination is intentionally not provided here (see ENDPOINT_COVERAGE.md § Pagination Policy).

is_order_scoring(client, params \\ [], opts \\ [])

@spec is_order_scoring(PolymarketClob.Client.t(), keyword(), keyword()) :: result()

Reports whether a single order is in the scoring (reward-eligible) set.

Accepts an optional :order_id query param. With no params, the endpoint returns scoring status for the authenticated account using whatever default the CLOB applies; mirror Python by passing [order_id: id] for an exact query.

update_balance_allowance(client, params \\ [], opts \\ [])

@spec update_balance_allowance(PolymarketClob.Client.t(), keyword(), keyword()) ::
  result()

Updates balance and allowance via the official GET /balance-allowance/update endpoint.

The current Python client models this write as an L2-authenticated GET with query params. signature_type is always included. Optional params: :asset_type and :token_id.