-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Time02/master
add mix request
- Loading branch information
Showing
6 changed files
with
181 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Lin\Coinex; | ||
|
||
class CoinexMix extends Request | ||
{ | ||
protected $spot; //现货类 | ||
protected $futures; //合约类 | ||
|
||
/** | ||
* CoinexMix constructor. | ||
* @param $spot | ||
* @param $futures | ||
*/ | ||
function __construct($spot,$futures){ | ||
$this->spot=$spot; | ||
$this->futures=$futures; | ||
} | ||
|
||
/** | ||
* 异步同时获取期货和现货盘口 | ||
* @param array $spotParam | ||
* @param array $futuresParam | ||
* @param string $spotName | ||
* @param string $futuresName | ||
* @return array | ||
* @throws Exceptions\Exception | ||
*/ | ||
function mixGetMarketDepthAsync(array $spotParam,array $futuresParam,string $spotName,string $futuresName){ | ||
$requestParams = []; | ||
$requestParams[] = $this->spot->market()->getMarketDepthRequestParams($spotParam,$spotName); | ||
$requestParams[] = $this->futures->market()->getMarketDepthRequestParams($futuresParam,$futuresName); | ||
return $this->execAsync($requestParams); | ||
} | ||
|
||
/** | ||
* 异步现货,期货同时下单 | ||
* @param array $spotData | ||
* @param array $futuresData | ||
* @param string $spotName | ||
* @param string $futuresName | ||
* @return array | ||
* @throws Exceptions\Exception | ||
*/ | ||
function mixPostOrderAsync(array $spotData,array $futuresData,string $spotName,string $futuresName){ | ||
$requestParams = []; | ||
$requestParams[] = $this->spot->trading()->postLimitRequestParams($spotData,$spotName); | ||
$requestParams[] = $this->futures->order()->postPutLimitRequestParams($futuresData,$futuresName); | ||
return $this->execAsync($requestParams); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters