2019-01-15 18:32:55 +00:00
|
|
|
import { Model } from '@nozbe/watermelondb'
|
2019-01-15 22:29:02 +00:00
|
|
|
import { action } from '@nozbe/watermelondb/decorators'
|
2019-01-15 18:32:55 +00:00
|
|
|
|
|
|
|
export default class LpEvent extends Model {
|
|
|
|
static table = 'lp_events'
|
|
|
|
|
|
|
|
@field('event_id') eventId
|
|
|
|
@field('address') address
|
|
|
|
@field('event') event
|
2019-01-15 22:29:02 +00:00
|
|
|
@field('block_number') blockNumber
|
|
|
|
|
|
|
|
@action async addEvent(data) {
|
|
|
|
return await this.create(lpEvent => {
|
|
|
|
const { event, address, id, blockNumber } = data
|
|
|
|
lpEvent.eventId = id
|
|
|
|
lpEvent.address = address
|
|
|
|
lpEvent.event = event
|
|
|
|
lpEvent.blockNumber = blockNumber
|
|
|
|
})
|
|
|
|
}
|
2019-01-15 18:32:55 +00:00
|
|
|
|
|
|
|
}
|