diff --git a/.env.example b/.env.example index 88228a6..0968b3e 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -APP_VERSION=0.4.2 +APP_VERSION=0.4.3 NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS NEXT_PUBLIC_SG721_CODE_ID=793 diff --git a/components/collections/actions/actions.ts b/components/collections/actions/actions.ts index fa65b27..98bff3f 100644 --- a/components/collections/actions/actions.ts +++ b/components/collections/actions/actions.ts @@ -22,7 +22,6 @@ export const ACTION_TYPES = [ 'update_per_address_limit', 'update_collection_info', 'freeze_collection_info', - 'withdraw', 'transfer', 'batch_transfer', 'burn', @@ -60,11 +59,6 @@ export const BASE_ACTION_LIST: ActionListItem[] = [ name: 'Freeze Collection Info', description: `Freeze collection info to prevent further updates`, }, - { - id: 'withdraw', - name: 'Withdraw Tokens', - description: `Withdraw tokens from the contract`, - }, { id: 'transfer', name: 'Transfer Tokens', @@ -153,11 +147,6 @@ export const VENDING_ACTION_LIST: ActionListItem[] = [ name: 'Freeze Collection Info', description: `Freeze collection info to prevent further updates`, }, - { - id: 'withdraw', - name: 'Withdraw Tokens', - description: `Withdraw tokens from the contract`, - }, { id: 'transfer', name: 'Transfer Tokens', @@ -224,7 +213,6 @@ export type DispatchExecuteArgs = { | { type: Select<'update_start_trading_time'>; startTime?: string } | { type: Select<'update_per_address_limit'>; limit: number } | { type: Select<'shuffle'> } - | { type: Select<'withdraw'> } | { type: Select<'transfer'>; recipient: string; tokenId: number } | { type: Select<'batch_transfer'>; recipient: string; tokenIds: string } | { type: Select<'burn'>; tokenId: number } @@ -284,9 +272,6 @@ export const dispatchExecute = async (args: DispatchExecuteArgs) => { case 'shuffle': { return vendingMinterMessages.shuffle(txSigner) } - case 'withdraw': { - return vendingMinterMessages.withdraw(txSigner) - } case 'transfer': { return sg721Messages.transferNft(args.recipient, args.tokenId.toString()) } @@ -365,9 +350,6 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => { case 'shuffle': { return vendingMinterMessages(minterContract)?.shuffle() } - case 'withdraw': { - return vendingMinterMessages(minterContract)?.withdraw() - } case 'transfer': { return sg721Messages(sg721Contract)?.transferNft(args.recipient, args.tokenId.toString()) } diff --git a/contracts/vendingMinter/messages/execute.ts b/contracts/vendingMinter/messages/execute.ts index 058ae73..391178f 100644 --- a/contracts/vendingMinter/messages/execute.ts +++ b/contracts/vendingMinter/messages/execute.ts @@ -14,7 +14,6 @@ export const EXECUTE_TYPES = [ 'mint_to', 'mint_for', 'shuffle', - 'withdraw', 'burn_remaining', ] as const @@ -106,7 +105,6 @@ export type DispatchExecuteArgs = { | { type: Select<'mint_to'>; recipient: string } | { type: Select<'mint_for'>; recipient: string; tokenId: number } | { type: Select<'shuffle'> } - | { type: Select<'withdraw'> } | { type: Select<'burn_remaining'> } ) @@ -146,9 +144,6 @@ export const dispatchExecute = async (args: DispatchExecuteArgs) => { case 'shuffle': { return messages.shuffle(txSigner) } - case 'withdraw': { - return messages.withdraw(txSigner) - } case 'burn_remaining': { return messages.burnRemaining(txSigner) } @@ -193,9 +188,6 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => { case 'shuffle': { return messages(contract)?.shuffle() } - case 'withdraw': { - return messages(contract)?.withdraw() - } case 'burn_remaining': { return messages(contract)?.burnRemaining() } diff --git a/package.json b/package.json index 74d0a30..21e4d0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stargaze-studio", - "version": "0.4.2", + "version": "0.4.3", "workspaces": [ "packages/*" ], diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index ecd8e03..1116be5 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -214,7 +214,7 @@ const CollectionCreationPage: NextPage = () => { setCreatingCollection(false) // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - toast.error(error.message, { style: { maxWidth: 'none' } }) + toast.error(error.message, { style: { maxWidth: 'none' }, duration: 10000 }) setCreatingCollection(false) setUploading(false) } @@ -276,7 +276,7 @@ const CollectionCreationPage: NextPage = () => { setCreatingCollection(false) // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - toast.error(error.message, { style: { maxWidth: 'none' } }) + toast.error(error.message, { style: { maxWidth: 'none' }, duration: 10000 }) setCreatingCollection(false) setUploading(false) } @@ -498,7 +498,7 @@ const CollectionCreationPage: NextPage = () => { setTransactionHash(data.transactionHash) setVendingMinterContractAddress(data.baseMinterAddress) setSg721ContractAddress(data.sg721Address) - if (uploadDetails?.assetFiles.length === 1) { + if (uploadDetails?.assetFiles.length === 1 || uploadDetails?.uploadMethod === 'existing') { await toast .promise( baseMinterContract.use(data.baseMinterAddress)?.mint(wallet.address, baseUri) as Promise, @@ -676,9 +676,14 @@ const CollectionCreationPage: NextPage = () => { if (!uploadDetails) { throw new Error('Please select assets and metadata') } - // if (minterType === 'base' && uploadDetails.uploadMethod === 'new' && uploadDetails.assetFiles.length > 1) { - // throw new Error('Base Minter can only mint one asset at a time. Please select only one asset.') - // } + if ( + minterType === 'base' && + uploadDetails.uploadMethod === 'new' && + uploadDetails.assetFiles.length > 1 && + uploadDetails.metadataFiles.length === 0 + ) { + throw new Error('Please select metadata files') + } if (uploadDetails.uploadMethod === 'new' && uploadDetails.assetFiles.length === 0) { throw new Error('Please select the assets') }