Ethereum Boilerplate Questions

This is what I have now on the fiat page. I messed up with the Onramper API key when I installed the plugin. Where I can find it?

The Onramper API key can found from your Onramper account dashboard and you can add or find it in your Moralis server settings. That should fix that issue, that page should be giving a Wrong API Key error in console.

From browser console:

I have cloned the project and yes I did get your issues where you can’t authenticate properly or the chain dropdown didn’t work.

What fixed it was creating and using a new server - both mainnet or testnet worked. Can you try this?

Also, NFT balances doesn’t show picture of NFT.

On my end using a random wallet address, a few NFTs of this collection show up.

The rest give issues of Invalid URI, this is because some of the tokens don’t have their token_uri synced.

You can use the reSyncMetadata API to sync the token_uri for these tokens. For now, you will have to do this for each token_id with missing token_uri / metadata as token_uris not on IPFS so they won’t resync automatically.

1 Like

You were right about Onramper API key. I needed to go this page and fill out the form to get the API key.

And then add that key to installed Onramper plugin on Moralis server I’ve created.
Now it’s working:

Although I created new server as you suggested, and clear all history including data in my browser,
I still need to manually refresh the page when I change network from drop down menu in header section, in order to drop down menu and wallet balances be visible in header again.

So the network does change successfully (MetaMask is prompted) but the app doesn’t refresh? Are you getting any errors in browser console now?

Yes, the network does change successfully (MetaMask is prompted) but the app doesn’t refresh. I need to manually refresh the page to drop down menu with networks to be visible again.

Console before connecting to Metamask wallet:

Console after connection to Mettamask wallet:


image

where my nft will show up after listing it for sale because i can’t see it in the explore page ?

Under the marketplace page in collections, these NFT’s will be marked as on sale.
NFT’s that are on sale and not on sale will appear on marketplace page only

Updating react-moralis to the latest version e.g. npm install react-moralis will fix this.

Let me know if doing this breaks something else in the boilerplate.

1 Like

Thank you very much!
I run: npm install react-moralist in Git Bush and it’s solved the problem with refreshing. The dapp seams to run smoothly now. :grinning:

What about this warnings when I run yarn install


I suppose I can delete package-lock.json.But what about these other warnings, can I ignore this?

And one more warning after running yarn start

okay so i can see the listed NFT in the collection. But I can’t buy it not !

That message will be displayed if there is no object for this NFT in your Moralis server’s MarketItems Class. Can you doublecheck this.

What about this warnings when I run yarn install

Likely due to conflicts with installing the latest react-moralis, I did not encounter any of these although I am using npm. Possibly installing some of the latest dependencies like eslint will fix some of these, you can try it, but keep a note of the previous version so you can revert if things break.

And one more warning after running yarn start

You can install the @web3auth/web3auth package to get rid of this warning but things should be working fine so you could ignore it unless you need to use web3auth.

Ok! Thanks for the help and tips!

I saw in the tutorial , the badge ribbon is supposed to be on currently listed market items on the NFT marketplace. but idk why in my case , i can’t see that on the listed items.

I’m getting this error as well in the NFTTokenIds.js
line31

Unhandled Rejection (SyntaxError): Unexpected token o in JSON at position 1

Line 31 in the NFTTokenIds.js github code is of css styles. If this is the line that is causing the error, then there must be a syntax error in the json properties.

If you are referring to some other code, can you paste the reference of that code.

Hi @johnversus , I’m getting this error , I am sorry , idk i typed 31 instead of line 25

Also I discovered this as well

can you try console.log of the parameters of getAllTokenIds and also the other the result data of getAllTokenIds function. I think the 400 error is due to some wrong parameters.

@johnversus, thank you for replying ! This is the payout result i’m getting from it.

You don’t have to worry about this 400 error, it is just due to how the boilerplate is set up.

This unexpected token error means you’re parsing something that’s not valid JSON. What is the contract address you’re using?

An option is to use a try and catch block so if the error happens to just use the metadata directly (dependent on it being a valid object).

try {
    NFT.metadata = JSON.parse(NFT.metadata);
} catch (err) {
    console.log(err);
}
NFT.image = resolveLink(NFT.metadata?.image);