Is it possible to list all objects by package?

Hi, I’m newbie for SUI move :hand_with_fingers_splayed: and want to list all objects defined at specific package.

Assuming SUI’s object model, it seems difficult to list objects by package, but I am wondering if it is possible without indexing server. Thx in advance!

Hi @momentum99! You’re right - Sui doesn’t currently have a native way to list all objects from a specific package. Here are two approaches you could consider:

  1. Custom Indexer Solution:
    Build an indexer that tracks object creation and maintains a mapping of package-to-objects. This would give you the most flexibility.
  2. Event-Based Solution:
    Have your package emit events whenever new objects are created, then query these events. This is lighter-weight but requires package modifications.

The indexer approach would work for existing packages, while events need forward planning. I’d be happy to elaborate on either approach if helpful!

Ok I got it. Thx so much @siomari :+1: