Skip to content

isProviderActive

isProviderActive(client, options): Promise<boolean>

Defined in: packages/synapse-core/src/sp-registry/is-provider-active.ts:68

Check if a provider is active

The underlying contract method is guarded by the providerExists modifier and will revert for unknown provider IDs. This wrapper normalizes those reverts to false so callers can use it as a simple existence + active check.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to check the provider status.
optionsOptionsTypeisProviderActive.OptionsType

Promise<boolean>

Whether the provider exists and is active isProviderActive.OutputType

Errors isProviderActive.ErrorType

import { isProviderActive } 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 active = await isProviderActive(client, {
providerId: 123n,
})
console.log(active)