import { CONFIG, LandId } from "../../config/constants";
export var ChainIDs;
(function (ChainIDs) {
    ChainIDs[ChainIDs["Ethereum"] = 1] = "Ethereum";
    ChainIDs[ChainIDs["Ropsten"] = 3] = "Ropsten";
    ChainIDs[ChainIDs["Crab"] = 44] = "Crab";
    ChainIDs[ChainIDs["CrabTest"] = 44] = "CrabTest";
    ChainIDs[ChainIDs["Heco"] = 128] = "Heco";
    ChainIDs[ChainIDs["Hecotest"] = 256] = "Hecotest";
    ChainIDs[ChainIDs["Polygon"] = 137] = "Polygon";
    ChainIDs[ChainIDs["Mumbai"] = 80001] = "Mumbai";
    ChainIDs[ChainIDs["Tron"] = 11112] = "Tron";
    ChainIDs[ChainIDs["Shasta"] = 11111] = "Shasta";
})(ChainIDs || (ChainIDs = {}));
/**
 * Get Addresses
 * @param chainId Chain id
 * @returns Addresses or undefined
 */
export const getAddressesByLandId = (landId) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
    switch (landId) {
        case LandId.ETHEREUM:
            return (_a = CONFIG[1]) === null || _a === void 0 ? void 0 : _a.address;
        case LandId.TRON:
            return (_b = CONFIG[2]) === null || _b === void 0 ? void 0 : _b.address;
        case LandId.CRAB:
            return (_c = CONFIG[3]) === null || _c === void 0 ? void 0 : _c.address;
        case LandId.HECO:
            return (_d = CONFIG[4]) === null || _d === void 0 ? void 0 : _d.address;
        case LandId.POLYGON:
            return (_e = CONFIG[5]) === null || _e === void 0 ? void 0 : _e.address;
        case LandId._ETHEREUM:
            return (_f = CONFIG[1001]) === null || _f === void 0 ? void 0 : _f.address;
        case LandId._TRON:
            return (_g = CONFIG[1002]) === null || _g === void 0 ? void 0 : _g.address;
        case LandId._CRAB:
            return (_h = CONFIG[1003]) === null || _h === void 0 ? void 0 : _h.address;
        case LandId._HECO:
            return (_j = CONFIG[1004]) === null || _j === void 0 ? void 0 : _j.address;
        case LandId._POLYGON:
            return (_k = CONFIG[1005]) === null || _k === void 0 ? void 0 : _k.address;
        default:
            return;
    }
};
/**
 * Get Address By Name
 * @param chainId Chain id
 * @param name Name
 * @returns Address
 */
export const getAddressByName = (landId, name) => {
    const addresses = getAddressesByLandId(landId);
    if (addresses) {
        return addresses[name];
    }
    return "";
};
