Нужна помощь в перекодировки из PHP в Googel-App-Script [требует правки]

174
06 апреля 2018, 16:26

Есть пример кода на PHP авторизации на криптобирже. Я работаю с Google Sheets и нужна эта авторизация на языке Google-App-Script

$apikey='xxxxxxx';
$apisecret='xxxxxxx';
$nonce=time();
$uri='https://c-cex.com/t/api.html?a=getbalance&currency=BTC&apikey='.$apikey.'&nonce='.$nonce;
$sign=hash_hmac('sha512',$uri,$apisecret);
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
$execResult = curl_exec($ch);
$obj = json_decode($execResult);

Вообщем тут еще такое примечание:

We use a standard HMAC-SHA512 signing. Append apikey and nonce to your request and calculate the HMAC hash and include it under an apisign header.

А полное описание тут.

READ ALSO
Как сделать свой $this->title yii2

Как сделать свой $this->title yii2

В yii2 есть public $title ($this->title); Где он создан и как создать свой?

228