Factor out redundant source param in parse order functions
This commit is contained in:
@@ -2,7 +2,7 @@ import { logUtils } from '@0x/utils';
|
||||
import * as R from 'ramda';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
|
||||
import { DDEX_SOURCE, DdexMarket, DdexSource } from '../data_sources/ddex';
|
||||
import { DdexMarket, DdexSource } from '../data_sources/ddex';
|
||||
import { TokenOrderbookSnapshot as TokenOrder } from '../entities';
|
||||
import * as ormConfig from '../ormconfig';
|
||||
import { parseDdexOrders } from '../parsers/ddex_orders';
|
||||
@@ -43,7 +43,7 @@ async function getAndSaveMarketOrderbookAsync(ddexSource: DdexSource, market: Dd
|
||||
const observedTimestamp = Date.now();
|
||||
|
||||
logUtils.log(`${market.id}: Parsing orders.`);
|
||||
const orders = parseDdexOrders(orderBook, market, observedTimestamp, DDEX_SOURCE);
|
||||
const orders = parseDdexOrders(orderBook, market, observedTimestamp);
|
||||
|
||||
if (orders.length > 0) {
|
||||
logUtils.log(`${market.id}: Saving ${orders.length} orders.`);
|
||||
|
@@ -2,7 +2,7 @@ import { logUtils } from '@0x/utils';
|
||||
import * as R from 'ramda';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
|
||||
import { IDEX_SOURCE, IdexSource } from '../data_sources/idex';
|
||||
import { IdexSource } from '../data_sources/idex';
|
||||
import { TokenOrderbookSnapshot as TokenOrder } from '../entities';
|
||||
import * as ormConfig from '../ormconfig';
|
||||
import { parseIdexOrders } from '../parsers/idex_orders';
|
||||
@@ -51,7 +51,7 @@ async function getAndSaveMarketOrderbookAsync(idexSource: IdexSource, marketId:
|
||||
}
|
||||
|
||||
logUtils.log(`${marketId}: Parsing orders.`);
|
||||
const orders = parseIdexOrders(orderBook, observedTimestamp, IDEX_SOURCE);
|
||||
const orders = parseIdexOrders(orderBook, observedTimestamp);
|
||||
|
||||
if (orders.length > 0) {
|
||||
logUtils.log(`${marketId}: Saving ${orders.length} orders.`);
|
||||
|
@@ -2,7 +2,7 @@ import { logUtils } from '@0x/utils';
|
||||
import * as R from 'ramda';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
|
||||
import { OASIS_SOURCE, OasisMarket, OasisSource } from '../data_sources/oasis';
|
||||
import { OasisMarket, OasisSource } from '../data_sources/oasis';
|
||||
import { TokenOrderbookSnapshot as TokenOrder } from '../entities';
|
||||
import * as ormConfig from '../ormconfig';
|
||||
import { parseOasisOrders } from '../parsers/oasis_orders';
|
||||
@@ -46,7 +46,7 @@ async function getAndSaveMarketOrderbookAsync(oasisSource: OasisSource, market:
|
||||
const observedTimestamp = Date.now();
|
||||
|
||||
logUtils.log(`${market.id}: Parsing orders.`);
|
||||
const orders = parseOasisOrders(orderBook, market, observedTimestamp, OASIS_SOURCE);
|
||||
const orders = parseOasisOrders(orderBook, market, observedTimestamp);
|
||||
|
||||
if (orders.length > 0) {
|
||||
logUtils.log(`${market.id}: Saving ${orders.length} orders.`);
|
||||
|
@@ -2,7 +2,6 @@ import { logUtils } from '@0x/utils';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
|
||||
import {
|
||||
PARADEX_SOURCE,
|
||||
ParadexActiveMarketsResponse,
|
||||
ParadexMarket,
|
||||
ParadexSource,
|
||||
@@ -75,7 +74,7 @@ async function getAndSaveMarketOrderbookAsync(paradexSource: ParadexSource, mark
|
||||
const observedTimestamp = Date.now();
|
||||
|
||||
logUtils.log(`${market.symbol}: Parsing orders.`);
|
||||
const orders = parseParadexOrders(paradexOrderbookResponse, market, observedTimestamp, PARADEX_SOURCE);
|
||||
const orders = parseParadexOrders(paradexOrderbookResponse, market, observedTimestamp);
|
||||
|
||||
if (orders.length > 0) {
|
||||
logUtils.log(`${market.symbol}: Saving ${orders.length} orders.`);
|
||||
|
@@ -3,7 +3,7 @@ import { RadarMarket } from '@radarrelay/types';
|
||||
import * as R from 'ramda';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
|
||||
import { RADAR_SOURCE, RadarSource } from '../data_sources/radar';
|
||||
import { RadarSource } from '../data_sources/radar';
|
||||
import { TokenOrderbookSnapshot as TokenOrder } from '../entities';
|
||||
import * as ormConfig from '../ormconfig';
|
||||
import { parseRadarOrders } from '../parsers/radar_orders';
|
||||
@@ -44,7 +44,7 @@ async function getAndSaveMarketOrderbookAsync(radarSource: RadarSource, market:
|
||||
const observedTimestamp = Date.now();
|
||||
|
||||
logUtils.log(`${market.id}: Parsing orders.`);
|
||||
const orders = parseRadarOrders(orderBook, market, observedTimestamp, RADAR_SOURCE);
|
||||
const orders = parseRadarOrders(orderBook, market, observedTimestamp);
|
||||
|
||||
if (orders.length > 0) {
|
||||
logUtils.log(`${market.id}: Saving ${orders.length} orders.`);
|
||||
|
Reference in New Issue
Block a user