Skip to content

Documentation / react-auth / addRpcUrlOverrideToChain

Function: addRpcUrlOverrideToChain()

addRpcUrlOverrideToChain(chain, rpcUrl): Object

Allows you to override the RPC url for the given chain

Parameters

chain: Chain

[Chain]([object Object]) chain you want to modify

rpcUrl: string

{@type string} rpc url you want to use for this chain

Returns

Object

modified chain object

blockExplorers?

blockExplorers?: Object

Collection of block explorers

Index signature

[key: string]: BlockExplorer

blockExplorers.default

blockExplorers.default: BlockExplorer

id

id: number

Id in number form

name

name: string

Human readable name

nativeCurrency

nativeCurrency: NativeCurrency

Currency used by chain

network?

network?: string

Internal network name

rpcUrls

rpcUrls: Object | Object

testnet?

testnet?: boolean

Flag for test networks

Example

ts
import { mainnet } from 'viem/chains';
import { addRpcUrlOverrideToChain } from '@privy-io/react-auth';

const mainnetOverride = addRpcUrlOverrideToChain(mainnet, INSERT_MAINNET_OVERRIDE_URL);