@@ -46,17 +46,17 @@ class API
46
46
protected $ transfered = 0 ; // /< This stores the amount of bytes transfered
47
47
protected $ requestCount = 0 ; // /< This stores the amount of API requests
48
48
protected $ httpDebug = false ; // /< If you enable this, curl will output debugging information
49
- private $ subscriptions = []; // /< View all websocket subscriptions
50
- private $ btc_value = 0.00 ; // /< value of available assets
51
- private $ btc_total = 0.00 ;
49
+ protected $ subscriptions = []; // /< View all websocket subscriptions
50
+ protected $ btc_value = 0.00 ; // /< value of available assets
51
+ protected $ btc_total = 0.00 ;
52
52
53
53
// /< value of available onOrder assets
54
54
55
55
protected $ exchangeInfo = NULL ;
56
56
protected $ lastRequest = [];
57
57
58
- private $ xMbxUsedWeight = 0 ;
59
- private $ xMbxUsedWeight1m = 0 ;
58
+ protected $ xMbxUsedWeight = 0 ;
59
+ protected $ xMbxUsedWeight1m = 0 ;
60
60
61
61
/**
62
62
* Constructor for the class,
@@ -92,7 +92,7 @@ public function __construct()
92
92
}
93
93
94
94
/**
95
- * magic get for private and protected members
95
+ * magic get for protected and protected members
96
96
*
97
97
* @param $file string the name of the property to return
98
98
* @return null
@@ -106,7 +106,7 @@ public function __get(string $member)
106
106
}
107
107
108
108
/**
109
- * magic set for private and protected members
109
+ * magic set for protected and protected members
110
110
*
111
111
* @param $member string the name of the member property
112
112
* @param $value the value of the member property
@@ -124,7 +124,7 @@ public function __set(string $member, $value)
124
124
* @param $file string file location
125
125
* @return null
126
126
*/
127
- private function setupApiConfigFromFile (string $ file = null )
127
+ protected function setupApiConfigFromFile (string $ file = null )
128
128
{
129
129
$ file = is_null ($ file ) ? getenv ("HOME " ) . "/.config/jaggedsoft/php-binance-api.json " : $ file ;
130
130
@@ -149,7 +149,7 @@ private function setupApiConfigFromFile(string $file = null)
149
149
* @param $file string file location
150
150
* @return null
151
151
*/
152
- private function setupCurlOptsFromFile (string $ file = null )
152
+ protected function setupCurlOptsFromFile (string $ file = null )
153
153
{
154
154
$ file = is_null ($ file ) ? getenv ("HOME " ) . "/.config/jaggedsoft/php-binance-api.json " : $ file ;
155
155
@@ -172,7 +172,7 @@ private function setupCurlOptsFromFile(string $file = null)
172
172
*
173
173
* @return null
174
174
*/
175
- private function setupProxyConfigFromFile (string $ file = null )
175
+ protected function setupProxyConfigFromFile (string $ file = null )
176
176
{
177
177
$ file = is_null ($ file ) ? getenv ("HOME " ) . "/.config/jaggedsoft/php-binance-api.json " : $ file ;
178
178
@@ -1175,7 +1175,7 @@ public function candlesticks(string $symbol, string $interval = "5m", int $limit
1175
1175
* @param $priceData array of prices
1176
1176
* @return array containing the response
1177
1177
*/
1178
- private function balanceData (array $ array , $ priceData )
1178
+ protected function balanceData (array $ array , $ priceData )
1179
1179
{
1180
1180
$ balances = [];
1181
1181
@@ -1258,7 +1258,7 @@ private function balanceData(array $array, $priceData)
1258
1258
* @param $json array data to convert
1259
1259
* @return array
1260
1260
*/
1261
- private function balanceHandler (array $ json )
1261
+ protected function balanceHandler (array $ json )
1262
1262
{
1263
1263
$ balances = [];
1264
1264
foreach ($ json as $ item ) {
@@ -1281,7 +1281,7 @@ private function balanceHandler(array $json)
1281
1281
* @param $json object data to convert
1282
1282
* @return array
1283
1283
*/
1284
- private function tickerStreamHandler (\stdClass $ json )
1284
+ protected function tickerStreamHandler (\stdClass $ json )
1285
1285
{
1286
1286
return [
1287
1287
"eventType " => $ json ->e ,
@@ -1318,7 +1318,7 @@ private function tickerStreamHandler(\stdClass $json)
1318
1318
* @param \stdClass $json object data to convert
1319
1319
* @return array
1320
1320
*/
1321
- private function executionHandler (\stdClass $ json )
1321
+ protected function executionHandler (\stdClass $ json )
1322
1322
{
1323
1323
return [
1324
1324
"symbol " => $ json ->s ,
@@ -1346,7 +1346,7 @@ private function executionHandler(\stdClass $json)
1346
1346
* @param $ticks array of the canbles array
1347
1347
* @return array object of the chartdata
1348
1348
*/
1349
- private function chartData (string $ symbol , string $ interval , array $ ticks )
1349
+ protected function chartData (string $ symbol , string $ interval , array $ ticks )
1350
1350
{
1351
1351
if (!isset ($ this ->info [$ symbol ])) {
1352
1352
$ this ->info [$ symbol ] = [];
@@ -1391,7 +1391,7 @@ private function chartData(string $symbol, string $interval, array $ticks)
1391
1391
* @param $trades array of trade information
1392
1392
* @return array easier format for trade information
1393
1393
*/
1394
- private function tradesData (array $ trades )
1394
+ protected function tradesData (array $ trades )
1395
1395
{
1396
1396
$ output = [];
1397
1397
foreach ($ trades as $ trade ) {
@@ -1417,7 +1417,7 @@ private function tradesData(array $trades)
1417
1417
* @param $array array book prices
1418
1418
* @return array easier format for book prices information
1419
1419
*/
1420
- private function bookPriceData (array $ array )
1420
+ protected function bookPriceData (array $ array )
1421
1421
{
1422
1422
$ bookprices = [];
1423
1423
foreach ($ array as $ obj ) {
@@ -1439,7 +1439,7 @@ private function bookPriceData(array $array)
1439
1439
* @param $array array of prices
1440
1440
* @return array of key/value pairs
1441
1441
*/
1442
- private function priceData (array $ array )
1442
+ protected function priceData (array $ array )
1443
1443
{
1444
1444
$ prices = [];
1445
1445
foreach ($ array as $ obj ) {
@@ -1583,7 +1583,7 @@ public function displayDepth(array $array)
1583
1583
* @param $json array of the depth infomration
1584
1584
* @return array of the depth information
1585
1585
*/
1586
- private function depthData (string $ symbol , array $ json )
1586
+ protected function depthData (string $ symbol , array $ json )
1587
1587
{
1588
1588
$ bids = $ asks = [];
1589
1589
foreach ($ json ['bids ' ] as $ obj ) {
@@ -1682,7 +1682,7 @@ public function addToTransfered(int $int)
1682
1682
* @param $json array of depth bids and asks
1683
1683
* @return null
1684
1684
*/
1685
- private function depthHandler (array $ json )
1685
+ protected function depthHandler (array $ json )
1686
1686
{
1687
1687
$ symbol = $ json ['s ' ];
1688
1688
if ($ json ['u ' ] <= $ this ->info [$ symbol ]['firstUpdate ' ]) {
@@ -1715,7 +1715,7 @@ private function depthHandler(array $json)
1715
1715
* @param \stdClass $json object time
1716
1716
* @return null
1717
1717
*/
1718
- private function chartHandler (string $ symbol , string $ interval , \stdClass $ json )
1718
+ protected function chartHandler (string $ symbol , string $ interval , \stdClass $ json )
1719
1719
{
1720
1720
if (!$ this ->info [$ symbol ][$ interval ]['firstOpen ' ]) { // Wait for /kline to finish loading
1721
1721
$ this ->chartQueue [$ symbol ][$ interval ][] = $ json ;
@@ -2317,7 +2317,7 @@ public function bookTicker(callable $callback)
2317
2317
* This function downloads ca bundle for curl website
2318
2318
* and uses it as part of the curl options
2319
2319
*/
2320
- private function downloadCurlCaBundle ()
2320
+ protected function downloadCurlCaBundle ()
2321
2321
{
2322
2322
$ output_filename = getcwd () . "/ca.pem " ;
2323
2323
@@ -2361,17 +2361,17 @@ private function downloadCurlCaBundle()
2361
2361
fclose ($ fp );
2362
2362
}
2363
2363
2364
- private function floorDecimal ($ n , $ decimals =2 )
2364
+ protected function floorDecimal ($ n , $ decimals =2 )
2365
2365
{
2366
2366
return floor ($ n * pow (10 , $ decimals )) / pow (10 , $ decimals );
2367
2367
}
2368
2368
2369
2369
2370
- private function setXMbxUsedWeight (int $ usedWeight ) : void {
2370
+ protected function setXMbxUsedWeight (int $ usedWeight ) : void {
2371
2371
$ this ->xMbxUsedWeight = $ usedWeight ;
2372
2372
}
2373
2373
2374
- private function setXMbxUsedWeight1m (int $ usedWeight1m ) : void {
2374
+ protected function setXMbxUsedWeight1m (int $ usedWeight1m ) : void {
2375
2375
$ this ->xMbxUsedWeight1m = $ usedWeight1m ;
2376
2376
}
2377
2377
0 commit comments