Update paymentAddress checks
This commit is contained in:
parent
cd0c3f1d8d
commit
28f4c81bde
@ -77,7 +77,7 @@ export const MintingDetails = ({ onChange, numberOfTokens, uploadMethod }: Minti
|
|||||||
unitPrice: unitPriceState.value ? (Number(unitPriceState.value) * 1_000_000).toString() : '',
|
unitPrice: unitPriceState.value ? (Number(unitPriceState.value) * 1_000_000).toString() : '',
|
||||||
perAddressLimit: perAddressLimitState.value,
|
perAddressLimit: perAddressLimitState.value,
|
||||||
startTime: timestamp ? (timestamp.getTime() * 1_000_000).toString() : '',
|
startTime: timestamp ? (timestamp.getTime() * 1_000_000).toString() : '',
|
||||||
paymentAddress: paymentAddressState.value,
|
paymentAddress: paymentAddressState.value.trim(),
|
||||||
}
|
}
|
||||||
onChange(data)
|
onChange(data)
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
@ -770,7 +770,10 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
)
|
)
|
||||||
if (mintingDetails.startTime === '') throw new Error('Start time is required')
|
if (mintingDetails.startTime === '') throw new Error('Start 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 (mintingDetails.paymentAddress && !isValidAddress(mintingDetails.paymentAddress))
|
if (
|
||||||
|
mintingDetails.paymentAddress &&
|
||||||
|
(!isValidAddress(mintingDetails.paymentAddress) || !mintingDetails.paymentAddress.startsWith('stars1'))
|
||||||
|
)
|
||||||
throw new Error('Invalid payment address')
|
throw new Error('Invalid payment address')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user