Add Binance ticker API

This commit is contained in:
Brian Ziemek 2018-03-18 02:49:27 -04:00 committed by GitHub
parent 8c683b756a
commit 79d9d0871a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,8 @@ class Tools extends Base {
return 'cryptobridge';
} else if (preg_match('/yobit.net/', $url)) {
return 'yobit';
} else if (preg_match('/binance.com/', $url)) {
return 'binance';
}
$this->setErrorMessage("API URL unknown");
return false;
@ -139,6 +141,9 @@ class Tools extends Base {
case 'yobit':
return @$aData[strtolower($strBase) . "_" . strtolower($strQuote)]['last'];
break;
case 'binance':
return @$aData['price'];
break;
}
} else {
$this->setErrorMessage("Got an invalid response from ticker API");