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.
Properties
Section titled “Properties”getApprovedProvidersForPieceCID()
Section titled “getApprovedProvidersForPieceCID()”getApprovedProvidersForPieceCID: (pieceCid) => Promise<ProviderInfo[]>;
Defined in: packages/synapse-sdk/src/types.ts:162
Finds providers that have registered a specific data segment (PieceCID).
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
pieceCid | PieceLink | The PieceCID of the data segment. |
Returns
Section titled “Returns”A promise that resolves to an array of ProviderInfo
objects.
getProviderByAddress()
Section titled “getProviderByAddress()”getProviderByAddress: (address) => Promise<null | ProviderInfo>;
Defined in: packages/synapse-sdk/src/types.ts:170
Retrieves details for a specific provider by their address.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
address | string | The unique address (ID) of the provider. |
Returns
Section titled “Returns”Promise
<null
| ProviderInfo
>
A promise that resolves to ProviderInfo
if found, otherwise null
.