Не получается выполнить запрос, выдает ошибку {"messages":["the_tonce_is_invalid"]}
Ошибка связана с меткой времени, но никак не получается ее побороть. Может есть идеи?
<?php
require __DIR__.'/../vendor/autoload.php';
use GuzzleHttp\Client;
$public_key = '';
$secret_key = '';
$client = new Client([
'base_uri' => 'https://api.kuna.io',
]);
// $api_path = '/v3/auth/kuna_codes/issued-by-me';
$api_path = '/v3/auth/me';
$nonce = strval(date_timestamp_get(date_create()));
// $nonce = time();
$data = (object) [];
$headers = [
// 'accept' => 'application/json',
// 'content-type' => 'application/json',
'kun-nonce' => $nonce,
'kun-apikey' => $public_key,
'kun-signature' => hash_hmac('sha384', $api_path.$nonce.json_encode($data), $secret_key),
];
$options = [
'form_params' => $data,
'headers' => $headers,
'http_errors' => false,
// 'debug' => true,
];
print_r($options);
// var_dump($options);
$response = $client->request('POST', $api_path, $options);
$result = $response->getBody()->getContents();
print_r($result);