Returns an RPC request that can be used to make JSON-RPC requests.
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",});
function getRpcClient( options: Readonly<{ chain: Readonly<ChainOptions & { rpc: string }>; client: ThirdwebClient; config?: { batchTimeoutMs?: number; maxBatchSize?: number; requestTimeoutMs?: number; }; }>,): EIP1193RequestFn<EIP1474Methods>;
The RPC options.
let options: Readonly<{ chain: Readonly<ChainOptions & { rpc: string }>; client: ThirdwebClient; config?: { batchTimeoutMs?: number; maxBatchSize?: number; requestTimeoutMs?: number; };}>;
let returnType: EIP1193RequestFn<EIP1474Methods>;
The RPC request function.