Bitcoin Forum
November 06, 2024, 04:14:02 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: .  (Read 218 times)
MicroGuy (OP)
Legendary
*
Offline Offline

Activity: 2506
Merit: 1030


Twitter @realmicroguy


View Profile WWW
March 02, 2018, 02:22:50 AM
Last edit: April 08, 2019, 11:36:30 PM by MicroGuy
 #1

.
SlavicSquats
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
March 02, 2018, 04:10:53 AM
Last edit: March 02, 2018, 05:52:37 AM by SlavicSquats
 #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
MMM005
Full Member
***
Offline Offline

Activity: 384
Merit: 101


View Profile
March 02, 2018, 12:02:58 PM
 #3

Try this code:

Code:
<?php

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

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!