Skip to content

Commit

Permalink
fix history() fromId, defaults to all
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Eyrick authored Apr 22, 2018
1 parent 7502938 commit 897c9bb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,18 @@ public function orders(string $symbol, int $limit = 500, int $fromOrderId = 1)
*
* @param $symbol string the currency symbol
* @param $limit int the amount of orders returned
* @param $fromTradeId int return the orders from this order onwards
* @param $fromTradeId int (optional) return the orders from this order onwards. negative for all
* @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)
{
return $this->httpRequest("v3/myTrades", "GET", [
$parameters = [
"symbol" => $symbol,
"limit" => $limit,
"fromId" => $fromTradeId,
], true);
"limit" => $limit
];
if ( $fromTradeId > 0 ) $parameters["fromId"] = $fromTradeId;
return $this->httpRequest( "v3/myTrades", "GET", $parameters, true );
}

/**
Expand Down

0 comments on commit 897c9bb

Please sign in to comment.