"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.coinNames = void 0;
exports.getMainnet = getMainnet;
exports.isMainnet = isMainnet;
exports.isTestnet = isTestnet;
exports.isCoinName = isCoinName;
exports.toCoinName = toCoinName;
// BitGo coin names (from Network::from_coin_name in src/networks.rs)
exports.coinNames = [
    "btc",
    "tbtc",
    "tbtc4",
    "tbtcsig",
    "tbtcbgsig",
    "bch",
    "tbch",
    "bcha",
    "tbcha",
    "btg",
    "tbtg",
    "bsv",
    "tbsv",
    "dash",
    "tdash",
    "doge",
    "tdoge",
    "ltc",
    "tltc",
    "zec",
    "tzec",
];
function getMainnet(name) {
    switch (name) {
        case "tbtc":
        case "tbtc4":
        case "tbtcsig":
        case "tbtcbgsig":
            return "btc";
        case "tbch":
            return "bch";
        case "tbcha":
            return "bcha";
        case "tbtg":
            return "btg";
        case "tbsv":
            return "bsv";
        case "tdash":
            return "dash";
        case "tdoge":
            return "doge";
        case "tltc":
            return "ltc";
        case "tzec":
            return "zec";
        default:
            return name;
    }
}
function isMainnet(name) {
    return getMainnet(name) === name;
}
function isTestnet(name) {
    return getMainnet(name) !== name;
}
function isCoinName(v) {
    return exports.coinNames.includes(v);
}
/** Convert a CoinName or UtxolibName to CoinName */
function toCoinName(name) {
    switch (name) {
        case "bitcoin":
            return "btc";
        case "testnet":
            return "tbtc";
        case "bitcoinTestnet4":
            return "tbtc4";
        case "bitcoinPublicSignet":
            return "tbtcsig";
        case "bitcoinBitGoSignet":
            return "tbtcbgsig";
        case "bitcoincash":
            return "bch";
        case "bitcoincashTestnet":
            return "tbch";
        case "ecash":
            return "bcha";
        case "ecashTest":
            return "tbcha";
        case "bitcoingold":
            return "btg";
        case "bitcoingoldTestnet":
            return "tbtg";
        case "bitcoinsv":
            return "bsv";
        case "bitcoinsvTestnet":
            return "tbsv";
        case "dashTest":
            return "tdash";
        case "dogecoin":
            return "doge";
        case "dogecoinTest":
            return "tdoge";
        case "litecoin":
            return "ltc";
        case "litecoinTest":
            return "tltc";
        case "zcash":
            return "zec";
        case "zcashTest":
            return "tzec";
        default:
            // CoinName values pass through (including "dash" which is both CoinName and UtxolibName)
            return name;
    }
}
