Author

Topic: . (Read 196 times)

legendary
Activity: 2506
Merit: 1030
Twitter @realmicroguy
.
March 03, 2018, 11:56:07 AM
#4
full member
Activity: 384
Merit: 101
March 02, 2018, 08:02:58 AM
#3
Try this code:

Code:

ini_set
('display_errors''On');
error_reporting(E_ALL);

// Generate random amount between 28.00 and 30.00
$ran1 mt_rand(28003000);
$ran2 $ran1/100;

// Config
$sAPIKey ""// private key
$sAPISecret ""// api secret

$sPair "GLD_BTC";
$sRate "0.0001";
$sNonce time();
$sRequest "https://www.tradesatoshi.com/api/private/submitorder";

$ch curl_init();
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);

// disable cert validation
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);


$rParam = array('Market' => $sPair'Type' => 'Buy''Amount' => $ran2'Price' => $sRate);
$rParam json_encode($rParam);
$rSignature $sAPIKey 'POST' strtolower(urlencode($sRequest)) . $sNonce base64_encode($rParam);
$hmac_sign base64_encode(hash_hmac('sha512'$rSignaturebase64_decode($sAPISecret), true));
$header 'Basic ' $sAPIKey ':' $hmac_sign ':' $sNonce;
$headers = array("Content-Type: application/json; charset=utf-8""Authorization: $header");
curl_setopt($chCURLOPT_HTTPHEADER$headers);
curl_setopt($chCURLOPT_URL$sRequest);
curl_setopt($chCURLOPT_POSTFIELDS$rParam);
// run the query
$execResult curl_exec($ch);

var_dump($execResult);


BTC AddressBTC: 1EjmkQq7pHsmKhhrpP3hcGehq3ryAF3Qrb

newbie
Activity: 14
Merit: 0
March 02, 2018, 12:10:53 AM
#2
Well for starters,
 echo $sRequest; is a de-bug request, not sure what your going for fully here since you use Hungarian Notion.

Then $execResult = curl_exec($ch); is right out of the PHP Docs so you may wanna fit that to what your looking for more.

That should get you ahead a decent amount!

BTC - 3Bt5TVKGGdJqUFSBrLf5WyckavmPRUc5hT

EDIT - I guess I wont get my BTC Sad
legendary
Activity: 2506
Merit: 1030
Twitter @realmicroguy
March 01, 2018, 10:22:50 PM
#1
.
Jump to: