Files
nullcart/backend/src/modules/moneroWallet/controllers/MoneroWalletController.ts
T
nobswebdev 83cb437f19 add fee priority to Monero wallet withdrawal API.
Pass sweep_all priority through the withdraw endpoint so admins can choose transaction fee speed.
2026-09-06 18:21:07 +02:00

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);
}
}