Skip to content
Alchemy Logo

getAlchemyRpcUrl

function getAlchemyRpcUrl(chainId): undefined | string;

Defined in: packages/common/src/transport/chainRegistry.ts:145

Gets the Alchemy RPC base URL for a given chain ID.

const rpcUrl = getAlchemyRpcUrl(1); // "https://eth-mainnet.g.alchemy.com/v2"

ParameterTypeDescription

chainId

number

The chain ID to lookup

undefined | string

The Alchemy RPC base URL or undefined if not supported

Was this page helpful?