nefertiti-node
Version:
ES module to work with Nefertiti crypto trade bot.
25 lines (21 loc) • 721 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getAvailableMarkets;
var _child_process = require("child_process");
var _variables = require("./variables.js");
/**
* @function getAvailableMarkets
* @description Get all of the available markets for an exchange
* @param {string} exchangeCode - Exchange to use. can be code: 'kucn' or name: 'kucoin'
* @returns {array} returns an array of objects
*
* @example
*
* const gdaxMarkets = getAvailableMarkets('gdax');
*/
function getAvailableMarkets(exchangeCode) {
const stdout = (0, _child_process.execFileSync)(_variables.executable, ['markets', `--exchange=${exchangeCode}`]);
return JSON.parse(stdout);
}