app/traderBot.js
/**
     * This method makes a public or private API request.
     * @param  {String}   method   The API method (public or private)
     * @param  {Object}   params   Arguments to pass to the api call
     * @param  {Function} callback A callback function to be executed when the request is complete
     * @return {Object}            The request object
     */
This method makes a public or private API request.
@param  {String}   method   The API method (public or private)
@param  {Object}   params   Arguments to pass to the api call
@param  {Function} callback A callback function to be executed when the request is complete
@return {Object}            The request object
This method makes a public or private API request . @param { String } method The API method ( public or private ) @param { Object } params Arguments to pass to the api call @param { Function } callback A callback function to be executed when the request is complete @return { Object } The request object
api(method, params, callback) {
        if(typeof params === 'function') {
            callback = params;
            params   = {};
        }
        if(methods.public.includes(method)) {
            return this.publicMethod(method, params, callback);
        }
        else if(methods.private.includes(method)) {
            return this.privateMethod(method, params, callback);
        }
        else {
            throw new Error(method + ' is not a valid API method.');
        }
    }
api ( method , params , callback ) { if ( typeof params === 'function' ) { callback = params ; params = { } ; } if ( methods . public . includes ( method ) ) { return this . publicMethod ( method , params , callback ) ; } else if ( methods . private . includes ( method ) ) { return this . privateMethod ( method , params , callback ) ; } else { throw new Error ( method + ' is not a valid API method.' ) ; } }
This method makes a public or private API request.
This method makes a public or private API request .
// Default params to empty object