2021-07-13 19:06:36 +02:00
|
|
|
import { Injectable } from '@nestjs/common';
|
2021-07-14 15:56:28 +02:00
|
|
|
import { Queue } from 'bull';
|
|
|
|
import { InjectQueue } from '@nestjs/bull';
|
2021-07-13 19:06:36 +02:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
class StatusService {
|
2021-07-14 15:56:28 +02:00
|
|
|
constructor(@InjectQueue('withdrawal') private withdrawalQueue: Queue) {}
|
|
|
|
|
2021-07-13 19:06:36 +02:00
|
|
|
async status(): Promise<Health> {
|
|
|
|
return {
|
|
|
|
status: '',
|
|
|
|
error: false,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
main(): string {
|
|
|
|
return `This is <a href=https://tornado.cash>tornado.cash</a> Relayer service. Check the <a href=/status>/status</a> for settings`;
|
|
|
|
}
|
2021-07-14 15:56:28 +02:00
|
|
|
|
|
|
|
async withdrawal(data): Promise<string> {
|
|
|
|
const job = await this.withdrawalQueue.add(data)
|
|
|
|
|
|
|
|
return String(job.id);
|
|
|
|
}
|
2021-07-13 19:06:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export { StatusService };
|