I am trying to retrieve all the of the unique Key/Value pairs for all of the possible metadata_attributes / trait_type’s for a given contract.
I am trying to do something like the following:
// @ts-ignore
const Web3Api = useMoralisWeb3Api();
const fetchNFTsForContract = async () => {
const options = {
chain: "eth",
token_address: "0x3bc..4560",
};
// @ts-ignore
const someNFTs = await Web3Api.account.getNFTsForContract(options);
console.log(someNFTs);
};
useEffect(() => {
if (!isWeb3Enabled) return;
fetchNFTsForContract()
}, [isWeb3Enabled])
But I don’t seem to get any results…
When I try to use getNFTsForContract
it requires a wallet address specific to retrieve the NFTs for a given wallet.
Essentially what I am trying to recreate is here:
https://am.nftavatarmaker.com/
Where a user browses through the possible traits in an already existing NFT contract, and then is able to mint a new one based on the chosen traits (Background, Skin Color, etc.)
How can I accomplish this using the react-moralis
library?