Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web3.js #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/mint/web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const getMintPrice = async () => {
return defaultMintPrice
default:
console.log("Using hardcoded price detection")
const methodNameVariants = ['price', 'cost', 'public_sale_price', 'getPrice']
const methodNameVariants = ['price', 'cost', 'public_sale_price', 'getPrice','MINT_PRICE']
const name = methodNameVariants.find(n => findMethodByName(n) !== undefined)
if (!name) {
const defaultMintPrice = getDefaultMintPrice()
Expand Down Expand Up @@ -100,10 +100,10 @@ export const getMintedNumber = async () => {
export const getMaxSupply = async () => {
if (!NFTContract)
return undefined
if (NFTContract.methods.maxSupply)
return await NFTContract.methods.maxSupply().call()
if (NFTContract.methods.MAX_SUPPLY)
return await NFTContract.methods.MAX_SUPPLY().call()
if (NFTContract.methods.COLLECTION_SIZE)
return await NFTContract.methods.COLLECTION_SIZE().call()
if (NFTContract.methods.COLLECTION_SIZE)
return await NFTContract.methods.COLLECTION_SIZE().call()
alert("Widget doesn't know how to fetch maxSupply from your contract. Contact https://buildship.xyz to resolve this.")
return undefined
}
Expand Down