grapheneapi.aio.websocket module

class grapheneapi.aio.websocket.Websocket(*args, **kwargs)

Bases: grapheneapi.aio.rpc.Rpc

connect()
disconnect()
get_response_by_id(request_id)

Pop response from dict containing all query results

Parameters:request_id (int) – request id to get response to
parse_messages()

Listen websocket for incoming messages in infinity manner

Messages which are responses (has id) are stored in dict, while messages which are notifies are stored in asyncio queue and are supposed to be processed later by whom who sets the subscribtion callback

rpcexec(payload)

Execute a RPC call

Parameters:payload (dict) – json-rpc request in format: {“jsonrpc”: “2.0”, “method”: “call”, “params”: “[x, y, z]”, “id”: 1}