Publicación
Comparte tu conocimiento.
How to subscribe to blockchain events in Sui?
Hi! I'm diving into using Sui and I'd love to subscribe to specific blockchain events. However, I'm hitting a roadblock. I know about using suix_subscribeEvent in JSON API, but I've heard it's becoming outdated. But in my hunt through the GraphQL API, I can't find the equivalent feature. Should I just stick with the legacy JSON API, or is there another way to achieve event subscriptions?
- Move CLI
Respuestas
2Tiene razón en su comprensión: con GraphQL, ahora mismo está limitado a realizar sondeos. Por el contrario, la API JSON permite realizar sondeos y usar websockets para suscribirse, pero ten en cuenta que los websockets están a punto de desaparecer. Si estás sopesando tus opciones, ten en cuenta que Sui podría eliminar la API JSON en breve, por lo que es aconsejable planificar en consecuencia.
La suscripción a los eventos aún no está disponible a través de la RPC de GraphQL. Lo mejor que puedes hacer, incluso con el RPC de JSON, es optar por el sondeo.
Sabes la respuesta?
Inicie sesión y compártalo.