diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-09-26 06:03:49 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 19:04:24 +0800 |
commit | 5262d3b1f2227d5e4988e801a4318aa6e0e0ab68 (patch) | |
tree | b083e49535d4f390bc3ce7e33aa22b10b71ddd2c /packages/pipeline/src/index.ts | |
parent | 7d9afce13b0e84d778cf82ddb42366ac3213d1b1 (diff) | |
download | dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.tar dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.tar.gz dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.tar.bz2 dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.tar.lz dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.tar.xz dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.tar.zst dexon-sol-tools-5262d3b1f2227d5e4988e801a4318aa6e0e0ab68.zip |
Implement scraping and parsing exchange cancel events
Diffstat (limited to 'packages/pipeline/src/index.ts')
-rw-r--r-- | packages/pipeline/src/index.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/pipeline/src/index.ts b/packages/pipeline/src/index.ts index c01ff57b4..c68df95bf 100644 --- a/packages/pipeline/src/index.ts +++ b/packages/pipeline/src/index.ts @@ -2,6 +2,7 @@ import 'reflect-metadata'; import { createConnection } from 'typeorm'; import { Etherscan } from './data_sources/etherscan'; +import { ExchangeCancelEvent } from './entities/ExchangeCancelEvent'; import { ExchangeFillEvent } from './entities/ExchangeFillEvent'; import { config } from './ormconfig'; @@ -12,12 +13,16 @@ const EXCHANGE_ADDRESS = '0x4f833a24e1f95d70f028921e27040ca56e09ab0b'; (async () => { const connection = await createConnection(config); - const repository = connection.getRepository(ExchangeFillEvent); - console.log(`found ${await repository.count()} existing fill events`); + const fillRepository = connection.getRepository(ExchangeFillEvent); + const cancelRepository = connection.getRepository(ExchangeCancelEvent); + console.log(`found ${await fillRepository.count()} existing fill events`); + console.log(`found ${await cancelRepository.count()} existing cancel events`); const rawEvents = await etherscan.getContractEventsAsync(EXCHANGE_ADDRESS); const events = parseExchangeEvents(rawEvents); + console.log(`got ${events.length} parsed events`); for (const event of events) { await event.save(); } - console.log(`now ${await repository.count()} total fill events`); + console.log(`now ${await fillRepository.count()} total fill events`); + console.log(`now ${await cancelRepository.count()} total cancel events`); })(); |