Ethereum Boilerplate Questions

I just updated the 1inch plugin, I dont have enough Eth on my metamask right now. I guess kovanEth not going to work tryin to test it, could you maybe check if it works from your ends.

is there an boilerplate update or so ?

Hi!

Have you solved this problem? The same happens to me. Thank you very much!

If you’ve recently cloned the boilerplate then no, you’re using the latest one. If you’re getting the chain null issue and you have authenticated (and have a valid chain selected in your wallet), try updating your react-moralis package (command yarn add react-moralis).

There is a version 2 of the boilerplate coming out as well.

@zilla86 You can more or less ignore all of those warnings if you get a similar terminal output.

Nah not really, it still dont work for me.

What isn’t working exactly?

Probably a dumb question but I am really struggling. I deployed ethereum-boilerplate, it works great, using it for Avax and to show my NFTs. However my issue is NFTBalance.jsx calls GetNFTs which gets every NFT in my wallet. I’m trying to change it to call GetNFTsForContract, to only show my collections NFTs, and no matter what I try, I just can’t get it to work. Any suggestions? I’m pretty new to this.

How have you tried using getNFTsForContract?

If you want to filter the results by contract you could keep using getNFTs and use the token_addresses parameter (array of address strings).

function NFTBalance() {
  const { data: NFTBalances } = useNFTBalances({ token_addresses: ["0x2953399124f0cbb46d2cbacd8a89cf0599974963"] });

  ...

Hey that worked! I was trying to change it inside of useNFTBalances, and not directly inside of NFTBalance, I don’t know why I didn’t think of simply doing that. Thanks!

How would you get 2 contracts passed in? I tried the following which I thought was the correct way, and it’s not working.

function NFTBalance() {
const { data: NFTBalances } = useNFTBalances({ token_addresses: [“0x2953399124f0cbb46d2cbacd8a89cf0599974963” | “0x2953399124f0cbb46d2cbacd8a89cf05999cx963”] });

You’d use an array of

["0x2953399124f0cbb46d2cbacd8a89cf0599974963", "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"]

And so on.

ok, I thought using a comma there would go to the next option after token_addresses but since we are inside of token_addresses that doesn’t happen. It’s working the way I need it to. Thanks for your help! Its been 4 years since I looked at javascript, gosh I’m rusty.

1 Like

Hello, you can upload a video where you can purchase a NFT insite of the web!

Hi. thank you for the video tutorial.
I was able to follow all steps until the yarn start…
it opens and run the code, but it seems there it loads only a blank page.
I have tried several browsers…, and also have enabled Javascript… and there seems to be no other error on the VScode

do you see any errors in the browser console?

And there is a recent change in the moralis sdk package name, probably you need to updated the package name in the boilerplate.

forgot to mentioned, that I also do not see any error on the console. not sure how to change the package name either :sweat_smile:

I guess there should be some errors if it is not working as mentioned in the docs.
Did you use the correct folder name while installing and starting the localhost servers?

You can change the package like this

npm remove moralis
npm install moralis-v1
1 Like

Please help kind sers. When installing the boilerplate I get this error:

Module not found: Error: Can’t resolve ‘zlib’ in ‘/Users/kingy/Downloads/ethereum-boilerplate-main/node_modules/react-moralis/lib’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

Did you use yarn install to install it? For the webpack issue, a workaround is to install [email protected], otherwise you will need to add that polyfill to your webpack config.

I can’t replicate this on a fresh ethereum-boilerplate.

Strange! I yarn installed on my macbook and pc and both got the same issue.