Polymarket_common.CryptoSourceCryptographic utilities for Polymarket API authentication.
This module provides EIP-712 signing for L1 authentication, HMAC-SHA256 signing for L2 authentication, and Ethereum address derivation.
Abstract type for a 32-byte private key (64 hex chars, no 0x prefix).
Create a private key from a hex string (64 chars, no 0x prefix).
Convert a private key to its hex string representation.
Compute keccak256 hash of bytes, returns hex string with 0x prefix.
Compute keccak256 hash of hex-encoded data (no 0x prefix), returns hex string with 0x prefix.
HMAC-SHA256 of message with raw key bytes, returns raw bytes.
val sign_l2_request :
secret:string ->
timestamp:string ->
method_:string ->
path:string ->
body:string ->
stringGenerate L2 authentication signature. secret is base64-encoded. Returns base64-encoded signature.
val sign_clob_auth_message :
private_key:private_key ->
address:string ->
timestamp:string ->
nonce:int ->
stringSign the CLOB authentication message using EIP-712. Returns hex signature with 0x prefix.
Derive Ethereum address from private key. Returns 0x-prefixed address.
Get current Unix timestamp in milliseconds as string.