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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain, Account> | The client to use to add the approved provider. |
options | OptionsType | addApprovedProvider.OptionsType |
Returns
Section titled “Returns”Promise<`0x${string}`>
The transaction hash addApprovedProvider.OutputType
Throws
Section titled “Throws”Errors addApprovedProvider.ErrorType
Example
Section titled “Example”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)