Client.L1SourceProvides L1 (wallet-based) authentication for creating and deriving API keys, plus all public endpoints. L1 authentication uses EIP-712 signatures from the wallet's private key.
val create :
?base_url:string ->
sw:Eio.Switch.t ->
net:_ Eio.Net.t ->
rate_limiter:Polymarket_rate_limiter.Rate_limiter.t ->
private_key:Crypto.private_key ->
unit ->
tCreate a new L1-authenticated CLOB client.
val create_api_key :
t ->
nonce:int ->
(Auth.api_key_response, Polymarket_http.Client.error) resultCreate a new API key using L1 wallet authentication. Returns the API key, secret, and passphrase.
val derive_api_key :
t ->
nonce:int ->
(l2 * Auth.api_key_response, Polymarket_http.Client.error) resultDerive API key from wallet and automatically upgrade to L2 client. Returns both the L2 client and the raw response (for credential storage).
val get_order_book :
t ->
token_id:string ->
unit ->
(Types.order_book_summary, Polymarket_http.Client.error) resultval get_order_books :
t ->
token_ids:string list ->
unit ->
(Types.order_book_summary list, Polymarket_http.Client.error) resultval get_price :
t ->
token_id:string ->
side:Polymarket_clob.Types.Side.t ->
unit ->
(Types.price_response, Polymarket_http.Client.error) resultval get_midpoint :
t ->
token_id:string ->
unit ->
(Types.midpoint_response, Polymarket_http.Client.error) resultval get_prices :
t ->
requests:(string * Polymarket_clob.Types.Side.t) list ->
unit ->
(Types.prices_response, Polymarket_http.Client.error) resultval get_spreads :
t ->
token_ids:string list ->
unit ->
(Types.spreads_response, Polymarket_http.Client.error) resultval get_price_history :
t ->
market:string ->
?start_ts:int ->
?end_ts:int ->
?interval:Types.Interval.t ->
?fidelity:int ->
unit ->
(Types.price_history, Polymarket_http.Client.error) result