Skip to content

Instantly share code, notes, and snippets.

@coinables
Created August 5, 2017 19:24
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/eb5d2af7a18cdaf19164b04309ea19d8 to your computer and use it in GitHub Desktop.
Save coinables/eb5d2af7a18cdaf19164b04309ea19d8 to your computer and use it in GitHub Desktop.
EthexindiaPHP
<?php
$APIkey = "yourAPIkey"; //change to your apikey
$ClientId = "yourClientId"; //change to your clientID
$secret = "yourAPIsecret"; //change to your API secret, provided when you get your API key
$nonce = microtime();
$Data = $nonce.$APIkey.$ClientId;
$hmac = base64_encode(hash_hmac('sha256', $Data, $secret, true));
$type = "buy"; //buy or sell
$volume = 1; //how many ether to buy
$price = 1500; //the price to pay in INR
$ch = curl_init();
$url = "https://api.ethexindia.com/trade?key=".$APIkey."&signature=".$hmac."&nonce=".$nonce."&type=".$type."&volume=".$volume."&price=".$price;
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
));
$ccc = curl_exec($ch);
$print_r($ccc);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment