- StargazeStudio is best viewed on the big screen.
+ Stargaze Studio is best viewed on the big screen.
- Please open StargazeStudio on your tablet or desktop browser.
+ Please open Stargaze Studio on your tablet or desktop browser.
diff --git a/components/collections/actions/Action.tsx b/components/collections/actions/Action.tsx
index 7667af7..e56f57a 100644
--- a/components/collections/actions/Action.tsx
+++ b/components/collections/actions/Action.tsx
@@ -181,7 +181,9 @@ export const CollectionActions = ({
type !== 'update_royalties_for_infinity_swap'
? 'Percentage of royalties to be paid'
: 'Change in share percentage',
- placeholder: '5%',
+ placeholder: isEitherType(type, ['set_royalties_for_infinity_swap', 'update_royalties_for_infinity_swap'])
+ ? '0.5%'
+ : '5%',
})
const showTokenUriField = isEitherType(type, ['mint_token_uri', 'update_token_metadata'])
@@ -310,6 +312,13 @@ export const CollectionActions = ({
royaltyShareState.value,
])
+ useEffect(() => {
+ if (isEitherType(type, ['set_royalties_for_infinity_swap']) && Number(royaltyShareState.value) > 5) {
+ royaltyShareState.onChange('5')
+ toast.error('Royalty share cannot be greater than 5% for Infinity Swap')
+ }
+ }, [royaltyShareState.value])
+
useEffect(() => {
const addresses: string[] = []
airdropAllocationArray.forEach((allocation) => {
diff --git a/components/collections/creation/UploadDetails.tsx b/components/collections/creation/UploadDetails.tsx
index 8d78746..694ee47 100644
--- a/components/collections/creation/UploadDetails.tsx
+++ b/components/collections/creation/UploadDetails.tsx
@@ -119,7 +119,7 @@ export const UploadDetails = ({
if (event.target.files === null) return
const thumbnailCompatibleAssetTypes: AssetType[] = ['video', 'audio', 'html']
const thumbnailCompatibleFileNamesList: string[] = []
- if (minterType === 'vending' || (minterType === 'base' && event.target.files.length > 1)) {
+ if (minterType === 'vending') {
//sort the files
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
//check if the sorted file names are in numerical order
@@ -146,6 +146,38 @@ export const UploadDetails = ({
return
}
}
+ } else if (minterType === 'base' && event.target.files.length > 1) {
+ //sort the files
+ const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
+ //check if the sorted file names are in numerical order
+ const sortedFileNames = sortedFiles.map((file) => file.name.split('.')[0])
+ sortedFiles.map((file) => {
+ if (thumbnailCompatibleAssetTypes.includes(getAssetType(file.name))) {
+ thumbnailCompatibleFileNamesList.push(file.name.split('.')[0])
+ }
+ })
+ setThumbnailCompatibleAssetFileNames(thumbnailCompatibleFileNamesList)
+ console.log('Thumbnail Compatible Files: ', thumbnailCompatibleFileNamesList)
+
+ for (let i = 0; i < sortedFileNames.length - 1; i++) {
+ if (
+ isNaN(Number(sortedFileNames[i])) ||
+ isNaN(Number(sortedFileNames[i + 1])) ||
+ parseInt(sortedFileNames[i]) !== parseInt(sortedFileNames[i + 1]) - 1
+ ) {
+ toast.error('The file names should be in numerical order.')
+ setThumbnailCompatibleAssetFileNames([])
+ addLogItem({
+ id: uid(),
+ message: 'The file names should be in numerical order.',
+ type: 'Error',
+ timestamp: new Date(),
+ })
+ //clear the input
+ event.target.value = ''
+ return
+ }
+ }
} else if (minterType === 'base' && event.target.files.length === 1) {
if (thumbnailCompatibleAssetTypes.includes(getAssetType(event.target.files[0].name))) {
thumbnailCompatibleFileNamesList.push(event.target.files[0].name.split('.')[0])
@@ -186,7 +218,23 @@ export const UploadDetails = ({
event.target.value = ''
return toast.error('The number of metadata files should be equal to the number of asset files.')
}
- if (minterType === 'vending' || (minterType === 'base' && assetFilesArray.length > 1)) {
+ // compare the first file name for asset and metadata files
+ if (
+ minterType === 'base' &&
+ assetFilesArray.length > 1 &&
+ event.target.files[0].name.split('.')[0] !== assetFilesArray[0].name.split('.')[0]
+ ) {
+ event.target.value = ''
+ toast.error('The metadata file names should match the asset file names.')
+ addLogItem({
+ id: uid(),
+ message: 'The metadata file names should match the asset file names.',
+ type: 'Error',
+ timestamp: new Date(),
+ })
+ return
+ }
+ if (minterType === 'vending') {
//sort the files
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
//check if the sorted file names are in numerical order
@@ -204,6 +252,28 @@ export const UploadDetails = ({
return
}
}
+ } else if (minterType === 'base' && assetFilesArray.length > 1) {
+ //sort the files
+ const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
+ //check if the sorted file names are in numerical order
+ const sortedFileNames = sortedFiles.map((file) => file.name.split('.')[0])
+ for (let i = 0; i < sortedFileNames.length - 1; i++) {
+ if (
+ isNaN(Number(sortedFileNames[i])) ||
+ isNaN(Number(sortedFileNames[i + 1])) ||
+ parseInt(sortedFileNames[i]) !== parseInt(sortedFileNames[i + 1]) - 1
+ ) {
+ toast.error('The file names should be in numerical order.')
+ addLogItem({
+ id: uid(),
+ message: 'The file names should be in numerical order.',
+ type: 'Error',
+ timestamp: new Date(),
+ })
+ event.target.value = ''
+ return
+ }
+ }
}
let loadedFileCount = 0
const files: File[] = []
diff --git a/components/openEdition/CollectionDetails.tsx b/components/openEdition/CollectionDetails.tsx
index e340f6a..9f71853 100644
--- a/components/openEdition/CollectionDetails.tsx
+++ b/components/openEdition/CollectionDetails.tsx
@@ -226,7 +226,7 @@ export const CollectionDetails = ({
{/* TODO: Cancel once we're able to index on-chain metadata */}
-
+