im trying to use a end pint to get blockstamp time on most recent transaction but i cant get it work this is my codeapi_key =
Get the time of the last transaction for the token_address
params = {
"chain": "eth",
"contract_addresses": [token_address],
"exclude_contracts": {},
"wallet_addresses": [],
"exclude_wallets": [],
"limit": 1
}
params_tuple = tuple(params.items())
result = evm_api.token.get_erc20_transfers(
api_key=api_key,
params=params_tuple,
)
print(f"Token Transfers Results: {result}")
if result and "result" in result and len(result["result"]) > 0:
last_transaction_time = parse(result["result"][0]["block_timestamp"])
last_transaction_time = last_transaction_time.astimezone(timezone.utc).replace(tzinfo=None)
# Print the timestamp
print(f"Last Transaction Timestamp: {last_transaction_time}")
# Check if the last transaction was more than 3 days ago
if (datetime.utcnow() - last_transaction_time).days > 3:
print("Skipping this token as the last transaction was more than 3 days ago.")
continue
time.sleep(1 / 50)
Check if the last transaction was more than 3 days ago
if last_transaction_time and (datetime.utcnow() - last_transaction_time).days > 3:
continue