-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_offer.php
More file actions
49 lines (39 loc) · 1.31 KB
/
new_offer.php
File metadata and controls
49 lines (39 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
$main_api_url = 'https://api.bitcurex.com/';
$market = ''; //example: 'pln' or 'eur'
$api_user_id = '';
$api_key = '';
$api_secret = '';
$limit = ''; // example: '1900'
$volume = ''; // example: '0.003'
$offer_type = ''; // example: 'ask'
function putOffer($url, $params){
$data_string = json_encode($params);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
)
);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
$url = $main_api_url.'offer/'.$market.'/'.$api_user_id.'/'.$api_key;
$params = array(
'limit' => $limit,
'volume' => $volume,
'offer_type' => $offer_type,
'api_secret' => $api_secret
);
var_dump(
json_decode(
putOffer($url, $params)
)
);
?>