Skip to content

Commit 6317091

Browse files
authored
Merge pull request #8 from swaylock/7-returnOrderStatus
Add returnOrderStatus to Trading API.
2 parents 6c7f061 + cd9bcba commit 6317091

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.styleci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ preset: none
22

33
#risky: false
44

5-
linting: true
6-
75
enabled:
86
#- align_double_arrow
97
#- align_equals

src/PoloniexAPITrading.php

+29
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,35 @@ public function returnOrderTrades($orderNumber) {
182182
]);
183183
}
184184

185+
/**
186+
* Returns the status of a given order, specified by the "orderNumber" POST
187+
* parameter. If the specified orderNumber is not open, or it is not yours,
188+
* you will receive an error.
189+
*
190+
* Note that returnOrderStatus, in concert with returnOrderTrades, can be
191+
* used to determine various status information about an order:
192+
*
193+
* - If returnOrderStatus returns status: "Open", the order is fully open.
194+
* - If returnOrderStatus returns status: "Partially filled", the order is
195+
* partially filled, and returnOrderTrades may be used to find the list
196+
* of those fills.
197+
* - If returnOrderStatus returns an error and returnOrderTrades returns an
198+
* error, then the order was cancelled before it was filled
199+
* - If returnOrderStatus returns an error and returnOrderTrades returns a
200+
* list of trades, then the order had fills and is no longer open (due
201+
* to being completely filled, or partially filled and then cancelled).
202+
*
203+
* @param string $orderNumber Order number.
204+
*
205+
* @return json
206+
*/
207+
public function returnOrderStatus($orderNumber) {
208+
return $this->request->exec([
209+
'command' => 'returnOrderStatus',
210+
'orderNumber' => $orderNumber
211+
]);
212+
}
213+
185214
/**
186215
* Places a limit buy order in a given market. Required POST parameters are
187216
* "currencyPair", "rate", and "amount". If successful, the method will return

0 commit comments

Comments
 (0)