UNPKG

txq

Version:

TXQ: Bitcoin Transaction Storage Queue Service

22 lines (18 loc) 613 B
import { Service, Inject } from 'typedi'; import { UseCase } from '../UseCase'; import { UseCaseOutcome } from '../UseCaseOutcome'; @Service('getTxsPending') export default class GetTxsPending extends UseCase { constructor( @Inject('txsyncService') private txsyncService, @Inject('logger') private logger) { super(); } public async run(params: { offset?: any, limit?: any}): Promise<UseCaseOutcome> { let txs = await this.txsyncService.getTxsPending(params.offset ? params.offset : 0, params.limit ? params.limit : 10000); return { success: true, result: txs }; } }