Merge pull request #93 from public-awesome/update_check_wallet_balance

Update checkWalletBalance() to cover Base Minter instantiation
This commit is contained in:
Serkan Reis 2023-01-18 10:29:42 +03:00 committed by GitHub
commit 489c53ed23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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.')
}