Polymarket_common.AuthSourceAuthentication types and header builders for Polymarket APIs.
This module provides credentials types and functions for building authentication headers for L1 (wallet-based) and L2 (API key-based) authentication.
API credentials for L2 authentication.
Response from API key endpoints (create or derive).
Convert API key response to credentials.
L1 authentication uses EIP-712 signed messages to prove wallet ownership. It's used for creating and deriving API credentials.
val build_l1_headers :
private_key:Crypto.private_key ->
address:string ->
nonce:int ->
(string * string) listBuild L1 authentication headers for wallet-based endpoints.
L2 authentication uses HMAC-SHA256 to sign requests using API credentials. It's used for authenticated trading and account management endpoints.
val build_l2_headers :
credentials:credentials ->
address:string ->
method_:string ->
path:string ->
body:string ->
(string * string) listBuild L2 authentication headers for API key-authenticated endpoints.