Skip to content

Commit 577bf51

Browse files
authored
myTrades - add startTime and endTime params
added startTime and endTime parameters to myTrades request
2 parents 068d9c0 + 1c6da32 commit 577bf51

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

php-binance-api.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,12 @@ public function orders(string $symbol, int $limit = 500, int $fromOrderId = 0, a
576576
* @param $symbol string the currency symbol
577577
* @param $limit int the amount of orders returned
578578
* @param $fromTradeId int (optional) return the orders from this order onwards. negative for all
579+
* @param $startTime int (optional) return the orders from this time onwards. null to ignore
580+
* @param $endTime int (optional) return the orders from this time backwards. null to ignore
579581
* @return array with error message or array of orderDetails array
580582
* @throws \Exception
581583
*/
582-
public function history(string $symbol, int $limit = 500, int $fromTradeId = -1)
584+
public function history(string $symbol, int $limit = 500, int $fromTradeId = -1, int $startTime = null, int $endTime = null)
583585
{
584586
$parameters = [
585587
"symbol" => $symbol,
@@ -588,6 +590,12 @@ public function history(string $symbol, int $limit = 500, int $fromTradeId = -1)
588590
if ($fromTradeId > 0) {
589591
$parameters["fromId"] = $fromTradeId;
590592
}
593+
if (isset($startTime)) {
594+
$parameters["startTime"] = $startTime;
595+
}
596+
if (isset($endTime)) {
597+
$parameters["endTime"] = $endTime;
598+
}
591599

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

0 commit comments

Comments
 (0)