Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 44d8026

Browse files
author
Jon Eyrick
authored
Add to withdrawHistory and depositHistory, new withdrawFee function
Support optional parameters for depositHistory and withdrawHistory withdrawFee contributed by eugypalu withdrawHistory suggested by dormadekhin-denis
1 parent f007e87 commit 44d8026

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

php-binance-api.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -632,14 +632,13 @@ public function depositAddress(string $asset)
632632
* $depositHistory = $api->depositHistory( "BTC" );
633633
*
634634
* @param $asset string empty or the currency such as BTC
635+
* @param $params array optional startTime, endTime, status parameters
635636
* @return array with error message or array deposit history information
636637
* @throws \Exception
637638
*/
638-
public function depositHistory(string $asset = null)
639+
public function depositHistory(string $asset = null, array $params = [])
639640
{
640-
$params = [
641-
"wapi" => true,
642-
];
641+
$params["wapi"] = true;
643642
if (is_null($asset) == false) {
644643
$params['asset'] = $asset;
645644
}
@@ -654,19 +653,36 @@ public function depositHistory(string $asset = null)
654653
* $withdrawHistory = $api->withdrawHistory( "BTC" );
655654
*
656655
* @param $asset string empty or the currency such as BTC
656+
* @param $params array optional startTime, endTime, status parameters
657657
* @return array with error message or array deposit history information
658658
* @throws \Exception
659659
*/
660-
public function withdrawHistory(string $asset = null)
660+
public function withdrawHistory(string $asset = null, array $params = [])
661661
{
662-
$params = [
663-
"wapi" => true,
664-
];
662+
$params["wapi"] = true;
665663
if (is_null($asset) == false) {
666664
$params['asset'] = $asset;
667665
}
668666
return $this->httpRequest("v3/withdrawHistory.html", "GET", $params, true);
669667
}
668+
669+
/**
670+
* withdrawFee get the withdrawal fee for an asset
671+
*
672+
* $withdrawFee = $api->withdrawHistory( "BTC" );
673+
*
674+
* @param $asset string currency such as BTC
675+
* @return array with error message or array containing withdrawFee
676+
* @throws \Exception
677+
*/
678+
public function withdrawFee(string $asset)
679+
{
680+
$params = [
681+
"wapi" => true,
682+
"asset" => $asset
683+
];
684+
return $this->httpRequest("v3/withdrawFee.html", "GET", $params, true);
685+
}
670686

671687
/**
672688
* prices get all the current prices

0 commit comments

Comments
 (0)