aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities/transaction.ts
blob: 74205017767297e8f173c0f081e3de6962cc7c5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { BigNumber } from '@0x/utils';
import { Column, Entity, PrimaryColumn } from 'typeorm';

import { bigNumberTransformer, numberToBigIntTransformer } from '../utils';

@Entity({ name: 'transactions', schema: 'raw' })
export class Transaction {
    @PrimaryColumn({ name: 'transaction_hash' })
    public transactionHash!: string;
    @PrimaryColumn({ name: 'block_hash' })
    public blockHash!: string;
    @PrimaryColumn({ name: 'block_number', transformer: numberToBigIntTransformer })
    public blockNumber!: number;

    @Column({ type: 'numeric', name: 'gas_used', transformer: bigNumberTransformer })
    public gasUsed!: BigNumber;
    @Column({ type: 'numeric', name: 'gas_price', transformer: bigNumberTransformer })
    public gasPrice!: BigNumber;
}