Input Struct #78
-
Hi, I was using your library like 1 year ago and I was calling this method to find permit nonce value: def getPermitNonce(wallet, checkToken):
r = requests.get(f"https://{api_url}/api?module=account&action=txlist&address={wallet}&startblock=0&endblock=9999999999999&page=1&offset=0&sort=desc&apikey={random.choice(api_keys)}")
for tx in r.json()["result"]:
try:
if "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad".lower() == tx["to"].lower() and tx["isError"] == "0":
#print(tx["hash"])
decoded_transaction = codec.decode.transaction(tx["hash"])
#print(decoded_transaction["decoded_input"]["inputs"][0][1])
nonce = decoded_transaction["decoded_input"]["inputs"][0][1]['struct']['details']['nonce'] + 1
token = decoded_transaction["decoded_input"]["inputs"][0][1]['struct']['details']['token']
print(checkToken, token)
if checkToken.lower() == token.lower():
# print(tx["hash"])
print(f"{token} nonce is {nonce}")
return nonce
break
except Exception as e:
print(e)
pass
return 0 but now it doesn't have "struct", is it changed ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
Actually, the PERMIT2_PERMIT has indeed these parameters, my bad! |
Beta Was this translation helpful? Give feedback.
Hi, I found the solution by looking the tutorial(how to get permit nonce), I think you should add it to your library examples because it's not easy to find that function you already made to find permit nonce. Thank you so much. 🙏