diff --git a/src/components/Asset/Edit/_validation.ts b/src/components/Asset/Edit/_validation.ts index 8d81768fe..afc256153 100644 --- a/src/components/Asset/Edit/_validation.ts +++ b/src/components/Asset/Edit/_validation.ts @@ -1,5 +1,6 @@ import { FileInfo } from '@oceanprotocol/lib' import * as Yup from 'yup' +import web3 from 'web3' export const validationSchema = Yup.object().shape({ name: Yup.string() @@ -41,7 +42,14 @@ export const validationSchema = Yup.object().shape({ .nullable(), timeout: Yup.string().required('Required'), author: Yup.string().nullable(), - tags: Yup.array().nullable() + tags: Yup.array().nullable(), + paymentCollector: Yup.string().test( + 'ValidAddress', + 'Must be a valid Ethereum Address.', + (value) => { + return web3.utils.isAddress(value) + } + ) }) export const computeSettingsValidationSchema = Yup.object().shape({