Skip to content

addApprovedProvider

addApprovedProvider(client, options): Promise<`0x${string}`>

Defined in: packages/synapse-core/src/warm-storage/add-approved-provider.ts:60

Add an approved provider for the client

This function approves a provider so that the client can create data sets with them.

ParameterTypeDescription
clientClient<Transport, Chain, Account>The client to use to add the approved provider.
optionsOptionsTypeaddApprovedProvider.OptionsType

Promise<`0x${string}`>

The transaction hash addApprovedProvider.OutputType

Errors addApprovedProvider.ErrorType

import { addApprovedProvider } from '@filoz/synapse-core/warm-storage'
import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { calibration } from '@filoz/synapse-core/chains'
const account = privateKeyToAccount('0x...')
const client = createWalletClient({
account,
chain: calibration,
transport: http(),
})
const txHash = await addApprovedProvider(client, {
providerId: 1n,
})
console.log(txHash)