aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2019-01-31 02:12:15 +0800
committerfragosti <francesco.agosti93@gmail.com>2019-01-31 02:12:15 +0800
commitc2ad95fd94611dba2030778553380cf07a85a4c3 (patch)
tree337be782f27f2bd3a2dc88da6a5f65b592a4c92c
parent5ad2e9d6b6b1ff7c5327975501e8c042a5817ab9 (diff)
downloaddexon-0x-contracts-c2ad95fd94611dba2030778553380cf07a85a4c3.tar.gz
dexon-0x-contracts-c2ad95fd94611dba2030778553380cf07a85a4c3.tar.zst
dexon-0x-contracts-c2ad95fd94611dba2030778553380cf07a85a4c3.zip
update types to adhere to new dex trades and bloxy api format
-rw-r--r--packages/pipeline/src/data_sources/bloxy/index.ts1
-rw-r--r--packages/pipeline/src/entities/dex_trade.ts2
-rw-r--r--packages/pipeline/src/parsers/bloxy/index.ts1
-rw-r--r--packages/pipeline/test/entities/dex_trades_test.ts1
-rw-r--r--packages/pipeline/test/parsers/bloxy/index_test.ts2
-rw-r--r--yarn.lock25
6 files changed, 32 insertions, 0 deletions
diff --git a/packages/pipeline/src/data_sources/bloxy/index.ts b/packages/pipeline/src/data_sources/bloxy/index.ts
index 3d9147757..bba424f67 100644
--- a/packages/pipeline/src/data_sources/bloxy/index.ts
+++ b/packages/pipeline/src/data_sources/bloxy/index.ts
@@ -27,6 +27,7 @@ export interface BloxyTrade {
tx_time: string;
tx_date: string;
tx_sender: string;
+ tradeIndex: string;
smart_contract_id: number;
smart_contract_address: string;
contract_type: string;
diff --git a/packages/pipeline/src/entities/dex_trade.ts b/packages/pipeline/src/entities/dex_trade.ts
index 9d288cb51..93dcaf238 100644
--- a/packages/pipeline/src/entities/dex_trade.ts
+++ b/packages/pipeline/src/entities/dex_trade.ts
@@ -9,6 +9,8 @@ export class DexTrade {
public sourceUrl!: string;
@PrimaryColumn({ name: 'tx_hash' })
public txHash!: string;
+ @PrimaryColumn({ name: 'trade_index' })
+ public tradeIndex!: string;
@Column({ name: 'tx_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
public txTimestamp!: number;
diff --git a/packages/pipeline/src/parsers/bloxy/index.ts b/packages/pipeline/src/parsers/bloxy/index.ts
index caa55d289..3d797aff0 100644
--- a/packages/pipeline/src/parsers/bloxy/index.ts
+++ b/packages/pipeline/src/parsers/bloxy/index.ts
@@ -21,6 +21,7 @@ export function _parseBloxyTrade(rawTrade: BloxyTrade): DexTrade {
const dexTrade = new DexTrade();
dexTrade.sourceUrl = BLOXY_DEX_TRADES_URL;
dexTrade.txHash = rawTrade.tx_hash;
+ dexTrade.tradeIndex = rawTrade.tradeIndex;
dexTrade.txTimestamp = new Date(rawTrade.tx_time).getTime();
dexTrade.txDate = rawTrade.tx_date;
dexTrade.txSender = rawTrade.tx_sender;
diff --git a/packages/pipeline/test/entities/dex_trades_test.ts b/packages/pipeline/test/entities/dex_trades_test.ts
index 83aaeec8f..7c4829988 100644
--- a/packages/pipeline/test/entities/dex_trades_test.ts
+++ b/packages/pipeline/test/entities/dex_trades_test.ts
@@ -33,6 +33,7 @@ const baseTrade = {
takerAnnotation: '',
protocol: 'Kyber Network Proxy',
sellAddress: '0xbf2179859fc6d5bee9bf9158632dc51678a4100e',
+ tradeIndex: '3',
};
const tradeWithNullAddresses: DexTrade = R.merge(baseTrade, {
diff --git a/packages/pipeline/test/parsers/bloxy/index_test.ts b/packages/pipeline/test/parsers/bloxy/index_test.ts
index 6aabb091d..d270bd2a7 100644
--- a/packages/pipeline/test/parsers/bloxy/index_test.ts
+++ b/packages/pipeline/test/parsers/bloxy/index_test.ts
@@ -17,6 +17,7 @@ const baseInput: BloxyTrade = {
tx_time: '2018-11-21T09:06:28.000+00:00',
tx_date: '2018-11-21',
tx_sender: '0x00923b9a074762b93650716333b3e1473a15048e',
+ tradeIndex: '1',
smart_contract_id: 7091917,
smart_contract_address: '0x818e6fecd516ecc3849daf6845e3ec868087b755',
contract_type: 'DEX/Kyber Network Proxy',
@@ -40,6 +41,7 @@ const baseInput: BloxyTrade = {
const baseExpected: DexTrade = {
sourceUrl: BLOXY_DEX_TRADES_URL,
txHash: '0xb93a7faf92efbbb5405c9a73cd4efd99702fe27c03ff22baee1f1b1e37b3a0bf',
+ tradeIndex: '1',
txTimestamp: 1542791188000,
txDate: '2018-11-21',
txSender: '0x00923b9a074762b93650716333b3e1473a15048e',
diff --git a/yarn.lock b/yarn.lock
index 1b51eff11..3bc39a830 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -13495,6 +13495,15 @@ react-dom@^16.3.2:
object-assign "^4.1.1"
prop-types "^15.6.0"
+react-dom@^16.4.2:
+ version "16.7.0"
+ resolved "https://registry.npmjs.org/react-dom/-/react-dom-16.7.0.tgz#a17b2a7ca89ee7390bc1ed5eb81783c7461748b8"
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ scheduler "^0.12.0"
+
react-dom@^16.5.2:
version "16.5.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7"
@@ -13821,6 +13830,15 @@ react@^16.3.2:
object-assign "^4.1.1"
prop-types "^15.6.0"
+react@^16.4.2:
+ version "16.7.0"
+ resolved "https://registry.npmjs.org/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381"
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ scheduler "^0.12.0"
+
react@^16.5.2:
version "16.5.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42"
@@ -14709,6 +14727,13 @@ schedule@^0.5.0:
dependencies:
object-assign "^4.1.1"
+scheduler@^0.12.0:
+ version "0.12.0"
+ resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.12.0.tgz#8ab17699939c0aedc5a196a657743c496538647b"
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+
schema-utils@^0.4.4:
version "0.4.7"
resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"