Alchemy Logo

createAlchemyPublicRpcClient

const createAlchemyPublicRpcClient: ({
  transport,
  chain,
}) => 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.

import { createAlchemyPublicRpcClient, alchemy } from "@account-kit/infra";
import { sepolia } from "@account-kit/infra";
 
const client = createAlchemyPublicRpcClient({
  transport: alchemy({
    apiKey: "ALCHEMY_API_KEY",
  }),
  chain: sepolia,
});

ParameterType

{ transport, chain, }

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

{ transport, chain, }.chain

Chain | undefined

{ transport, chain, }.transport

AlchemyTransport

ClientWithAlchemyMethods

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

Was this page helpful?