getRpcUrlForChain

Retrieves the RPC URL for the specified chain. If a custom RPC URL is defined in the options, it will be used. Otherwise, a thirdweb RPC URL will be constructed using the chain ID and client ID.

Example

import { getRpcUrlForChain } from "thirdweb/chains";
const rpcUrl = getRpcUrlForChain({ chain: 1, client });
console.log(rpcUrl); // "https://1.rpc.thirdweb.com/...
function getRpcUrlForChain(options: GetRpcUrlForChainOptions): string;

Parameters

The options object containing the chain and client information.

Type

let options: GetRpcUrlForChainOptions;

Returns

let returnType: string;

The RPC URL for the specified chain.