Skip to content

Commit

Permalink
Add $params to function orders by max-grim
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggedsoft authored Nov 10, 2019
2 parents c8941f9 + f9ada9b commit 9e5edfc
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ public function marketBuyTest(string $symbol, $quantity, array $flags = [])
* @return integer (signifcant digits) based on the minimum order amount
*/
public function numberOfDecimals($val = 0.00000001) {
$val = sprintf("%.18f", $val);
$val = sprintf("%.18f", $val);
$parts = explode('.', $val);
$parts[1] = rtrim($parts[1], "0");
$parts[1] = rtrim($parts[1], "0");
return strlen($parts[1]);
}

Expand Down Expand Up @@ -444,16 +444,22 @@ public function openOrders(string $symbol = null)
* @param $symbol string the currency symbol
* @param $limit int the amount of orders returned
* @param $fromOrderId string return the orders from this order onwards
* @param $params array optional startTime, endTime parameters
* @return array with error message or array of orderDetails array
* @throws \Exception
*/
public function orders(string $symbol, int $limit = 500, int $fromOrderId = 1)
public function orders(string $symbol, int $limit = 500, int $fromOrderId = 1, array $params = [])
{
return $this->httpRequest("v3/allOrders", "GET", [

$parameters = [
"symbol" => $symbol,
"limit" => $limit,
"orderId" => $fromOrderId,
], true);
];
if($fromOrderId > 0) $parameters[] = ["orderId" => $fromOrderId];

$parameters = array_merge($parameters, $params);

return $this->httpRequest("v3/allOrders", "GET", $parameters, true);
}

/**
Expand Down Expand Up @@ -2323,4 +2329,4 @@ private function floorDecimal($n, $decimals=2)
return floor($n * pow(10, $decimals)) / pow(10, $decimals);
}

}
}

0 comments on commit 9e5edfc

Please sign in to comment.