var _a;
import { CHAIN_IDs, PUBLIC_NETWORKS } from "../constants";
// Chain-specific overrides for when the endpoint name does not match the canonical chain name.
var endpoints = (_a = {},
    _a[CHAIN_IDs.ALEPH_ZERO] = "alephzero",
    _a[CHAIN_IDs.ARBITRUM] = "arbitrum",
    _a[CHAIN_IDs.MAINNET] = "ethereum",
    _a);
export function getURL(chainId, apiKey, transport) {
    var _a, _b;
    var chain = (_a = endpoints[chainId]) !== null && _a !== void 0 ? _a : (_b = PUBLIC_NETWORKS[chainId]) === null || _b === void 0 ? void 0 : _b.name;
    if (!chain) {
        throw new Error("No known DRPC provider for chainId ".concat(chainId));
    }
    chain = chain.toLowerCase().replace(" ", "-");
    var rpcType = transport === "https" ? "rpc" : "ws";
    return "".concat(transport, "://lb.drpc.org/og").concat(rpcType, "?network=").concat(chain, "&dkey=").concat(apiKey);
}
//# sourceMappingURL=drpc.js.map