package com.m2pool.pool.enums;

/**
 * @Description 矿池单位换算
 * @Date 2022/5/20 11:15
 * @Author 杜懿
 */
public enum PoolProfitScale {

    GRS("grs",  2),
    MONA("mona",  2),
    DGBS("dgbs",  2),
    DGBQ("dgbq",  2),
    DGBO("dgbo",  2),
    DGB2_ODO("dgb2_odo",  2),
    DGB_QUBIT_A10("dgb_qubit_a10",  2),
    DGB_SKEIN_A10("dgb_skein_a10",  2),
    DGB_ODO_B20("dgb_odo_b20",  2),
    NEXA("nexa",  2),
    RXD("rxd",  2),
    ALPH("alph",  2),
    ENX("enx",  2),
    MONERO("monero",2),
    SHA3X("sha3x",2);

    /** 币种参数名 */
    private final String coin;

    private final int scale ;


    PoolProfitScale(String coin, int scale) {
        this.coin = coin;
        this.scale = scale;
    }

    public String getCoin() {
        return coin;
    }

    public int getScale() {
        return scale;
    }

    public static int getScaleByCoin(String coin){
        for (PoolProfitScale t : PoolProfitScale.values()) {
            if(t.getCoin().equals(coin)){
                return t.getScale();
            }
        }
        return 8;
    }
}
