Move.

帖子

分享您的知识。

Pluto Dev👽.
Jan 12, 2025
专家问答

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
分享
评论
.

答案

2
CarlkawIy.
Jan 14 2025, 03:20

你的理解是正确的:使用 GraphQL,你现在只能进行轮询. 然而,JSON API允许轮询和网络套接字同时进行订阅,但请注意,网络套接字即将消失. 如果你正在权衡自己的选择,请记住,Sui 可能很快会逐步淘汰 JSON API,因此明智的做法是做出相应的规划.

1
最佳答案
评论
.
YJS.
YJS94
Jan 14 2025, 03:20

目前尚无法通过 GraphQL RPC 订阅活动. 即使使用 JSON RPC,最好的选择可能是改为选择投票.

0
评论
.

你知道答案吗?

请登录并分享。

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

148帖子231答案
Sui.X.Peera.

赚取你的 1000 Sui 份额

获取声誉积分,并因帮助 Sui 社区成长而获得奖励。

奖励活动七月