CCXT.WS.Auth.Sha512Newline (ccxt_client v0.6.1)

Copy Markdown View Source

SHA512 Newline auth pattern — gate, gateio.

Signs "{event}\n{channel}\n{req_params_json}\n{time_s}" with HMAC-SHA512 hex and wraps in a two-level frame (outer envelope + inner payload map).

Example Frame (gate)

%{
  "id" => "request_id",
  "time" => 1699999999,
  "channel" => "spot.login",
  "event" => "api",
  "payload" => %{
    "req_id" => "request_id",
    "timestamp" => "1699999999",
    "api_key" => "api_key",
    "signature" => "hex_signature",
    "req_param" => %{}
  }
}

Config / opts

KeyLocationDefaultPurpose
:channelconfig"spot.login"Login channel (per-market override)
:request_idoptsto_string(System.unique_integer([:positive]))Correlation id
:timestamp_ms_overrideconfig(unset)Test-only — freezes the clock