Documentation
¶
Overview ¶
Package polyauth implements Polymarket CLOB authentication and signing helpers.
Index ¶
- func DecodeAPISecret(secret string) ([]byte, error)
- func GenerateKey() (string, error)
- func HMACSignature(secret string, timestamp int64, method, requestPath string, body []byte) (string, error)
- func HMACSignatureBytes(secret []byte, timestamp int64, method, requestPath string, body []byte) string
- func L1Headers(signer *Signer, chainID, timestamp, nonce int64) (map[string]string, error)
- func L2Headers(signer *Signer, key string, secret []byte, passphrase string, timestamp int64, ...) (map[string]string, error)
- func SignTypedData(signer *Signer, typedData apitypes.TypedData) (string, error)
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAPISecret ¶
DecodeAPISecret decodes a URL-safe base64 Polymarket API secret.
func GenerateKey ¶
GenerateKey creates a new secp256k1 private key and returns it as hex.
func HMACSignature ¶
func HMACSignature(secret string, timestamp int64, method, requestPath string, body []byte) (string, error)
HMACSignature signs a request with a base64-encoded Polymarket API secret.
func HMACSignatureBytes ¶
func HMACSignatureBytes(secret []byte, timestamp int64, method, requestPath string, body []byte) string
HMACSignatureBytes signs a request with a decoded Polymarket API secret.
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func ParsePrivateKey ¶
ParsePrivateKey parses a hex-encoded secp256k1 private key.
func (*Signer) PrivateKey ¶
func (s *Signer) PrivateKey() *ecdsa.PrivateKey
PrivateKey returns the underlying ECDSA private key.
Click to show internal directories.
Click to hide internal directories.