Check end time during open edition creation - 2

This commit is contained in:
Serkan Reis 2023-08-21 11:37:19 +03:00
parent 0ed370aa67
commit 8990175b03

View File

@ -305,6 +305,11 @@ export const OpenEditionMinterCreator = ({
if (mintingDetails.startTime === '') throw new Error('Start time is required') if (mintingDetails.startTime === '') throw new Error('Start time is required')
if (mintingDetails.endTime === '') throw new Error('End time is required') if (mintingDetails.endTime === '') throw new Error('End time is required')
if (Number(mintingDetails.startTime) < new Date().getTime() * 1000000) throw new Error('Invalid start time') if (Number(mintingDetails.startTime) < new Date().getTime() * 1000000) throw new Error('Invalid start time')
if (Number(mintingDetails.endTime) < Number(mintingDetails.startTime))
throw new Error('End time cannot be earlier than start time')
if (Number(mintingDetails.endTime) === Number(mintingDetails.startTime))
throw new Error('End time cannot be equal to the start time')
if ( if (
mintingDetails.paymentAddress && mintingDetails.paymentAddress &&
(!isValidAddress(mintingDetails.paymentAddress) || !mintingDetails.paymentAddress.startsWith('stars1')) (!isValidAddress(mintingDetails.paymentAddress) || !mintingDetails.paymentAddress.startsWith('stars1'))