aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities/erc20_approval_event.ts
blob: 69cdfcb0b673a08d42d6b1c18d482f0569784e37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { BigNumber } from '@0x/utils';
import { Column, Entity, PrimaryColumn } from 'typeorm';

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

@Entity({ name: 'erc20_approval_events', schema: 'raw' })
export class ERC20ApprovalEvent {
    @PrimaryColumn({ name: 'token_address' })
    public tokenAddress!: string;
    @PrimaryColumn({ name: 'log_index' })
    public logIndex!: number;
    @PrimaryColumn({ name: 'block_number', transformer: numberToBigIntTransformer })
    public blockNumber!: number;

    @Column({ name: 'raw_data' })
    public rawData!: string;

    @Column({ name: 'transaction_hash' })
    public transactionHash!: string;
    @Column({ name: 'owner_address' })
    public ownerAddress!: string;
    @Column({ name: 'spender_address' })
    public spenderAddress!: string;
    @Column({ name: 'amount', type: 'numeric', transformer: bigNumberTransformer })
    public amount!: BigNumber;
}