my PHP's a little rusty, but try this:
<?php
error_reporting(E_ALL);
$secret = "daFsnQNdKXXXXXXXXS8ORTZex";
$api = "R1zuvCTHXXXXXXXeJbYF8U5DXZ";
$user = "saXXXXXXX@ail.com";
$d = "currency_markets/order_history";
$nonce = round(microtime(true), 100).round(microtime(true), 100);
$message = $nonce . $user . $api;
$sig = hash_hmac('sha256', $message, $secret);
$URL = "https://www.hashnest.com/api/v1/" . $d .
"?access_key=" . $api .
"&nonce=" . $nonce .
"&signature=" . $sig .
"¤cy_market_id=19&category=sale";
$result = array();
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
$result = curl_exec($ch);
curl_close($ch);
print_r(json_decode($result));
all i've done there is tidy up a bit and put a couple commas between the arguments in your calls to round()
(i also added error_reporting(E_ALL)
, but depending on your host's configuration, it may not have any effect)
[edit: changed to a GET request as per @Daffy's comments; removed redundant json_decode()
call]