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 ".concat(method, " response on chain ID ").concat(chainId, " (").concat(JSON.stringify(data), ")"));
}
export function getPublicClient(chainId, transport) {
    transport !== null && transport !== void 0 ? transport : (transport = http()); // @todo: Inherit URL from provider.
    var chain = Object.values(chains).find(function (chain) { return chain.id === chainId; });
    assert(chain);
    return createPublicClient({ chain: chain, transport: transport });
}
//# sourceMappingURL=util.js.map