An existing Provider
Block tag or number to use for all requests
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({ chain: mainnet, transport: http() })
const blockNumber = await client.getBlockNumber() // or "latest", "earliest", etc.
const blockProvider = whatsabi.providers.WithBlockNumber(client, blockNumber);
const r = await whatsabi.autoload(address, { provider: blockProvider
Wrap an existing Provider into one that will always use a specified blockTag for requests.
This helper is to avoid plumbing the blockTag throughout the whatsabi stack, and because it's more ergonomic to use the same blockTag consistently across a given provider.