Open eugenekhoo1 opened 1 year ago
i have resolved this problem..if you still need then tell..
first of all graph is used for some test network or mainnet so in chainId section do "11155111" instead of "31337" i don`t think you are going to do it by the way..
With
const { runContractFunction: getTokenURI } = useWeb3Contract({
abi: nftAbi,
contractAddress: nftAddress,
functionName: "tokenURI",
params: {
tokenId: tokenId,
},
});
you are explicitly telling tokenURI
function to accept tokenId
as a parameter and assigning it to tokenId
variable. However in your BasicNFT.sol
contract you have commented out the input tokenId
in tokenURI
function implementation so useWeb3Contract({..... ,params: {tokenId: tokenId,},})
never assign it to the tokenId
variable. So you need to uncomment the input parameter variable of tokenURI
function in you BasicNFT
smartcontract.
So it should be like this
function tokenURI(uint256 tokenId) public view override returns (string memory) {
return TOKEN_URI;
}
Can you help me solve this issue? I am experiencing the same problem. (In nextjs-nft-marketplace-thegraph-fcc) i have also uncomment the parameter variable of tokenURI function in you BasicNFT smartcontract.
please share your repo
When I connect with Hardhat, errors occur; however, when I connect to Sepolia, no errors are shown, and all images are displayed.
When i am Moving blocks... in sepolia network this error are occur:)
ProviderError: Unsupported method: evm_mine. See available methods at https://docs.alchemy.com/alchemy/documentation/apis
at HttpProvider.request (C:\Users\shrad\Desktop\jgh\hh-BC\hardhat-nft-marketplace\node_modules\hardhat\src\internal\core\providers\http.ts:88:21)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at moveBlocks (C:\Users\shrad\Desktop\jgh\hh-BC\hardhat-nft-marketplace\utils\move-blocks.js:11:9)
at mine (C:\Users\shrad\Desktop\jgh\hh-BC\hardhat-nft-marketplace\scripts\mine.js:7:5)
error Command failed with exit code 1.
GraphQL NftMarketPlace repo: https://github.com/Shradhesh71/GraphQL_NftMarketPlace Hardhat Nft-MarketPlace repo: https://github.com/Shradhesh71/Nft-MarketPlace
The evm_mine
method used is in moveBlocks
is for hardhat network not for sepolia or real testnet.
Coming to hardhat, try again with clearing activity and nonce data ( and make sure you're connected to hardhat network in metamask).
One important thing remember is that you can not query your local blockchain(hardhat) with GRAPH indexer.
Thank you @tusharr1411 for helping me with this topic.
I am getting a list of all the the active item's tokenId,nftAddress and other props which i am passing to nftBox. My question is this as the tokenUri function takes one value as parameter in the form of tokenId but i am getting all the Active TokenId's in tokenId varaible please help.
[Also posted on main repo]
Hi, I am having issues getting the Token URIs using the useWeb3Contract function in NFTBox..as you can see my NFT boxes are not loading due to it being undefined.
The issue seems to be with the follow code, but i cant seem to debug it:
I have checked my subgraph and it does show the correct nftAddress that the getTokenURI function uses as one of it params
I am also able to get the ActiveItems that the 'listings.js' code is calling.
Tried to troubleshoot, but seems like all the params for the useWeb3Contract are in order...so im not too sure what the issue is with loading..
Repos: NextJS code https://github.com/eugenekhoo1/nextjs-nft-marketplace
NFT Contracts https://github.com/eugenekhoo1/hardhat-nft-marketplace
Graph https://github.com/eugenekhoo1/graph-nft-marketplace