From 2bc02cb5781a8d1fe4dbae86be10416dd13423d7 Mon Sep 17 00:00:00 2001 From: ePascalC Date: Mon, 26 Jul 2021 21:33:49 +0200 Subject: [PATCH] Function assetDetail - add optional param asset As per #410 --- php-binance-api.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/php-binance-api.php b/php-binance-api.php index b99a20e1..28228f2e 100755 --- a/php-binance-api.php +++ b/php-binance-api.php @@ -660,13 +660,21 @@ public function exchangeInfo() * * @property int $weight 1 * + * @param string $asset (optional) Should be an asset, e.g. BNB or empty to get the full list + * * @return array containing the response */ - public function assetDetail() + public function assetDetail($asset = '') { $params["sapi"] = true; + if ($asset != '' && gettype($asset) == 'string') + $params['asset'] = $asset; $arr = $this->httpRequest("v1/asset/assetDetail", 'GET', $params, true); - // wrap into another array for backwards compatibility with the old wapi one + // if asset was set, no backward compatibility needed as this was implemented later + if (isset($params['asset'])) + return $arr; + + // wrap into another array for backward compatibility with the old wapi one if (!empty($arr['BTC']['withdrawFee'])) { return array( 'success' => 1,