diff --git a/components/collections/actions/actions.ts b/components/collections/actions/actions.ts index 35d45df..fa65b27 100644 --- a/components/collections/actions/actions.ts +++ b/components/collections/actions/actions.ts @@ -42,8 +42,8 @@ export interface ActionListItem { export const BASE_ACTION_LIST: ActionListItem[] = [ { id: 'mint_token_uri', - name: 'Mint Token URI', - description: `Mint a token with the given token URI`, + name: 'Append New Token', + description: `Mint a new token and append it to the collection`, }, { id: 'update_start_trading_time', diff --git a/components/collections/creation/BaseMinterDetails.tsx b/components/collections/creation/BaseMinterDetails.tsx index e111577..71d163e 100644 --- a/components/collections/creation/BaseMinterDetails.tsx +++ b/components/collections/creation/BaseMinterDetails.tsx @@ -4,6 +4,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { toUtf8 } from '@cosmjs/encoding' import axios from 'axios' +import clsx from 'clsx' +import { Alert } from 'components/Alert' +import { Conditional } from 'components/Conditional' import { useInputState } from 'components/forms/FormInput.hooks' import { useWallet } from 'contexts/wallet' import React, { useCallback, useEffect, useState } from 'react' @@ -73,7 +76,6 @@ export const BaseMinterDetails = ({ onChange, minterType }: BaseMinterDetailsPro } const filterBaseMinterContracts = async () => { - setMyBaseMinterContracts([]) await fetchMinterContracts() .then((minterContracts) => minterContracts.map(async (minterContract: any) => { @@ -107,19 +109,24 @@ export const BaseMinterDetails = ({ onChange, minterType }: BaseMinterDetailsPro }) }, [debouncedMyBaseMinterContracts]) - const debouncedWalletAddress = useDebounce(wallet.address, 500) + const debouncedWalletAddress = useDebounce(wallet.address, 300) const displayToast = async () => { await toast.promise(filterBaseMinterContracts(), { - loading: 'Fetching Base Minter contracts...', - success: 'Base Minter contracts retrieved.', - error: 'Unable to retrieve Base Minter contracts.', + loading: 'Retrieving previous 1/1 collections...', + success: 'Collection retrieval finalized.', + error: 'Unable to retrieve any 1/1 collections.', }) } useEffect(() => { if (debouncedWalletAddress && baseMinterAcquisitionMethod === 'existing') { + setMyBaseMinterContracts([]) + existingBaseMinterState.onChange('') void displayToast() + } else if (baseMinterAcquisitionMethod === 'new' || !wallet.initialized) { + setMyBaseMinterContracts([]) + existingBaseMinterState.onChange('') } }, [debouncedWalletAddress, baseMinterAcquisitionMethod]) @@ -130,7 +137,7 @@ export const BaseMinterDetails = ({ onChange, minterType }: BaseMinterDetailsPro } onChange(data) // eslint-disable-next-line react-hooks/exhaustive-deps - }, [existingBaseMinterState.value, baseMinterAcquisitionMethod]) + }, [existingBaseMinterState.value, baseMinterAcquisitionMethod, wallet.initialized]) return (
@@ -151,7 +158,7 @@ export const BaseMinterDetails = ({ onChange, minterType }: BaseMinterDetailsPro className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label" htmlFor="inlineRadio5" > - Create a New Base Minter Contract + Create a New 1/1 Collection
@@ -170,27 +177,49 @@ export const BaseMinterDetails = ({ onChange, minterType }: BaseMinterDetailsPro className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label" htmlFor="inlineRadio6" > - Use an Existing Base Minter Contract + Append a New Token to an Existing 1/1 Collection
{baseMinterAcquisitionMethod === 'existing' && (
-
- - +
+ + + + +
+ + + No previous 1/1 collections were found. You may create a new 1/1 collection or fill in the minter + contract address manually. + + + + + + Please connect your wallet first. + + +
+
)} diff --git a/contracts/baseMinter/contract.ts b/contracts/baseMinter/contract.ts index 7ebfcd4..ac5d3c6 100644 --- a/contracts/baseMinter/contract.ts +++ b/contracts/baseMinter/contract.ts @@ -141,8 +141,12 @@ export const baseMinter = (client: SigningCosmWasmClient, txSigner: string): Bas }) console.log(factoryParameters.params.mint_fee_bps) - const price = (await getConfig()).config.mint_price.amount - console.log(price) + const price = (await getConfig()).config?.mint_price.amount + if (!price) { + throw new Error( + 'Unable to retrieve a valid mint price. It may be that the given contract address does not belong to a Base Minter contract.', + ) + } console.log((Number(price) * Number(factoryParameters.params.mint_fee_bps)) / 100) const res = await client.execute( senderAddress, diff --git a/package.json b/package.json index efd16a6..d2c8451 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stargaze-studio", - "version": "0.3.5", + "version": "0.3.6", "workspaces": [ "packages/*" ], diff --git a/pages/collections/actions.tsx b/pages/collections/actions.tsx index cf529bf..5c50eda 100644 --- a/pages/collections/actions.tsx +++ b/pages/collections/actions.tsx @@ -88,7 +88,7 @@ const CollectionActionsPage: NextPage = () => { toUtf8(Buffer.from(Buffer.from('contract_info').toString('hex'), 'hex').toString()), ), { - loading: 'Retrieving Minter type...', + loading: 'Retrieving minter type...', error: 'Minter type retrieval failed.', success: 'Minter type retrieved.', }, diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index f6336e6..20bf22f 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -935,9 +935,9 @@ const CollectionCreationPage: NextPage = () => { }} type="button" > -

Vending Minter

+

Standard Collection

- Vending Minter contract facilitates primary market vending machine style minting + A non-appendable collection that facilitates primary market vending machine style minting
@@ -957,8 +957,10 @@ const CollectionCreationPage: NextPage = () => { }} type="button" > -

Base Minter

- Base Minter contract enables 1/1 minting +

1/1 Collection

+ + An appendable collection that only allows for direct secondary market listing of tokens +