-
Notifications
You must be signed in to change notification settings - Fork 0
/
txns.js
40 lines (40 loc) · 1.34 KB
/
txns.js
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
const expireTime = parseInt(process.env.EXPIRE_TIME ?? 2592000);
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const l1_txnDetails = new Schema({
provider: { type: Object },
blockNumber: { type: Number, index: true },
blockHash: { type: String },
hash: { type: String, unique: true, required: true },
type: { type: Number },
to: { type: String },
from: { type: String },
nonce: { type: Number },
gasLimit: { type: String },
gasPrice: { type: String },
maxPriorityFeePerGas: { type: String },
maxFeePerGas: { type: String },
data: { type: String },
value: { type: String },
chainId: { type: String },
signature: { type: Object },
accessList: { type: Array },
decodedData: { type: Object },
blockHeader: {
_type: { type: String },
baseFeePerGas: { type: String },
difficulty: { type: String },
extraData: { type: String },
gasLimit: { type: String },
gasUsed: { type: String },
hash: { type: String },
miner: { type: String },
nonce: { type: String },
number: { type: Number },
parentHash: { type: String },
timestamp: { type: Number, index: true },
transactions: { type: Array },
},
createdAt: { type: Date, index: true, expires: expireTime },
});
module.exports = mongoose.model("l1_transactions", l1_txnDetails);