MCPcopy Create free account
hub / github.com/ccxt/ccxt / getExchangeSettings

Function getExchangeSettings

utils/update-static-tests-data.js:17–26  ·  view source on GitHub ↗
(exchangeId)

Source from the content-addressed store, hash-verified

15const rootDir = __dirname + '/../';
16const useJsonParsing = false;
17function getExchangeSettings(exchangeId) {
18 // set up keys and settings, if any
19 const keysGlobal = path.resolve(rootDir + '/keys.json');
20 const keysLocal = path.resolve(rootDir + '/keys.local.json');
21 const keysFile = fs.existsSync(keysLocal) ? keysLocal : keysGlobal;
22 const settingsFile = fs.readFileSync(keysFile);
23 let settings = JSON.parse(settingsFile.toString());
24 settings = settings[exchangeId] || {};
25 return settings;
26}
27function jsonStringify(elem, spaces = 4) {
28 return JSON.stringify(elem, (k, v) => (v === undefined ? null : v), spaces); // preserve undefined values and convert them to null
29}

Callers

nothing calls this directly

Calls 3

resolveMethod · 0.65
parseMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…