"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MCC = void 0;
const BtcRpcImplementation_1 = require("./chain-clients/BtcRpcImplementation");
const DogeRpcImplementation_1 = require("./chain-clients/DogeRpcImplementation");
const XrpRpcImplementation_1 = require("./chain-clients/XrpRpcImplementation");
const genericMccTypes_1 = require("./types/genericMccTypes");
var MCC;
(function (MCC) {
    class BTC extends BtcRpcImplementation_1.BTCImplementation {
        constructor(options) {
            super(options);
        }
    }
    MCC.BTC = BTC;
    class DOGE extends DogeRpcImplementation_1.DOGEImplementation {
        constructor(options) {
            super(options);
        }
    }
    MCC.DOGE = DOGE;
    class XRP extends XrpRpcImplementation_1.XRPImplementation {
        constructor(options) {
            super(options);
        }
    }
    MCC.XRP = XRP;
    function getChainType(chainIdOrName) {
        switch (chainIdOrName) {
            case "XRP":
            case "RIPPLE":
            case genericMccTypes_1.ChainType.XRP:
                return genericMccTypes_1.ChainType.XRP;
            case "BTC":
            case genericMccTypes_1.ChainType.BTC:
                return genericMccTypes_1.ChainType.BTC;
            case "DOGE":
            case genericMccTypes_1.ChainType.DOGE:
                return genericMccTypes_1.ChainType.DOGE;
            default:
                return genericMccTypes_1.ChainType.invalid;
        }
    }
    MCC.getChainType = getChainType;
    function getChainTypeName(chainIdOrName) {
        switch (chainIdOrName) {
            case genericMccTypes_1.ChainType.XRP:
                return "XRP";
            case genericMccTypes_1.ChainType.BTC:
                return "BTC";
            case genericMccTypes_1.ChainType.DOGE:
                return "DOGE";
            default:
                return "invalid";
        }
    }
    MCC.getChainTypeName = getChainTypeName;
    function Client(chainIdOrName, options) {
        const chainType = getChainType(chainIdOrName);
        switch (chainType) {
            case genericMccTypes_1.ChainType.XRP:
                return new XRP(options);
            case genericMccTypes_1.ChainType.BTC:
                return new BTC(options);
            case genericMccTypes_1.ChainType.DOGE:
                return new DOGE(options);
            default: {
                throw new Error("Not implemented");
            }
        }
    }
    MCC.Client = Client;
})(MCC = exports.MCC || (exports.MCC = {}));
//# sourceMappingURL=module.js.map