0xTaoDev / jupiter-python-sdk

Jupiter Python SDK is a Python library that allows you to use most of Jupiter features.
https://pypi.org/project/jupiter-python-sdk/
MIT License
120 stars 32 forks source link

Error When running script #7

Closed octoma closed 4 months ago

octoma commented 5 months ago

Hi. I get the following:::: .local/lib/python3.9/site-packages/jupiter_python_sdk/jupiter.py", line 676, in swap transaction_data = httpx.post(url=self.ENDPOINT_APIS_URL['SWAP'], json=transaction_parameters).json()['swapTransaction'] KeyError: 'swapTransactio

0xTaoDev commented 4 months ago

Hello, I'm gonna improve the code thanks to the issue you encountered. Indeed, this error occurs when there are no routes available. It can happen due to numerous reasons such as: slippage, token not listed, and so on. I will specificed the reason if there is an error when you are trying to swap.

0xTaoDev commented 4 months ago

Code updated https://github.com/0xTaoDev/jupiter-python-sdk/commit/a9f7d51d2655c29d9ac56c2891385407af82d5ee