Closed SnaYxchg closed 5 years ago
Hello @shivamnayyar2003,
This repository is for the C# library only.
You might have better luck asking at and using the official Coinbase library for PHP here: https://github.com/coinbase/coinbase-php
Wish I could help, but I haven't written PHP in 17 years.
Thanks, Brian
`<?php $time = time(); $method = "GET"; $path = '/v2/accounts'; $sign = base64_encode(hash_hmac("sha256", $time.$method.$path, $api_secret));
$headers = array( "CB-VERSION: 2018-12-23" "CB-ACCESS-SIGN: ".$sign, "CB-ACCESS-TIMESTAMP: ".$time, "CB-ACCESS-KEY: ".$api_key, "Content-Type: application/json" );
$ch = curl_init('https://api.coinbase.com'.$path);
curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if(curl_errno($ch)) { echo ': '.curl_error($ch);
}
else
{
var_dump($result);
}
curl_close($ch);
?>`
Please help me fix this