src/API.php
public function request($method, array $params = []) {
        $data = [
            'version' => '2.0',
            'method' => $method,
            'params' => $params,
            'id' => $this->genID()
        ];

        $data['params']['apikey'] = $this->config[self::KEY];

        if (array_key_exists(self::LANGUAGE, $this->config) &&
            !array_key_exists(self::LANGUAGE, $params)) {
            $data['params'][self::LANGUAGE] = $this->config[self::LANGUAGE];
        }

        $response = $this->execute($data);

        $this->evaluateResponse($response);

        return $response['result'];
    }
public function request($method, array $params = []) {
        $data = [
            'version' => '2.0',
            'method' => $method,
            'params' => $params,
            'id' => $this->genID()
        ];

        $data['params']['apikey'] = $this->config[self::KEY];

        if (array_key_exists(self::LANGUAGE, $this->config) &&
            !array_key_exists(self::LANGUAGE, $params)) {
            $data['params'][self::LANGUAGE] = $this->config[self::LANGUAGE];
        }

        $response = $this->execute($data);

        $this->evaluateResponse($response);

        return $response['result'];
    }
public function request ( $ method , array $ params = [ ] ) { $ data = [ 'version' => '2.0' , 'method' => $ method , 'params' => $ params , 'id' => $ this -> genID ( ) ] ; $ data [ 'params' ] [ 'apikey' ] = $ this -> config [ self :: KEY ] ; if ( array_key_exists ( self :: LANGUAGE , $ this -> config ) && ! array_key_exists ( self :: LANGUAGE , $ params ) ) { $ data [ 'params' ] [ self :: LANGUAGE ] = $ this -> config [ self :: LANGUAGE ] ; } $ response = $ this -> execute ( $ data ) ; $ this -> evaluateResponse ( $ response ) ; return $ response [ 'result' ] ; }
Sends request to API

@param string $method JSON-RPC method
@param array $params Optional parameters

@return array Result of request

@throws Exception on error
Sends request to API