Skip to content

Commit f5d5abf

Browse files
authored
Switch wapi tradeFee to sapi commissionFee
As per #363 WAPI endpoints will disappear on Aug 1. The old tradeFee function remains available until Binance decommissions it, but a deprecated warning is sent. The new commissionFee function allows now calling it without argument, showing the full list of all symbols with the fees.
1 parent e7044b3 commit f5d5abf

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

php-binance-api.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,31 @@ public function tradeFee(string $symbol)
693693
"symbol" => $symbol,
694694
"wapi" => true,
695695
];
696+
trigger_error('Function tradeFee is deprecated and will be removed from Binance on Aug 1, 2021. Please use $api->commissionFee', E_USER_NOTICE);
696697

697698
return $this->httpRequest("v3/tradeFee.html", 'GET', $params, true);
698699
}
700+
701+
/**
702+
* commissionFee - Fetch commission trade fee
703+
*
704+
* @link https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
705+
*
706+
* @property int $weight 1
707+
*
708+
* @param string $symbol (optional) Should be a symbol, e.g. BNBUSDT or empty to get the full list
709+
*
710+
* @return array containing the response
711+
* @throws \Exception
712+
*/
713+
public function commissionFee($symbol = '')
714+
{
715+
$params = array('sapi' => true);
716+
if ($symbol != '' && gettype($symbol) == 'string')
717+
$params['symbol'] = $symbol;
718+
719+
return $this->httpRequest("v1/asset/tradeFee", 'GET', $params, true);
720+
}
699721

700722
/**
701723
* withdraw requests a asset be withdrawn from binance to another wallet

0 commit comments

Comments
 (0)