正在显示
3 个修改的文件
包含
35 行增加
和
0 行删除
| @@ -787,4 +787,18 @@ class CmBroker | @@ -787,4 +787,18 @@ class CmBroker | ||
| 787 | return $this->exBroker->cancelOrder($symbolOri, $cliOrdId, $orderId); | 787 | return $this->exBroker->cancelOrder($symbolOri, $cliOrdId, $orderId); |
| 788 | } | 788 | } |
| 789 | } | 789 | } |
| 790 | + public function getOrder($symbol, $cliOrdId = "", $orderId = ""): ?WsDataOrder | ||
| 791 | + { | ||
| 792 | + $symbolOri = $this->getSymbolOri($symbol); | ||
| 793 | + if ($this->plat == self::PLAT_OKX) { | ||
| 794 | + $res = $this->exBroker->getOrder($symbolOri, $cliOrdId, $orderId); | ||
| 795 | + if (isset($res['data']) && isset($res['data'][0])) { | ||
| 796 | + $data = $res['data'][0]; | ||
| 797 | + return WsDataOrder::TransferOkxOrder($data, $this->symbolInfos, function ($symbol) { | ||
| 798 | + return $this->getSymbolSt($symbol); | ||
| 799 | + }); | ||
| 800 | + } | ||
| 801 | + } | ||
| 802 | + return null; | ||
| 803 | + } | ||
| 790 | } | 804 | } |
| @@ -86,6 +86,13 @@ class Api | @@ -86,6 +86,13 @@ class Api | ||
| 86 | $method = 'POST'; | 86 | $method = 'POST'; |
| 87 | return $this->request($path, $method, $param, $this->apiInfo); | 87 | return $this->request($path, $method, $param, $this->apiInfo); |
| 88 | } | 88 | } |
| 89 | + //查询订单 | ||
| 90 | + public function getOrder($param) | ||
| 91 | + { | ||
| 92 | + $path = '/api/v5/trade/order'; | ||
| 93 | + $method = 'GET'; | ||
| 94 | + return $this->request($path, $method, $param, $this->apiInfo); | ||
| 95 | + } | ||
| 89 | //撤销订单 | 96 | //撤销订单 |
| 90 | public function cancelOrder($param) | 97 | public function cancelOrder($param) |
| 91 | { | 98 | { |
| @@ -121,6 +128,7 @@ class Api | @@ -121,6 +128,7 @@ class Api | ||
| 121 | $method = 'POST'; | 128 | $method = 'POST'; |
| 122 | return $this->request($path, $method, $param, $this->apiInfo); | 129 | return $this->request($path, $method, $param, $this->apiInfo); |
| 123 | } | 130 | } |
| 131 | + //获取账户配置 | ||
| 124 | public function getAccountConfig($param = []) | 132 | public function getAccountConfig($param = []) |
| 125 | { | 133 | { |
| 126 | $path = '/api/v5/account/config'; | 134 | $path = '/api/v5/account/config'; |
| @@ -400,4 +400,17 @@ class ExBroker | @@ -400,4 +400,17 @@ class ExBroker | ||
| 400 | } | 400 | } |
| 401 | return $this->api->cancelOrder($param); | 401 | return $this->api->cancelOrder($param); |
| 402 | } | 402 | } |
| 403 | + public function getOrder($symbol, $cliOrdId = "", $ordId = "") | ||
| 404 | + { | ||
| 405 | + $param = [ | ||
| 406 | + 'instId' => $symbol | ||
| 407 | + ]; | ||
| 408 | + if ($cliOrdId != "") { | ||
| 409 | + $param['clOrdId'] = $cliOrdId; | ||
| 410 | + } | ||
| 411 | + if ($ordId != "") { | ||
| 412 | + $param['ordId'] = $ordId; | ||
| 413 | + } | ||
| 414 | + return $this->api->getOrder($param); | ||
| 415 | + } | ||
| 403 | } | 416 | } |
-
请 注册 或 登录 后发表评论