Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_cast(hash) Not working #743

Open
rahulrock213 opened this issue Jul 28, 2024 · 0 comments
Open

get_cast(hash) Not working #743

rahulrock213 opened this issue Jul 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rahulrock213
Copy link

rahulrock213 commented Jul 28, 2024

Traceback (most recent call last):
File "/root/wrap/wrap.py", line 22, in
print(client.get_cast("0x321712dc8eccc5d2be38e38c1ef0c8916c49949a80ffe20ec5752bb23ea4d86f"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/wrap/myenv/lib/python3.12/site-packages/farcaster/client.py", line 338, in get_cast
response = self._get(
^^^^^^^^^^
File "/root/wrap/myenv/lib/python3.12/site-packages/farcaster/client.py", line 89, in _get
raise Exception(response["errors"]) # pragma: no cover
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: [{'message': 'Path /v2/cast?hash=0x321712dc8eccc5d2be38e38c1ef0c8916c49949a80ffe20ec5752bb23ea4d86f does not exist'}]

`
import os
from farcaster import Warpcast
from dotenv import load_dotenv
from typing import List, Optional

# Load environment variables from .env file
load_dotenv()

# Get mnemonic from environment variable
mnemonic = os.getenv("FARCASTER_MNEMONIC")

# Initialize the Warpcast client
client = Warpcast(mnemonic=mnemonic)

# Check API health (optional)
print(client.get_healthcheck())
print(client.get_casts(535436, cursor=None, limit=1))
# Fetch user by username
#user = client.get_user_by_username("kannada")
#print(user.username)
#print(user.fid)
print(client.get_cast("0x321712dc8eccc5d2be38e38c1ef0c8916c49949a80ffe20ec5752bb23ea4d86f"))`
#response = client.get_cast("0x321712dc8eccc5d2be38e38c1ef0c8916c49949a80ffe20ec5752bb23ea4d86f")
#print(response.cast.author.username)
`
@rahulrock213 rahulrock213 added the bug Something isn't working label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant