I wanted to get the Mint price from nft i tried getting it from abi but it's not effective since different contracts has different names for it so how can i find the set mint price from contract in pure.js or is there any api for it. and lastly how to find the max supply like not the total supply which is minted amount 222/3000 in here i want to get the 3000 which is max supply, thanks
2 Answers
There aren't any standards (at least any that would be in use) for setting the mint price. So everyone implements it in their own way. Therefore there is no universal way to retrieve it - and many contract don't have a mint price at all.
The same goes for max supply: there is no way to programmatically know what is the max supply (unless there is an explicit variable for it and you can trust it). You would have to manually analyze the contract to see if it has some max supply.
-
i'm creating a platform where anyone can come and mint by pasting the contract but it's a must to show what's the mint price unless they will put a desired price they want and might fail? Jan 25 at 4:47
-
Well you can simulate the transactions to see if it would fail with the given mint price. Check your used library's documentation for more information. Jan 25 at 4:52
Unfortunately, like Lauri said in prev post, there is no one standard or even any commonly used pattern.
The only solution I can think about here is to pre-approve contracts in your application with checked and set proper function calls for every contract and show only those pre-approved contracts for your users in the application.