package nft.info;

import common.Resp;
import config.Config;
import exception.ZXChainException;
import util.HttpUtil;
import util.Tools;
import util.ZxlSDKUtil;

public class QueryAddrSeriesList {
    String addr;

    public QueryAddrSeriesList(String addr) {
        this.addr = addr;
    }

    public SeriesList query() throws Exception {
        // todo 参数校验
        Resp resp = HttpUtil.apiGetJsonX(Config.baseUrl + "/api/v1/nft/series/list", Tools.getJson(this), ZxlSDKUtil.generateApiSign());
        if (resp.getRetCode() != 0) {
            throw new ZXChainException(resp.getRetMsg());
        }

        return resp.getData(SeriesList.class);
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }
}
