CCXT.Signing.HmacSha256Iso (ccxt_client v0.6.1)

Copy Markdown View Source

HMAC-SHA256 with ISO timestamp and passphrase (OKX-style).

Used by: OKX, Coinbase, and ~10 other exchanges.

How it works

  1. Create ISO8601 timestamp
  2. Build payload: timestamp + METHOD + path + body
  3. Sign with HMAC-SHA256, encode as Base64
  4. Send signature, API key, timestamp, and passphrase in headers

Configuration

signing: %{
  pattern: :hmac_sha256_iso_passphrase,
  api_key_header: "OK-ACCESS-KEY",
  timestamp_header: "OK-ACCESS-TIMESTAMP",
  signature_header: "OK-ACCESS-SIGN",
  passphrase_header: "OK-ACCESS-PASSPHRASE",
  signature_encoding: :base64
}