xud
Version:
Exchange Union Daemon
34 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const sequelize_1 = require("sequelize");
function Order(sequelize) {
const attributes = {
id: { type: sequelize_1.DataTypes.STRING, primaryKey: true, allowNull: false },
nodeId: { type: sequelize_1.DataTypes.INTEGER, allowNull: true },
localId: { type: sequelize_1.DataTypes.STRING, allowNull: true },
initialQuantity: { type: sequelize_1.DataTypes.BIGINT, allowNull: false },
pairId: { type: sequelize_1.DataTypes.STRING, allowNull: false },
price: {
type: sequelize_1.DataTypes.DOUBLE,
allowNull: true,
set(value) {
if (value === 0 || value === Number.POSITIVE_INFINITY) {
this.setDataValue('price', undefined);
}
else {
this.setDataValue('price', value);
}
},
},
isBuy: { type: sequelize_1.DataTypes.BOOLEAN, allowNull: false },
createdAt: { type: sequelize_1.DataTypes.BIGINT, allowNull: false },
};
const options = {
tableName: 'orders',
timestamps: false,
};
const Order = sequelize.define('Order', attributes, options);
return Order;
}
exports.default = Order;
//# sourceMappingURL=Order.js.map