diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-09-18 02:27:38 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-13 01:11:46 +0800 |
commit | eb1317a59abec368f3855eb3690e40d8db2a8984 (patch) | |
tree | c612db4cc6287a8b1f95d3cd458f332d68853adf /packages/pipeline/src/models/event.ts | |
parent | 98325e1cfb4f6c732728fe2943895fad2cb03be5 (diff) | |
download | dexon-0x-contracts-eb1317a59abec368f3855eb3690e40d8db2a8984.tar.gz dexon-0x-contracts-eb1317a59abec368f3855eb3690e40d8db2a8984.tar.zst dexon-0x-contracts-eb1317a59abec368f3855eb3690e40d8db2a8984.zip |
Rebase pipeline branch off development
Diffstat (limited to 'packages/pipeline/src/models/event.ts')
-rw-r--r-- | packages/pipeline/src/models/event.ts | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/packages/pipeline/src/models/event.ts b/packages/pipeline/src/models/event.ts new file mode 100644 index 000000000..cb1c939e5 --- /dev/null +++ b/packages/pipeline/src/models/event.ts @@ -0,0 +1,84 @@ +const event = { + tableName: 'events', + tableProperties: { + id: { + type: 'key', + }, + timestamp: { + type: 'timestamp', + required: true, + }, + event_type: { + type: 'varchar', + required: true, + }, + error_id: { + type: 'varchar', + }, + order_hash: { + type: 'char(66)', + }, + maker: { + type: 'char(42)', + }, + maker_amount: { + type: 'varchar', + }, + maker_fee: { + type: 'varchar', + }, + maker_token: { + type: 'char(42)', + }, + taker_amount: { + type: 'varchar', + }, + taker_fee: { + type: 'varchar', + }, + taker_token: { + type: 'char(42)', + }, + txn_hash: { + type: 'char(66)', + }, + gas_used: { + type: 'varchar', + }, + gas_price: { + type: 'varchar', + }, + fee_recipient: { + type: 'char(42)', + }, + method_id: { + type: 'char(10)', + }, + salt: { + type: 'varchar', + }, + block_number: { + type: 'bigint', + }, + }, +}; +const logToEventSchemaMapping: any = { + blockNumber: 'block_number', + transactionHash: 'txn_hash', + event: 'event_type', + logIndex: 'log_index', + 'args.maker': 'maker', + 'args.taker': 'taker', + 'args.feeRecipient': 'fee_recipient', + 'args.makerToken': 'maker_token', + 'args.takerToken': 'taker_token', + 'args.filledMakerTokenAmount': 'maker_amount', + 'args.filledTakerTokenAmount': 'taker_amount', + 'args.paidMakerFee': 'maker_fee', + 'args.paidTakerFee': 'taker_fee', + 'args.orderHash': 'order_hash', + 'args.cancelledMakerTokenAmount': 'maker_amount', + 'args.cancelledTakerTokenAmount': 'taker_amount', + 'args.errorId': 'error_id', +}; +export { event, logToEventSchemaMapping }; |