Skip to content

hasActivePDPProduct

hasActivePDPProduct(data): boolean

Defined in: packages/synapse-core/src/sp-registry/get-pdp-provider.ts:44

Returns true when the contract response carries an active, populated PDP product.

The contract’s getProviderWithProduct view only enforces providerExists, so it will happily return a default-initialized ServiceProduct with isActive: false and an empty capabilityKeys array for providers that never registered a PDP product or had it removed. Detect that case before attempting to parse capabilities.

Parameter Type
data { 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}`; }; }
data.product { capabilityKeys: readonly string[]; isActive: boolean; productType: number; }
data.product.capabilityKeys readonly string[]
data.product.isActive boolean
data.product.productType number
data.productCapabilityValues readonly `0x${string}`[]
data.providerId bigint
data.providerInfo { description: string; isActive: boolean; name: string; payee: `0x${string}`; serviceProvider: `0x${string}`; }
data.providerInfo.description string
data.providerInfo.isActive boolean
data.providerInfo.name string
data.providerInfo.payee `0x${string}`
data.providerInfo.serviceProvider `0x${string}`

boolean