aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-09-26 06:03:49 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-13 01:12:11 +0800
commit25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c (patch)
treeb5b64fceb74a8403f734f6d357c9f0cf80d3be50 /packages/pipeline/src/entities
parent6b889aeeedf4dd2d358834fe2f50a1ce82629b3e (diff)
downloaddexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.tar
dexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.tar.gz
dexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.tar.bz2
dexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.tar.lz
dexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.tar.xz
dexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.tar.zst
dexon-0x-contracts-25f1b7701fa1c5402e7d6f91cccdbd63bb9a525c.zip
Implement scraping and parsing exchange cancel events
Diffstat (limited to 'packages/pipeline/src/entities')
-rw-r--r--packages/pipeline/src/entities/ExchangeCancelEvent.ts32
-rw-r--r--packages/pipeline/src/entities/ExchangeFillEvent.ts6
2 files changed, 35 insertions, 3 deletions
diff --git a/packages/pipeline/src/entities/ExchangeCancelEvent.ts b/packages/pipeline/src/entities/ExchangeCancelEvent.ts
new file mode 100644
index 000000000..8e21518d3
--- /dev/null
+++ b/packages/pipeline/src/entities/ExchangeCancelEvent.ts
@@ -0,0 +1,32 @@
+import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm';
+
+import { AssetType } from '../types';
+
+@Entity()
+export class ExchangeCancelEvent extends BaseEntity {
+ @PrimaryColumn() public logIndex!: number;
+
+ @Column() public address!: string;
+ @Column() public rawData!: string;
+ @Column() public blockNumber!: number;
+
+ @Column() public makerAddress!: string;
+ @Column({ nullable: true, type: String })
+ public takerAddress!: string;
+ @Column() public feeRecepientAddress!: string;
+ @Column() public senderAddress!: string;
+ @Column() public orderHash!: string;
+ @Column() public rawMakerAssetData!: string;
+ @Column() public makerAssetType!: AssetType;
+ @Column() public makerAssetProxyId!: string;
+ @Column() public makerTokenAddress!: string;
+ @Column({ nullable: true, type: String })
+ public makerTokenId!: string | null;
+ @Column() public rawTakerAssetData!: string;
+ @Column() public takerAssetType!: AssetType;
+ @Column() public takerAssetProxyId!: string;
+ @Column() public takerTokenAddress!: string;
+ @Column({ nullable: true, type: String })
+ public takerTokenId!: string | null;
+ // TODO(albrow): Include topics?
+}
diff --git a/packages/pipeline/src/entities/ExchangeFillEvent.ts b/packages/pipeline/src/entities/ExchangeFillEvent.ts
index a7e817240..e66bd64e3 100644
--- a/packages/pipeline/src/entities/ExchangeFillEvent.ts
+++ b/packages/pipeline/src/entities/ExchangeFillEvent.ts
@@ -1,6 +1,6 @@
import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm';
-export type ExchangeFillEventAssetType = 'erc20' | 'erc721';
+import { AssetType } from '../types';
@Entity()
export class ExchangeFillEvent extends BaseEntity {
@@ -20,13 +20,13 @@ export class ExchangeFillEvent extends BaseEntity {
@Column() public takerFeePaid!: string;
@Column() public orderHash!: string;
@Column() public rawMakerAssetData!: string;
- @Column() public makerAssetType!: ExchangeFillEventAssetType;
+ @Column() public makerAssetType!: AssetType;
@Column() public makerAssetProxyId!: string;
@Column() public makerTokenAddress!: string;
@Column({ nullable: true, type: String })
public makerTokenId!: string | null;
@Column() public rawTakerAssetData!: string;
- @Column() public takerAssetType!: ExchangeFillEventAssetType;
+ @Column() public takerAssetType!: AssetType;
@Column() public takerAssetProxyId!: string;
@Column() public takerTokenAddress!: string;
@Column({ nullable: true, type: String })