Skip to content
On this page

setRpcUrl

Sets the backend RPC URL.

Usage

ts
import { testClient } from './client'

await testClient.setRpcUrl('https://eth-mainnet.g.alchemy.com/v2') 
ts
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'

export const testClient = createTestClient({
  chain: foundry,
  mode: 'anvil',
  transport: http(), 
})

Released under the MIT License.