getProviderWithProduct
getProviderWithProduct(
client,options):Promise<{product: {capabilityKeys: readonlystring[];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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the provider details. |
options | OptionsType | getProviderWithProduct.OptionsType |
Returns
Section titled “Returns”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
Throws
Section titled “Throws”Errors getProviderWithProduct.ErrorType
Example
Section titled “Example”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)