Skip to content

SubgraphRetrievalService

Defined in: packages/synapse-sdk/src/types.ts:155

Defines the contract for a service that can retrieve provider information from a data source, typically a Synapse-compatible subgraph.

This interface allows for custom implementations to be provided in place of the default SubgraphService. Any service that implements this interface can be used with the Synapse SDK by passing it via the subgraphService option when creating a Synapse instance.

This enables integration with alternative data sources or custom implementations while maintaining compatibility with the SDK’s retrieval system.

getApprovedProvidersForPieceCID: (pieceCid) => Promise<ProviderInfo[]>;

Defined in: packages/synapse-sdk/src/types.ts:162

Finds providers that have registered a specific data segment (PieceCID).

ParameterTypeDescription
pieceCidPieceLinkThe PieceCID of the data segment.

Promise<ProviderInfo[]>

A promise that resolves to an array of ProviderInfo objects.


getProviderByAddress: (address) => Promise<null | ProviderInfo>;

Defined in: packages/synapse-sdk/src/types.ts:170

Retrieves details for a specific provider by their address.

ParameterTypeDescription
addressstringThe unique address (ID) of the provider.

Promise<null | ProviderInfo>

A promise that resolves to ProviderInfo if found, otherwise null.