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
146 stars 34 forks source link

UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol. #16

Closed sleechie closed 6 months ago

sleechie commented 6 months ago

I am very experienced with Python but fairly new to APIs:

result = await async_client.send_raw_transaction(txn=bytes(signed_txn), opts=opts)

returns an error:

UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

but I am using all of the default urls here:

jupiter = Jupiter( async_client=async_client, keypair=private_key, quote_api_url="https://quote-api.jup.ag/v6/quote?", swap_api_url="https://quote-api.jup.ag/v6/swap", open_order_api_url="https://jup.ag/api/limit/v1/createOrder", cancel_orders_api_url="https://jup.ag/api/limit/v1/cancelOrders", query_open_orders_api_url="https://jup.ag/api/limit/v1/openOrders?wallet=", query_order_history_api_url="https://jup.ag/api/limit/v1/orderHistory", query_trade_history_api_url="https://jup.ag/api/limit/v1/tradeHistory" )

I am not sure if this is the right place for my question, but what exactly am I missing? Thank you so much for putting all of this together!

sleechie commented 6 months ago

My bad lol I figured it out

0xTaoDev commented 6 months ago

Hello, how did you fix it? thanks

sleechie commented 6 months ago

I never replaced

async_client = AsyncClient("SOLANA-RPC-ENDPOINT-URL")

with an actual endpoint I just left the placeholder string in there. Once I added an endpoint everything worked great. Thanks again for putting this together!

0xTaoDev commented 6 months ago

Thanks, I will make it more clear, have a good day!