import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryBalancesRequest, QueryBalancesResponse } from "./query";
/** Query defines the gRPC querier service for the safety fund module */

export class QueryClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.balances = this.balances.bind(this);
  }
  balances(request = {}) {
    const data = QueryBalancesRequest.encode(request).finish();
    const promise = this.rpc.request("mars.safety.v1beta1.Query", "Balances", data);
    return promise.then(data => QueryBalancesResponse.decode(new _m0.Reader(data)));
  }
}
export const createRpcQueryExtension = base => {
  const rpc = createProtobufRpcClient(base);
  const queryService = new QueryClientImpl(rpc);
  return {
    balances(request) {
      return queryService.balances(request);
    }
  };
};