Files
purple-explorer/models/tx.js
T

17 lines
625 B
JavaScript
Raw Normal View History

2021-03-17 17:54:09 -06:00
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
2019-05-27 10:33:22 -07:00
var TxSchema = new Schema({
txid: { type: String, lowercase: true, unique: true, index: true},
vin: { type: Array, default: [] },
vout: { type: Array, default: [] },
2020-11-23 15:33:54 -07:00
total: { type: Number, default: 0, index: true },
timestamp: { type: Number, default: 0, index: true },
blockhash: { type: String, index: true },
2021-03-20 01:34:13 -06:00
blockindex: {type: Number, default: 0, index: true},
tx_type: { type: String, default: null }
2019-05-27 10:33:22 -07:00
}, {id: false});
2020-11-23 15:33:54 -07:00
TxSchema.index({total: 1, total: -1, blockindex: 1, blockindex: -1});
2021-03-17 17:54:09 -06:00
module.exports = mongoose.model('Tx', TxSchema);