正在显示
1 个修改的文件
包含
5 行增加
和
2 行删除
| @@ -6,6 +6,7 @@ require_once __DIR__ . '/../jytools/BinanceFutures.php'; | @@ -6,6 +6,7 @@ require_once __DIR__ . '/../jytools/BinanceFutures.php'; | ||
| 6 | require_once __DIR__ . '/../jytools/func.php'; | 6 | require_once __DIR__ . '/../jytools/func.php'; |
| 7 | 7 | ||
| 8 | use trader\struct\ApiInfo; | 8 | use trader\struct\ApiInfo; |
| 9 | +use trader\struct\WsData; | ||
| 9 | use trader\CmBroker; | 10 | use trader\CmBroker; |
| 10 | use function jytools\output; | 11 | use function jytools\output; |
| 11 | 12 | ||
| @@ -17,8 +18,10 @@ $restHost = "http://bbapi.keetu.com"; | @@ -17,8 +18,10 @@ $restHost = "http://bbapi.keetu.com"; | ||
| 17 | $broker = new CmBroker(CmBroker::PLAT_BYBIT, $apiInfo, $wsHost, $restHost); | 18 | $broker = new CmBroker(CmBroker::PLAT_BYBIT, $apiInfo, $wsHost, $restHost); |
| 18 | 19 | ||
| 19 | output("开始监听"); | 20 | output("开始监听"); |
| 20 | -$broker->accListen(function ($data) { | ||
| 21 | - var_dump($data); | 21 | +$broker->accListen(function (WsData $data) { |
| 22 | + if ($data->dataType == "order") { | ||
| 23 | + var_dump($data); | ||
| 24 | + } | ||
| 22 | }); | 25 | }); |
| 23 | // $broker->klineListen("BTCUSDT", "1m", function ($data) { | 26 | // $broker->klineListen("BTCUSDT", "1m", function ($data) { |
| 24 | // output($data->toArray()); | 27 | // output($data->toArray()); |
-
请 注册 或 登录 后发表评论