import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { setPaginationParams } from "../helpers";
export class LCDQueryClient {
  constructor({
    requestClient
  }) {
    _defineProperty(this, "req", void 0);
    this.req = requestClient;
    this.params = this.params.bind(this);
    this.tasks = this.tasks.bind(this);
    this.reward = this.reward.bind(this);
    this.rewardsAll = this.rewardsAll.bind(this);
  }
  /* Params returns the total set of rewards parameters. */
  async params(_params = {}) {
    const endpoint = `gitopia/gitopia/rewards/params`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of tasks items. */
  async tasks(params) {
    const endpoint = `gitopia/gitopia/rewards/tasks/${params.address}`;
    return await this.req.get(endpoint);
  }
  /* Queries a Rewards by index. */
  async reward(params) {
    const endpoint = `gitopia/gitopia/rewards/rewards/${params.recipient}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Rewards items. */
  async rewardsAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/rewards/rewards`;
    return await this.req.get(endpoint, options);
  }
}