pool/web/yaamp/core/exchange/graviex.php
Jia Wu 31441a6c98 markets: handle graviex ticker (#252)
manual only, so market row need to be created manually if really required.
2018-04-01 05:06:54 +02:00

23 lines
547 B
PHP

<?php
// https://graviex.net/api/v2/tickers.json
function graviex_api_query($method, $params='')
{
$uri = "https://graviex.net/api/v2/{$method}";
if (!empty($params)) $uri .= "/{$params}";
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$execResult = strip_tags(curl_exec($ch));
// array required for ticker "foreach"
$obj = json_decode($execResult, true);
return $obj;
}