import assert from "assert";
import { createPublicClient, http } from "viem";
import * as chains from "viem/chains";
export function gasPriceError(method, chainId, data) {
    throw new Error(`Malformed ${method} response on chain ID ${chainId} (${JSON.stringify(data)})`);
}
export function getPublicClient(chainId, transport) {
    transport ??= http(); // @todo: Inherit URL from provider.
    const chain = Object.values(chains).find((chain) => chain.id === chainId);
    assert(chain);
    return createPublicClient({ chain, transport });
}
//# sourceMappingURL=util.js.map