26 lines
726 B
TypeScript
26 lines
726 B
TypeScript
import { Transform } from 'class-transformer';
|
|
import { IsInt, IsNotEmpty, IsString, Max, Min } from 'class-validator';
|
|
import { getAppConfig } from '../../../config';
|
|
import { IsBitcoinAddress } from '../../../validation/decorators/isBitcoinAddress';
|
|
|
|
const {
|
|
validation: { bitcoinWithdrawMaxFeeRateSatVbyte }
|
|
} = getAppConfig();
|
|
|
|
export class BitcoinWalletWithdrawDto {
|
|
@Transform(({ value }: { value: unknown }) => (typeof value === 'string' ? value.trim() : value))
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@IsBitcoinAddress()
|
|
destinationAddress: string;
|
|
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(bitcoinWithdrawMaxFeeRateSatVbyte)
|
|
feeRateSatVbyte: number;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
password: string;
|
|
}
|