WebsocketAPI
Attributes
attributeconnection_lockasyncio.LockFunctions
func__init__(self, url, tld='com', testnet=False, https_proxy=None)paramselfparamurlstrparamtldstr= 'com'paramtestnetbool= Falseparamhttps_proxyOptional[str]= NoneReturns
Nonefuncregister_subscription_queue(self, subscription_id, queue) -> NoneRegister a queue to receive events for a specific subscription.
paramselfparamsubscription_idstrparamqueueasyncio.QueueReturns
Nonefuncunregister_subscription_queue(self, subscription_id) -> NoneUnregister a subscription queue.
paramselfparamsubscription_idstrReturns
Nonefunc_handle_message(self, msg)Override message handling to support request-response
paramselfparammsgReturns
Nonefunc_ensure_ws_connection(self) -> NoneEnsure WebSocket connection is established and ready
This function will:
- Check if connection exists and is streaming
- Attempt to connect if not
- Wait for connection to be ready
- Handle reconnection if needed
paramselfReturns
Nonefuncrequest(self, id, payload) -> dictSend request and wait for response
paramselfparamidstrparampayloaddictReturns
dictfunc__aexit__(self, exc_type, exc_val, exc_tb)Clean up responses before closing
paramselfparamexc_typeparamexc_valparamexc_tbReturns
None