-
Notifications
You must be signed in to change notification settings - Fork 981
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
Load totalSupply without connecting wallet #33
Comments
Yes you can load totalSupply just by pulling from your contract. If you find the line in your rendered code Minted VS Total Supply Then I wrote a function to update that HTMLID with the contract values instead of the config file `async function passMaxNFT() {
}
} |
where are you dropping these functions ? in blockchainactions.js or in app.js ? |
In app.js |
Hi heisenbergpromotions, thanks for your solution! Unfortunately its not working when i just paste ist under the Line "{data.totalSupply} / {CONFIG.MAX_SUPPLY}" It would be very nice if you could sent more infos where exactly you did rewrite to app.js ! |
Could you please elaborate or provide the full code changes. Thanks in advance. |
i solved this problem creating an API that calls the supply number and pasting it on the script/head of the index.html file. Paste the code below on the of your HTML (dont forget to replace the CONTRACTHERE and APIHERE by your NFT contract address and API (create an API by loging on etherscan):
Now go to your APP.JS file and replace this code:
<s.TextTitle
<s.TextTitle
Certify that you have to turn down adblocker to make sure that this code will gonna work correctly. I use brave browser and i had to deactivate the protection to my dapp minting site, but now its working perfectly. Hope it helps. |
HI Thanks for your help! Now I have one Problem ... it just shows only "Conect" where the Minting Amount should be. |
How can "totalSupply" be loaded before the wallet is connected?
The idea is that the minting page shows " 0 / " until the wallet is connected, and makes it appear at though nothing has been minted, which may turn off the user and they may not even connect the wallet.
I dont know React, but is there a simple change to allow the totalSupply to be loaded before the wallet is connected?
Thanks
The text was updated successfully, but these errors were encountered: