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

AttributeError: module 'algosdk.v2client.algod' has no attribute 'asset_info' #47

Closed
Bhaney44 opened this issue Nov 28, 2022 · 1 comment

Comments

@Bhaney44
Copy link

I'm using the code from #36 but I am getting an error that is preventing any functional return.

from tinyman.v1.client import TinymanMainnetClient
from algosdk.v2client import algod
client = TinymanMainnetClient(algod_client=algod)

asset1 = client.fetch_asset(31566704)
asset2 = client.fetch_asset(386192725)
amount = 100
asset_in = asset1

pool = client.fetch_pool(asset1, asset2)
quote = pool.fetch_fixed_input_swap_quote(asset_in(amount * 10 ** asset_in.decimals), slippage=0.05)

Error

Traceback (most recent call last):
  File "/Users/Desktop/Projects/quote.py", line 5, in <module>
    asset1 = client.fetch_asset(92772865)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tinyman/v1/client.py", line 25, in fetch_asset
    asset.fetch(self.algod)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tinyman/assets.py", line 19, in fetch
    params = algod.asset_info(self.id)['params']
AttributeError: module 'algosdk.v2client.algod' has no attribute 'asset_info'

I searched in client.py and assets.py but I have not found a way to change the params variable such that asset_info is recognized. I'm not sure how or why this error would occur because it is resulting in a de facto deprecation of the Python-SDK. Any advice or suggestions would be appreciated. Thanks!

@Bhaney44
Copy link
Author

Solution

algod = AlgodClient('', 'https://node.algoexplorerapi.io', headers={'User-Agent': 'algosdk'})
client = TinymanMainnetClient(algod_client=algod)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant