baseUrl . $this->api_version . $end_point; $params = [ 'api_key' => $this->api_key, 'secret' => $this->api_secret, 'scope' => 'active', 'limit' => 50 ]; $query = http_build_query($params); $signature = hash_hmac('sha256', $this->api_version . $end_point . '?' . $query, $this->api_secret); $client = new Client([ 'headers' => [ 'Content-Type' => 'application/json', 'APIKEY' => $this->api_key, 'Signature' => $signature ], ]); $response = $client->request('GET', $url . '?' . $query); $data = json_decode($response->getBody()); return $data; } public function getBalance(){ $end_point = 'accounts'; $url = $this->baseUrl . $this->api_version . $end_point; $params = [ 'api_key' => $this->api_key, 'secret' => $this->api_secret, ]; $query = http_build_query($params); $signature = hash_hmac('sha256', $this->api_version . $end_point . '?' . $query, $this->api_secret); $client = new Client([ 'headers' => [ 'Content-Type' => 'application/json', 'APIKEY' => $this->api_key, 'Signature' => $signature ], ]); $response = $client->request('GET', $url . '?' . $query); $data = json_decode($response->getBody()); return $data; } }