getApprovedProviders
getApprovedProviders(
client,options):Promise<OutputType>
Defined in: packages/synapse-core/src/warm-storage/get-approved-providers.ts:67
Get approved provider IDs with optional pagination
For large lists, use pagination to avoid gas limit issues. If limit=0, returns all remaining providers starting from offset.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the approved providers. |
options | OptionsType | getApprovedProviders.OptionsType |
Returns
Section titled “Returns”Array of approved provider IDs getApprovedProviders.OutputType
Throws
Section titled “Throws”Errors getApprovedProviders.ErrorType
Example
Section titled “Example”import { getApprovedProviders } from '@filoz/synapse-core/warm-storage'import { createPublicClient, http } from 'viem'import { calibration } from '@filoz/synapse-core/chains'
const client = createPublicClient({ chain: calibration, transport: http(),})
// Get first 100 providersconst providerIds = await getApprovedProviders(client, { offset: 0n, limit: 100n,})
console.log(providerIds)