How can I get all the NFTs of an collection

How can I get all the NFTs of a collection using Sui Typescript SDK?

You will need to query the network for the object type.

With GraphQL you can do:

query GetObjectsByType($type: String!, $first: Int!, $after: String) {
  objects(
    first: $first,
    after: $after,
    filter: { type: $type }
  ) {
    nodes {
      address
      version
      digest
    }
  }
}

and you can adjust the variables payload as such

{
  "type": "0xCoffee::module::ObjectType",
  "first": 10, 
  "after": null
}
2 Likes