Skip to content

Commit

Permalink
throw new buy sell failed
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed May 19, 2021
1 parent b7944df commit e43a415
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Api/Trader.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function buy(array $data,bool $show=true){
if(!$show) return $trader;

//如果交易所返回订单不存在抛出异常
if(empty($trader['_order_id'])) throw new \Exception('Order does not exist.');
if(empty($trader['_order_id'])) throw new \Exception('Buy Failed');

//交易所是撮合交易,所以查询需要间隔时间
sleep(Exchanges::$TRADER_SHOW_TIME);
Expand Down Expand Up @@ -113,7 +113,7 @@ function sell(array $data,bool $show=true){
if(!$show) return $trader;

//如果交易所返回订单不存在抛出异常
if(empty($trader['_order_id'])) throw new \Exception('Order does not exist.');
if(empty($trader['_order_id'])) throw new \Exception('Sell Failed');

//交易所是撮合交易,所以查询需要间隔时间
sleep(Exchanges::$TRADER_SHOW_TIME);
Expand Down

0 comments on commit e43a415

Please sign in to comment.