txq
Version:
TXQ: Bitcoin Transaction Storage Queue Service
26 lines (23 loc) • 724 B
text/typescript
import { Service, Inject } from 'typedi';
import { UseCase } from '../UseCase';
import { UseCaseOutcome } from '../UseCaseOutcome';
('getTxoutsByScriptHash')
export default class GetTxoutsByScriptHash extends UseCase {
constructor(
('txoutService') private txoutService,
('logger') private logger) {
super();
}
public async run(params: {
scripthash: string,
offset: any,
script?: boolean,
limit: any,
unspent?: boolean}): Promise<UseCaseOutcome> {
let entities = await this.txoutService.getTxoutByScriptHash(params.scripthash, params.offset, params.limit, params.script, params.unspent);
return {
success: true,
result: entities
};
}
}