"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRpcQueryExtension = exports.QueryClientImpl = void 0;
const _m0 = __importStar(require("protobufjs/minimal"));
const stargate_1 = require("@cosmjs/stargate");
const query_1 = require("./query");
class QueryClientImpl {
    constructor(rpc) {
        this.rpc = rpc;
        this.params = this.params.bind(this);
        this.vault = this.vault.bind(this);
        this.allVaults = this.allVaults.bind(this);
        this.megavaultTotalShares = this.megavaultTotalShares.bind(this);
        this.megavaultOwnerShares = this.megavaultOwnerShares.bind(this);
        this.megavaultAllOwnerShares = this.megavaultAllOwnerShares.bind(this);
        this.vaultParams = this.vaultParams.bind(this);
        this.megavaultWithdrawalInfo = this.megavaultWithdrawalInfo.bind(this);
    }
    params(request = {}) {
        const data = query_1.QueryParamsRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "Params", data);
        return promise.then(data => query_1.QueryParamsResponse.decode(new _m0.Reader(data)));
    }
    vault(request) {
        const data = query_1.QueryVaultRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "Vault", data);
        return promise.then(data => query_1.QueryVaultResponse.decode(new _m0.Reader(data)));
    }
    allVaults(request = {
        pagination: undefined
    }) {
        const data = query_1.QueryAllVaultsRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "AllVaults", data);
        return promise.then(data => query_1.QueryAllVaultsResponse.decode(new _m0.Reader(data)));
    }
    megavaultTotalShares(request = {}) {
        const data = query_1.QueryMegavaultTotalSharesRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "MegavaultTotalShares", data);
        return promise.then(data => query_1.QueryMegavaultTotalSharesResponse.decode(new _m0.Reader(data)));
    }
    megavaultOwnerShares(request) {
        const data = query_1.QueryMegavaultOwnerSharesRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "MegavaultOwnerShares", data);
        return promise.then(data => query_1.QueryMegavaultOwnerSharesResponse.decode(new _m0.Reader(data)));
    }
    megavaultAllOwnerShares(request = {
        pagination: undefined
    }) {
        const data = query_1.QueryMegavaultAllOwnerSharesRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "MegavaultAllOwnerShares", data);
        return promise.then(data => query_1.QueryMegavaultAllOwnerSharesResponse.decode(new _m0.Reader(data)));
    }
    vaultParams(request) {
        const data = query_1.QueryVaultParamsRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "VaultParams", data);
        return promise.then(data => query_1.QueryVaultParamsResponse.decode(new _m0.Reader(data)));
    }
    megavaultWithdrawalInfo(request) {
        const data = query_1.QueryMegavaultWithdrawalInfoRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.vault.Query", "MegavaultWithdrawalInfo", data);
        return promise.then(data => query_1.QueryMegavaultWithdrawalInfoResponse.decode(new _m0.Reader(data)));
    }
}
exports.QueryClientImpl = QueryClientImpl;
const createRpcQueryExtension = (base) => {
    const rpc = (0, stargate_1.createProtobufRpcClient)(base);
    const queryService = new QueryClientImpl(rpc);
    return {
        params(request) {
            return queryService.params(request);
        },
        vault(request) {
            return queryService.vault(request);
        },
        allVaults(request) {
            return queryService.allVaults(request);
        },
        megavaultTotalShares(request) {
            return queryService.megavaultTotalShares(request);
        },
        megavaultOwnerShares(request) {
            return queryService.megavaultOwnerShares(request);
        },
        megavaultAllOwnerShares(request) {
            return queryService.megavaultAllOwnerShares(request);
        },
        vaultParams(request) {
            return queryService.vaultParams(request);
        },
        megavaultWithdrawalInfo(request) {
            return queryService.megavaultWithdrawalInfo(request);
        }
    };
};
exports.createRpcQueryExtension = createRpcQueryExtension;
//# sourceMappingURL=data:application/json;base64, 