aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/index.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-09-26 07:03:54 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 06:24:06 +0800
commitb0de2a388fc7079bc45c7886b002420783021416 (patch)
treebc8c255fce21f2cbd3f45d375d3d1fd59dbfe45b /packages/pipeline/src/index.ts
parent40610830da70ae406227e80c700efea11042ba68 (diff)
downloaddexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.tar
dexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.tar.gz
dexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.tar.bz2
dexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.tar.lz
dexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.tar.xz
dexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.tar.zst
dexon-sol-tools-b0de2a388fc7079bc45c7886b002420783021416.zip
Implement scraping and parsing exchange CancelUpTo events
Diffstat (limited to 'packages/pipeline/src/index.ts')
-rw-r--r--packages/pipeline/src/index.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/pipeline/src/index.ts b/packages/pipeline/src/index.ts
index 67b1f6fb2..1a010b6e5 100644
--- a/packages/pipeline/src/index.ts
+++ b/packages/pipeline/src/index.ts
@@ -5,6 +5,7 @@ import { createConnection } from 'typeorm';
import { Etherscan } from './data_sources/etherscan';
import { parseExchangeEvents } from './data_types/events/exchange_events';
import { ExchangeCancelEvent } from './entities/ExchangeCancelEvent';
+import { ExchangeCancelUpToEvent } from './entities/ExchangeCancelUpToEvent';
import { ExchangeFillEvent } from './entities/ExchangeFillEvent';
import { config } from './ormconfig';
@@ -15,14 +16,12 @@ const EXCHANGE_ADDRESS = '0x4f833a24e1f95d70f028921e27040ca56e09ab0b';
const connection = await createConnection(config);
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 cancelUpToRepository = connection.getRepository(ExchangeCancelUpToEvent);
+ console.log(`found ${(await fillRepository.count()) + (await cancelRepository.count())} existing 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 fillRepository.count()} total fill events`);
- console.log(`now ${await cancelRepository.count()} total cancel events`);
+ console.log(`now there are ${(await fillRepository.count()) + (await cancelRepository.count())} total events`);
})();