scroll领取nft python 脚本

2023-12-18 13:16:45
import csv,requests,json,time
from web3 import Web3
from eth_account import Account
from eth_account.messages import encode_defunct


def claim():
    #判断是否claim过
    try:
        router = w3.eth.contract(contract, abi=abi)
        claim1 = router.functions.minted(from_address).call()
        print(f'是否claim过:{claim1}')
        if claim1 is True:
            return
    except:
        pass
    
    #API获取参数
    while True:
        timestamp=int(time.time()*1000)
        try:
            res=requests.get(f'https://nft.scroll.io/p/{from_address}.json?timestamp={timestamp}',proxies=proxies)
            if res.status_code==200:
                try:
                    res1=res.json()
                    metadata=res1['metadata']
                    proof=res1['proof']
                except:
                    print(from_address,':无资格领取')
                    return

 

文章来源:https://blog.csdn.net/a394467238/article/details/135059564
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。