diff --git a/packages/admin-ui/src/pages/Services/schemas/index.js b/packages/admin-ui/src/pages/Services/schemas/index.js index 695aa598..f6519a95 100644 --- a/packages/admin-ui/src/pages/Services/schemas/index.js +++ b/packages/admin-ui/src/pages/Services/schemas/index.js @@ -11,6 +11,7 @@ import inforu from './inforu' import infura from './infura' import _itbit from './itbit' import _kraken from './kraken' +import lnbits from './lnbits' import mailgun from './mailgun' import scorechain from './scorechain' import sumsub from './sumsub' @@ -31,6 +32,7 @@ const schemas = (markets = {}) => { return { [bitgo.code]: bitgo, [galoy.code]: galoy, + [lnbits.code]: lnbits, [bitstamp.code]: bitstamp, [blockcypher.code]: blockcypher, [elliptic.code]: elliptic, diff --git a/packages/admin-ui/src/pages/Services/schemas/lnbits.js b/packages/admin-ui/src/pages/Services/schemas/lnbits.js new file mode 100644 index 00000000..00d03e5a --- /dev/null +++ b/packages/admin-ui/src/pages/Services/schemas/lnbits.js @@ -0,0 +1,36 @@ +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)), + }) + }, +} \ No newline at end of file diff --git a/packages/admin-ui/src/pages/Wizard/components/Wallet/ChooseWallet.jsx b/packages/admin-ui/src/pages/Wizard/components/Wallet/ChooseWallet.jsx index c99295b8..f46bb5f0 100644 --- a/packages/admin-ui/src/pages/Wizard/components/Wallet/ChooseWallet.jsx +++ b/packages/admin-ui/src/pages/Wizard/components/Wallet/ChooseWallet.jsx @@ -36,7 +36,7 @@ const SAVE_ACCOUNTS = gql` ` const isConfigurable = it => - R.includes(it)(['infura', 'bitgo', 'trongrid', 'galoy']) + R.includes(it)(['infura', 'bitgo', 'trongrid', 'galoy', 'lnbits']) const isLocalHosted = it => R.includes(it)([ @@ -178,6 +178,19 @@ const ChooseWallet = ({ data: currentData, addData }) => { /> )} + {selected === 'lnbits' && ( + <> +

Enter wallet information

+ + + )} ) } diff --git a/packages/server/lib/new-admin/config/accounts.js b/packages/server/lib/new-admin/config/accounts.js index 87a3e35a..e955082b 100644 --- a/packages/server/lib/new-admin/config/accounts.js +++ b/packages/server/lib/new-admin/config/accounts.js @@ -103,6 +103,7 @@ const ALL_ACCOUNTS = [ cryptos: [BTC, ZEC, LTC, BCH, DASH], }, { code: 'galoy', display: 'Galoy', class: WALLET, cryptos: [LN] }, + { code: 'lnbits', display: 'LNBits', class: WALLET, cryptos: [LN] }, { code: 'bitstamp', display: 'Bitstamp',