Move.

帖子

分享您的知识。

Caplec.
Feb 13, 2025
专家问答

How to get custom Sui token object ID for a specific account?

I'm trying to find out how to obtain a custom Sui token object ID for a specific account using the frontend. I'm planning to use the TypeScript SDK. Can anyone guide me on how to achieve this?

  • Move CLI
1
1
分享
评论
.

答案

1
elfDani.
Feb 13 2025, 11:08

getOwnedObjects嘿,既然你正在使用TypeScript SDK开发前端部分,你可以使用这个方法. 此方法允许您检索特定帐户拥有的对象,并根据您要查找的结构类型对其进行过滤. 你可以通过在StructType请求中传递过滤器参数来做到这一点,如下所示:

suiClient.getOwnedObjects({
  owner: "0xCAFE",
  filter: {
    StructType: "0xCAFE::module::struct"
  }
})

这应该可以帮助您获取指定账户所需的自定义 Sui 代币对象 ID.

1
评论
.

你知道答案吗?

请登录并分享。

我们使用 cookie 确保您在我们的网站上获得最佳体验。
更多信息