Use suix_subscribeEvent failing

Hello. Can anyone please help me? Why my script on python does not work? It gives an error

New event received: {‘jsonrpc’: ‘2.0’, ‘error’: {‘code’: -32602, ‘message’: ‘byte deserialization failed, cause by: AccountAddressParseError’}, ‘id’: 1}

This is the code:

import asyncio
import websockets
import json

async def subscribe_events():
    uri = "wss://rpc-mainnet.suiscan.xyz/websocket"  # Replace with the actual WebSocket URL of your SUI full node
    async with websockets.connect(uri) as websocket:
        # Subscribe to events for the specific package, module, and function
        subscribe_message = {
            "jsonrpc": "2.0",
            "id": 1,
            "method": "suix_subscribeEvent",
            "params": [
                {
                    "Package": "'0xfa9302fe83a1b717293ca0d4f80a9195e66ac3d401977df5b16f1aae00232ab9'",
                    "Module": "move_pump",
                    "Function": "buy"
                }
            ]
        }
        await websocket.send(json.dumps(subscribe_message))
        
        while True:
            response = await websocket.recv()
            event = json.loads(response)
            print("New event received:", event)

asyncio.get_event_loop().run_until_complete(subscribe_events())

I cant find any solution, how to recieve the new input with this package? I need to know, when Buy was done, and when was Sell done.

1 Like
1 Like