<?php
function BitBay_Trading_Api($method, $params = array())
{
$key = "123";
$secret = "321";
$params["method"] = "info";
$params["moment"] = time();
$post = http_build_query($params, "", "&");
$sign = hash_hmac("sha512", $post, $secret);
$headers = array(
"API-Key: " . $key,
"API-Hash: " . $sign,
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, "https://bitbay.net/API/Trading/tradingApi.php");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//$ret = curl_exec($curl);
// return $ret;
return $params["method"];
}
preferences:
26.8 ms | 406 KiB | 5 Q