diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-24 07:03:52 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 06:24:48 +0800 |
commit | bb440b683a7a4d966694de2b897f51f22dadb31c (patch) | |
tree | 216304717c10083d477898576beb1c4658163a7c /packages/pipeline/src/entities | |
parent | d959b3e23402840661f45a2b5ecd5ca64dcdabf3 (diff) | |
download | dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar.gz dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar.bz2 dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar.lz dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar.xz dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar.zst dexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.zip |
Implement support for getting and parsing blocks and transactions
Diffstat (limited to 'packages/pipeline/src/entities')
-rw-r--r-- | packages/pipeline/src/entities/Block.ts | 9 | ||||
-rw-r--r-- | packages/pipeline/src/entities/Transaction.ts | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/packages/pipeline/src/entities/Block.ts b/packages/pipeline/src/entities/Block.ts new file mode 100644 index 000000000..49e0ef840 --- /dev/null +++ b/packages/pipeline/src/entities/Block.ts @@ -0,0 +1,9 @@ +import { Column, Entity, PrimaryColumn } from 'typeorm'; + +@Entity() +export class Block { + @PrimaryColumn() public hash!: string; + @PrimaryColumn() public number!: number; + + @Column() public unixTimestampSeconds!: number; +} diff --git a/packages/pipeline/src/entities/Transaction.ts b/packages/pipeline/src/entities/Transaction.ts new file mode 100644 index 000000000..d89d44746 --- /dev/null +++ b/packages/pipeline/src/entities/Transaction.ts @@ -0,0 +1,11 @@ +import { Column, Entity, PrimaryColumn } from 'typeorm'; + +@Entity() +export class Transaction { + @PrimaryColumn() public transactionHash!: string; + @PrimaryColumn() public blockHash!: string; + @PrimaryColumn() public blockNumber!: number; + + @Column() public gasUsed!: number; + @Column() public gasPrice!: number; +} |