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.

ParameterType
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.capabilityKeysreadonly string[]
data.product.isActiveboolean
data.product.productTypenumber
data.productCapabilityValuesreadonly `0x${string}`[]
data.providerIdbigint
data.providerInfo{ description: string; isActive: boolean; name: string; payee: `0x${string}`; serviceProvider: `0x${string}`; }
data.providerInfo.descriptionstring
data.providerInfo.isActiveboolean
data.providerInfo.namestring
data.providerInfo.payee`0x${string}`
data.providerInfo.serviceProvider`0x${string}`

boolean