- Added LNBits wallet schema to the admin UI, including validation and input components. - Updated the services index to include LNBits in the available wallet options. - Enhanced the wallet selection component to handle LNBits configuration input.
36 lines
No EOL
832 B
JavaScript
36 lines
No EOL
832 B
JavaScript
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)),
|
|
})
|
|
},
|
|
} |