chore: use monorepo organization
This commit is contained in:
parent
deaf7d6ecc
commit
a687827f7e
1099 changed files with 8184 additions and 11535 deletions
57
packages/admin-ui/src/pages/Services/schemas/binance.js
Normal file
57
packages/admin-ui/src/pages/Services/schemas/binance.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import * as Yup from 'yup'
|
||||
|
||||
import {
|
||||
SecretInput,
|
||||
TextInput,
|
||||
Autocomplete
|
||||
} from 'src/components/inputs/formik'
|
||||
|
||||
import { secretTest, buildCurrencyOptions } from './helper'
|
||||
|
||||
const schema = markets => {
|
||||
return {
|
||||
code: 'binance',
|
||||
name: 'Binance',
|
||||
title: 'Binance (Exchange)',
|
||||
elements: [
|
||||
{
|
||||
code: 'apiKey',
|
||||
display: 'API key',
|
||||
component: TextInput,
|
||||
face: true,
|
||||
long: true
|
||||
},
|
||||
{
|
||||
code: 'privateKey',
|
||||
display: 'Private key',
|
||||
component: SecretInput
|
||||
},
|
||||
{
|
||||
code: 'currencyMarket',
|
||||
display: 'Currency market',
|
||||
component: Autocomplete,
|
||||
inputProps: {
|
||||
options: buildCurrencyOptions(markets),
|
||||
labelProp: 'display',
|
||||
valueProp: 'code'
|
||||
},
|
||||
face: true
|
||||
}
|
||||
],
|
||||
getValidationSchema: account => {
|
||||
return Yup.object().shape({
|
||||
apiKey: Yup.string('The API key must be a string')
|
||||
.max(100, 'The API key is too long')
|
||||
.required('The API key is required'),
|
||||
privateKey: Yup.string('The private key must be a string')
|
||||
.max(100, 'The private key is too long')
|
||||
.test(secretTest(account?.privateKey, 'private key')),
|
||||
currencyMarket: Yup.string(
|
||||
'The currency market must be a string'
|
||||
).required('The currency market is required')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default schema
|
||||
Loading…
Add table
Add a link
Reference in a new issue