Skip to content

getProviderWithProduct

getProviderWithProduct(client, options): Promise<{ product: { capabilityKeys: readonly string[]; isActive: boolean; productType: number; }; productCapabilityValues: readonly `0x${string}`[]; providerId: bigint; providerInfo: { description: string; isActive: boolean; name: string; payee: `0x${string}`; serviceProvider: `0x${string}`; }; }>

Defined in: packages/synapse-core/src/sp-registry/get-provider-with-product.ts:65

Get provider details with specific product information

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the provider details.
optionsOptionsTypegetProviderWithProduct.OptionsType

Promise<{ product: { capabilityKeys: readonly string[]; isActive: boolean; productType: number; }; productCapabilityValues: readonly `0x${string}`[]; providerId: bigint; providerInfo: { description: string; isActive: boolean; name: string; payee: `0x${string}`; serviceProvider: `0x${string}`; }; }>

The provider with product details getProviderWithProduct.OutputType

Errors getProviderWithProduct.ErrorType

import { getProviderWithProduct } from '@filoz/synapse-core/sp-registry'
import { createPublicClient, http } from 'viem'
import { calibration } from '@filoz/synapse-core/chains'
const client = createPublicClient({
chain: calibration,
transport: http(),
})
const provider = await getProviderWithProduct(client, {
providerId: 1n,
productType: 0, // ProductType.PDP
})
console.log(provider.providerInfo.name)