Merge pull request #101 from public-awesome/develop

Sync development > main
This commit is contained in:
Serkan Reis 2023-02-05 14:38:00 +03:00 committed by GitHub
commit 6d0adcc355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 34 deletions

View File

@ -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

View File

@ -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())
}

View File

@ -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()
}

View File

@ -1,6 +1,6 @@
{
"name": "stargaze-studio",
"version": "0.4.2",
"version": "0.4.3",
"workspaces": [
"packages/*"
],

View File

@ -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<string>,
@ -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')
}