"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getURL = getURL;
const constants_1 = require("../constants");
const endpoints = {
    [constants_1.CHAIN_IDs.ARBITRUM]: "arbitrum",
    [constants_1.CHAIN_IDs.MAINNET]: "ethereum",
};
function getURL(chainId, apiKey, transport) {
    let chain = endpoints[chainId] ?? constants_1.PUBLIC_NETWORKS[chainId]?.name;
    if (!chain) {
        throw new Error(`No known DRPC provider for chainId ${chainId}`);
    }
    chain = chain.toLowerCase().replace(" ", "-");
    const rpcType = transport === "https" ? "rpc" : "ws";
    return `${transport}://lb.drpc.org/og${rpcType}?network=${chain}&dkey=${apiKey}`;
}
//# sourceMappingURL=drpc.js.map