createAlchemyPublicRpcClient

1const createAlchemyPublicRpcClient: ({
2 transport,
3 chain,
4}) => ClientWithAlchemyMethods;

Defined in: account-kit/infra/dist/types/client/rpcClient.d.ts:26

Creates an Alchemy public RPC client with the provided chain, connection configuration, and optional fetch options. The client has alchemy methods and can dynamically update HTTP headers.

Example

1import { createAlchemyPublicRpcClient, alchemy } from "@account-kit/infra";
2import { sepolia } from "@account-kit/infra";
3
4const client = createAlchemyPublicRpcClient({
5 transport: alchemy({
6 apiKey: "ALCHEMY_API_KEY",
7 }),
8 chain: sepolia,
9});

Parameters

ParameterType

{ transport, chain, }

{ chain: Chain | undefined; transport: AlchemyTransport; }

{ transport, chain, }.chain

Chain | undefined

{ transport, chain, }.transport

AlchemyTransport

Returns

ClientWithAlchemyMethods

A client object tailored with Alchemy methods and capabilities to interact with the blockchain