Open Edition collection creation summary
This commit is contained in:
parent
9292e6218a
commit
b300a37384
@ -8,6 +8,7 @@ import { toUtf8 } from '@cosmjs/encoding'
|
|||||||
import { coin } from '@cosmjs/proto-signing'
|
import { coin } from '@cosmjs/proto-signing'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { Button } from 'components/Button'
|
import { Button } from 'components/Button'
|
||||||
|
import type { MinterType } from 'components/collections/actions/Combobox'
|
||||||
import { Conditional } from 'components/Conditional'
|
import { Conditional } from 'components/Conditional'
|
||||||
import { ConfirmationModal } from 'components/ConfirmationModal'
|
import { ConfirmationModal } from 'components/ConfirmationModal'
|
||||||
import { LoadingModal } from 'components/LoadingModal'
|
import { LoadingModal } from 'components/LoadingModal'
|
||||||
@ -45,22 +46,20 @@ import { type RoyaltyDetailsDataProps, RoyaltyDetails } from './RoyaltyDetails'
|
|||||||
|
|
||||||
export type MetadataStorageMethod = 'off-chain' | 'on-chain'
|
export type MetadataStorageMethod = 'off-chain' | 'on-chain'
|
||||||
|
|
||||||
export interface OpenEditionMinterInfo {
|
|
||||||
name: string
|
|
||||||
minter: string
|
|
||||||
contractAddress: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OpenEditionMinterCreatorProps {
|
interface OpenEditionMinterCreatorProps {
|
||||||
onChange: (data: OpenEditionMinterCreatorDataProps) => void
|
onChange: (data: OpenEditionMinterCreatorDataProps) => void
|
||||||
openEditionMinterUpdatableCreationFee?: string
|
openEditionMinterUpdatableCreationFee?: string
|
||||||
openEditionMinterCreationFee?: string
|
openEditionMinterCreationFee?: string
|
||||||
minimumMintPrice?: string
|
minimumMintPrice?: string
|
||||||
minimumUpdatableMintPrice?: string
|
minimumUpdatableMintPrice?: string
|
||||||
|
minterType?: MinterType
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OpenEditionMinterCreatorDataProps {
|
export interface OpenEditionMinterCreatorDataProps {
|
||||||
metadataStorageMethod: MetadataStorageMethod
|
metadataStorageMethod: MetadataStorageMethod
|
||||||
|
openEditionMinterContractAddress: string | null
|
||||||
|
sg721ContractAddress: string | null
|
||||||
|
transactionHash: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export const OpenEditionMinterCreator = ({
|
export const OpenEditionMinterCreator = ({
|
||||||
@ -69,6 +68,7 @@ export const OpenEditionMinterCreator = ({
|
|||||||
openEditionMinterUpdatableCreationFee,
|
openEditionMinterUpdatableCreationFee,
|
||||||
minimumMintPrice,
|
minimumMintPrice,
|
||||||
minimumUpdatableMintPrice,
|
minimumUpdatableMintPrice,
|
||||||
|
minterType,
|
||||||
}: OpenEditionMinterCreatorProps) => {
|
}: OpenEditionMinterCreatorProps) => {
|
||||||
const wallet = useWallet()
|
const wallet = useWallet()
|
||||||
const { openEditionMinter: openEditionMinterContract, openEditionFactory: openEditionFactoryContract } =
|
const { openEditionMinter: openEditionMinterContract, openEditionFactory: openEditionFactoryContract } =
|
||||||
@ -544,6 +544,7 @@ export const OpenEditionMinterCreator = ({
|
|||||||
}
|
}
|
||||||
await openEditionFactoryDispatchExecute(payload)
|
await openEditionFactoryDispatchExecute(payload)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
console.log('Data: ', data)
|
||||||
setTransactionHash(data.transactionHash)
|
setTransactionHash(data.transactionHash)
|
||||||
setOpenEditionMinterContractAddress(data.openEditionMinterAddress)
|
setOpenEditionMinterContractAddress(data.openEditionMinterAddress)
|
||||||
setSg721ContractAddress(data.sg721Address)
|
setSg721ContractAddress(data.sg721Address)
|
||||||
@ -555,15 +556,26 @@ export const OpenEditionMinterCreator = ({
|
|||||||
setCreationInProgress(false)
|
setCreationInProgress(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if (minterType !== 'openEdition') {
|
||||||
|
setTransactionHash(null)
|
||||||
|
setOpenEditionMinterContractAddress(null)
|
||||||
|
setSg721ContractAddress(null)
|
||||||
|
setCreationInProgress(false)
|
||||||
|
setUploading(false)
|
||||||
|
}
|
||||||
|
}, [minterType])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const data: OpenEditionMinterCreatorDataProps = {
|
const data: OpenEditionMinterCreatorDataProps = {
|
||||||
metadataStorageMethod,
|
metadataStorageMethod,
|
||||||
|
openEditionMinterContractAddress,
|
||||||
|
sg721ContractAddress,
|
||||||
|
transactionHash,
|
||||||
}
|
}
|
||||||
onChange(data)
|
onChange(data)
|
||||||
toast.success('Metadata storage method updated')
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [metadataStorageMethod])
|
}, [metadataStorageMethod, openEditionMinterContractAddress, sg721ContractAddress, transactionHash])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -1102,9 +1102,13 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (vendingMinterContractAddress !== null || isMintingComplete)
|
if (
|
||||||
|
vendingMinterContractAddress !== null ||
|
||||||
|
openEditionMinterDetails?.openEditionMinterContractAddress ||
|
||||||
|
isMintingComplete
|
||||||
|
)
|
||||||
scrollRef.current?.scrollIntoView({ behavior: 'smooth' })
|
scrollRef.current?.scrollIntoView({ behavior: 'smooth' })
|
||||||
}, [vendingMinterContractAddress, isMintingComplete])
|
}, [vendingMinterContractAddress, openEditionMinterDetails?.openEditionMinterContractAddress, isMintingComplete])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setBaseTokenUri(uploadDetails?.baseTokenURI as string)
|
setBaseTokenUri(uploadDetails?.baseTokenURI as string)
|
||||||
@ -1151,6 +1155,67 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mx-10" ref={scrollRef}>
|
<div className="mx-10" ref={scrollRef}>
|
||||||
|
<Conditional
|
||||||
|
test={minterType === 'openEdition' && openEditionMinterDetails?.openEditionMinterContractAddress !== null}
|
||||||
|
>
|
||||||
|
<Alert className="mt-5" type="info">
|
||||||
|
<div>
|
||||||
|
Open Edition Minter Contract Address:{' '}
|
||||||
|
<Anchor
|
||||||
|
className="text-stargaze hover:underline"
|
||||||
|
external
|
||||||
|
href={`/contracts/openEditionMinter/query/?contractAddress=${
|
||||||
|
openEditionMinterDetails?.openEditionMinterContractAddress as string
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{openEditionMinterDetails?.openEditionMinterContractAddress as string}
|
||||||
|
</Anchor>
|
||||||
|
<br />
|
||||||
|
SG721 Contract Address:{' '}
|
||||||
|
<Anchor
|
||||||
|
className="text-stargaze hover:underline"
|
||||||
|
external
|
||||||
|
href={`/contracts/sg721/query/?contractAddress=${
|
||||||
|
openEditionMinterDetails?.sg721ContractAddress as string
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{openEditionMinterDetails?.sg721ContractAddress as string}
|
||||||
|
</Anchor>
|
||||||
|
<br />
|
||||||
|
Transaction Hash: {' '}
|
||||||
|
<Conditional test={NETWORK === 'testnet'}>
|
||||||
|
<Anchor
|
||||||
|
className="text-stargaze hover:underline"
|
||||||
|
external
|
||||||
|
href={`${BLOCK_EXPLORER_URL}/tx/${openEditionMinterDetails?.transactionHash as string}`}
|
||||||
|
>
|
||||||
|
{openEditionMinterDetails?.transactionHash}
|
||||||
|
</Anchor>
|
||||||
|
</Conditional>
|
||||||
|
<Conditional test={NETWORK === 'mainnet'}>
|
||||||
|
<Anchor
|
||||||
|
className="text-stargaze hover:underline"
|
||||||
|
external
|
||||||
|
href={`${BLOCK_EXPLORER_URL}/txs/${openEditionMinterDetails?.transactionHash as string}`}
|
||||||
|
>
|
||||||
|
{openEditionMinterDetails?.transactionHash}
|
||||||
|
</Anchor>
|
||||||
|
</Conditional>
|
||||||
|
<br />
|
||||||
|
<Button className="mt-2">
|
||||||
|
<Anchor
|
||||||
|
className="text-white"
|
||||||
|
external
|
||||||
|
href={`${STARGAZE_URL}/launchpad/${
|
||||||
|
openEditionMinterDetails?.openEditionMinterContractAddress as string
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
View on Launchpad
|
||||||
|
</Anchor>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Alert>
|
||||||
|
</Conditional>
|
||||||
<Conditional test={vendingMinterContractAddress !== null || isMintingComplete}>
|
<Conditional test={vendingMinterContractAddress !== null || isMintingComplete}>
|
||||||
<Alert className="mt-5" type="info">
|
<Alert className="mt-5" type="info">
|
||||||
<div>
|
<div>
|
||||||
@ -1410,6 +1475,7 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
<OpenEditionMinterCreator
|
<OpenEditionMinterCreator
|
||||||
minimumMintPrice={minimumOpenEditionMintPrice as string}
|
minimumMintPrice={minimumOpenEditionMintPrice as string}
|
||||||
minimumUpdatableMintPrice={minimumOpenEditionUpdatableMintPrice as string}
|
minimumUpdatableMintPrice={minimumOpenEditionUpdatableMintPrice as string}
|
||||||
|
minterType={minterType}
|
||||||
onChange={setOpenEditionMinterDetails}
|
onChange={setOpenEditionMinterDetails}
|
||||||
openEditionMinterCreationFee={openEditionMinterCreationFee as string}
|
openEditionMinterCreationFee={openEditionMinterCreationFee as string}
|
||||||
openEditionMinterUpdatableCreationFee={openEditionMinterUpdatableCreationFee as string}
|
openEditionMinterUpdatableCreationFee={openEditionMinterUpdatableCreationFee as string}
|
||||||
|
Loading…
Reference in New Issue
Block a user