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

Function getExchangeSettings

cli/ts/cache.ts:65–84  ·  view source on GitHub ↗
(exchangeId: string)

Source from the content-addressed store, hash-verified

63}
64
65function getExchangeSettings (exchangeId: string) {
66 let settingsPath = path.join (getCacheDirectory (), 'config.json');
67 const config = loadMainConfigFile ();
68
69 if ('cachePath' in config) {
70 settingsPath = config['cachePath'];
71 }
72
73 if (!fs.existsSync (settingsPath)) {
74 log.error ('The specified config file was not found: ' + settingsPath);
75 }
76
77 const settings = JSON.parse (fs.readFileSync (settingsPath).toString ());
78
79 if (exchangeId in settings) {
80 return settings[exchangeId];
81 }
82
83 return {};
84}
85
86/**
87 *

Callers

nothing calls this directly

Calls 5

getCacheDirectoryFunction · 0.85
loadMainConfigFileFunction · 0.85
errorMethod · 0.45
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…