Skip to content

fetchProviderSelectionInput

fetchProviderSelectionInput(client, options): Promise<ProviderSelectionInput>

Defined in: packages/synapse-core/src/warm-storage/fetch-provider-selection-input.ts:43

Fetch all chain data needed for provider selection.

Executes parallel queries for:

  • Approved PDP providers (via spRegistry)
  • Endorsed provider IDs (via endorsements)
  • Client’s existing datasets (via warmStorage view)

Then enriches datasets with a single batched multicall for:

  • Live status, listener (managed check), metadata, active piece count

Returns a ProviderSelectionInput ready to pass to selectProviders().

For users who need custom caching or only need a subset of this data, assemble ProviderSelectionInput manually instead.

ParameterTypeDescription
clientClient<Transport, Chain>Viem public client configured for the target chain
optionsOptionsTypeClient address and desired metadata

Promise<ProviderSelectionInput>

ProviderSelectionInput with all fields populated