Docs

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/...

Parameters

Returns

The RPC URL for the specified chain.