Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I use EventFilter::MoveEventType in the sui-sdk to query events? #19929

Open
tzxyz opened this issue Oct 20, 2024 · 1 comment
Open
Assignees
Labels
doc-issue Issue submitted using the Doc issue template

Comments

@tzxyz
Copy link

tzxyz commented Oct 20, 2024

  pub async fn get_pools(&self) -> Result<()> {
      // 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::factory::CreatePoolEvent
      let query = EventFilter::MoveEventType(
          StructTag::from_str("0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::factory::CreatePoolEvent")
      );
      let mut cursor = Option::None;
      self.sui
          .event_api()
          .query_events(query, cursor, None, false);

      Ok(())
  }

failed to resolve: use of undeclared type StructTag use of undeclared type StructTag

It seems that the sui-sdk cannot import the StructTag struct. How should I resolve this?

@tzxyz tzxyz added the doc-issue Issue submitted using the Doc issue template label Oct 20, 2024
@stefan-mysten
Copy link
Contributor

You'd need to import move-core-types from here: https://github.com/MystenLabs/sui/tree/main/external-crates/move/crates/move-core-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-issue Issue submitted using the Doc issue template
Projects
None yet
Development

No branches or pull requests

3 participants