123456789101112131415161718192021222324252627282930313233343536 |
- import { AllowNull, Column, DataType, Model, Table } from 'sequelize-typescript'
- export interface BnMonitorData {
- chainId: bigint
- syncBlockNumber: number
- }
- @Table({
- modelName: 'BnMonitor',
- indexes: [
- {
- fields: ['chainId'],
- unique: true,
- },
- ],
- })
- export default class BnMonitor extends Model {
- @AllowNull(false)
- @Column(DataType.INTEGER.UNSIGNED)
- get chainId(): bigint {
- return this.getDataValue('chainId')
- }
- @AllowNull(false)
- @Column(DataType.INTEGER.UNSIGNED)
- get syncBlockNumber(): number {
- return this.getDataValue('syncBlockNumber')
- }
- getData(): BnMonitorData {
- return {
- chainId: this.chainId,
- syncBlockNumber: this.syncBlockNumber,
- }
- }
- }
|