2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
2021-10-17 10:36:14 +02:00
|
|
|
import { regexAddress } from 'util/lbryURI';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
2021-05-20 21:30:40 +02:00
|
|
|
export default function validateSendTx(address: string) {
|
|
|
|
const errors = {
|
|
|
|
address: '',
|
|
|
|
};
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
// All we need to check is if the address is valid
|
|
|
|
// If values are missing, users wont' be able to submit the form
|
2018-07-11 06:49:36 +02:00
|
|
|
if (!process.env.NO_ADDRESS_VALIDATION && !regexAddress.test(address)) {
|
|
|
|
errors.address = __('Not a valid LBRY address');
|
|
|
|
}
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
return errors;
|
2021-10-17 10:36:14 +02:00
|
|
|
}
|