ar request = require('request');
var nonce   = require('nonce');

module.exports = function() {
    'use strict';

    // Module dependencies

    // Constants
    var version         = '0.1.0',
        PUBLIC_API_URL  = 'http://pubapi.cryptsy.com/api.php',
        PRIVATE_API_URL = 'https://api.cryptsy.com/api',
        USER_AGENT      = 'nomp/node-open-mining-portal'

    // Constructor
    function Cryptsy(key, secret){
        // Generate headers signed by this user's key and secret.
        // The secret is encapsulated and never exposed
        this._getPrivateHeaders = function(parameters){
            var paramString, signature;

            if (!key || !secret){
                throw 'Cryptsy: Error. API key and secret required';
            }

            // Sort parameters alphabetically and convert to `arg1=foo&arg2=bar`
            paramString = Object.keys(parameters).sort().map(function(param){
                return encodeURIComponent(param) + '=' + encodeURIComponent(parameters[param]);
            }).join('&');

            signature = crypto.createHmac('sha512', secret).update(paramString).digest('hex');

            return {
                Key: key,
                Sign: signature
            };
        };
    }

    // If a site uses non-trusted SSL certificates, set this value to false
    Cryptsy.STRICT_SSL = true;

    // Helper methods
    function joinCurrencies(currencyA, currencyB){
        return currencyA + '_' + currencyB;
    }

    // Prototype
    Cryptsy.prototype = {
        constructor: Cryptsy,

        // Make an API request
        _request: function(options, callback){
            if (!('headers' in options)){
                options.headers = {};
            }

            options.headers['User-Agent'] = USER_AGENT;
            options.json = true;
            options.strictSSL = Cryptsy.STRICT_SSL;

            request(options, function(err, response, body) {
                callback(err, body);
            });

            return this;
        },

        // Make a public API request
        _public: function(parameters, callback){
            var options = {
                method: 'GET',
                url: PUBLIC_API_URL,
                qs: parameters
            };

            return this._request(options, callback);
        },

        // Make a private API request
        _private: function(parameters, callback){
            var options;

            parameters.nonce = nonce();
            options = {
                method: 'POST',
                url: PRIVATE_API_URL,
                form: parameters,
                headers: this._getPrivateHeaders(parameters)
            };

            return this._request(options, callback);
        },


        /////


        // PUBLIC METHODS

        getTicker: function(callback){
            var parameters = {
                    method: 'marketdatav2'
                };

            return this._public(parameters, callback);
        },

        getOrderBook: function(currencyA, currencyB, callback){
            var parameters = {
                    command: 'returnOrderBook',
                    currencyPair: joinCurrencies(currencyA, currencyB)
                };

            return this._public(parameters, callback);
        },

        getTradeHistory: function(currencyA, currencyB, callback){
            var parameters = {
                    command: 'returnTradeHistory',
                    currencyPair: joinCurrencies(currencyA, currencyB)
                };

            return this._public(parameters, callback);
        },


        /////


        // PRIVATE METHODS

        myBalances: function(callback){
            var parameters = {
                    command: 'returnBalances'
                };

            return this._private(parameters, callback);
        },

        myOpenOrders: function(currencyA, currencyB, callback){
            var parameters = {
                    command: 'returnOpenOrders',
                    currencyPair: joinCurrencies(currencyA, currencyB)
                };

            return this._private(parameters, callback);
        },

        myTradeHistory: function(currencyA, currencyB, callback){
            var parameters = {
                    command: 'returnTradeHistory',
                    currencyPair: joinCurrencies(currencyA, currencyB)
                };

            return this._private(parameters, callback);
        },

        buy: function(currencyA, currencyB, rate, amount, callback){
            var parameters = {
                    command: 'buy',
                    currencyPair: joinCurrencies(currencyA, currencyB),
                    rate: rate,
                    amount: amount
                };

            return this._private(parameters, callback);
        },

        sell: function(currencyA, currencyB, rate, amount, callback){
            var parameters = {
                    command: 'sell',
                    currencyPair: joinCurrencies(currencyA, currencyB),
                    rate: rate,
                    amount: amount
                };

            return this._private(parameters, callback);
        },

        cancelOrder: function(currencyA, currencyB, orderNumber, callback){
            var parameters = {
                    command: 'cancelOrder',
                    currencyPair: joinCurrencies(currencyA, currencyB),
                    orderNumber: orderNumber
                };

            return this._private(parameters, callback);
        },

        withdraw: function(currency, amount, address, callback){
            var parameters = {
                    command: 'withdraw',
                    currency: currency,
                    amount: amount,
                    address: address
                };

            return this._private(parameters, callback);
        }
    };

    return Cryptsy;
}();

