@@ -53,7 +53,10 @@ class API
5353
5454 protected $ exchangeInfo = NULL ;
5555 protected $ lastRequest = [];
56-
56+
57+ private $ xMbxUsedWeight = 0 ;
58+ private $ xMbxUsedWeight1m = 0 ;
59+
5760 /**
5861 * Constructor for the class,
5962 * send as many argument as you want.
@@ -1015,7 +1018,15 @@ protected function httpRequest(string $url, string $method = "GET", array $param
10151018 'header ' => $ header ,
10161019 'json ' => $ json
10171020 ];
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+
10191030 if (isset ($ json ['msg ' ])){
10201031 // should always output error, not only on httpdebug
10211032 // not outputing errors, hides it from users and ends up with tickets on github
@@ -2347,5 +2358,22 @@ private function floorDecimal($n, $decimals=2)
23472358 {
23482359 return floor ($ n * pow (10 , $ decimals )) / pow (10 , $ decimals );
23492360 }
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+ }
23502378
23512379}
0 commit comments