Skip to content

Commit

Permalink
Update Path
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Sep 10, 2019
1 parent f8409e7 commit a8ca16c
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 28 deletions.
116 changes: 94 additions & 22 deletions src/Api/Futures/Contract.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,87 @@ public function getContractInfo(array $data=[]){
return $this->exec();
}

public function getIndex(array $data){
/**
* GET api/v1/contract_index
* */
public function getIndex(array $data=[]){
$this->type='GET';
$this->path='/api/v1/contract_index';
$this->data=$data;
return $this->exec();
}

/**
* GET api/v1/contract_price_limit
* */
public function getPriceLimit(array $data=[]){
$this->type='GET';
$this->path='/api/v1/contract_price_limit';
$this->data=$data;
return $this->exec();
}

/**
* GET api/v1/contract_open_interest
* */
public function getOpenInterest(array $data=[]){
$this->type='GET';
$this->path='/api/v1/contract_open_interest';
$this->data=$data;
return $this->exec();
}

/**
*GET api/v1/contract_delivery_price
* */
public function getDeliveryPrice(array $data=[]){
$this->type='GET';
$this->path='/api/v1/contract_delivery_price';
$this->data=$data;
return $this->exec();
}

/**
*GET api/v1/contract_risk_info
* */
public function getRiskInfo(array $data=[]){
$this->type='GET';
$this->path='';
$this->path='/api/v1/contract_risk_info';
$this->data=$data;
return $this->exec();
}

public function getPriceLimit(array $data){
/**
*GET `api/v1/contract_insurance_fund
* */
public function getInsuranceFund(array $data=[]){
$this->type='GET';
$this->path='';
$this->path='/api/v1/contract_insurance_fund';
$this->data=$data;
return $this->exec();
}

public function getOpenInterest(array $data){
/**
*GET api/v1/contract_adjustfactor
* */
public function getAdjustfactor(array $data=[]){
$this->type='GET';
$this->path='';
$this->path='/api/v1/contract_adjustfactor';
$this->data=$data;
return $this->exec();
}

public function getDeliveryPrice(array $data){
/**
*GET api/v1/contract_his_open_interest
* */
public function getHisOpenInterest(array $data=[]){
$this->type='GET';
$this->path='';
$this->path='/api/v1/contract_his_open_interest';
$this->data=$data;
return $this->exec();
}


/**
* 获取用户账户信息
* symbol false string 品种代码 "BTC","ETH"...如果缺省,默认返回所有品种
Expand Down Expand Up @@ -89,7 +142,7 @@ public function postPositionInfo(array $data=[]){
lever_rate int true 杠杆倍数[“开仓”若有10倍多单,就不能再下20倍多单]
order_price_type string true 订单报价类型 "limit":限价 "opponent":对手价
* */
public function postOrder(array $data){
public function postOrder(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_order';

Expand All @@ -103,7 +156,7 @@ public function postOrder(array $data){
/**
*
* */
public function postBatchOrder(array $data){
public function postBatchOrder(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_batchorder';
$this->data=$data;
Expand All @@ -119,7 +172,7 @@ public function postBatchOrder(array $data){
client_order_id false string 客户订单ID(多个订单ID中间以","分隔,一次最多允许撤消50个订单)
symbol true string "BTC","ETH"...
* */
public function postCancel(array $data){
public function postCancel(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_cancel';
$this->data=$data;
Expand All @@ -129,7 +182,7 @@ public function postCancel(array $data){
/**
* symbol true string 品种代码,如"BTC","ETH"...
* */
public function postCancelAll(array $data){
public function postCancelAll(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_cancelall';
$this->data=$data;
Expand All @@ -142,30 +195,49 @@ public function postCancelAll(array $data){
client_order_id false string 客户订单ID(多个订单ID中间以","分隔,一次最多允许查询20个订单)
symbol true string "BTC","ETH"...
* */
public function postOrderInfo(array $data){
public function postOrderInfo(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_order_info';
$this->data=$data;
return $this->exec();
}

public function postOrderDetail(array $data){
$this->type='GET';
$this->path='';
/**
*POST api/v1/contract_order_detail
* */
public function postOrderDetail(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_order_detail';
$this->data=$data;
return $this->exec();
}

public function postOpenOrders(array $data){
$this->type='GET';
$this->path='';
/**
* POST api/v1/contract_openorders
* */
public function postOpenOrders(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_openorders';
$this->data=$data;
return $this->exec();
}

public function postHisorders(array $data){
$this->type='GET';
$this->path='';
/**
*POST api/v1/contract_hisorders
* */
public function postHisorders(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_hisorders';
$this->data=$data;
return $this->exec();
}

/**
*POST api/v1/contract_matchresults
* */
public function postMatchresults(array $data=[]){
$this->type='POST';
$this->path='/api/v1/contract_matchresults';
$this->data=$data;
return $this->exec();
}
Expand Down
18 changes: 12 additions & 6 deletions src/Api/Futures/Market.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Market extends Request
step0时,不合并深度, (20档数据) step6, step7, step8, step9, step10, step11(合并深度7-11);
step6时,不合并深度
* */
public function getDepth(array $data){
public function getDepth(array $data=[]){
$this->type='GET';
$this->path='/market/depth';

Expand All @@ -28,16 +28,22 @@ public function getDepth(array $data){
return $this->exec();
}

public function getHistoryKline(array $data){
/**
* GET /market/history/kline
* */
public function getHistoryKline(array $data=[]){
$this->type='GET';
$this->path='/market/history/kline';
$this->data=$data;
return $this->exec();
}

public function getDetailMerged(array $data){
/**
* GET /market/detail/merged
* */
public function getDetailMerged(array $data=[]){
$this->type='GET';
$this->path='';
$this->path='/market/detail/merged';
$this->data=$data;
return $this->exec();
}
Expand All @@ -46,7 +52,7 @@ public function getDetailMerged(array $data){
* 获取市场最近成交记录
* symbol true string 合约名称 如"BTC_CW"表示BTC当周合约,"BTC_NW"表示BTC次周合约,"BTC_CQ"表示BTC季度合约
* */
public function getTrade(array $data){
public function getTrade(array $data=[]){
$this->type='GET';
$this->path='/market/trade';
$this->data=$data;
Expand All @@ -58,7 +64,7 @@ public function getTrade(array $data){
* symbol true string 合约名称 如"BTC_CW"表示BTC当周合约,"BTC_NW"表示BTC次周合约,"BTC_CQ"表示BTC季度合约
size false number 获取交易记录的数量 1 [1, 2000]
* */
public function getHistoryTrade(array $data){
public function getHistoryTrade(array $data=[]){
$this->type='GET';
$this->path='/market/history/trade';

Expand Down

0 comments on commit a8ca16c

Please sign in to comment.