Merge pull request #157 from public-awesome/free-mint-updates
Free mint related changes
This commit is contained in:
commit
d3a8fa5a7a
10
.env.example
10
.env.example
@ -1,18 +1,18 @@
|
|||||||
APP_VERSION=0.5.9
|
APP_VERSION=0.6.0
|
||||||
|
|
||||||
NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS
|
NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS
|
||||||
NEXT_PUBLIC_SG721_CODE_ID=1911
|
NEXT_PUBLIC_SG721_CODE_ID=2092
|
||||||
NEXT_PUBLIC_SG721_UPDATABLE_CODE_ID=1912
|
NEXT_PUBLIC_SG721_UPDATABLE_CODE_ID=1912
|
||||||
NEXT_PUBLIC_VENDING_MINTER_CODE_ID=1909
|
NEXT_PUBLIC_VENDING_MINTER_CODE_ID=2091
|
||||||
NEXT_PUBLIC_VENDING_MINTER_FLEX_CODE_ID=2080
|
NEXT_PUBLIC_VENDING_MINTER_FLEX_CODE_ID=2080
|
||||||
NEXT_PUBLIC_BASE_MINTER_CODE_ID=1910
|
NEXT_PUBLIC_BASE_MINTER_CODE_ID=1910
|
||||||
NEXT_PUBLIC_VENDING_FACTORY_ADDRESS="stars1ynec878x5phexq3hj4zdgvp6r5ayfmxks38kvunwyjugqn3hqeqq3cgtuw"
|
NEXT_PUBLIC_VENDING_FACTORY_ADDRESS="stars1ukaladct74um4lhn6eru0d9hdrcqzj3q8sjrfcg7226xey0xc2gsy0gl22"
|
||||||
NEXT_PUBLIC_VENDING_FACTORY_UPDATABLE_ADDRESS="stars1fnfywcnzzwledr93at65qm8gf953tjxgh6u2u4r8n9vsdv7u75eqe7ecn3"
|
NEXT_PUBLIC_VENDING_FACTORY_UPDATABLE_ADDRESS="stars1fnfywcnzzwledr93at65qm8gf953tjxgh6u2u4r8n9vsdv7u75eqe7ecn3"
|
||||||
NEXT_PUBLIC_VENDING_FACTORY_FLEX_ADDRESS="stars1l5v0vgly8r9jw4exeajnftymr29kn70n23gpl2g5fylaww2pzkhq0rks7c"
|
NEXT_PUBLIC_VENDING_FACTORY_FLEX_ADDRESS="stars1l5v0vgly8r9jw4exeajnftymr29kn70n23gpl2g5fylaww2pzkhq0rks7c"
|
||||||
NEXT_PUBLIC_BASE_FACTORY_ADDRESS="stars10rmaxgnjvskuumgv7e2awqkhdqdcygkwrz8a8vvt88szj7fc7xlq5jcs3f"
|
NEXT_PUBLIC_BASE_FACTORY_ADDRESS="stars10rmaxgnjvskuumgv7e2awqkhdqdcygkwrz8a8vvt88szj7fc7xlq5jcs3f"
|
||||||
NEXT_PUBLIC_BASE_FACTORY_UPDATABLE_ADDRESS="stars13pw8r33dsnghlxfj2upaywf38z2fc6npuw9maq9e5cpet4v285sscgzjp2"
|
NEXT_PUBLIC_BASE_FACTORY_UPDATABLE_ADDRESS="stars13pw8r33dsnghlxfj2upaywf38z2fc6npuw9maq9e5cpet4v285sscgzjp2"
|
||||||
NEXT_PUBLIC_SG721_NAME_ADDRESS="stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0ur5lhe49uhlsasszc5fhr"
|
NEXT_PUBLIC_SG721_NAME_ADDRESS="stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0ur5lhe49uhlsasszc5fhr"
|
||||||
NEXT_PUBLIC_WHITELIST_CODE_ID=1913
|
NEXT_PUBLIC_WHITELIST_CODE_ID=2093
|
||||||
NEXT_PUBLIC_WHITELIST_FLEX_CODE_ID=2005
|
NEXT_PUBLIC_WHITELIST_FLEX_CODE_ID=2005
|
||||||
NEXT_PUBLIC_BADGE_HUB_CODE_ID=1336
|
NEXT_PUBLIC_BADGE_HUB_CODE_ID=1336
|
||||||
NEXT_PUBLIC_BADGE_HUB_ADDRESS="stars1dacun0xn7z73qzdcmq27q3xn6xuprg8e2ugj364784al2v27tklqynhuqa"
|
NEXT_PUBLIC_BADGE_HUB_ADDRESS="stars1dacun0xn7z73qzdcmq27q3xn6xuprg8e2ugj364784al2v27tklqynhuqa"
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable eslint-comments/disable-enable-pair */
|
||||||
|
/* eslint-disable no-nested-ternary */
|
||||||
import { FormControl } from 'components/FormControl'
|
import { FormControl } from 'components/FormControl'
|
||||||
import { FormGroup } from 'components/FormGroup'
|
import { FormGroup } from 'components/FormGroup'
|
||||||
import { useInputState, useNumberInputState } from 'components/forms/FormInput.hooks'
|
import { useInputState, useNumberInputState } from 'components/forms/FormInput.hooks'
|
||||||
@ -75,7 +77,11 @@ export const MintingDetails = ({ onChange, numberOfTokens, uploadMethod, minimum
|
|||||||
if (numberOfTokens) numberOfTokensState.onChange(numberOfTokens)
|
if (numberOfTokens) numberOfTokensState.onChange(numberOfTokens)
|
||||||
const data: MintingDetailsDataProps = {
|
const data: MintingDetailsDataProps = {
|
||||||
numTokens: numberOfTokensState.value,
|
numTokens: numberOfTokensState.value,
|
||||||
unitPrice: unitPriceState.value ? (Number(unitPriceState.value) * 1_000_000).toString() : '',
|
unitPrice: unitPriceState.value
|
||||||
|
? (Number(unitPriceState.value) * 1_000_000).toString()
|
||||||
|
: unitPriceState.value === 0
|
||||||
|
? '0'
|
||||||
|
: '',
|
||||||
perAddressLimit: perAddressLimitState.value,
|
perAddressLimit: perAddressLimitState.value,
|
||||||
startTime: timestamp ? (timestamp.getTime() * 1_000_000).toString() : '',
|
startTime: timestamp ? (timestamp.getTime() * 1_000_000).toString() : '',
|
||||||
paymentAddress: paymentAddressState.value.trim(),
|
paymentAddress: paymentAddressState.value.trim(),
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable eslint-comments/disable-enable-pair */
|
||||||
|
/* eslint-disable no-nested-ternary */
|
||||||
import { FormControl } from 'components/FormControl'
|
import { FormControl } from 'components/FormControl'
|
||||||
import { FormGroup } from 'components/FormGroup'
|
import { FormGroup } from 'components/FormGroup'
|
||||||
import { AddressList } from 'components/forms/AddressList'
|
import { AddressList } from 'components/forms/AddressList'
|
||||||
@ -102,7 +104,11 @@ export const WhitelistDetails = ({ onChange }: WhitelistDetailsProps) => {
|
|||||||
.replace(/'/g, '')
|
.replace(/'/g, '')
|
||||||
.replace(/ /g, ''),
|
.replace(/ /g, ''),
|
||||||
members: whitelistType === 'standard' ? whitelistStandardArray : whitelistFlexArray,
|
members: whitelistType === 'standard' ? whitelistStandardArray : whitelistFlexArray,
|
||||||
unitPrice: unitPriceState.value ? (Number(unitPriceState.value) * 1_000_000).toString() : '',
|
unitPrice: unitPriceState.value
|
||||||
|
? (Number(unitPriceState.value) * 1_000_000).toString()
|
||||||
|
: unitPriceState.value === 0
|
||||||
|
? '0'
|
||||||
|
: undefined,
|
||||||
startTime: startDate ? (startDate.getTime() * 1_000_000).toString() : '',
|
startTime: startDate ? (startDate.getTime() * 1_000_000).toString() : '',
|
||||||
endTime: endDate ? (endDate.getTime() * 1_000_000).toString() : '',
|
endTime: endDate ? (endDate.getTime() * 1_000_000).toString() : '',
|
||||||
perAddressLimit: perAddressLimitState.value,
|
perAddressLimit: perAddressLimitState.value,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stargaze-studio",
|
"name": "stargaze-studio",
|
||||||
"version": "0.5.9",
|
"version": "0.6.0",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
|
@ -483,18 +483,6 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Whitelist State: ', whitelistDetails?.whitelistState)
|
|
||||||
console.log('Whitelist Type: ', whitelistDetails?.whitelistType)
|
|
||||||
console.log(
|
|
||||||
'Factory Address: ',
|
|
||||||
whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex'
|
|
||||||
? VENDING_FACTORY_FLEX_ADDRESS
|
|
||||||
: collectionDetails?.updatable
|
|
||||||
? VENDING_FACTORY_UPDATABLE_ADDRESS
|
|
||||||
: VENDING_FACTORY_ADDRESS,
|
|
||||||
)
|
|
||||||
|
|
||||||
console.log('Whitelist: ', whitelist)
|
|
||||||
const payload: VendingFactoryDispatchExecuteArgs = {
|
const payload: VendingFactoryDispatchExecuteArgs = {
|
||||||
contract:
|
contract:
|
||||||
whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex'
|
whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex'
|
||||||
@ -820,6 +808,7 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
const checkMintingDetails = () => {
|
const checkMintingDetails = () => {
|
||||||
if (!mintingDetails) throw new Error('Please fill out the minting details')
|
if (!mintingDetails) throw new Error('Please fill out the minting details')
|
||||||
if (mintingDetails.numTokens < 1 || mintingDetails.numTokens > 10000) throw new Error('Invalid number of tokens')
|
if (mintingDetails.numTokens < 1 || mintingDetails.numTokens > 10000) throw new Error('Invalid number of tokens')
|
||||||
|
if (mintingDetails.unitPrice === '') throw new Error('Public mint price is required')
|
||||||
if (whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex') {
|
if (whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex') {
|
||||||
if (Number(mintingDetails.unitPrice) < Number(minimumFlexMintPrice))
|
if (Number(mintingDetails.unitPrice) < Number(minimumFlexMintPrice))
|
||||||
throw new Error(`Invalid unit price: The minimum unit price is ${Number(minimumFlexMintPrice) / 1000000} STARS`)
|
throw new Error(`Invalid unit price: The minimum unit price is ${Number(minimumFlexMintPrice) / 1000000} STARS`)
|
||||||
@ -893,7 +882,7 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
}
|
}
|
||||||
} else if (whitelistDetails.whitelistState === 'new') {
|
} else if (whitelistDetails.whitelistState === 'new') {
|
||||||
if (whitelistDetails.members?.length === 0) throw new Error('Whitelist member list cannot be empty')
|
if (whitelistDetails.members?.length === 0) throw new Error('Whitelist member list cannot be empty')
|
||||||
if (whitelistDetails.unitPrice === '') throw new Error('Whitelist unit price is required')
|
if (whitelistDetails.unitPrice === undefined) throw new Error('Whitelist unit price is required')
|
||||||
if (Number(whitelistDetails.unitPrice) < 0)
|
if (Number(whitelistDetails.unitPrice) < 0)
|
||||||
throw new Error('Invalid unit price: The unit price cannot be negative')
|
throw new Error('Invalid unit price: The unit price cannot be negative')
|
||||||
if (whitelistDetails.startTime === '') throw new Error('Start time is required')
|
if (whitelistDetails.startTime === '') throw new Error('Start time is required')
|
||||||
|
Loading…
Reference in New Issue
Block a user