Update checkWalletBalance() to cover Base Minter instantiation

This commit is contained in:
Serkan Reis 2023-01-18 10:24:25 +03:00
parent 940cf06d6b
commit 06239329c4

View File

@ -816,12 +816,12 @@ const CollectionCreationPage: NextPage = () => {
const checkwalletBalance = () => {
if (!wallet.initialized) throw new Error('Wallet not connected.')
if (whitelistDetails?.whitelistType === 'new' && whitelistDetails.memberLimit) {
if (minterType === 'vending' && whitelistDetails?.whitelistType === 'new' && whitelistDetails.memberLimit) {
const amountNeeded = Math.ceil(Number(whitelistDetails.memberLimit) / 1000) * 100000000 + 2500000000
if (amountNeeded >= Number(wallet.balance[0].amount))
throw new Error('Insufficient wallet balance to instantiate the required contracts.')
} else {
const amountNeeded = 2500000000
const amountNeeded = minterType === 'vending' ? 2500000000 : 1000000000
if (amountNeeded >= Number(wallet.balance[0].amount))
throw new Error('Insufficient wallet balance to instantiate the required contracts.')
}