aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-10-24 07:03:52 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 06:24:48 +0800
commitbb440b683a7a4d966694de2b897f51f22dadb31c (patch)
tree216304717c10083d477898576beb1c4658163a7c /packages/pipeline/src/entities
parentd959b3e23402840661f45a2b5ecd5ca64dcdabf3 (diff)
downloaddexon-0x-contracts-bb440b683a7a4d966694de2b897f51f22dadb31c.tar.gz
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.ts9
-rw-r--r--packages/pipeline/src/entities/Transaction.ts11
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;
+}