
/*
 *
 * poloniex-unofficial
 * https://git.io/polonode
 *
 * Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency
 * exchange APIs.
 *
 * Copyright (c) 2016 Tyler Filla
 *
 * This software may be modified and distributed under the terms of the MIT
 * license. See the LICENSE file for details.
 *
 */

"use strict";

/*
 * Module IDs for wrappers and utilities.
 */
const MOD_ID_WRAPPER_PUSH = "./api/PushWrapper.js";
const MOD_ID_WRAPPER_PUBLIC = "./api/PublicWrapper.js";
const MOD_ID_WRAPPER_TRADING = "./api/TradingWrapper.js";
const MOD_ID_UTIL_CURRENCY_PAIR = "./util/CurrencyPair.js";
const MOD_ID_UTIL_ORDER_BOOK = "./util/OrderBook.js";

/*
 * Legacy API selector function. Deprecated.
 */
exports.api = function(name, params) {
    // Module ID
    var modId;

    // Get module ID from wrapper name
    switch (name) {
    case "push":
        modId = MOD_ID_WRAPPER_PUSH;
        break;
    case "public":
        modId = MOD_ID_WRAPPER_PUBLIC;
        break;
    case "trading":
        modId = MOD_ID_WRAPPER_TRADING;
        break;
    }

    // Abort if module isn't available
    if (!modId) {
        return;
    }

    // Get the API wrapper constructor
    var wrapper = require(modId);

    // If params were supplied
    if (params) {
        // Instantiate wrapper with authentication parameters
        return new wrapper(params.key, params.secret);
    } else {
        // Instantiate wrapper without authentication parameters
        return new wrapper();
    }
};

/*
 * Push API wrapper constructor.
 */
exports.PushWrapper = require(MOD_ID_WRAPPER_PUSH);

/*
 * Public API wrapper constructor.
 */
exports.PublicWrapper = require(MOD_ID_WRAPPER_PUBLIC);

/*
 * Trading API wrapper constructor.
 */
exports.TradingWrapper = require(MOD_ID_WRAPPER_TRADING);

/*
 * Currency pair utility constructor.
 */
exports.CurrencyPair = require(MOD_ID_UTIL_CURRENCY_PAIR);

/*
 * Order book utility constructor.
 */
exports.OrderBook = require(MOD_ID_UTIL_ORDER_BOOK);

@@ -340,1174 +340,95 @@
 %0A * 
-Module IDs for wrappers and utilities.%0A */%0Aconst MOD_ID_WRAPPER_PUSH = %22./api/PushWrapper.js%22;%0Aconst MOD_ID_WRAPPER_PUBLIC = %22./api/PublicWrapper.js%22;%0Aconst MOD_ID_WRAPPER_TRADING = %22./api/TradingWrapper.js%22;%0Aconst MOD_ID_UTIL_CURRENCY_PAIR = %22./util/CurrencyPair.js%22;%0Aconst MOD_ID_UTIL_ORDER_BOOK = %22./util/OrderBook.js%22;%0A%0A/*%0A * Legacy API selector function. Deprecated.%0A */%0Aexports.api = function(name, params) %7B%0A    // Module ID%0A    var modId;%0A%0A    // Get module ID from wrapper name%0A    switch (name) %7B%0A    case %22push%22:%0A        modId = MOD_ID_WRAPPER_PUSH;%0A        break;%0A    case %22public%22:%0A        modId = MOD_ID_WRAPPER_PUBLIC;%0A        break;%0A    case %22trading%22:%0A        modId = MOD_ID_WRAPPER_TRADING;%0A        break;%0A    %7D%0A%0A    // Abort if module isn't available%0A    if (!modId) %7B%0A        return;%0A    %7D%0A%0A    // Get the API wrapper constructor%0A    var wrapper = require(modId);%0A%0A    // If params were supplied%0A    if (params) %7B%0A        // Instantiate wrapper with authentication parameters%0A        return new wrapper(params.key, params.secret);%0A    %7D else %7B%0A        // Instantiate wrapper without authentication parameters%0A        return new wrapper();%0A    %7D%0A%7D
+Push API wrapper constructor.%0A */%0Aexports.PushWrapper = require(%22./api/PushWrapper.js%22)
 ;%0A%0A/
@@ -426,34 +426,36 @@
 .js%22);%0A%0A/*%0A * Pu
-sh
+blic
  API wrapper con
@@ -470,34 +470,36 @@
 .%0A */%0Aexports.Pu
-sh
+blic
 Wrapper = requir
@@ -504,126 +504,32 @@
 ire(
-MOD_ID_WRAPPER_PUSH);%0A%0A/*%0A * Public API wrapper constructor.%0A */%0Aexports.PublicWrapper = require(MOD_ID_WRAPPER_PUBLIC
+%22./api/PublicWrapper.js%22
 );%0A%0A
@@ -608,30 +608,33 @@
 ire(
-MOD_ID_WRAPPER_TRADING
+%22./api/TradingWrapper.js%22
 );%0A%0A
@@ -713,33 +713,32 @@
 ire(
-MOD_ID_UTIL_CURRENCY_PAIR
+%22./util/CurrencyPair.js%22
 );%0A%0A
@@ -811,29 +811,28 @@
 ire(
-MOD_ID_UTIL_ORDER_BOOK
+%22./util/OrderBook.js%22
 );%0A

Remove legacy api() selector function