Created
May 31, 2023 18:11
-
-
Save puneetkaura/acc873b632e8fabcecd097ed2cda81bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from moralis import sol_api | |
API_KEY = os.environ['MORALIS_API_KEY'] | |
# LUKIAH_MINT_NFT_ADDRESS = "jcWV1azgWtye6WR5XnLKHkiQ7oHz2pAETd1ugbqi7QN" | |
PUNEET_WALLET_ADDRESS = "EBryGAW6UnzR7gCtUK5Yk6pYgZkqM4nJXebkErYwyoNU" | |
def _get_wallet_NFTs(wallet_address): | |
params = { | |
"network": "mainnet", | |
"address": wallet_address, | |
} | |
result = sol_api.account.get_nfts( | |
api_key=API_KEY, | |
params=params, | |
) | |
print(result) | |
return result | |
def hasLukiahNFT(wallet_address=None): | |
if not wallet_address: | |
wallet_address = "7LhuMhKU7KuDT8JiLauySSfEZNR5tXnneJwQ68XGKm3c" | |
nfts = _get_wallet_NFTs(wallet_address=wallet_address) | |
lukiah_nfts = [] | |
if (len(nfts) > 0): | |
for nft in nfts: | |
if nft['symbol'] == "LUKIAH" and nft["associatedTokenAddress"] == "AvJjYGQq7ESdRvtXbE3yfWQRVGkfza4Y4FvaAVpcXLLP": | |
print("Wallet has " + nft["name"]) | |
lukiah_nfts.append(nft) | |
else: | |
pass | |
else: | |
print("NO NFTS are owned by this Solana wallet") | |
hasLukiahNFT(wallet_address="7LhuMhKU7KuDT8JiLauySSfEZNR5tXnneJwQ68XGKm3c") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment