setRpcUrl
Sets the backend RPC URL.
Usage
ts
import { testClient } from './client'
await testClient.setRpcUrl('https://eth-mainnet.g.alchemy.com/v2')
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(),
})
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'
export const testClient = createTestClient({
chain: foundry,
mode: 'anvil',
transport: http(),
})