Skip to content

Commit

Permalink
myTrades - add startTime and endTime params
Browse files Browse the repository at this point in the history
added startTime and endTime parameters to myTrades request
  • Loading branch information
ePascalC authored Jul 7, 2021
2 parents 068d9c0 + 1c6da32 commit 577bf51
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,12 @@ public function orders(string $symbol, int $limit = 500, int $fromOrderId = 0, a
* @param $symbol string the currency symbol
* @param $limit int the amount of orders returned
* @param $fromTradeId int (optional) return the orders from this order onwards. negative for all
* @param $startTime int (optional) return the orders from this time onwards. null to ignore
* @param $endTime int (optional) return the orders from this time backwards. null to ignore
* @return array with error message or array of orderDetails array
* @throws \Exception
*/
public function history(string $symbol, int $limit = 500, int $fromTradeId = -1)
public function history(string $symbol, int $limit = 500, int $fromTradeId = -1, int $startTime = null, int $endTime = null)
{
$parameters = [
"symbol" => $symbol,
Expand All @@ -588,6 +590,12 @@ public function history(string $symbol, int $limit = 500, int $fromTradeId = -1)
if ($fromTradeId > 0) {
$parameters["fromId"] = $fromTradeId;
}
if (isset($startTime)) {
$parameters["startTime"] = $startTime;
}
if (isset($endTime)) {
$parameters["endTime"] = $endTime;
}

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

0 comments on commit 577bf51

Please sign in to comment.