Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coinables/775a696d068425aa361c70e810d9cd60 to your computer and use it in GitHub Desktop.
Save coinables/775a696d068425aa361c70e810d9cd60 to your computer and use it in GitHub Desktop.
bittrex
$apikey = "your_key";
$apisecret = "your_secret":
function bittrexbalance($apikey, $apisecret){
$nonce=time();
$uri='https://bittrex.com/api/v1.1/account/getbalances?apikey='.$apikey.'&nonce='.$nonce;
$sign=hash_hmac('sha512',$uri,$apisecret);
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$execResult = curl_exec($ch);
$obj = json_decode($execResult, true);
return $obj;
}
$mybal = bittrexbalance($apikey, $apisecret);
var_dump($mybal);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment