aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-10-24 07:03:52 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:04:24 +0800
commit1402a3dfae1be32a346f8b75a4209950bda00b74 (patch)
treecdd899665634759da68b51a6d4b57e6a7c47a10e /packages/pipeline/src/entities
parent64865bc10f88f97c3e406bbc1d39e68ca45380ef (diff)
downloaddexon-sol-tools-1402a3dfae1be32a346f8b75a4209950bda00b74.tar.gz
dexon-sol-tools-1402a3dfae1be32a346f8b75a4209950bda00b74.tar.zst
dexon-sol-tools-1402a3dfae1be32a346f8b75a4209950bda00b74.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;
+}