Pass sweep_all priority through the withdraw endpoint so admins can choose transaction fee speed.
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
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, priority, password }: MoneroWalletWithdrawDto) {
|
|
return this.walletAdminService.withdrawAll(destinationAddress, priority, password);
|
|
}
|
|
|
|
@Post('/reveal-seed')
|
|
@Throttle(throttleProfiles.walletRevealSeed)
|
|
revealSeed(@Body() { password }: MoneroWalletRevealSeedDto) {
|
|
return this.walletAdminService.revealSeed(password);
|
|
}
|
|
}
|