package nft.transfer;

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

public class QueryTransferResult {
    String operatorPubKey;
    String taskId;

    public QueryTransferResult() {
    }

    public QueryTransferResult(String operatorPubKey, String taskId) {
        this.operatorPubKey = operatorPubKey;
        this.taskId = taskId;
    }

    public TransferResult query() throws Exception {
        Resp resp = HttpUtil.apiGetJsonX(Config.baseUrl + "/api/v1/nft/transfer/result", Tools.getJson(this), ZxlSDKUtil.generateApiSign());
        if (resp.getRetCode() != 0) {
            throw new ZXChainException(resp.getRetMsg());
        }

        return resp.getData(TransferResult.class);
    }

    public String getOperatorPubKey() {
        return operatorPubKey;
    }

    public void setOperatorPubKey(String operatorPubKey) {
        this.operatorPubKey = operatorPubKey;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }
}
