package polymarket
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=4eb4c5d2f63ff081c9713d90be5a51b2
sha512=0e3de0c9b40683e09ab8f9f966a44784ef1b9b482c3eefef84104a7e8042c92f1d79893ee9588b24fa3d0decaed7f365509f4d1c23c66ce8328efb64e721f276
doc/polymarket.common/Polymarket_common/Crypto/index.html
Module Polymarket_common.CryptoSource
Cryptographic utilities for Polymarket API authentication.
This module provides EIP-712 signing for L1 authentication, HMAC-SHA256 signing for L2 authentication, and Ethereum address derivation.
Types
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.
Hashing
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 for L2 Authentication
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.
EIP-712 for L1 Authentication
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.
Utilities
Derive Ethereum address from private key. Returns 0x-prefixed address.
Get current Unix timestamp in milliseconds as string.