init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
import { JwtGuard } from '../../../guards/JwtGuard';
|
||||
import { throttleProfiles } from '../../../config/throttleProfiles';
|
||||
import { MoneroWalletRevealSeedDto } from '../dto/MoneroWalletRevealSeedDto';
|
||||
import { MoneroWalletWithdrawDto } from '../dto/MoneroWalletWithdrawDto';
|
||||
import { MoneroWalletAdminService } from '../services/MoneroWalletAdminService';
|
||||
|
||||
@Controller('monero-wallet')
|
||||
@UseGuards(JwtGuard)
|
||||
export class MoneroWalletController {
|
||||
constructor(private readonly walletAdminService: MoneroWalletAdminService) {}
|
||||
|
||||
@Get('/')
|
||||
getStatus() {
|
||||
return this.walletAdminService.getStatus();
|
||||
}
|
||||
|
||||
@Post('/withdraw')
|
||||
@Throttle(throttleProfiles.walletWithdraw)
|
||||
withdraw(@Body() { destinationAddress, password }: MoneroWalletWithdrawDto) {
|
||||
return this.walletAdminService.withdrawAll(destinationAddress, password);
|
||||
}
|
||||
|
||||
@Post('/reveal-seed')
|
||||
@Throttle(throttleProfiles.walletRevealSeed)
|
||||
revealSeed(@Body() { password }: MoneroWalletRevealSeedDto) {
|
||||
return this.walletAdminService.revealSeed(password);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user