Task B

mail@pastecode.io avatar
unknown
python
2 years ago
786 B
2
Indexable
Never
#!/usr/bin/python
# Get (X+Y) holders
import requests
NFT1="0xd21a23606D2746f086f6528Cd6873bAD3307b903"
NFT2="0xB796485fE35C926328914cD4CD9447D095d41F7f"
LNFT1=[]
LNFT2=[]
chainid=1
URL1 = "https://api.covalenthq.com/v1/"+str(chainid)+"/tokens/"+NFT1+"/token_holders/?&key=ckey_80d0aba5413a4a5a8e0d2d315f6";
URL2 = "https://api.covalenthq.com/v1/"+str(chainid)+"/tokens/"+NFT2+"/token_holders/?&key=ckey_80d0aba5413a4a5a8e0d2d315f6";
r1 = requests.get(url = URL1)
r2 = requests.get(url = URL2)
dataNFT1 = r1.json()
dataNFT2 = r2.json()
for item in dataNFT1['data']['items']:
    LNFT1.append(item['address'])
for item in dataNFT2['data']['items']:
    LNFT2.append(item['address'])

XPlusY=(list(set(LNFT1) & set(LNFT2)))
for address in XPlusY:
    print(address)