2019-01-15 18:32:55 +00:00
|
|
|
import { Model } from '@nozbe/watermelondb'
|
2019-01-17 17:16:17 +00:00
|
|
|
import { action, field } from '@nozbe/watermelondb/decorators'
|
2019-01-15 18:32:55 +00:00
|
|
|
|
|
|
|
export default class LpEvent extends Model {
|
2019-01-16 18:57:07 +00:00
|
|
|
static table = 'lp_events'
|
2019-01-15 22:29:02 +00:00
|
|
|
|
2019-01-17 17:16:17 +00:00
|
|
|
@field('address') address
|
|
|
|
|
|
|
|
@field('event_id') eventId
|
|
|
|
|
|
|
|
@field('event') event
|
|
|
|
|
|
|
|
@field('block_number') blockNumber
|
|
|
|
|
2019-01-15 22:29:02 +00:00
|
|
|
@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
|
|
|
}
|
2019-01-17 17:16:17 +00:00
|
|
|
|