getRpcClient

Returns an RPC request that can be used to make JSON-RPC requests.

Example

import { createThirdwebClient } from "thirdweb";
import { getRpcClient } from "thirdweb/rpc";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const rpcRequest = getRpcClient({ client, chain: ethereum });
const blockNumber = await rpcRequest({
method: "eth_blockNumber",
});

Parameters

Returns

The RPC request function.