Created
August 5, 2017 19:24
-
-
Save coinables/eb5d2af7a18cdaf19164b04309ea19d8 to your computer and use it in GitHub Desktop.
EthexindiaPHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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