bitmex API - 주문리스트 가져오기(order list)
$apiKey = "";
$apiSecret = "";
$verb = 'GET';
$path = '/api/v1/order?filter=';
$expires = time() + ( 60 * 60 );
$message = $verb.$path.$expires;
$signature = hash_hmac('sha256', $message, $apiSecret);
$headers = array(
'content-type: application/json',
'Accept: application/json',
'X-Requested-With: XMLHttpRequest',
'api-expires: '.$expires,
'api-key: '.$apiKey,
'api-signature: '.$signature
);
$arg = array(
'header' => $headers,
'url' => 'https://www.bitmex.com'.$path,
'method' => $verb,
);
//print_r2($arg);exit;
$result = get_curl($arg);
$result = json_decode($result, true);
//print_r($result);exit;
=================================================================================
get_curl 함수 이외엔 모두 php 내장 함수라 그냥 사용하면 됨.
get_curl 함수원형은 자체 제작 함수지만, 여태껏 많이 보여준 관계로 굳이 저술하지 않았습니다.