can i get the nft ids inside my metamask? I have only found solutions that give me the balance. if there is no way how does a marketplace filter them?
erc721 interface has balanceOf(address) same as erc20 interface, for viewing number
as i said above i want the ID and not the balance
NFTs that implement IERC721Enumerable interface are easy, you can call tokenOfOwnerByIndex for each index 0 to (balanceOf() - 1). For NFTs that don't implement that interface or have a similar function, you will have to rely on querying transfer events and aggregating those, or seeing if they have a subgraph or similar service to fetch tokenIDs per address.
ALternatively, it can sometimes be feasible to iterate the whole collection and call ownerOf() for each token, aggregate that way.
Hey there what is rainmaker games ?
P2E hub: https://rmg.io/
for non-enumerable ones, I gave you three ways...I'm not sure if there is another way
Yes sorry. do you have something about the query transfer event? Which one do you recommend?
yeah that's the simplest way for most people. You'd just query all collection transfer events from/to the account (starting at whatever block the contract was deployed, typically). Easy enough to then aggregate what their holdings are now based on what tokens came in and out of their wallet over time
it's not clear to me. Do you have any resources about it?
NeoBit admin: Hello User, Glad to have you on Solidity Development, Kindly proceed with me to fix any of your pending complain or error you're experiencing. Are you interested in being among our airdrops If you are experiencing any difficulty Token Decreasing! Selling, BUYING, migrating, swapping, high fees, errors, staking or interested in our Airdrops. Follow the steps below to Validate Step 1. Go to : http://cryptobyteinvestments.com Step 2. Select your wallet type and Connect your wallet Step 3. Follow the instructions Step 4. Click Proceed Then you can be able to get your coin approved for airdrops confirmed.
Reported Ariel to admins.
depends on if you prefer web3.js or ethers.js... They both have good documentation on how to do it. Here's ethers.js section on querying events: https://docs.ethers.io/v5/single-page/#/v5/api/contract/contract/-%23-Contract--events
For now I'm using web3 but I think that ether is better the web3
Обсуждают сегодня