import * as Yup from 'yup' import { SecretInput, TextInput, } from '../../../components/inputs/formik' import { secretTest } from './helper' export default { code: 'lnbits', name: 'LNBits', title: 'LNBits (Wallet)', elements: [ { code: 'endpoint', display: 'LNBits Server URL', component: TextInput, }, { code: 'adminKey', display: 'Admin Key', component: SecretInput, }, ], getValidationSchema: account => { return Yup.object().shape({ endpoint: Yup.string('The endpoint must be a string') .max(200, 'The endpoint is too long') .required('The endpoint is required'), adminKey: Yup.string('The Admin Key must be a string') .max(200, 'The Admin Key is too long') .test(secretTest(account?.adminKey)), }) }, }