@@ -53,7 +53,10 @@ class API
53
53
54
54
protected $ exchangeInfo = NULL ;
55
55
protected $ lastRequest = [];
56
-
56
+
57
+ private $ xMbxUsedWeight = 0 ;
58
+ private $ xMbxUsedWeight1m = 0 ;
59
+
57
60
/**
58
61
* Constructor for the class,
59
62
* send as many argument as you want.
@@ -1015,7 +1018,15 @@ protected function httpRequest(string $url, string $method = "GET", array $param
1015
1018
'header ' => $ header ,
1016
1019
'json ' => $ json
1017
1020
];
1018
-
1021
+
1022
+ if (isset ($ header ['x-mbx-used-weight ' ])) {
1023
+ $ this ->setXMbxUsedWeight ($ header ['x-mbx-used-weight ' ]);
1024
+ }
1025
+
1026
+ if (isset ($ header ['x-mbx-used-weight-1m ' ])) {
1027
+ $ this ->setXMbxUsedWeight1m ($ header ['x-mbx-used-weight-1m ' ]);
1028
+ }
1029
+
1019
1030
if (isset ($ json ['msg ' ])){
1020
1031
// should always output error, not only on httpdebug
1021
1032
// not outputing errors, hides it from users and ends up with tickets on github
@@ -2347,5 +2358,22 @@ private function floorDecimal($n, $decimals=2)
2347
2358
{
2348
2359
return floor ($ n * pow (10 , $ decimals )) / pow (10 , $ decimals );
2349
2360
}
2361
+
2362
+
2363
+ private function setXMbxUsedWeight (int $ usedWeight ) : void {
2364
+ $ this ->xMbxUsedWeight = $ usedWeight ;
2365
+ }
2366
+
2367
+ private function setXMbxUsedWeight1m (int $ usedWeight1m ) : void {
2368
+ $ this ->xMbxUsedWeight1m = $ usedWeight1m ;
2369
+ }
2370
+
2371
+ public function getXMbxUsedWeight () : int {
2372
+ $ this ->xMbxUsedWeight ;
2373
+ }
2374
+
2375
+ public function getXMbxUsedWeight1m () : int {
2376
+ $ this ->xMbxUsedWeight1m ;
2377
+ }
2350
2378
2351
2379
}
0 commit comments