parent
e8e3e70929
commit
d24904b48a
@ -1,23 +1,21 @@ |
||||
import { ApiFactory } from 'remix-plugin' |
||||
import { BaseApi } from 'remix-plugin' |
||||
import { EventEmitter } from 'events' |
||||
|
||||
export class TxListenerModule extends ApiFactory { |
||||
const profile = { |
||||
name: 'txListener', |
||||
displayName: 'transaction listener', |
||||
events: ['newTransaction'], |
||||
description: 'service - notify new transactions', |
||||
permission: true |
||||
} |
||||
|
||||
export class TxListenerModule extends BaseApi { |
||||
|
||||
constructor (txlistener) { |
||||
super() |
||||
super(profile) |
||||
this.events = new EventEmitter() |
||||
txlistener.event.register('newTransaction', (tx) => { |
||||
this.events.emit('newTransaction', tx) |
||||
}) |
||||
} |
||||
|
||||
get profile () { |
||||
return { |
||||
name: 'txListener', |
||||
displayName: 'transaction listener', |
||||
events: ['newTransaction'], |
||||
description: 'service - notify new transactions', |
||||
permission: true |
||||
} |
||||
} |
||||
} |
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue