package polymarket
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Module Polymarket_common.AuthSource
Authentication 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.
Types
API credentials for L2 authentication.
Response from API key endpoints (create or derive).
Conversion
Convert API key response to credentials.
L1 Authentication
L1 authentication uses EIP-712 signed messages to prove wallet ownership. It's used for creating and deriving API credentials.
Source
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
L2 authentication uses HMAC-SHA256 to sign requests using API credentials. It's used for authenticated trading and account management endpoints.
Source
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.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page