@@ -186,11 +186,11 @@
  '0.
-1.0
+0.1
 ',%0A 
@@ -226,91 +226,75 @@
 p://
-pubapi.cryptsy.com/api.php',%0A        PRIVATE_API_URL = 'https://api.cryptsy.com/api
+www.coinwarz.com/v1/api/profitability/?apikey=YOUR_API_KEY&algo=all
 ',%0A 
@@ -681,22 +681,23 @@
 throw 'C
-ryptsy
+oinWarz
 : Error.
@@ -1486,22 +1486,23 @@
 pe%0A    C
-ryptsy
+oinWarz
 .prototy
@@ -1530,22 +1530,23 @@
 uctor: C
-ryptsy
+oinWarz
 ,%0A%0A     
@@ -1835,22 +1835,23 @@
 tSSL = C
-ryptsy
+oinWarz
 .STRICT_
@@ -2306,432 +2306,8 @@
 %7D,%0A%0A
-        // Make a private API request%0A        _private: function(parameters, callback)%7B%0A            var options;%0A%0A            parameters.nonce = nonce();%0A            options = %7B%0A                method: 'POST',%0A                url: PRIVATE_API_URL,%0A                form: parameters,%0A                headers: this._getPrivateHeaders(parameters)%0A            %7D;%0A%0A            return this._request(options, callback);%0A        %7D,%0A%0A
 %0A   
@@ -3159,35 +3159,32 @@
 ,%0A%0A%0A        ////
-/%0A%0A
 %0A        // PRIV
@@ -3180,2289 +3180,28 @@
     
-// PRIVATE METHODS%0A%0A        myBalances: function(callback)%7B%0A            var parameters = %7B%0A                    command: 'returnBalances'%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D,%0A%0A        myOpenOrders: function(currencyA, currencyB, callback)%7B%0A            var parameters = %7B%0A                    command: 'returnOpenOrders',%0A                    currencyPair: joinCurrencies(currencyA, currencyB)%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D,%0A%0A        myTradeHistory: function(currencyA, currencyB, callback)%7B%0A            var parameters = %7B%0A                    command: 'returnTradeHistory',%0A                    currencyPair: joinCurrencies(currencyA, currencyB)%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D,%0A%0A        buy: function(currencyA, currencyB, rate, amount, callback)%7B%0A            var parameters = %7B%0A                    command: 'buy',%0A                    currencyPair: joinCurrencies(currencyA, currencyB),%0A                    rate: rate,%0A                    amount: amount%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D,%0A%0A        sell: function(currencyA, currencyB, rate, amount, callback)%7B%0A            var parameters = %7B%0A                    command: 'sell',%0A                    currencyPair: joinCurrencies(currencyA, currencyB),%0A                    rate: rate,%0A                    amount: amount%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D,%0A%0A        cancelOrder: function(currencyA, currencyB, orderNumber, callback)%7B%0A            var parameters = %7B%0A                    command: 'cancelOrder',%0A                    currencyPair: joinCurrencies(currencyA, currencyB),%0A                    orderNumber: orderNumber%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D,%0A%0A        withdraw: function(currency, amount, address, callback)%7B%0A            var parameters = %7B%0A                    command: 'withdraw',%0A                    currency: currency,%0A                    amount: amount,%0A                    address: address%0A                %7D;%0A%0A            return this._private(parameters, callback);%0A        %7D%0A    %7D;%0A%0A    return Cryptsy
+%0A    return CoinWarz
 ;%0A%7D(

Update apiCoinWarz.js