169 похожих чатов

Hi guys, I'm doing a dapp for NFT. how

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?

16 ответов

3 просмотра

erc721 interface has balanceOf(address) same as erc20 interface, for viewing number

TheCodingMan- Автор вопроса

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.

Aaron (Coffee) - https://rmg.io | https://darkalpha.eth.limo
NFTs that implement IERC721Enumerable interface ar...

ALternatively, it can sometimes be feasible to iterate the whole collection and call ownerOf() for each token, aggregate that way.

TheCodingMan
I haven't another way?🤯

for non-enumerable ones, I gave you three ways...I'm not sure if there is another way

TheCodingMan- Автор вопроса
Aaron (Coffee) - https://rmg.io | https://darkalpha.eth.limo
for non-enumerable ones, I gave you three ways...I...

Yes sorry. do you have something about the query transfer event? Which one do you recommend?

TheCodingMan
Yes sorry. do you have something about the query t...

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

TheCodingMan- Автор вопроса

it's not clear to me. Do you have any resources about it?

TheCodingMan
it's not clear to me. Do you have any resources a...

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.

Abhishek Ranjan
/report

Reported Ariel to admins.​​​​

TheCodingMan
it's not clear to me. Do you have any resources a...

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

TheCodingMan- Автор вопроса

Похожие вопросы

Обсуждают сегодня

Вопрос по диагностике ошибок (я знаю в чем, в данном конкретном примере, я знаю, как исправить, пример модельный, понятно, что в реальности бывает намного запутаннее). module...
ⰄⰎⰋⰐⰐⰑⰛⰤⰧⰧⰩⰄ ⰊⰑⰁⰓⰡⰛⰦⰕⰫ
10
А чем вам питонисты не угодили?😂
.
79
Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
52
А дальше что?.. Записать в файл, потом в Код?.. И потом разбирать как-то?..
Хаскель Моисеевич Гопник
14
доброго времени. db, dw и прочие исполняются при трансляции или при выполнении программы?
lutayyy
10
type TObj = object procedure Init; virtual; end; TObj1 = object(TObj) procedure Init; override; end; procedure TObj1.Init; begin inherited; end; procedur...
Alexander 👋
29
например asm AT&T ... label: .string "hi" ... # not error lea label(%rip), %rax # error ( not compile ) mov %rip, %rax # not error mov (%rip), %rax из форумов прочитал чт...
Simple Sorcerer
6
Почему никто не подсказал, что можно объявить свои типы данных, в которых меньше полей, чем в отданном джейсоне, и добавлять их по необходимости?
Strange Rabbit
10
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
86
Есть предложения, как подобное можно упростить?
Hemul GM
12
Карта сайта