Fix autoWithdraw settings schema (#2388)

This commit is contained in:
ekzyis 2025-08-03 19:27:11 +02:00 committed by GitHub
parent 6fa1c226ae
commit 8384f866b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -188,12 +188,6 @@ export function advSchema (args) {
}) })
} }
export const autowithdrawSchemaMembers = object({
autoWithdrawThreshold: intValidator.required('required').min(0, 'must be at least 0').max(10000, 'must be at most 10000').transform(Number),
autoWithdrawMaxFeePercent: floatValidator.required('required').min(0, 'must be at least 0').max(50, 'must not exceed 50').transform(Number),
autoWithdrawMaxFeeTotal: intValidator.required('required').min(0, 'must be at least 0').max(1_000, 'must not exceed 1000').transform(Number)
})
export const vaultEntrySchema = key => object({ export const vaultEntrySchema = key => object({
key: string().required('required').matches(key, `expected ${key}`), key: string().required('required').matches(key, `expected ${key}`),
iv: string().required('required').hex().length(24, 'must be 24 characters long'), iv: string().required('required').hex().length(24, 'must be 24 characters long'),
@ -475,9 +469,9 @@ export const settingsSchema = object().shape({
}, [['tipRandomMax', 'tipRandomMin']]) }, [['tipRandomMax', 'tipRandomMin']])
export const walletSettingsSchema = object({ export const walletSettingsSchema = object({
autoWithdrawThreshold: intValidator.min(0, 'must be greater or equal to 0').required('required'), autoWithdrawThreshold: intValidator.required('required').min(0, 'must be at least 0').max(10000, 'must be at most 10000').transform(Number),
autoWithdrawMaxFeePercent: floatValidator.min(0, 'must be greater or equal to 0').required('required'), autoWithdrawMaxFeePercent: floatValidator.required('required').min(0, 'must be at least 0').max(50, 'must not exceed 50').transform(Number),
autoWithdrawMaxFeeTotal: intValidator.min(0, 'must be greater or equal to 0').required('required'), autoWithdrawMaxFeeTotal: intValidator.required('required').min(0, 'must be at least 0').max(1_000, 'must not exceed 1000').transform(Number),
receiveCreditsBelowSats: intValidator.min(0, 'must be greater or equal to 0').required('required'), receiveCreditsBelowSats: intValidator.min(0, 'must be greater or equal to 0').required('required'),
sendCreditsBelowSats: intValidator.min(0, 'must be greater or equal to 0').required('required'), sendCreditsBelowSats: intValidator.min(0, 'must be greater or equal to 0').required('required'),
proxyReceive: boolean().required('required') proxyReceive: boolean().required('required')