Move.

Post

Share your knowledge.

Pluto Dev👽.
Jan 12, 2025
Expert Q&A

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
1
2
Share
Comments
.

Answers

2
CarlkawIy.
Jan 14 2025, 03:20

You're correct in your understanding: with GraphQL, you're limited to polling right now. Whereas, the JSON API allows both polling and websockets for subscribing, though do note that websockets are on the way out. If you're weighing your options, keep in mind that Sui may phase out the JSON API soon, so it's wise to plan accordingly.

1
Best Answer
Comments
.
YJS.
YJS94
Jan 14 2025, 03:20

Subscribing to events isn't available yet through the GraphQL RPC. Your best bet, even with the JSON RPC, might be to opt for polling instead.

0
Comments
.

Do you know the answer?

Please log in and share it.

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148Posts231Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJune
We use cookies to ensure you get the best experience on our website.
More info