Skip to content

Commit 9a4ac74

Browse files
authored
Switch assetDetail from wapi to sapi
As per #363 WAPI endpoints will disappear on Aug 1. Calling this function using sapi will now return the same structure as for wapi to provide backwards compatibility
1 parent df34bc8 commit 9a4ac74

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

php-binance-api.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,21 @@ public function exchangeInfo()
647647

648648
public function assetDetail()
649649
{
650-
$params["wapi"] = true;
651-
return $this->httpRequest("v3/assetDetail.html", 'GET', $params, true);
650+
$params["sapi"] = true;
651+
$arr = $this->httpRequest("v1/asset/assetDetail", 'GET', $params, true);
652+
// wrap into another array for backwards compatibility with the old wapi one
653+
if (!empty($arr['BTC']['withdrawFee'])) {
654+
return array(
655+
'success' => 1,
656+
'assetDetail' => $arr,
657+
);
658+
} else {
659+
return array(
660+
'success' => 0,
661+
'assetDetail' => array(),
662+
);
663+
664+
}
652665
}
653666

654667
public function userAssetDribbletLog()

0 commit comments

Comments
 (0)