subscribe error
JasonLinZh opened this issue · 1 comments
JasonLinZh commented
Get stuck at drift_client.subscribe()
driftpy version: 0.7.39
async def main():
subaccount_id = 0
spot_market_index = 0
market_index = 0
drift_client = DriftClient(connection, wallet, "mainnet",
account_subscription=AccountSubscriptionConfig("websocket"),
)
await drift_client.add_user(subaccount_id)
await drift_client.subscribe()
loop = asyncio.new_event_loop()
answer = loop.run_until_complete(main())
here is the error message:
Traceback (most recent call last):
File "/Users/jason/theplatform/test_drift.py", line 109, in <module>
answer = loop.run_until_complete(main())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jason/anaconda3/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/jason/theplatform/test_drift.py", line 105, in main
await drift_client.subscribe()
File "/Users/jason/anaconda3/lib/python3.11/site-packages/driftpy/drift_client.py", line 143, in subscribe
await self.account_subscriber.subscribe()
File "/Users/jason/anaconda3/lib/python3.11/site-packages/driftpy/accounts/ws/drift_client.py", line 71, in subscribe
) = await find_all_market_and_oracles(self.program, data_and_slots=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jason/anaconda3/lib/python3.11/site-packages/driftpy/constants/config.py", line 138, in find_all_market_and_oracles
perp_slot = int(parsed_resp.result["context"]["slot"])
^^^^^^^^^^^^^^^^^^
AttributeError: 'Error' object has no attribute 'result'
soundsonacid commented
don't use public mainnet beta url it doesn't support gpa
use alchemy or helius free