package com.m2pool.pool.enums;

/**
 * @Description 矿池
 * @Date 2022/5/20 11:15
 * @Author 杜懿
 */
public enum Pools {

    GRS("grs", "grs", "groestl", "grs_pool_blkstats", "grs_mhs", "grs_pool","grs.svg",0.985,60),
    MONA("mona", "mona", "Lyra2REv2", "mona_pool_blkstats", "mona_mhs", "mona_pool","mona.svg",0.985,90),
    DGBS("dgbs", "dgb(skein)", "DigiByte(Skein)", "dgbs_pool_blkstats", "dgbs_mhs", "dgbs_pool","dgb.svg",0.985,0),
    DGBQ("dgbq", "dgb(qubit)", "DigiByte(Qubit)", "dgbq_pool_blkstats", "dgbq_mhs", "dgbq_pool","dgb.svg",0.985,0),
    DGBO("dgbo", "dgb(odocrypt)", "DigiByte(Odocrypt)", "dgbo_pool_blkstats", "dgbo_mhs", "dgbo_pool","dgb.svg",0.985,0),
    //DGB2_ODO("dgb2_odo", "dgb-odocrypt-pool2", "odocrypt", "dgb2_odo_pool_blkstats", "dgb2_odo_miners", "dgb2_odo_pool"),
    DGB_QUBIT_A10("dgb_qubit_a10", "dgb-qubit-pool2", "qubit", "dgb_qubit_a10_pool_blkstats", "dgb_qubit_a10_miners", "dgb_qubit_a10_pool","dgb.svg",0.985,15),
    DGB_SKEIN_A10("dgb_skein_a10", "dgb-skein-pool2", "skein", "dgb_skein_a10_pool_blkstats", "dgb_skein_a10_miners", "dgb_skein_a10_pool","dgb.svg",0.985,15),
    DGB_ODO_B20("dgb_odo_b20", "dgb-odoscrypt-pool3", "odocrypt", "dgb_odo_b20_pool_blkstats", "dgb_odo_b20_miners", "dgb_odo_b20_pool","dgb.svg",0.985,15),
    NEXA("nexa", "nexa", "NexaPow", "nexa_pool_blkstats", "nexa_mhs", "nexa_pool","nexa.png",0.985,120),
    RXD("rxd", "Radiant", "Sha512256D", "rxd_pool_blkstats", "rxd_mhs", "rxd_pool","rxd.png",0.985,300),
    ALPH("alph", "Alephium", "Blake3", "alph_pool_blkstats", "alph_mhs", "alph_pool","alph.svg",0.985,0),
    ENX("enx", "entropyx", "kHeavyHash", "enx_pool_blkstats", "enx_mhs", "enx_pool","enx.svg",0.985,0),
    MONERO("monero", "monero", "randomx", "monero_pool_blkstats", "monero_mhs", "monero_pool","xmr.png",0.985,0),
    SHA3X("sha3x", "sha3x", "sha3x", "sha3x_pool_blkstats", "sha3x_mhs", "sha3x_pool","xtm.svg",0.985,0);


    /** 币种参数名 */
    private final String coin;
    /** 页面显示名 */
    private final String name;
    /** 算法 */
    private final String algorithm;
    /** 报块数据表名 */
    private final String blkTable;
    /** 矿机表名 */
    private final String mhs;
    /** 矿池表名 */
    private final String poolTable;

    private final String img;

    private final double fac;

    /**
     * 阻塞时间
     */
    private final long blockTime;

    Pools(String coin, String name, String algorithm, String blkTable, String mhs, String poolTable, String img, double fac, long blockTime) {
        this.coin = coin;
        this.name = name;
        this.algorithm = algorithm;
        this.blkTable = blkTable;
        this.mhs = mhs;
        this.poolTable = poolTable;
        this.img = img;
        this.fac = fac;
        this.blockTime = blockTime;
    }



    public String getCoin() {
        return coin;
    }

    public String getName() {
        return name;
    }

    public String getAlgorithm() {
        return algorithm;
    }

    public String getBlkTable() {
        return blkTable;
    }

    public String getMhs() {
        return mhs;
    }

    public String getPoolTable() {
        return poolTable;
    }

    public String getImg() {
        return img;
    }

    public double getFac() {
        return fac;
    }



    public static String getNameByCoin(String coin){
        for (Pools t : Pools.values()) {
            if(t.getCoin().equals(coin)){
                return t.getName();
            }
        }
        return "";
    }

    public static String getImgByCoin(String coin){
        for (Pools t : Pools.values()) {
            if(t.getCoin().equals(coin)){
                return t.getImg();
            }
        }
        return "";
    }

    public long getBlockTime() {
        return blockTime;
    }
}
