Add Bitcoin wallet admin withdraw and seed reveal API.
Expose JWT-protected withdraw-all and reveal-seed endpoints with address validation and password verification, matching Monero wallet admin behavior.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
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 { BitcoinWalletRevealSeedDto } from '../dto/BitcoinWalletRevealSeedDto';
|
||||
import { BitcoinWalletWithdrawDto } from '../dto/BitcoinWalletWithdrawDto';
|
||||
import { BitcoinWalletAdminService } from '../services/BitcoinWalletAdminService';
|
||||
|
||||
@Controller('bitcoin-wallet')
|
||||
@@ -11,4 +15,16 @@ export class BitcoinWalletController {
|
||||
getStatus() {
|
||||
return this.walletAdminService.getStatus();
|
||||
}
|
||||
|
||||
@Post('/withdraw')
|
||||
@Throttle(throttleProfiles.walletWithdraw)
|
||||
withdraw(@Body() { destinationAddress, feeRateSatVbyte, password }: BitcoinWalletWithdrawDto) {
|
||||
return this.walletAdminService.withdrawAll(destinationAddress, feeRateSatVbyte, password);
|
||||
}
|
||||
|
||||
@Post('/reveal-seed')
|
||||
@Throttle(throttleProfiles.walletRevealSeed)
|
||||
revealSeed(@Body() { password }: BitcoinWalletRevealSeedDto) {
|
||||
return this.walletAdminService.revealSeed(password);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user