txq
Version:
TXQ: Bitcoin Transaction Storage Queue Service
27 lines (23 loc) • 710 B
text/typescript
import { Service, Inject } from 'typedi';
('merchantapilogService')
export default class MerchantapilogService {
constructor(
('merchantapilogModel') private merchantapilogModel,
('eventService') private eventService,
('logger') private logger) {}
public async save(miner: string, requestType: string, response: any, txid?: string) {
const savedId = await this.merchantapilogModel.save(
miner, requestType, response, txid
);
if (txid) {
this.eventService.pushChannelEvent('merchantapilogs', {
miner,
eventType: requestType,
entity: {
txid,
...response
},
}, savedId);
}
}
}