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
| Key | Location | Default | Purpose |
|---|---|---|---|
:channel | config | "spot.login" | Login channel (per-market override) |
:request_id | opts | to_string(System.unique_integer([:positive])) | Correlation id |
:timestamp_ms_override | config | (unset) | Test-only — freezes the clock |