Initializes the SemaphoreSubgraph instance with a supported network or a custom subgraph URL. This allows to interact with the Semaphore smart contract through the specified endpoint.
Either a supported network identifier or a direct URL to the subgraph.
Private
_urlRetrieves the URL of the subgraph currently being used by the instance. This URL points to the specific subgraph where Semaphore data is stored.
The URL of the subgraph.
Fetches detailed information about a specific group by its ID. This method can also retrieve members and validated proofs for the group if requested via options.
The unique identifier of the group.
Configuration options to specify which details to fetch about the group.
A promise that resolves to the details of the specified group.
Retrieves detailed information about groups from the subgraph based on the provided options. This method can filter groups by various parameters and include additional details like members and validated proofs if specified in the options.
Configuration options to filter groups and specify which additional details to fetch.
A promise that resolves to an array of group details.
Determines whether a specific member is part of a group. This method queries the subgraph to check if the provided member's identity commitment exists within the specified group.
The unique identifier of the group.
The identity commitment of the member to check.
A promise that resolves to true if the member is part of the group, otherwise false.
The SemaphoreSubgraph class provides an interface to interact with the Semaphore smart contract via subgraph queries. It enables operations such as retrieving lists of group members and validated proofs, as well as checking membership within groups. Each group in Semaphore is represented as a LeanIMT (Lean Incremental Merkle Tree). This class supports interaction through either a SupportedNetwork or a direct URL to the subgraph. The subgraphs themselves are hosted on The Graph protocol, facilitating efficient and decentralized query processing.