function queryPrivate($method, array $request = array())
    {
        if(!isset($request['nonce'])) {
            // generate a 64 bit nonce using a timestamp at microsecond resolution
            // string functions are used to avoid problems on 32 bit systems
            $nonce = explode(' ', microtime());
            $request['nonce'] = $nonce[1] . str_pad(substr($nonce[0], 2, 6), 6, '0');
        }

        // build the POST data string
        $postdata = http_build_query($request, '', '&');

        // set API key and sign the message
        $path = '/' . $this->version . '/private/' . $method;
        $sign = hash_hmac('sha512', $path . hash('sha256', $request['nonce'] . $postdata, true), base64_decode($this->secret), true);
        $headers = array(
            'API-Key: ' . $this->key,
            'API-Sign: ' . base64_encode($sign)
        );

        // make request
        curl_setopt($this->curl, CURLOPT_URL, $this->url . $path);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);
        $result = curl_exec($this->curl);
        if($result===false)
            throw new \Exception('CURL error: ' . curl_error($this->curl));

        // decode results
        $result = json_decode($result, true);
        if(!is_array($result))
            throw new \Exception('JSON decode error');

        return $result;
    }
function queryPrivate($method, array $request = array())
    {
        if(!isset($request['nonce'])) {
            // generate a 64 bit nonce using a timestamp at microsecond resolution
            // string functions are used to avoid problems on 32 bit systems
            $nonce = explode(' ', microtime());
            $request['nonce'] = $nonce[1] . str_pad(substr($nonce[0], 2, 6), 6, '0');
        }

        // build the POST data string
        $postdata = http_build_query($request, '', '&');

        // set API key and sign the message
        $path = '/' . $this->version . '/private/' . $method;
        $sign = hash_hmac('sha512', $path . hash('sha256', $request['nonce'] . $postdata, true), base64_decode($this->secret), true);
        $headers = array(
            'API-Key: ' . $this->key,
            'API-Sign: ' . base64_encode($sign)
        );

        // make request
        curl_setopt($this->curl, CURLOPT_URL, $this->url . $path);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);
        $result = curl_exec($this->curl);
        if($result===false)
            throw new \Exception('CURL error: ' . curl_error($this->curl));

        // decode results
        $result = json_decode($result, true);
        if(!is_array($result))
            throw new \Exception('JSON decode error');

        return $result;
    }
function queryPrivate ( $ method , array $ request = array ( ) ) { if ( ! isset ( $ request [ 'nonce' ] ) ) { // generate a 64 bit nonce using a timestamp at microsecond resolution // string functions are used to avoid problems on 32 bit systems $ nonce = explode ( ' ' , microtime ( ) ) ; $ request [ 'nonce' ] = $ nonce [ 1 ] . str_pad ( substr ( $ nonce [ 0 ] , 2 , 6 ) , 6 , '0' ) ; } // build the POST data string $ postdata = http_build_query ( $ request , '' , '&' ) ; // set API key and sign the message $ path = '/' . $ this -> version . '/private/' . $ method ; $ sign = hash_hmac ( 'sha512' , $ path . hash ( 'sha256' , $ request [ 'nonce' ] . $ postdata , true ) , base64_decode ( $ this -> secret ) , true ) ; $ headers = array ( 'API-Key: ' . $ this -> key , 'API-Sign: ' . base64_encode ( $ sign ) ) ; // make request curl_setopt ( $ this -> curl , CURLOPT_URL , $ this -> url . $ path ) ; curl_setopt ( $ this -> curl , CURLOPT_POSTFIELDS , $ postdata ) ; curl_setopt ( $ this -> curl , CURLOPT_HTTPHEADER , $ headers ) ; $ result = curl_exec ( $ this -> curl ) ; if ( $ result === false ) throw new \ Exception ( 'CURL error: ' . curl_error ( $ this -> curl ) ) ; // decode results $ result = json_decode ( $ result , true ) ; if ( ! is_array ( $ result ) ) throw new \ Exception ( 'JSON decode error' ) ; return $ result ; }
Query private methods

@param string $path method path
@param array $request request parameters
@return array request result on success
@throws KrakenAPIException
Query private methods