-
Notifications
You must be signed in to change notification settings - Fork 20
/
TransactionSchema.ts
103 lines (91 loc) · 2.19 KB
/
TransactionSchema.ts
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import {Schema} from 'mongoose';
interface IContractSharkTx {
status?: string; // current status of the transaction
hash?: string;
txHash?: string;
to?: string;
isV2?: boolean;
isV3?: boolean;
isV2Sushi?: boolean;
isV2Bal?: boolean;
from?: string;
gas?: any;
gasPrice?: any;
gasUsed?: string; // present on on-chain txns
nonce?: number;
value?: any;
blockHash?: string;
cumulativeGasUsed?: number;
transactionHash?: string;
blockNumber?: number;
data: string;
timestampTx: number; // the UTC time of first detection of current status
transactionIndex?: number; // optional, present if status confirmed, failed
logsBloom?: string;
// CUSTOM DATA
links?: {
etherscan?: string;
};
fromTokenAddress?: string;
toTokenAddress?: string;
checkedPath?: any;
// CUSTOM DATA
whaleData?: any;
// FOR PENDING
mempoolData?: any;
// FOR CONFIRMED
logs?: any;
events?: any;
// wich server, when
notes?: {
message?: string;
timestampTx?: number;
};
}
const TransactionSchema = new Schema(
{
status: String, // current status of the transaction
hash: String,
txHash: String,
to: String,
isV2: Boolean,
isV3: Boolean,
isV2Sushi: Boolean,
isV2Bal: Boolean,
from: String,
gas: Number,
gasPrice: String,
gasUsed: String, // present on on-chain txns
nonce: Number,
value: String,
blockHash: String,
cumulativeGasUsed: Number,
transactionHash: String,
blockNumber: Number,
data: String,
timestampTx: Number, // the UTC time of first detection of current status
transactionIndex: Number, // optional, present if status confirmed, failed
logsBloom: String,
// CUSTOM DATA
links: {
etherscan: String,
},
fromTokenAddress: String,
toTokenAddress: String,
checkedPath: Schema.Types.Mixed,
// CUSTOM DATA
whaleData: Schema.Types.Mixed,
// FOR PENDING
mempoolData: Schema.Types.Mixed,
// FOR CONFIRMED
logs: Schema.Types.Mixed,
events: Schema.Types.Mixed,
// wich server, when
notes: {
message: String,
timestampTx: Number,
},
},
{autoIndex: false}
);
export {TransactionSchema, IContractSharkTx};