Skip to content

Commit

Permalink
Add to withdrawHistory and depositHistory, new withdrawFee function
Browse files Browse the repository at this point in the history
Support optional parameters for depositHistory and withdrawHistory
withdrawFee contributed by eugypalu
withdrawHistory suggested by dormadekhin-denis
  • Loading branch information
Jon Eyrick authored Apr 16, 2018
1 parent f007e87 commit 44d8026
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,14 +632,13 @@ public function depositAddress(string $asset)
* $depositHistory = $api->depositHistory( "BTC" );
*
* @param $asset string empty or the currency such as BTC
* @param $params array optional startTime, endTime, status parameters
* @return array with error message or array deposit history information
* @throws \Exception
*/
public function depositHistory(string $asset = null)
public function depositHistory(string $asset = null, array $params = [])
{
$params = [
"wapi" => true,
];
$params["wapi"] = true;
if (is_null($asset) == false) {
$params['asset'] = $asset;
}
Expand All @@ -654,19 +653,36 @@ public function depositHistory(string $asset = null)
* $withdrawHistory = $api->withdrawHistory( "BTC" );
*
* @param $asset string empty or the currency such as BTC
* @param $params array optional startTime, endTime, status parameters
* @return array with error message or array deposit history information
* @throws \Exception
*/
public function withdrawHistory(string $asset = null)
public function withdrawHistory(string $asset = null, array $params = [])
{
$params = [
"wapi" => true,
];
$params["wapi"] = true;
if (is_null($asset) == false) {
$params['asset'] = $asset;
}
return $this->httpRequest("v3/withdrawHistory.html", "GET", $params, true);
}

/**
* withdrawFee get the withdrawal fee for an asset
*
* $withdrawFee = $api->withdrawHistory( "BTC" );
*
* @param $asset string currency such as BTC
* @return array with error message or array containing withdrawFee
* @throws \Exception
*/
public function withdrawFee(string $asset)
{
$params = [
"wapi" => true,
"asset" => $asset
];
return $this->httpRequest("v3/withdrawFee.html", "GET", $params, true);
}

/**
* prices get all the current prices
Expand Down

0 comments on commit 44d8026

Please sign in to comment.