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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to check the provider status. |
options | OptionsType | isProviderActive.OptionsType |
Returns
Section titled “Returns”Promise<boolean>
Whether the provider exists and is active isProviderActive.OutputType
Throws
Section titled “Throws”Errors isProviderActive.ErrorType
Example
Section titled “Example”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)