aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/models/event.ts
blob: cb1c939e590138acb8c753752bc8a9570c6032e6 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const event = {
    tableName: 'events',
    tableProperties: {
        id: {
            type: 'key',
        },
        timestamp: {
            type: 'timestamp',
            required: true,
        },
        event_type: {
            type: 'varchar',
            required: true,
        },
        error_id: {
            type: 'varchar',
        },
        order_hash: {
            type: 'char(66)',
        },
        maker: {
            type: 'char(42)',
        },
        maker_amount: {
            type: 'varchar',
        },
        maker_fee: {
            type: 'varchar',
        },
        maker_token: {
            type: 'char(42)',
        },
        taker_amount: {
            type: 'varchar',
        },
        taker_fee: {
            type: 'varchar',
        },
        taker_token: {
            type: 'char(42)',
        },
        txn_hash: {
            type: 'char(66)',
        },
        gas_used: {
            type: 'varchar',
        },
        gas_price: {
            type: 'varchar',
        },
        fee_recipient: {
            type: 'char(42)',
        },
        method_id: {
            type: 'char(10)',
        },
        salt: {
            type: 'varchar',
        },
        block_number: {
            type: 'bigint',
        },
    },
};
const logToEventSchemaMapping: any = {
    blockNumber: 'block_number',
    transactionHash: 'txn_hash',
    event: 'event_type',
    logIndex: 'log_index',
    'args.maker': 'maker',
    'args.taker': 'taker',
    'args.feeRecipient': 'fee_recipient',
    'args.makerToken': 'maker_token',
    'args.takerToken': 'taker_token',
    'args.filledMakerTokenAmount': 'maker_amount',
    'args.filledTakerTokenAmount': 'taker_amount',
    'args.paidMakerFee': 'maker_fee',
    'args.paidTakerFee': 'taker_fee',
    'args.orderHash': 'order_hash',
    'args.cancelledMakerTokenAmount': 'maker_amount',
    'args.cancelledTakerTokenAmount': 'taker_amount',
    'args.errorId': 'error_id',
};
export { event, logToEventSchemaMapping };