Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import path from 'path';
import fetch from 'node-fetch';
import Promise from 'bluebird';
import fs from 'fs';
import jsonformat from 'json-format';
import draftLog from 'draftlog';
const iconOutputPath = `${__dirname}${path.sep}..${path.sep}imgs${path.sep}cryptoIcons${path.sep}/`;
const translationFile = `${__dirname}${path.sep}..${path.sep}js${path.sep}` +
`languages${path.sep}/en_US.json`;
draftLog(console);
let whitelist = {};
/*
* The whitelist is obtained from the ticker. It is a mapping of currency code
* to CMC id. In the event of duplicate crypto currency codes the CMC id listed in
* the whitelist will be used. For dupes not listed, the first one in the results
* set obtained from CMC will be used (which is likely the one that was
* listed with CMC the longest).
*/
function getWhitelist() {
return new Promise((resolve, reject) => {
fetch('https://ticker.openbazaar.org/whitelist')
.then(res => resolve(res.json()))
.catch(err => reject(err));
});
import Draftlog from 'draftlog';
import chalk from 'chalk';
Draftlog(console);
export const info = (...args) => `${chalk.bgBlue(' INFO ')}: ${args.join(' ')}`;
export const warn = (...args) => `${chalk.keyword('orange').inverse(' WARN ')}: ${args.join(' ')}`;
export const erro = (...args) => `${chalk.bgRed(' ERRO ')}: ${args.join(' ')}`;
export default console;