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