So, I was analyzing the specific holders for NFT Owners but it doesnât include the burn address. For instance, for contract 0x0cfb5d82be2b949e8fa73a656df91821e2ad99fd it doesnât include the burn address despite it being one of the top holders.
def getHolders(tok_add):
addresses_dict = {}
end = False
cursor = ""
count = 0
while not end:
tradeUrl = "https://deep-index.moralis.io/api/v2/nft/" + str(tok_add) + \
"/owners?chain=eth&format=decimal"
if cursor != "":
tradeUrl += "&cursor=%s" % cursor
headers = {
"Content-Type": "application/json",
"X-API-Key": APIKEY,
}
# get the response, if we fail once, end the search
try:
response = requests.request("GET", tradeUrl, headers=headers, timeout = 30)
data = response.json()
results = data["result"]
cursor = data["cursor"]
count+=1
except Exception as err:
return "Error"
time.sleep(.3)
# add each address to dict and update their count if they do
# already exist
for result in results:
owner = result["owner_of"]
if owner in addresses_dict:
addresses_dict[result["owner_of"]][1] += 1
else:
count+= 1
addresses_dict[result["owner_of"]] = [result["owner_of"], 1]
print("For " + tok_add + " the number of holders is " + str(count))
return addresses_dict
if __name__ == "__main__":
ca = "0x0cfb5d82be2b949e8fa73a656df91821e2ad99fd"
ktfdict = getHolders(ca)
burn_address = "0x0000000000000000000000000000000000000000"
if burn_address in ktfdict:
print("Great")
else:
print("Not Great")
it prints ânot greatâ. I also had other checks just trying to find the top holders by sorting and they always exclude the burn address