add bitcoin withdraw max fee validation config
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
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()
|
||||
@@ -11,7 +16,7 @@ export class BitcoinWalletWithdrawDto {
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(100)
|
||||
@Max(bitcoinWithdrawMaxFeeRateSatVbyte)
|
||||
feeRateSatVbyte: number;
|
||||
|
||||
@IsString()
|
||||
|
||||
Reference in New Issue
Block a user