CCXT.Signing.HmacSha256Kucoin (ccxt_client v0.6.1)

Copy Markdown View Source

HMAC-SHA256 with HMAC-signed passphrase (KuCoin-style).

Used by: KuCoin, KuCoin Futures, and ~3 other exchanges.

How it works

  1. Create millisecond timestamp
  2. Build payload: timestamp + METHOD + endpoint + body
  3. Sign payload with HMAC-SHA256, encode as Base64
  4. Also sign the passphrase with HMAC-SHA256 (v2 API keys)
  5. Send all in headers

Configuration

signing: %{
  pattern: :hmac_sha256_passphrase_signed,
  api_key_header: "KC-API-KEY",
  timestamp_header: "KC-API-TIMESTAMP",
  signature_header: "KC-API-SIGN",
  passphrase_header: "KC-API-PASSPHRASE",
  api_key_version_header: "KC-API-KEY-VERSION",
  api_key_version: "2"
}