
/*
 *
 * 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.
 *
 */

/*
 * Module IDs for wrappers and utilities.
 */
const MOD_ID_WRAPPER_PUSH = "./api/push.js";
const MOD_ID_WRAPPER_PUBLIC = "./api/public.js";
const MOD_ID_WRAPPER_TRADING = "./api/trading.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);

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

@@ -505,24 +505,82 @@
 rading.js%22;%0A
+const MOD_ID_UTIL_TRADING_PAIR = %22./util/TradingPair.js%22;%0A
 const MOD_ID
@@ -1757,24 +1757,126 @@
 _TRADING);%0A%0A
+/*%0A * Trading pair utility constructor.%0A */%0Aexports.TradingPair = require(MOD_ID_UTIL_TRADING_PAIR);%0A%0A
 /*%0A * Order 

Add TradingPair