parent
df24d8cdca
commit
1deed175c8
@ -1,23 +1,21 @@ |
|||||||
import { ApiFactory } from 'remix-plugin' |
import { BaseApi } from 'remix-plugin' |
||||||
import { EventEmitter } from 'events' |
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) { |
constructor (txlistener) { |
||||||
super() |
super(profile) |
||||||
this.events = new EventEmitter() |
this.events = new EventEmitter() |
||||||
txlistener.event.register('newTransaction', (tx) => { |
txlistener.event.register('newTransaction', (tx) => { |
||||||
this.events.emit('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