Fixed linting issues
This commit is contained in:
@@ -49,6 +49,7 @@ export class CryptoCompareOHLCVSource {
|
||||
public readonly defaultExchange = 'CCCAGG';
|
||||
public readonly interval = this.intervalBetweenRecords * MAX_PAGE_SIZE; // the hourly API returns data for one interval at a time
|
||||
private readonly _url: string = 'https://min-api.cryptocompare.com/data/histohour?';
|
||||
private readonly _priceUrl: string = 'https://min-api.cryptocompare.com/data/price?';
|
||||
|
||||
// rate-limit for all API calls through this class instance
|
||||
private readonly _limiter: Bottleneck;
|
||||
@@ -102,8 +103,8 @@ export class CryptoCompareOHLCVSource {
|
||||
}
|
||||
|
||||
public async getUsdPriceAsync(symbol: string): Promise<number> {
|
||||
const priceUrl = `https://min-api.cryptocompare.com/data/price?tsyms=USD&fsym=${symbol}`;
|
||||
const resp = await fetchAsync(priceUrl);
|
||||
const usdUrl = `${this._priceUrl}tsyms=USD&fsym=${symbol}`;
|
||||
const resp = await fetchAsync(usdUrl);
|
||||
const respJson: CryptoCompareUsdPrice = await resp.json();
|
||||
return respJson.USD;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import * as R from 'ramda';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
|
||||
import { logUtils } from '@0x/utils';
|
||||
|
||||
import { CryptoCompareOHLCVSource } from '../data_sources/ohlcv_external/crypto_compare';
|
||||
import { EdpsSource } from '../data_sources/dex_prices';
|
||||
import { CryptoCompareOHLCVSource } from '../data_sources/ohlcv_external/crypto_compare';
|
||||
import { Slippage } from '../entities';
|
||||
import * as ormConfig from '../ormconfig';
|
||||
import { calculateSlippage } from '../parsers/slippage';
|
||||
@@ -22,7 +21,6 @@ const USD_AMOUNTS = [10, 100, 1000, 10000];
|
||||
|
||||
// TODO: fetch from database
|
||||
const TOKENS = ['BAT', 'DAI', 'FUN', 'MANA', 'OMG', 'REP', 'TUSD', 'ZRX', 'MKR', 'BNB', 'USDC', 'LOOM', 'DNT', 'CVC'];
|
||||
//const TOKENS = ['BAT', 'DNT', 'CVC', 'MANA'];
|
||||
|
||||
let connection: Connection;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import 'mocha';
|
||||
|
||||
import { EdpsExchange, EdpsWrapper } from '../../../src/data_sources/dex_prices';
|
||||
import { EdpsWrapper } from '../../../src/data_sources/dex_prices';
|
||||
import { Slippage } from '../../../src/entities';
|
||||
import { calculateSlippage } from '../../../src/parsers/slippage';
|
||||
import { chaiSetup } from '../../utils/chai_setup';
|
||||
|
||||
Reference in New Issue
Block a user